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
00026
00027 #ifndef GEOMETRYLIST_H
00028 #define GEOMETRYLIST_H
00029
00030 #include "Displayable.h"
00031 #include "NameList.h"
00032 #include "ResizeArray.h"
00033 #include "GeometryMol.h"
00034 #include "DispCmds.h"
00035 class VMDApp;
00036
00037
00039 typedef ResizeArray<GeometryMol *> *GeomListPtr;
00040
00042 typedef struct {
00043 GeomListPtr geomList;
00044 int defaultColor;
00045 int curColor;
00046 } GeomListStruct;
00047
00048
00050 class GeometryList : public Displayable {
00051 private:
00053 NameList<GeomListStruct *> geomLists;
00054
00056 int colorCat;
00057
00058 VMDApp *app;
00059
00062 int add_geom_list(const char *, int);
00063
00065 int del_geom_list(int);
00066
00068 float labelsize;
00069
00070 protected:
00072 virtual void do_color_changed(int);
00073
00074 public:
00075 GeometryList(VMDApp *, Displayable *);
00076
00078 virtual ~GeometryList(void);
00079
00080
00081
00082
00083
00085 int num_lists(void) { return geomLists.num(); }
00086
00088 GeomListPtr geom_list(int n) { return (geomLists.data(n))->geomList; }
00089
00091 GeomListPtr geom_list(const char *nm) {
00092 int glistindex = geom_list_index(nm);
00093 return (glistindex >= 0 ? geom_list(glistindex) : (GeomListPtr) NULL);
00094 }
00095
00097 const char *geom_list_name(int n) { return geomLists.name(n); }
00098
00100 int geom_list_index(const char *nm) { return geomLists.typecode(nm); }
00101
00102
00103
00104
00105
00106
00107
00108
00109
00113 int add_geometry(const char *geomcat, const int *molids, const int *atomids,
00114 const int *cells, float k, int toggle);
00115
00117 int del_geometry(int, int);
00118
00120 int del_geometry(const char *nm, int n) {
00121 return del_geometry(geom_list_index(nm), n);
00122 }
00123
00127 int show_geometry(int, int, int);
00128
00130 int show_geometry(const char *nm, int n, int s) {
00131 return show_geometry(geom_list_index(nm), n, s);
00132 }
00133
00134 float getTextSize() const { return labelsize; }
00135 int setTextSize(float);
00136
00137 const float *getTextOffset(const char *nm, int n);
00138
00140 int setTextOffset(const char *nm, int n, const float delta[2]);
00141
00142 const char *getTextFormat(const char *nm, int n);
00143 int setTextFormat(const char *nm, int n, const char *format);
00144
00145
00146
00147
00148
00150 virtual void prepare();
00151 };
00152
00153 #endif
00154