MTK++ Latest version: 0.2.0

submolecule.h
Go to the documentation of this file.
00001 
00033 #ifndef SUBMOLECULE_H
00034 #define SUBMOLECULE_H
00035 
00036 #include <iostream>
00037 #include <string>
00038 #include <vector>
00039 #include <fstream>
00040 #include <iomanip>
00041 #include <stdlib.h>
00042 #include <sstream>
00043 
00044 #include "Utils/constants.h"
00045 
00046 namespace MTKpp
00047 {
00048 
00049 class collection;
00050 class molecule;
00051 class atom;
00052 class vector3d;
00053 
00054 struct Bond;
00055 struct Angle;
00056 struct Torsion;
00057 struct Improper;
00058 
00059 class stdFrag;
00060 struct stdAtom;
00061 
00062 // ============================================================
00063 // Class : submolecule()
00064 // ------------------------------------------------------------
00072 // ============================================================
00073 
00074 class submolecule
00075 {
00076     friend class molecule;
00077 public:
00078 
00083     submolecule(molecule *parent = 0);
00084 
00086     virtual ~submolecule();
00087 
00096     static bool less(submolecule* lhs, submolecule* rhs)
00097     {
00098         return lhs->getColIndex() < rhs->getColIndex();
00099     }
00100 
00109     static bool greater(submolecule* lhs, submolecule* rhs)
00110     {
00111         return lhs->getColIndex() > rhs->getColIndex();
00112     }
00113 
00118     void                     copy(submolecule* pSubMol);
00119 
00124     molecule*                getParent();
00125 
00130     virtual atom*            addAtom();
00131 
00137     virtual atom*            addAtom(atom* pAt);
00138 
00145     virtual Bond*            addBond(atom* a, atom* b);
00146 
00151     void                     setName(const std::string& name);
00152 
00157     void                     set1LName(const std::string& name);
00158 
00163     std::string              getName();
00164 
00169     std::string              get1LName();
00170 
00175     void                     setIndex(const int& i);
00176 
00181     int                      getIndex();
00182 
00187     void                     setSubMolId(const int& id);
00188 
00193     int                      getSubMolId();
00194 
00199     void                     setColIndex(const int& id);
00200 
00205     int                      getColIndex();
00206 
00211     void                     setiCode(const std::string& i);
00212 
00217     std::string             getiCode();
00218     
00223     void                     setNumAtoms(const int& n);
00224 
00229     int                      getNumAtoms();
00230 
00235     void                     setNumBonds(const int& n);
00236 
00241     int                      getNumBonds();
00242 
00247     void                     setStdFrag(stdFrag* f);
00248 
00253     stdFrag*                 getStdFrag();
00254 
00259     bool                     hasStdFrag();
00260 
00265     std::vector<atom*>       getAtomList();
00266 
00271     std::vector<Bond*>       getBondList();
00272 
00278     atom*                    getAtom(int i);
00279 
00285     atom*                    getAtom(const std::string& name);
00286 
00292     atom*                    getAtom(stdAtom* pStdAtom);
00293 
00295     void                     centerOfMass();
00296 
00298     vector3d*                getCenterOfMass();
00299 
00304     int                      numHeavyAtoms();
00305 
00310     double                   getMolecularWeight();
00311 
00315     void                     print();
00316 
00317 protected:
00318 
00320     molecule*                pParent;
00321 
00323     typedef std::vector<atom*>::iterator AtomIterator;
00324 
00326     std::string              itsName;
00327 
00329     std::string              its1LName;
00330 
00332     std::string              itsiCode;
00333 
00335     int                      itsColIndex;
00336 
00338     int                      itsIndex;
00339 
00341     int                      itsSubMolId; // This is a file id when pdb files are read
00342 
00344     int                      itsNumAtoms;
00345 
00347     int                      itsNumBonds;
00348 
00349     // coordinates of its center of mass
00350     vector3d*                pCenterMass;
00351 
00353     std::vector<atom*>       itsAtomList;
00354 
00356     std::vector<Bond*>       itsBondList;
00357 
00359     atom*                    pAtom;
00360 
00362     Bond*                    pBond;
00363 
00365     stdFrag*                 pStdFrag;
00366 };
00367 
00368 } // MTKpp namespace
00369 
00370 #endif // SUBMOLECULE_H
00371 

Generated on Fri Dec 23 2011 09:28:52 for MTK++ by Doxygen 1.7.5.1