00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef ATOMREP_H
00023 #define ATOMREP_H
00024
00025
00026 #define DEFAULT_ATOMREP AtomRep::LINES
00027 #define MAX_ATOMREP_CMD 255
00028 #define MAX_ATOMREP_DATA 7
00029
00031 class AtomRep {
00032 public:
00033
00034
00035
00036 enum RepMethod { LINES, BONDS, DYNAMICBONDS, HBONDS,
00037 POINTS, VDW, CPK, LICORICE,
00038 TRACE, TUBE, RIBBONS,
00039 NEWRIBBONS, STRUCTURE, NEWCARTOON,
00040 #ifdef VMDWITHCARBS
00041 RINGS_PAPERCHAIN, RINGS_TWISTER,
00042 #endif
00043 #ifdef VMDMSMS
00044 MSMS,
00045 #endif
00046 #ifdef VMDSURF
00047 SURF,
00048 #endif
00049 VOLSLICE, ISOSURFACE,
00050 #ifdef VMDFIELDLINES
00051 FIELDLINES,
00052 #endif
00053 BEADS,
00054 DOTTED, SOLVENT,
00055 TOTAL };
00056
00057
00058 enum RepDataNames { SPHERERAD, BONDRAD, SPHERERES, BONDRES, LINETHICKNESS, ISOSTEPSIZE, ISOLINETHICKNESS };
00059
00061 char cmdStr[MAX_ATOMREP_CMD + 1];
00062
00063 private:
00065 int repMethod;
00066 float repDataStorage[TOTAL][MAX_ATOMREP_DATA];
00067 float *repData;
00068
00070 int parse_cmd(const char *);
00071
00072 public:
00073 AtomRep(void);
00074 AtomRep(AtomRep &ar) { *this = ar; }
00075 ~AtomRep(void);
00076
00078 AtomRep& operator=(const AtomRep &);
00079
00081 int change(const char *newcmd) { return parse_cmd(newcmd); }
00082
00083
00084
00085
00086
00088 int method(void) { return repMethod; }
00089
00091 bool is_volumetric(void) {
00092 #ifdef VMDFIELDLINES
00093 if (repMethod == VOLSLICE || repMethod == ISOSURFACE || repMethod == FIELDLINES)
00094 return true;
00095 #else
00096 if (repMethod == VOLSLICE || repMethod == ISOSURFACE)
00097 return true;
00098 #endif
00099 return false;
00100 }
00101
00103 float get_data(int n) { return repData[n]; }
00104 };
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00119 typedef struct {
00120 int index;
00121 float defValue;
00122 } AtomRepDataInfo;
00123
00125 typedef struct {
00126 const char *name;
00127 int numdata;
00128 AtomRepDataInfo repdata[MAX_ATOMREP_DATA];
00129 } AtomRepParamStruct;
00130
00131
00132
00133 extern const AtomRepParamStruct AtomRepInfo[AtomRep::TOTAL];
00134
00135
00136 #endif
00137