Index: AtomColor.C
===================================================================
RCS file: /home/cvs/vmd/cvsroot/vmd/src/AtomColor.C,v
retrieving revision 1.87
diff -u -r1.87 AtomColor.C
--- AtomColor.C	2007/03/29 06:01:32	1.87
+++ AtomColor.C	2007/09/28 21:52:52
@@ -44,6 +44,11 @@
     (char *) "ColorID",  (char *) "Beta",     (char *) "Occupancy", 
     (char *) "Mass",     (char *) "Charge",   (char *) "Pos", 
     (char *) "User",
+#if 1
+    (char *) "User2",
+    (char *) "User3",
+    (char *) "User4",
+#endif
     (char *) "Index",    (char *) "Backbone", (char *) "Throb",
     (char *) "Timestep"
 #ifdef VMDVOLUMETEXTURE
@@ -165,6 +170,14 @@
     newMethod = CHARGE;
   } else if(!strupncmp(argv[0], AtomColorName[USER], CMDLEN)) {
     newMethod = USER;
+#if 1
+  } else if(!strupncmp(argv[0], AtomColorName[USER2], CMDLEN)) {
+    newMethod = USER2;
+  } else if(!strupncmp(argv[0], AtomColorName[USER3], CMDLEN)) {
+    newMethod = USER3;
+  } else if(!strupncmp(argv[0], AtomColorName[USER4], CMDLEN)) {
+    newMethod = USER4;
+#endif
   } else if(!strupncmp(argv[0], AtomColorName[POS], CMDLEN)) {
     newMethod = POS;
   } else if(!strupncmp(argv[0], AtomColorName[INDEX], CMDLEN)) {
@@ -441,8 +454,27 @@
       data_max = (float) (nAtoms-1);
       for (int i=0; i<nAtoms; i++) 
         data[i] = (float) i;
-    } else if (colorMethod == USER) {
+    } else if (colorMethod == USER 
+#if 1
+               || colorMethod == USER2
+               || colorMethod == USER3
+               || colorMethod == USER4
+#endif
+      ) {
+#if 0
       const float *user = mol->current()->user;
+#else
+      const float *user;
+      if (colorMethod == USER)
+        user = mol->current()->user;
+      else if (colorMethod == USER2)
+        user = mol->current()->user2;
+      else if (colorMethod == USER3)
+        user = mol->current()->user3;
+      else if (colorMethod == USER4)
+        user = mol->current()->user4;
+#endif
+
       if (!user) {
         memset(data, 0, nAtoms*sizeof(float));
         data_min = data_max = 0;
Index: AtomColor.h
===================================================================
RCS file: /home/cvs/vmd/cvsroot/vmd/src/AtomColor.h,v
retrieving revision 1.37
diff -u -r1.37 AtomColor.h
--- AtomColor.h	2007/02/15 23:35:27	1.37
+++ AtomColor.h	2007/09/28 21:50:47
@@ -37,8 +37,12 @@
   /// different methods for coloring atoms
   enum ColorMethod { NAME, TYPE, ELEMENT, RESNAME, RESTYPE, RESID, CHAIN, 
                      SEGNAME, CONFORMATION, MOLECULE, STRUCTURE, COLORID, 
-                     BETA, OCCUP, MASS, CHARGE, POS, USER, INDEX, BACKBONE, 
-                     THROB, TIMESTEP, 
+                     BETA, OCCUP, MASS, CHARGE, POS, 
+                     USER, 
+#if 1
+                     USER2, USER3, USER4, 
+#endif
+                     INDEX, BACKBONE, THROB, TIMESTEP, 
 #ifdef VMDVOLUMETEXTURE
                      VOLUME, 
 #endif
Index: AtomSel.C
===================================================================
RCS file: /home/cvs/vmd/cvsroot/vmd/src/AtomSel.C,v
retrieving revision 1.154
diff -u -r1.154 AtomSel.C
--- AtomSel.C	2007/09/11 16:24:20	1.154
+++ AtomSel.C	2007/09/28 21:42:14
@@ -936,6 +936,106 @@
   return 1;								     
 }
 
+#if 1
+static int atomsel_user2(void *v, int num, double *data, int *flgs) {
+  DrawMolecule *atom_sel_mol = ((atomsel_ctxt *)v)->atom_sel_mol;                     
+  int which_frame = ((atomsel_ctxt *)v)->which_frame;
+  Timestep *ts = selframe(atom_sel_mol, which_frame);
+  if (!ts || !ts->user2) {
+    memset(data, 0, num*sizeof(double));
+    return 1;                                                           
+  }
+  for (int i=0; i<num; i++) {					      
+    if (flgs[i]) {							      
+      data[i] = ts->user2[i];					      
+    }								              
+  }									      
+  return 1;								     
+}
+static int atomsel_set_user2(void *v, int num, double *data, int *flgs) {
+  DrawMolecule *atom_sel_mol = ((atomsel_ctxt *)v)->atom_sel_mol;                     
+  int which_frame = ((atomsel_ctxt *)v)->which_frame;
+  Timestep *ts = selframe(atom_sel_mol, which_frame);
+  if (!ts) return 0;
+  if (!ts->user2) {
+    ts->user2= new float[num];
+    memset(ts->user2, 0, num*sizeof(float));
+  }
+  for (int i=0; i<num; i++) {					      
+    if (flgs[i]) {							      
+      ts->user2[i] = (float)data[i];					      
+    }								              
+  }									      
+  return 1;								     
+}
+
+static int atomsel_user3(void *v, int num, double *data, int *flgs) {
+  DrawMolecule *atom_sel_mol = ((atomsel_ctxt *)v)->atom_sel_mol;                     
+  int which_frame = ((atomsel_ctxt *)v)->which_frame;
+  Timestep *ts = selframe(atom_sel_mol, which_frame);
+  if (!ts || !ts->user3) {
+    memset(data, 0, num*sizeof(double));
+    return 1;                                                           
+  }
+  for (int i=0; i<num; i++) {					      
+    if (flgs[i]) {							      
+      data[i] = ts->user3[i];					      
+    }								              
+  }									      
+  return 1;								     
+}
+static int atomsel_set_user3(void *v, int num, double *data, int *flgs) {
+  DrawMolecule *atom_sel_mol = ((atomsel_ctxt *)v)->atom_sel_mol;                     
+  int which_frame = ((atomsel_ctxt *)v)->which_frame;
+  Timestep *ts = selframe(atom_sel_mol, which_frame);
+  if (!ts) return 0;
+  if (!ts->user3) {
+    ts->user3= new float[num];
+    memset(ts->user3, 0, num*sizeof(float));
+  }
+  for (int i=0; i<num; i++) {					      
+    if (flgs[i]) {							      
+      ts->user3[i] = (float)data[i];					      
+    }								              
+  }									      
+  return 1;								     
+}
+
+static int atomsel_user4(void *v, int num, double *data, int *flgs) {
+  DrawMolecule *atom_sel_mol = ((atomsel_ctxt *)v)->atom_sel_mol;                     
+  int which_frame = ((atomsel_ctxt *)v)->which_frame;
+  Timestep *ts = selframe(atom_sel_mol, which_frame);
+  if (!ts || !ts->user4) {
+    memset(data, 0, num*sizeof(double));
+    return 1;                                                           
+  }
+  for (int i=0; i<num; i++) {					      
+    if (flgs[i]) {							      
+      data[i] = ts->user4[i];					      
+    }								              
+  }									      
+  return 1;								     
+}
+static int atomsel_set_user4(void *v, int num, double *data, int *flgs) {
+  DrawMolecule *atom_sel_mol = ((atomsel_ctxt *)v)->atom_sel_mol;                     
+  int which_frame = ((atomsel_ctxt *)v)->which_frame;
+  Timestep *ts = selframe(atom_sel_mol, which_frame);
+  if (!ts) return 0;
+  if (!ts->user4) {
+    ts->user4= new float[num];
+    memset(ts->user4, 0, num*sizeof(float));
+  }
+  for (int i=0; i<num; i++) {					      
+    if (flgs[i]) {							      
+      ts->user4[i] = (float)data[i];					      
+    }								              
+  }									      
+  return 1;								     
+}
+
+#endif
+
+
 static int atomsel_xpos(void *v, int num, double *data, int *flgs) {
   DrawMolecule *atom_sel_mol = ((atomsel_ctxt *)v)->atom_sel_mol;                     
   int which_frame = ((atomsel_ctxt *)v)->which_frame;
@@ -1960,8 +2060,14 @@
   atomSelParser->add_singleword("turn", atomsel_turn, atomsel_set_turn);
   atomSelParser->add_singleword("coil", atomsel_coil, atomsel_set_coil);
   atomSelParser->add_keyword("structure",atomsel_sstruct, atomsel_set_sstruct);
+
+  atomSelParser->add_keyword("user",  atomsel_user,  atomsel_set_user);
+#if 1
+  atomSelParser->add_keyword("user2", atomsel_user2, atomsel_set_user2);
+  atomSelParser->add_keyword("user3", atomsel_user3, atomsel_set_user3);
+  atomSelParser->add_keyword("user4", atomsel_user4, atomsel_set_user4);
+#endif
 
-  atomSelParser->add_keyword("user", atomsel_user, atomsel_set_user);
   atomSelParser->add_keyword("x", atomsel_xpos, atomsel_set_xpos);
   atomSelParser->add_keyword("y", atomsel_ypos, atomsel_set_ypos);
   atomSelParser->add_keyword("z", atomsel_zpos, atomsel_set_zpos);
Index: Timestep.C
===================================================================
RCS file: /home/cvs/vmd/cvsroot/vmd/src/Timestep.C,v
retrieving revision 1.52
diff -u -r1.52 Timestep.C
--- Timestep.C	2007/09/11 16:24:21	1.52
+++ Timestep.C	2007/09/28 22:06:28
@@ -36,6 +36,11 @@
   vel = NULL;
   force = NULL;
   user = NULL;
+#if 1
+  user2 = NULL;
+  user3 = NULL;
+  user4 = NULL;
+#endif
   memset(tscov, 0, sizeof(tscov));
   scalefactor = 1.0;
   a_length = b_length = c_length = 1;
@@ -74,6 +79,29 @@
     user = NULL;
   }
 
+#if 1
+  if (ts.user2) {
+    user2 = new float[num];
+    memcpy(user2, ts.user2, num*sizeof(float));
+  } else {
+    user2 = NULL;
+  }
+
+  if (ts.user3) {
+    user3 = new float[num];
+    memcpy(user3, ts.user3, num*sizeof(float));
+  } else {
+    user3 = NULL;
+  }
+
+  if (ts.user4) {
+    user4 = new float[num];
+    memcpy(user4, ts.user4, num*sizeof(float));
+  } else {
+    user4 = NULL;
+  }
+#endif
+
   memcpy(energy, ts.energy, sizeof(ts.energy));
   memcpy(tscov, ts.tscov, sizeof(tscov));
   scalefactor = ts.scalefactor;
@@ -95,6 +123,11 @@
   delete [] vel;
   delete [] pos;
   delete [] user;
+#if 1
+  delete [] user2;
+  delete [] user3;
+  delete [] user4;
+#endif
 }
 
 
Index: Timestep.h
===================================================================
RCS file: /home/cvs/vmd/cvsroot/vmd/src/Timestep.h,v
retrieving revision 1.39
diff -u -r1.39 Timestep.h
--- Timestep.h	2007/09/11 16:24:21	1.39
+++ Timestep.h	2007/09/28 21:38:48
@@ -52,6 +52,13 @@
   float *vel;               ///< velocites for all atoms as (vx,vy,vz), ...
   float *force;             ///< forces for all atoms.
   float *user;              ///< Demand-allocated 1-float-per-atom 'User' data
+
+#if 1
+  float *user2;             ///< Demand-allocated 1-float-per-atom 'User' data
+  float *user3;             ///< Demand-allocated 1-float-per-atom 'User' data
+  float *user4;             ///< Demand-allocated 1-float-per-atom 'User' data
+#endif
+
   float energy[TSENERGIES]; ///< energy for this step; by default, all 0
   int timesteps;            ///< timesteps elapsed so far (if known)
   double physical_time;     ///< Physical time corresponding to this timestep

