MTK++ Latest version: 0.2.0

mol2Parser.h
Go to the documentation of this file.
00001 
00033 #ifndef MOL2PARSER_H
00034 #define MOL2PARSER_H
00035 
00036 #include <map>
00037 #include <iostream>
00038 #include <string.h>
00039 #include <fstream>
00040 #include <iomanip>
00041 #include <stdlib.h>
00042 #include <sstream>
00043 #include <vector>
00044 
00045 #include "baseParser.h"
00046 
00047 namespace MTKpp
00048 {
00049 
00050 class collection;
00051 class molecule;
00052 class submolecule;
00053 class atom;
00054 
00055 struct Bond;
00056 
00057 // ============================================================
00058 // Class : mol2Parser()
00059 // ------------------------------------------------------------
00067 // ============================================================
00068 class mol2Parser : public baseParser
00069 {
00070 public:
00071 
00075     mol2Parser();
00076 
00078     ~mol2Parser();
00079 
00085     void            Read(const std::string &i, collection* c);
00086 
00092     void            Read(const std::string &i, molecule* m);
00093 
00094 
00100     void            Write(const std::string &o, molecule* m);
00101 
00103     std::string getChargeType() {
00104       return chargeType;
00105     };
00106 
00108     double getTotalCharge() {
00109       return totalCharge;
00110     };
00111 
00113     bool hasTotalCharge() {
00114       return hasTotalChargeRemark;
00115     };
00116 
00118     collection*    pCol;
00119 
00121     molecule*      pMol;
00122 
00124     submolecule*   pSmol;
00125 
00127     atom*          pAtom;
00128 
00130     Bond*          pBond;
00131 
00133     atom*          pBondAtom1;
00134 
00136     atom*          pBondAtom2;
00137 
00139     std::string chargeType;
00140 
00144     double totalCharge;
00145 
00147     bool hasTotalChargeRemark;
00148 
00149 protected: // functions
00150 
00157     bool            ReadAtomLine(std::string &fileline, AtomLine* pthisAtom);
00158 
00164     int             getAtom(int i);
00165 
00171     std::string get1LCode(std::string s);
00172 
00182     void buildupSubmolecule(collection* pCollection, std::string& residueID, unsigned int n, std::vector<AtomLine*>& atomLineVector);
00183 
00184 protected: // data
00185 
00187     std::map<int, int>  itsAtomMap;
00188 
00190     std::map<std::string, std::string> res21l;
00191 
00193     typedef std::map<std::string, std::string>::iterator nameMapIterator;
00194 };
00195 
00196 } // MTKpp namespace
00197 
00198 #endif // MOL2PARSER_H

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