00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GEOMETRYMOL_H
00026 #define GEOMETRYMOL_H
00027
00028 class MoleculeList;
00029 class Molecule;
00030 class VMDDisplayList;
00031 class CommandQueue;
00032
00033 #include "Displayable.h"
00034 #include "ResizeArray.h"
00035 #include "utilities.h"
00036 #include "JString.h"
00037
00038 class GeometryMonitor;
00039
00041 class GeometryMol : public Displayable {
00042 public:
00044 int items(void) { return numItems; }
00045
00047 int com_index(int i) {
00048 return comIndex[i];
00049 }
00050
00052 int obj_index(int i) {
00053 return objIndex[i];
00054 }
00055
00057 float value(void) { return geomValue; }
00058
00060 int has_value(void) { return hasValue; }
00061
00063 virtual float calculate(void) { return 0.0; }
00064
00066 virtual void set_pick(void) { }
00067
00068 protected:
00069 MoleculeList *molList;
00070 CommandQueue *cmdqueue;
00071
00072 int numItems;
00073 int *objIndex;
00074 int *comIndex;
00075 int *cellIndex;
00076 float geomValue;
00077 int hasValue;
00078 float valuePos[3];
00079 char *gmName;
00080 char *uniquegmName;
00081
00082
00083
00084
00085
00087 void geom_set_name(void);
00088
00091 void sort_items(void);
00092
00095 Molecule *check_mol(int m, int a);
00096
00099 Molecule *transformed_atom_coord(int ind, float *);
00100
00104 Molecule *normal_atom_coord(int ind, float *);
00105
00107 void display_line(float *, float *, VMDDisplayList *);
00108
00110 void display_string(const char *, VMDDisplayList *);
00111
00112 void atom_full_name(char *buf, Molecule *mol, int ind) ;
00113 void atom_short_name(char *buf, Molecule *mol, int ind) ;
00114 void atom_formatted_name(JString &str, Molecule *mol, int ind);
00115
00117 void set_pick_selection(int, int, int*);
00118 void set_pick_selection();
00119 void set_pick_value(double);
00120
00121 public:
00123 GeometryMol(int, int *, int *, const int *cells, MoleculeList *mlist,
00124 CommandQueue *, Displayable *);
00125
00126 virtual ~GeometryMol(void);
00127
00129 const char *name(void);
00130
00133 const char *unique_name(void);
00134
00136 int ok(void);
00137
00139 int calculate_all(ResizeArray<float> &);
00140
00142 void update() { create_cmd_list(); }
00143
00145 void set_color(int c) { my_color = c; update(); }
00146
00148 void set_text_size(float size) { my_text_size = size; update(); }
00149
00151 void set_text_thickness(float thick) { my_text_thickness = thick; update(); }
00152
00153 const float *text_offset() const { return my_text_offset; }
00154
00155 void set_text_offset(const float offset[2]) {
00156 my_text_offset[0] = offset[0];
00157 my_text_offset[1] = offset[1];
00158 update();
00159 }
00160
00169
00170 const char *text_format() const { return (const char *)my_text_format; }
00171 void set_text_format(const char *aFormat) {
00172 my_text_format = aFormat;
00173 update();
00174 }
00175
00176 protected:
00177 virtual void create_cmd_list() = 0;
00178 ResizeArray<GeometryMonitor *> monitors;
00179 int my_color;
00180
00181 private:
00182 float my_text_size;
00183 float my_text_thickness;
00184 float my_text_offset[2];
00185 JString my_text_format;
00186 };
00187
00188 #endif
00189