00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef ATOMSEL_H
00023 #define ATOMSEL_H
00024
00025 class MoleculeList;
00026 class DrawMolecule;
00027 class ParseTree;
00028 class SymbolTable;
00029 class Timestep;
00030
00031 extern void atomSelParser_init(SymbolTable *);
00032
00034 struct atomsel_ctxt {
00035 SymbolTable *table;
00036 DrawMolecule *atom_sel_mol;
00037 int which_frame;
00038 const char *singleword;
00039 atomsel_ctxt(SymbolTable *s, DrawMolecule *d, int frame, const char *word)
00040 : table(s), atom_sel_mol(d), which_frame(frame), singleword(word) {}
00041 };
00042
00044 class AtomSel {
00045 private:
00046 ParseTree *tree;
00047
00048
00049 AtomSel& operator=(const AtomSel &) { return *this; }
00050 AtomSel(AtomSel &) : ID(-1) {}
00051 const int ID;
00052 SymbolTable *table;
00053
00054 public:
00055 char *cmdStr;
00056 int *on;
00057 int molid() const { return ID; }
00058 int num_atoms;
00059 int selected;
00060 int firstsel;
00061 int lastsel;
00062
00063 enum {TS_LAST = -2, TS_NOW = -1};
00064 int which_frame;
00065 int do_update;
00066
00067 AtomSel(SymbolTable *, int mymolid);
00068 ~AtomSel();
00069
00077 enum {NO_PARSE = -1, NO_EVAL=-2, PARSE_SUCCESS = 0};
00078
00085 int change(const char *newcmd, DrawMolecule *);
00086
00089 float *coordinates(MoleculeList *) const;
00090
00092 Timestep *timestep(MoleculeList *) const;
00093
00099 static int get_frame_value(const char *s, int *val);
00100 };
00101
00103 int atomsel_custom_singleword(void *v, int num, int *flgs);
00104
00105 #endif
00106