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

GeometryList.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: GeometryList.h,v $
00013  *      $Author: johns $        $Locker:  $                $State: Exp $
00014  *      $Revision: 1.38 $      $Date: 2008/03/27 19:36:39 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *
00019  * This maintains a set of lists of geometry monitors, and draws them to
00020  * the scene.  This is a Displayable which keeps the graphical representations
00021  * of the geometry monitors; this is also a Pickable, and creates and controls
00022  * the PickMode objects which create new geometry monitors via the pointers.
00023  * This object keeps a set of ResizeArray, each of which is a 'category' for
00024  * geometry monitors (i.e Atoms, Bonds, etc.) containing GeometryMol objects.
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   // return information about this class
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   // routines to add/delete/modify geometry objects
00104   // NOTE: after GeometryMol objects have been added, they remain in the
00105   //    lists until either explicitely deleted, or their 'ok' routine
00106   //    no longer returns 'TRUE'.  If 'ok' returns FALSE, they are
00107   //    deleted.
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   // public virtual drawing routines
00147   // 
00148 
00150   virtual void prepare();
00151 };
00152 
00153 #endif
00154   

Generated on Fri Sep 5 01:24:53 2008 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002