MTK++ Latest version: 0.2.0

stdFrag.h
Go to the documentation of this file.
00001 
00033 #ifndef STDFRAG_h
00034 #define STDFRAG_h
00035 
00036 #include <iostream>
00037 #include <string>
00038 #include <vector>
00039 #include <map>
00040 #include <algorithm>
00041 #include <stdio.h>
00042 
00043 #include "Utils/constants.h"
00044 
00045 namespace MTKpp
00046 {
00047 
00048 class stdGroup;
00049 class vector3d;
00050 
00055 struct stdAtom {
00057     std::string    identity;
00058 
00060     int            index;
00061 
00063     std::string    type;
00064 
00076     std::string    chain;
00077 
00079     double         atmCharge;
00080 
00082     int            bond12;
00083 
00085     double         bondLength;
00086 
00088     int            bond13;
00089 
00091     double         bondAngle;
00092 
00094     int            bond14;
00095 
00097     double         bondTorsion;
00098 
00100     int            atNum;
00101 
00103     std::string    atSymbol;
00104 
00105     //std::string    hybridization;
00106 
00118     int            kind;
00119 };
00120 
00125 struct stdBond {
00127     int            atom1;
00128 
00130     int            atom2;
00131 
00144     int            type;
00145 
00157     int            stereo;
00158 
00165     int            topology;
00166 
00172     int            kind;
00173 
00175     double         length;
00176 };
00177 
00182 struct stdImproper {
00184     int            atom1;
00185 
00187     int            atom2;
00188 
00190     int            atom3;
00191 
00193     int            atom4;
00194 };
00195 
00200 struct stdLoop {
00202     int            atom1;
00203 
00205     int            atom2;
00206 
00208     int            type;
00209 
00211     int            stereo;
00212 };
00213 
00218 struct stdAlias {
00220     std::string    atom1;
00221 
00223     std::string    atom2;
00224 };
00225 
00230 struct stdRing {
00232     std::vector<int>    atoms;
00233 
00235     int                 size;
00236 
00242     int                 planar;
00243 
00249     int                 aromatic;
00250 
00256     int                 hetero;
00257 
00259     int                 nHetero;
00260 
00262     int                 nNitrogen;
00263 
00265     int                 nOxygen;
00266 
00268     int                 nSulfur;
00269 };
00270 
00275 struct stdFeature {
00285     std::string         name;
00286 
00290     std::vector<int>    atoms;
00291 };
00292 
00299 struct stdFuncGroup {
00303     std::string         groupName;
00304 
00308     std::string         fragName;
00309 
00313     std::vector<int>    atoms;
00314 };
00315 
00320 struct stdConnTorsion {
00324     int                 bondAtom;
00325 
00329     int                 angleAtom;
00330 
00334     int                 torsionAtom;
00335 
00339     double              torsion;
00340 };
00341 
00346 struct stdRotBond {
00350     int                 atom1;
00351 
00355     int                 atom2;
00356 
00360     int                 atom3;
00361 
00365     int                 atom4;
00366 
00370     std::vector<double>    values;
00371 };
00372 
00373 // ============================================================
00374 // Class : stdFrag()
00375 // ------------------------------------------------------------
00382 // ============================================================
00383 class stdFrag
00384 {
00385 public:
00390     stdFrag(stdGroup *parent = 0);
00391 
00397     stdFrag(stdFrag *sf, stdGroup *parent = 0);
00398 
00402     virtual ~stdFrag();
00403 
00408     stdGroup*                getParent();
00409 
00414     void                     setName(const std::string& name);
00415 
00420     std::string              getName();
00421 
00426     void                     setSymbol(const std::string& symbol);
00427 
00432     std::string              getSymbol();
00433 
00438     void                     setCode(const std::string& code);
00439 
00444     std::string              getCode();
00445 
00450     void                     setCharacter(const std::string& c);
00451 
00456     std::string              getCharacter();
00457 
00462     void                     setType(const std::string& type);
00463 
00468     std::string              getType();
00469 
00474     void                     setSymmetry(const std::string& sym);
00475 
00480     std::string              getSymmetry();
00481 
00486     void                     setSubGraphs(const std::vector<std::string>& g);
00487 
00492     std::vector<std::string> getSubGraphs();
00493 
00498     std::string              getSubGraphStr();
00499 
00504     stdAtom*                 addStdAtom();
00505 
00511     stdAtom*                 addStdAtom(stdAtom* s);
00512 
00518     stdAtom*                 getStdAtom(const int& index);
00519 
00525     stdAtom*                 getStdAtom(const std::string& name);
00526 
00532     bool                     hasStdAtom(const std::string& name);
00533 
00539     std::vector<stdAtom*>    getBondedStdAtoms(stdAtom* sAt);
00540 
00545     int                      numStdAtoms();
00546 
00551     int                      numStdHeavyAtoms();
00552 
00557     stdBond*                 addStdBond();
00558 
00564     stdBond*                 addStdBond(stdBond* b);
00565 
00572     stdBond*                 getStdBond(const int& at1, const int& at2);
00573 
00580     stdBond*                 getStdBond(const std::string& at1, const std::string& at2);
00581 
00588     stdBond*                 getStdBond(stdAtom* pAt1, stdAtom* pAt2);
00589 
00596     bool                     hasStdBond(const int& at1, const int& at2);
00597 
00602     int                      numStdBonds();
00603 
00609     int                      numStdBonds(stdAtom* pStdAtom);
00610 
00615     stdImproper*             addStdImproper();
00616 
00622     stdImproper*             addStdImproper(stdImproper* i);
00623 
00628     stdLoop*                 addStdLoop();
00629 
00635     stdLoop*                 addStdLoop(stdLoop* l);
00636 
00643     stdLoop*                 getStdLoop(const int& at1, const int& at2);
00644 
00651     stdLoop*                 getStdLoop(stdAtom* pAt1, stdAtom* pAt2);
00652 
00657     stdAlias*                addStdAlias();
00658 
00664     stdAlias*                addStdAlias(stdAlias* a);
00665 
00670     stdRing*                 addStdRing();
00671 
00677     stdRing*                 addStdRing(stdRing* r);
00678 
00683     stdFeature*              addStdFeature();
00684 
00690     stdFeature*              addStdFeature(stdFeature* f);
00691 
00698     bool                     hasStdFeature(stdAtom* a, std::string f);
00699 
00704     stdFuncGroup*            addStdFuncGroup();
00705 
00711     stdFuncGroup*            addStdFuncGroup(stdFuncGroup* f);
00712 
00717     void                     addStdConnPts(std::vector<int> &v);
00718 
00723     stdConnTorsion*          addStdConnTorsion();
00724 
00729     stdRotBond*              addStdRotBond();
00730 
00735     std::vector<stdAtom*>    getStdAtomList();
00736 
00741     std::vector<stdBond*>    getStdBondList();
00742 
00747     std::vector<stdLoop*>    getStdLoopList();
00748 
00753     std::vector<stdAlias*>   getStdAliasList();
00754 
00759     std::vector<stdImproper*>getStdImproperList();
00760 
00765     std::vector<stdRing*>    getStdRingList();
00766 
00771     std::vector<stdFeature*> getStdFeatureList();
00772 
00777     std::vector<stdFuncGroup*> getStdFuncGroupList();
00778 
00783     std::vector<int>         getStdConnPtsList();
00784 
00789     int                      getNumStdConnPtsList();
00790 
00795     std::vector<stdConnTorsion*> getStdConnTorList();
00796 
00801     std::vector<stdRotBond*> getStdRotBondList();
00802 
00808     std::string              getAlias(const std::string& name);
00809 
00814     int                      generateCoordinates();
00815 
00824     int                      generateCoordinates(vector3d* bd, vector3d* ag,
00825                              vector3d* tr, const int &forward = 1);
00826 
00830     std::vector<vector3d*>   getCoordinates();
00831 
00835     void                     print();
00836 
00840     void                     generateSimpleFP();
00841 
00846     std::vector<unsigned int>getSimpleFP();
00847 
00851     int                      generateAdjMatrix();
00852 
00856     int                      generateHeavyAdjMatrix();
00857 
00862     int*                     getAdjMatrix();
00863 
00868     int*                     getHeavyAdjMatrix();
00869 
00874     int                      getAdjMatrixSize();
00875 
00880     int                      getHeavyAdjMatrixSize();
00881 
00886     int                      generateAtomSymbols();
00887 
00892     int                      generateHeavyAtomSymbols();
00893 
00898     char*                    getAtomSymbols();
00899 
00904     char*                    getHeavyAtomSymbols();
00905 
00910     int                      generateAtomKinds();
00911 
00916     int                      generateHeavyAtomKinds();
00917 
00922     int*                     getAtomKinds();
00923 
00928     int*                     getHeavyAtomKinds();
00929 
00934     double                   getCharge();
00935 
00941     int                      getStdAtomIndex(stdAtom* a);
00942 
00943 protected:
00944 
00946     std::string              itsName;
00947 
00949     std::string              itsSymbol;
00950 
00952     std::string              itsCode;
00953 
00955     std::string              itsCharacter;
00956 
00965     std::string              itsType;
00966 
00971     std::string              itsSymmetry;
00972 
00974     std::vector<std::string> itsSubGraphs;
00975 
00977     typedef std::vector<stdAtom*>::iterator stdAtomIterator;
00978 
00980     typedef std::vector<stdBond*>::iterator stdBondIterator;
00981 
00983     typedef std::vector<stdLoop*>::iterator stdLoopIterator;
00984 
00986     typedef std::vector<stdAlias*>::iterator stdAliasIterator;
00987 
00989     typedef std::vector<stdImproper*>::iterator stdImproperIterator;
00990 
00992     typedef std::vector<stdRing*>::iterator stdRingIterator;
00993 
00995     typedef std::vector<stdFeature*>::iterator stdFeatureIterator;
00996 
00998     typedef std::vector<stdFuncGroup*>::iterator stdFuncGroupIterator;
00999 
01001     typedef std::vector<int>::iterator stdConnPtsIterator;
01002 
01004     typedef std::vector<stdConnTorsion*>::iterator stdConnTorsionIterator;
01005 
01007     typedef std::vector<stdRotBond*>::iterator stdRotBondIterator;
01008 
01010     std::vector<stdAtom*>    itsStdAtomList;
01011 
01013     std::vector<stdBond*>    itsStdBondList;
01014 
01016     std::vector<stdLoop*>    itsStdLoopList;
01017 
01019     std::vector<stdAlias*>   itsStdAliasList;
01020 
01022     std::vector<stdImproper*>itsStdImproperList;
01023 
01025     std::vector<stdRing*>    itsStdRingList;
01026 
01028     std::vector<stdFeature*> itsStdFeatureList;
01029 
01031     std::vector<stdFuncGroup*> itsStdFuncGroupList;
01032 
01034     std::vector<int>         itsStdConnPtsList;
01035 
01037     std::vector<stdConnTorsion*> itsStdConnTorsionList;
01038 
01040     std::vector<stdRotBond*> itsStdRotBondList;
01041 
01043     std::vector<vector3d*>   itsCoords;
01044 
01046     std::vector<unsigned int>itsSimpleFP;
01047 
01049     std::vector<unsigned int>itsFragmentFP;
01050 
01051     //------------//
01052     //- POINTERS -//
01053     //------------//
01054 
01056     stdGroup*                pParent;
01057 
01059     stdAtom*                 pStdAtom;
01060 
01062     stdAtom*                 pStdAtom1;
01063 
01065     stdAtom*                 pStdAtom2;
01066 
01068     vector3d*                pCoords;
01069 
01071     stdBond*                 pStdBond;
01072 
01074     stdLoop*                 pStdLoop;
01075 
01077     stdAlias*                pStdAlias;
01078 
01080     stdImproper*             pStdImproper;
01081 
01083     stdRing*                 pStdRing;
01084 
01086     stdFeature*              pStdFeature;
01087 
01089     stdFuncGroup*            pStdFuncGroup;
01090 
01092     stdConnTorsion*          pStdConnTorsion;
01093 
01095     stdRotBond*              pStdRotBond;
01096 
01098     int                      *adjMatrix;
01099 
01101     int                      adjMatrixSize;
01102 
01104     char                     *atomSymbols;
01105 
01107     int                      *atomKinds;
01108 
01110     int                      *heavyAtomAdjMatrix;
01111 
01113     int                      heavyAtomAdjMatrixSize;
01114 
01116     char                     *heavyAtomSymbols;
01117 
01119     int                      *heavyAtomKinds;
01120 };
01121 
01122 } // MTKpp namespace
01123 
01124 #endif // STDFRAG_H
01125 

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