Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

AtomSel.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2008 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: AtomSel.h,v $
00013  *      $Author: johns $        $Locker:  $                $State: Exp $
00014  *      $Revision: 1.50 $      $Date: 2008/03/27 19:36:35 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  * 
00019  * Parse and maintain the data for selecting atoms.
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   // prevent use of these methods.
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, /* const */ 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 

Generated on Sun Jul 6 01:27:19 2008 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002