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
00061 enum {TS_LAST = -2, TS_NOW = -1};
00062 int which_frame;
00063 int do_update;
00064
00065 AtomSel(SymbolTable *, int mymolid);
00066 ~AtomSel();
00067
00075 enum {NO_PARSE = -1, NO_EVAL=-2, PARSE_SUCCESS = 0};
00076
00083 int change(const char *newcmd, DrawMolecule *);
00084
00087 float *coordinates(MoleculeList *);
00088
00090 Timestep *timestep(MoleculeList *);
00091
00097 static int get_frame_value(const char *s, int *val);
00098 };
00099
00101 int atomsel_custom_singleword(void *v, int num, int *flgs);
00102
00103 #endif
00104