MTK++ Latest version: 0.2.0

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MTKpp::sdfParser Class Reference

Reads and writes SDF format files. More...

#include <mtkpp/src/Parsers/sdfParser.h>

Inheritance diagram for MTKpp::sdfParser:
Inheritance graph
[legend]
Collaboration diagram for MTKpp::sdfParser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 sdfParser ()
 sdfParser Constructor
 ~sdfParser ()
 sdfParser Destructor
void Read (const std::string &i, collection *c, const bool &bohr=false)
 Read SDF formatted files.
int ReadMolecule (std::ifstream &os, molecule *m, const bool &bohr=false)
 Read a molecule from a sd files.
int numMolecules (const std::string &i)
 Determine the number of molecules in an sd file.
void Write (const std::string &o, collection *c)
 Write SDF formatted file.
void Write (std::ostream &os, molecule *m)
 Write SDF formatted file.
virtual void Read ()
 Read function.
virtual void Write ()
 Write function.
std::ofstream & OpenFile (std::string fileName)
 Write function.
std::string determineElement (std::string &name)
 Preceive element symbol from the atom name.
void setError (int i)
 Error handling within Parsers.
bool getError ()
 Error handling within dcParser.
void setErrorMessage (std::string s)
 Error handling within Parsers.
std::string getErrorMessage ()
 Error handling within Parsers.

Protected Types

typedef std::vector< molecule * >
::iterator 
moleculeIterator
 molecule iterator
typedef std::vector
< submolecule * >::iterator 
subMoleculeIterator
 submolecule iterator
typedef std::vector< atom * >
::iterator 
atomIterator
 atom iterator
typedef std::map< int, Bond * >
::iterator 
BondMapIterator
 Bond Map Iterator.

Protected Member Functions

bool ReadAtomLine (std::string &fileline, AtomLine *pthisAtom)
int getAtom (int i)
 Get atom.

Protected Attributes

collectionpCollection
 collection pointer
moleculepMolecule
 molecule pointer
submoleculepSubMolecule
 submolecule pointer
atompAtom
 atom pointer
BondpBond
 Bond pointer.
atompBondAtom1
 atom pointer used in bonding section
atompBondAtom2
 atom pointer used in bonding section
std::map< int, int > itsAtomMap
 internal atom mapping local to molParser
connectionspConnections
std::map< int, Bond * > moleculeBondMap
 Bond Map.
std::ofstream outputFileStream
 Output File Stream.
bool bError
 Error occured.
std::string errorMessage
 Error message.
unsigned int NUM_INDENTS_PER_SPACE

Detailed Description

Reads and writes SDF format files.

Author:
Martin Peters
Version:
0.1
Date:
2005

Sdf File Example


Member Typedef Documentation

typedef std::vector<molecule*>::iterator MTKpp::sdfParser::moleculeIterator [protected]

molecule iterator

typedef std::vector<submolecule*>::iterator MTKpp::sdfParser::subMoleculeIterator [protected]

submolecule iterator

typedef std::vector<atom*>::iterator MTKpp::sdfParser::atomIterator [protected]

atom iterator

typedef std::map<int, Bond*>::iterator MTKpp::sdfParser::BondMapIterator [protected]

Bond Map Iterator.


Constructor & Destructor Documentation

MTKpp::sdfParser::sdfParser ( )
MTKpp::sdfParser::~sdfParser ( )

sdfParser Destructor

References pConnections.


Member Function Documentation

void MTKpp::sdfParser::Read ( const std::string &  i,
collection c,
const bool &  bohr = false 
)
int MTKpp::sdfParser::ReadMolecule ( std::ifstream &  os,
molecule m,
const bool &  bohr = false 
)
int MTKpp::sdfParser::numMolecules ( const std::string &  i)

Determine the number of molecules in an sd file.

Parameters:
iInput file
void MTKpp::sdfParser::Write ( const std::string &  o,
collection c 
)
void MTKpp::sdfParser::Write ( std::ostream &  os,
molecule m 
)
bool MTKpp::sdfParser::ReadAtomLine ( std::string &  fileline,
AtomLine pthisAtom 
) [protected]

\ Read a single line of the input file

Parameters:
filelineActual line
pthisAtomAtomLine struct to temporary store atom info

References MTKpp::AtomLine::element, MTKpp::FieldExists(), MTKpp::removeCharacter(), MTKpp::AtomLine::x, MTKpp::AtomLine::y, and MTKpp::AtomLine::z.

Referenced by Read(), and ReadMolecule().

int MTKpp::sdfParser::getAtom ( int  i) [protected]

Get atom.

Parameters:
iatom index in itsAtomMap

References itsAtomMap.

void MTKpp::baseParser::Read ( ) [virtual, inherited]

Read function.

Referenced by MTKpp::acParser::Read(), and MTKpp::molParser::Read().

void MTKpp::baseParser::Write ( ) [virtual, inherited]
std::ofstream & MTKpp::baseParser::OpenFile ( std::string  fileName) [inherited]

Write function.

References MTKpp::baseParser::outputFileStream.

Referenced by main().

std::string MTKpp::baseParser::determineElement ( std::string &  name) [inherited]

Preceive element symbol from the atom name.

References MTKpp::GetAlphaChar(), and MTKpp::removeCharacter().

Referenced by MTKpp::pdbParser::Read(), and MTKpp::prepParser::readFragment().

void MTKpp::baseParser::setError ( int  i) [inline, inherited]
bool MTKpp::baseParser::getError ( ) [inline, inherited]

Error handling within dcParser.

Returns:
error

References MTKpp::baseParser::bError.

Referenced by main().

void MTKpp::baseParser::setErrorMessage ( std::string  s) [inline, inherited]
std::string MTKpp::baseParser::getErrorMessage ( ) [inline, inherited]

Error handling within Parsers.

Returns:
error message

References MTKpp::baseParser::errorMessage.

Referenced by main().


Member Data Documentation

collection pointer

Referenced by ReadMolecule().

molecule pointer

Referenced by Read(), sdfParser(), and Write().

submolecule pointer

Referenced by Read(), ReadMolecule(), and sdfParser().

atom pointer

Referenced by Read(), ReadMolecule(), and Write().

Bond pointer.

Referenced by Read(), ReadMolecule(), sdfParser(), and Write().

atom pointer used in bonding section

Referenced by Read(), ReadMolecule(), and sdfParser().

atom pointer used in bonding section

Referenced by Read(), ReadMolecule(), and sdfParser().

std::map<int, int> MTKpp::sdfParser::itsAtomMap [protected]

internal atom mapping local to molParser

Referenced by getAtom(), and Write().

std::map<int, Bond*> MTKpp::sdfParser::moleculeBondMap [protected]

Bond Map.

Referenced by Write().

std::ofstream MTKpp::baseParser::outputFileStream [protected, inherited]

Output File Stream.

Referenced by MTKpp::baseParser::OpenFile().

bool MTKpp::baseParser::bError [protected, inherited]
std::string MTKpp::baseParser::errorMessage [protected, inherited]
unsigned int MTKpp::baseParser::NUM_INDENTS_PER_SPACE [protected, inherited]

The documentation for this class was generated from the following files:

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