00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 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.74 $ $Date: 2019年01月17日 21:20:58 $ 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 15 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 VMDNANOSHAPER 00053 NANOSHAPER, 00054 #endif 00055 #ifdef VMDSURF 00056 SURF, 00057 #endif 00058 VOLSLICE, ISOSURFACE, 00059 FIELDLINES, 00060 ORBITAL, 00061 BEADS, 00062 DOTTED, SOLVENT, 00063 #ifdef VMDLATTICECUBES 00064 LATTICECUBES, 00065 #endif 00066 TOTAL }; 00067 00068 enum RepDataNames { SPHERERAD, BONDRAD, SPHERERES, BONDRES, LINETHICKNESS, ISOSTEPSIZE, ISOLINETHICKNESS, WAVEFNCTYPE, WAVEFNCSPIN, WAVEFNCEXCITATION, GRIDSPACING, FIELDLINESTYLE, FIELDLINEDELTA, FIELDLINESEEDUSEGRID }; 00069 00071 char cmdStr[MAX_ATOMREP_CMD + 1]; 00072 00073 private: 00075 int repMethod; 00076 float repDataStorage[TOTAL][MAX_ATOMREP_DATA]; 00077 float *repData; 00078 00080 int parse_cmd(const char *); 00081 00082 public: 00083 AtomRep(void); 00084 AtomRep(AtomRep &ar) { *this = ar; } 00085 ~AtomRep(void); 00086 00088 AtomRep& operator=(const AtomRep &); 00089 00091 int change(const char *newcmd) { return parse_cmd(newcmd); } 00092 00093 // 00094 // info about current settings 00095 // 00096 00098 int method(void) { return repMethod; } 00099 00101 bool is_volumetric(void) { 00102 if (repMethod == VOLSLICE || repMethod == ISOSURFACE || repMethod == FIELDLINES) 00103 return true; 00104 return false; 00105 } 00106 00107 bool is_orbital(void) { 00108 if (repMethod == ORBITAL) 00109 return true; 00110 return false; 00111 } 00112 00114 float get_data(int n) { return repData[n]; } 00115 }; 00116 00117 00118 // 00119 // global structures and variables defining the data each rep requires 00120 // 00121 00122 // The following structure is used to define how each individual data 00123 // value is used by each rep style. Each style uses a number of different 00124 // data items to define that rep; this structure defines the type and range 00125 // of values allowed for those items. 00126 // Each AtomRep has storage for 5 optional data values. 00127 // The order they are specified is defined by each rep style. 00128 00130 typedef struct { 00131 int index; 00132 float defValue; 00133 } AtomRepDataInfo; 00134 00136 typedef struct { 00137 const char *name; 00138 int numdata; 00139 AtomRepDataInfo repdata[MAX_ATOMREP_DATA]; // info about each data value 00140 } AtomRepParamStruct; 00141 00142 00143 // array with definition of data for each rep 00144 extern const AtomRepParamStruct AtomRepInfo[AtomRep::TOTAL]; 00145 00146 00147 #endif 00148