Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

AtomRep.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2011 The Board of Trustees of the           
00004  *cr                        University of Illinois                       
00005  *cr                         All Rights Reserved                        
00006  *cr                                                                   
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: AtomRep.h,v $
00013  *      $Author: johns $        $Locker:  $                $State: Exp $
00014  *      $Revision: 1.69 $      $Date: 2011/10/12 22:49:45 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  * 
00019  * Parse and maintain the data for how a molecule should be represented.
00020  *
00021  ***************************************************************************/
00022 #ifndef ATOMREP_H
00023 #define ATOMREP_H
00024 
00025 // default atom representation, and max cmd string size
00026 #define DEFAULT_ATOMREP         AtomRep::LINES
00027 #define MAX_ATOMREP_CMD         255
00028 #define MAX_ATOMREP_DATA        12
00029 
00031 class AtomRep {
00032 public:
00033   // enumeration of all of the methods for representing molecules
00034   // XXX note that these MUST be ordered exactly the same way that
00035   //     they are ordered in AtomRep.C, and in the graphics forms.
00036   enum RepMethod { LINES, BONDS, DYNAMICBONDS, HBONDS,
00037                    POINTS, VDW, CPK, LICORICE, 
00038 #ifdef VMDPOLYHEDRA
00039                    POLYHEDRA,
00040 #endif
00041                    TRACE, TUBE, RIBBONS, 
00042                    NEWRIBBONS, STRUCTURE, NEWCARTOON, 
00043 #ifdef VMDWITHCARBS
00044                    RINGS_PAPERCHAIN, RINGS_TWISTER,
00045 #endif
00046 #ifdef VMDQUICKSURF
00047                    QUICKSURF,
00048 #endif
00049 #ifdef VMDMSMS
00050                    MSMS, 
00051 #endif
00052 #ifdef VMDSURF
00053                    SURF,
00054 #endif
00055                    VOLSLICE, ISOSURFACE,
00056                    FIELDLINES,
00057                    ORBITAL,
00058                    BEADS,
00059                    DOTTED, SOLVENT,
00060                    TOTAL };
00061 
00062   // these are the same as above, but for historical reasons
00063   enum RepDataNames { SPHERERAD, BONDRAD, SPHERERES, BONDRES, LINETHICKNESS, ISOSTEPSIZE, ISOLINETHICKNESS, WAVEFNCTYPE, WAVEFNCSPIN, WAVEFNCEXCITATION, GRIDSPACING };
00064 
00066   char cmdStr[MAX_ATOMREP_CMD + 1];
00067 
00068 private:
00070   int repMethod;
00071   float repDataStorage[TOTAL][MAX_ATOMREP_DATA];
00072   float *repData;
00073 
00075   int parse_cmd(const char *);
00076 
00077 public:
00078   AtomRep(void);
00079   AtomRep(AtomRep &ar) { *this = ar; }
00080   ~AtomRep(void);
00081   
00083   AtomRep& operator=(const AtomRep &);
00084 
00086   int change(const char *newcmd) { return parse_cmd(newcmd); }
00087 
00088   //
00089   // info about current settings
00090   //
00091 
00093   int method(void) { return repMethod; }
00094   
00096   bool is_volumetric(void) { 
00097     if (repMethod == VOLSLICE || repMethod == ISOSURFACE || repMethod == FIELDLINES)
00098       return true; 
00099     return false; 
00100   }
00101 
00102   bool is_orbital(void) {
00103     if (repMethod == ORBITAL) 
00104       return true; 
00105     return false; 
00106   }
00107 
00109   float get_data(int n) { return repData[n]; }
00110 };
00111 
00112 
00113 //
00114 // global structures and variables defining the data each rep requires
00115 //
00116 
00117 // The following structure is used to define how each individual data
00118 // value is used by each rep style.  Each style uses a number of different
00119 // data items to define that rep; this structure defines the type and range
00120 // of values allowed for those items.
00121 // Each AtomRep has storage for 5 optional data values.
00122 // The order they are specified is defined by each rep style.
00123 
00125 typedef struct {
00126   int index;                 
00127   float defValue;            
00128 } AtomRepDataInfo;
00129 
00131 typedef struct {
00132   const char *name;          
00133   int numdata;               
00134   AtomRepDataInfo repdata[MAX_ATOMREP_DATA];  // info about each data value
00135 } AtomRepParamStruct;
00136 
00137 
00138 // array with definition of data for each rep
00139 extern const AtomRepParamStruct AtomRepInfo[AtomRep::TOTAL];
00140 
00141 
00142 #endif
00143 

Generated on Wed May 16 01:48:59 2012 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002