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

CmdMol.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2019 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: CmdMol.h,v $
00013  *      $Author: johns $        $Locker:  $                $State: Exp $
00014  *      $Revision: 1.75 $      $Date: 2019/01/17 21:20:58 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  * 
00019  * Command objects for affecting molecules.
00020  *
00021  ***************************************************************************/
00022 #ifndef CMDMOL_H
00023 #define CMDMOL_H
00024 
00025 #include <string.h>
00026 #include "Command.h"
00027 #include "VMDApp.h"
00028 
00029 
00030 // the following uses the Cmdtypes MOL_NEW, MOL_DEL, MOL_ACTIVE,
00031 // MOL_FIX, MOL_ON, MOL_TOP, MOL_SELECT, MOL_REP, MOL_COLOR, MOL_ADDREP,
00032 // MOL_MODREP, MOL_DELREP, MOL_MODREPITEM
00033 
00035 class CmdMolNew : public Command {
00036 public:
00037   CmdMolNew() : Command(MOL_NEW) {}
00038 };
00039 
00041 class CmdMolLoad : public Command {
00042 protected:
00043     virtual void create_text();
00044 
00045 public:
00046   int molid;
00047   char *name;
00048   char *type;
00049   FileSpec spec;
00050   CmdMolLoad(int themolid, const char *thename, const char *thetype, 
00051       const FileSpec *thespec) 
00052   : Command(MOL_NEW), molid(themolid), spec(*thespec) {
00053     name = strdup(thename);
00054     type = strdup(thetype);
00055   }
00056   ~CmdMolLoad() {
00057     free(type);
00058     free(name);
00059   }
00060 };
00061   
00062 
00064 class CmdMolCancel : public Command {
00065 protected:
00066   virtual void create_text(void);
00067 
00068 public:
00069   int whichMol;
00070   CmdMolCancel(int molid)
00071   : Command(MOL_CANCEL), whichMol(molid) {}
00072 };
00073 
00074 
00076 class CmdMolDelete : public Command {
00077 
00078 protected:
00079   virtual void create_text(void);
00080 
00081 public:
00082   int whichMol;
00083   CmdMolDelete(int molid)
00084   : Command(MOL_DEL), whichMol(molid) {}
00085 };
00086 
00087 
00089 class CmdMolActive : public Command {
00090 
00091 protected:
00092   virtual void create_text(void);
00093 
00094 public:
00095   int whichMol;
00096   int yn;                
00097 
00099   CmdMolActive(int id, int on)
00100   : Command(MOL_ACTIVE), whichMol(id), yn(on) {}
00101 };
00102 
00103 
00105 class CmdMolFix : public Command {
00106 
00107 protected:
00108   virtual void create_text(void);
00109 
00110 public:
00111   int whichMol;
00112   int yn;                
00113 
00114   CmdMolFix(int id, int on) 
00115   : Command(MOL_FIX), whichMol(id), yn(on) {}
00116 };
00117 
00118 
00119 
00121 class CmdMolOn : public Command {
00122 protected:
00123   virtual void create_text(void);
00124 
00125 public:
00126   int whichMol;
00127   int yn;                
00128 
00129   CmdMolOn(int id, int on) 
00130   : Command(MOL_ON), whichMol(id), yn(on) {}
00131 };
00132 
00133 
00134 
00136 class CmdMolTop : public Command {
00137 protected:
00138   virtual void create_text(void);
00139 
00140 public:
00141   int whichMol;
00143   CmdMolTop(int id)
00144   : Command(MOL_TOP), whichMol(id) {}
00145 };
00146 
00147 
00149 class CmdMolSelect : public Command {
00150 public:
00152   char *sel;
00153   
00154 protected:
00155   virtual void create_text(void);
00156 
00157 public:
00158   CmdMolSelect(const char *newsel)
00159   : Command(MOL_SELECT) { sel = strdup(newsel); }
00160   virtual ~CmdMolSelect(void)      { free(sel); }
00161 };
00162 
00163 
00165 class CmdMolRep : public Command {
00166 public:
00167   // new representation command (if NULL, print out current settings)
00168   char *sel;
00169   
00170 protected:
00171   virtual void create_text(void) ;
00172 
00173 public:
00174   CmdMolRep(const char *newsel)
00175   : Command(MOL_REP) {  sel = strdup(newsel); }
00176   virtual ~CmdMolRep(void)      { free(sel); }
00177 };
00178 
00179 
00181 class CmdMolColor : public Command {
00182 public:
00184   char *sel;
00185   
00186 protected:
00187   virtual void create_text(void);
00188 
00189 public:
00190   CmdMolColor(const char *newsel)
00191   : Command(MOL_COLOR) {  sel = strdup(newsel); }
00192   virtual ~CmdMolColor(void) { free(sel); }
00193 };
00194 
00195 
00197 class CmdMolMaterial : public Command {
00198 public:
00200   char *mat;
00201   
00202 protected:
00203   virtual void create_text(void);
00204 
00205 public:
00206   CmdMolMaterial(const char *newmat)
00207   : Command(MOL_MATERIAL) { mat = strdup(newmat); }
00208   virtual ~CmdMolMaterial(void)      { free(mat); }
00209 };
00210 
00211 
00213 class CmdMolAddRep : public Command {
00214 
00215 protected:
00216   virtual void create_text(void);
00217 
00218 public:
00219   int whichMol;
00221   CmdMolAddRep(int id) 
00222   : Command(MOL_ADDREP), whichMol(id) {}
00223 };
00224 
00225 
00227 class CmdMolChangeRep : public Command {
00228 protected:
00229   virtual void create_text(void);
00230  
00231 public:
00232   int whichMol;
00233   int repn;
00234   CmdMolChangeRep(int molid, int repid)
00235   : Command(MOL_MODREP), whichMol(molid), repn(repid) {}
00236 };
00237 
00238 
00240 class CmdMolChangeRepItem : public Command {
00241 
00242 public:
00243   enum RepData { COLOR, REP, SEL, MAT }; 
00244   int whichMol;                          
00245   int repn;                              
00246   RepData repData;                       
00247   char *str;                             
00248 
00249 protected:
00250   virtual void create_text(void);
00251 
00252 public:
00254   CmdMolChangeRepItem(int rpos, int id, RepData rd, const char *s)
00255   : Command(MOL_MODREPITEM), whichMol(id), repn(rpos), repData(rd) {
00256     str = strdup(s);
00257   }
00258 
00259   virtual ~CmdMolChangeRepItem(void) { free(str); }
00260 };
00261 
00262 
00264 class CmdMolRepSelUpdate : public Command {
00265 public:
00266   int whichMol;
00267   int repn;
00268   int onoroff;
00269 
00270 protected:
00271   virtual void create_text();
00272 
00273 public:
00274   CmdMolRepSelUpdate(int rpos, int id, int on)
00275   : Command(MOL_REPSELUPDATE), whichMol(id), repn(rpos), onoroff(on) {}
00276 };
00277 
00278 
00280 class CmdMolRepColorUpdate : public Command {
00281 public:
00282   int whichMol;
00283   int repn;
00284   int onoroff;
00285 
00286 protected:
00287   virtual void create_text();
00288 
00289 public:
00290   CmdMolRepColorUpdate(int rpos, int id, int on)
00291   : Command(MOL_REPCOLORUPDATE), whichMol(id), repn(rpos), onoroff(on) {}
00292 };
00293 
00294 
00296 class CmdMolDeleteRep : public Command {
00297 public:
00298   int whichMol;
00299   int repn;       
00300 
00301 protected:
00302   virtual void create_text(void);
00303 
00304 public:
00305   CmdMolDeleteRep(int rpos, int id) 
00306   : Command(MOL_DELREP), whichMol(id), repn(rpos) {}
00307 };
00308 
00309 
00311 class CmdMolReanalyze : public Command {
00312 protected:
00313   virtual void create_text(void);
00314  
00315 public:
00316   int whichMol;
00317   CmdMolReanalyze(int id) 
00318   : Command(MOL_REANALYZE), whichMol(id) {}
00319 };
00320 
00321 
00323 class CmdMolBondsRecalc : public Command {
00324 protected:
00325   virtual void create_text(void);
00326  
00327 public:
00328   int whichMol;
00329   CmdMolBondsRecalc(int id) 
00330   : Command(MOL_BONDRECALC), whichMol(id) {}
00331 };
00332 
00334 class CmdMolSSRecalc : public Command {
00335 protected:
00336   virtual void create_text(void);
00337  
00338 public:
00339   int whichMol;
00340   CmdMolSSRecalc(int id) 
00341   : Command(MOL_SSRECALC), whichMol(id) {}
00342 };
00343 
00345 class CmdMolVolume : public Command {
00346 public:
00347   int whichMol;
00348   CmdMolVolume(int id)
00349   : Command(MOL_VOLUME), whichMol(id) {}
00350 };
00351 
00352 
00354 class CmdMolRename : public Command {
00355 protected:
00356   virtual void create_text();
00357 
00358 public:
00359   int whichMol;
00360   char *newname;
00361 
00362   CmdMolRename(int id, const char *nm);
00363   ~CmdMolRename();
00364 };
00365 
00366 
00368 class CmdMolShowPeriodic : public Command {
00369 protected:
00370   virtual void create_text();
00371 public:
00372   const int whichMol;
00373   const int repn;
00374   const int pbc;
00375   CmdMolShowPeriodic(int mol, int rep, int thepbc)
00376     : Command(MOL_SHOWPERIODIC), whichMol(mol), repn(rep), pbc(thepbc) {}
00377 };
00378 
00379 
00381 class CmdMolNumPeriodic: public Command {
00382 protected:
00383   virtual void create_text();
00384 public:
00385   const int whichMol;
00386   const int repn;
00387   const int nimages;
00388   CmdMolNumPeriodic(int mol, int rep, int n)
00389     : Command(MOL_NUMPERIODIC), whichMol(mol), repn(rep), nimages(n) {}
00390 };
00391 
00392 
00394 class CmdMolShowInstances : public Command {
00395 protected:
00396   virtual void create_text();
00397 public:
00398   const int whichMol;
00399   const int repn;
00400   const int instances;
00401   CmdMolShowInstances(int mol, int rep, int theinstances)
00402     : Command(MOL_SHOWPERIODIC), whichMol(mol), repn(rep), instances(theinstances) {}
00403 };
00404 
00405 
00406 
00408 class CmdMolScaleMinmax : public Command {
00409 protected:
00410   virtual void create_text();
00411 public:
00412   const int whichMol;
00413   const int repn;
00414   const float scalemin, scalemax;
00415   const int reset;
00416   CmdMolScaleMinmax(int mol, int rep, float themin, float themax,int doreset=0)
00417   : Command(MOL_SCALEMINMAX), whichMol(mol), repn(rep), scalemin(themin),
00418     scalemax(themax), reset(doreset) {}
00419 };
00420 
00421 
00423 class CmdMolDrawFrames : public Command {
00424 protected:
00425   virtual void create_text();
00426 public:
00427   const int whichMol;
00428   const int repn;
00429   const char * framespec;
00430   CmdMolDrawFrames(int mol, int rep, const char *frametxt)
00431   : Command(MOL_DRAWFRAMES), whichMol(mol), repn(rep), framespec(frametxt) {}
00432 };
00433 
00434 
00436 class CmdMolSmoothRep : public Command {
00437 protected:
00438   virtual void create_text();
00439 public:
00440   const int whichMol;
00441   const int repn;
00442   const int winsize;
00443   CmdMolSmoothRep(int mol, int rep, int win)
00444   : Command(MOL_SMOOTHREP), whichMol(mol), repn(rep), winsize(win) {}
00445 };
00446 
00447 
00449 class CmdMolShowRep : public Command {
00450 protected:
00451   virtual void create_text();
00452 public:
00453   const int whichMol;
00454   const int repn;
00455   const int onoff;
00456   CmdMolShowRep(int mol, int rep, int on)
00457   : Command(MOL_SHOWREP), whichMol(mol), repn(rep), onoff(on) {}
00458 };
00459 
00460 #endif

Generated on Fri Mar 29 02:44:42 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002