MTK++ Latest version: 0.2.0

sdfParser.h
Go to the documentation of this file.
00001 
00035 #ifndef SDFPARSER_H
00036 #define SDFPARSER_H
00037 
00038 #include <map>
00039 #include <iostream>
00040 #include <string.h>
00041 #include <fstream>
00042 #include <iomanip>
00043 #include <stdlib.h>
00044 #include <sstream>
00045 #include <vector>
00046 
00047 #include <math.h>
00048 #include <stdexcept>
00049 
00050 #include "baseParser.h"
00051 
00052 namespace MTKpp
00053 {
00054 
00055 class collection;
00056 class molecule;
00057 class submolecule;
00058 class atom;
00059 class element;
00060 class connections;
00061 struct Bond;
00062 struct Angle;
00063 struct Torsion;
00064 struct Improper;
00065 
00066 // ============================================================
00067 // Class : sdfParser()
00068 // ------------------------------------------------------------
00143 // ============================================================
00144 
00145 class sdfParser : public baseParser
00146 {
00147 public:
00148 
00152     sdfParser();
00153 
00155     ~sdfParser();
00156 
00163     void           Read(const std::string &i, collection* c, const bool &bohr = false);
00164 
00171     int            ReadMolecule(std::ifstream& os, molecule* m, const bool &bohr = false);
00172 
00177     int            numMolecules(const std::string &i);
00178 
00184     void           Write(const std::string &o, collection* c);
00185 
00191     void           Write(std::ostream& os, molecule* m);
00192 
00193 protected: // functions
00194 
00200     bool           ReadAtomLine(std::string &fileline, AtomLine* pthisAtom);
00201 
00206     int            getAtom(int i);
00207 
00208 protected: // data
00209 
00211     // - pointers to the backbone objects - //
00213 
00215     collection*    pCollection;
00216 
00218     molecule*      pMolecule;
00219 
00221     submolecule*   pSubMolecule;
00222 
00224     atom*          pAtom;
00225 
00227     Bond*          pBond;
00228 
00230     atom*           pBondAtom1;
00231 
00233     atom*           pBondAtom2;
00234 
00236     std::map<int, int>  itsAtomMap;
00237 
00238     // connections pointer
00239     connections* pConnections;
00240 
00242     typedef std::vector<molecule*>::iterator moleculeIterator;
00243 
00245     typedef std::vector<submolecule*>::iterator subMoleculeIterator;
00246 
00248     typedef std::vector<atom*>::iterator atomIterator;
00249 
00251     typedef std::map<int, Bond*>::iterator BondMapIterator;
00252 
00254     std::map<int, Bond*> moleculeBondMap;
00255 };
00256 
00257 } // MTKpp namespace
00258 
00259 #endif // SDFPARSER_H

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