#include <BALL/FORMAT/MOL2File.h>
Classes | |
struct | AtomStruct |
struct | BondStruct |
struct | MoleculeStruct |
struct | SetStruct |
A class used for storing TRIPOS sets. More... | |
struct | SubstructureStruct |
Public Member Functions | |
Constructors and Destructors | |
MOL2File () | |
MOL2File (const String &filename, File::OpenMode open_mode=std::ios::in) throw (Exception::FileNotFound) | |
MOL2File (const MOL2File &file) throw (Exception::FileNotFound) | |
virtual | ~MOL2File () |
Destructor. | |
Reading and Writing of Kernel Datastructures | |
virtual bool | write (const System &system) throw (File::CannotWrite) |
virtual bool | read (System &system) throw (Exception::ParseError) |
virtual Molecule * | read () throw (Exception::ParseError) |
virtual bool | write (const Molecule &molecule) throw (File::CannotWrite) |
const MOL2File & | operator= (const MOL2File &file) |
Size | getNumberOfSets () const |
Return the number of TRIPOS-Sets defined in this instance. | |
SetStruct & | getSet (Position i) |
Return the i-th TRIPOS set. NOTE: no range checking is performed. | |
const SetStruct & | getSet (Position i) const |
Return the i-th TRIPOS set, const version. NOTE: no range checking is performed. | |
Static Public Attributes | |
Constants | |
static const String | TRIPOS |
Protected Member Functions | |
void | readAtomSection_ () |
void | readBondSection_ () |
void | readMoleculeSection_ () |
void | readSetSection_ () |
void | readSubstructureSection_ () |
String | getSybylType_ (const Atom &atom) const |
bool | nextLine_ () |
void | clear_ () |
bool | buildAll_ (System &system) |
bool | containsAtomChilds_ (AtomContainerConstIterator &frag_it) |
Protected Attributes | |
vector< AtomStruct > | atoms_ |
vector< BondStruct > | bonds_ |
vector< SetStruct > | sets_ |
vector< SubstructureStruct > | substructures_ |
MoleculeStruct | molecule_ |
Size | number_of_lines_ |
char | buffer_ [4096] |
String | line_ |
buffer for the line in use | |
Static Protected Attributes | |
static const Size | MAX_LENGTH_ |
SYBYL MOL2 file class. This class is used to read and write SYBYL MOL2 files (Tripos).
BALL::MOL2File::MOL2File | ( | ) |
Default constructor
BALL::MOL2File::MOL2File | ( | const String & | filename, | |
File::OpenMode | open_mode = std::ios::in | |||
) | throw (Exception::FileNotFound) |
Detailed constructor
BALL::MOL2File::MOL2File | ( | const MOL2File & | file | ) | throw (Exception::FileNotFound) |
Copy constructor
virtual BALL::MOL2File::~MOL2File | ( | ) | [virtual] |
Destructor.
void BALL::MOL2File::clear_ | ( | ) | [protected] |
bool BALL::MOL2File::containsAtomChilds_ | ( | AtomContainerConstIterator & | frag_it | ) | [protected] |
Size BALL::MOL2File::getNumberOfSets | ( | ) | const [inline] |
Return the number of TRIPOS-Sets defined in this instance.
Return the i-th TRIPOS set, const version. NOTE: no range checking is performed.
Return the i-th TRIPOS set. NOTE: no range checking is performed.
bool BALL::MOL2File::nextLine_ | ( | ) | [protected] |
virtual Molecule* BALL::MOL2File::read | ( | ) | throw (Exception::ParseError) [virtual] |
Read a molecule. This method will load the first (or the next, on subsequent invocation) molecule from the file. If the file format does not support multiple molecules, only the first call to read will be successful. This method will create an instance of molecule and its the user's responsibility to destroy that molecule.
Exception::ParseError | if the contents of the file could not be parsed |
Reimplemented from BALL::GenericMolFile.
virtual bool BALL::MOL2File::read | ( | System & | system | ) | throw (Exception::ParseError) [virtual] |
Read a system from the MOL2 file
Reimplemented from BALL::GenericMolFile.
void BALL::MOL2File::readAtomSection_ | ( | ) | [protected] |
void BALL::MOL2File::readBondSection_ | ( | ) | [protected] |
void BALL::MOL2File::readMoleculeSection_ | ( | ) | [protected] |
void BALL::MOL2File::readSetSection_ | ( | ) | [protected] |
void BALL::MOL2File::readSubstructureSection_ | ( | ) | [protected] |
virtual bool BALL::MOL2File::write | ( | const Molecule & | molecule | ) | throw (File::CannotWrite) [virtual] |
Write a molecule. Repeated invocations of this method append molecules to the same file.
Reimplemented from BALL::GenericMolFile.
virtual bool BALL::MOL2File::write | ( | const System & | system | ) | throw (File::CannotWrite) [virtual] |
Write a system to the MOL2 file
Reimplemented from BALL::GenericMolFile.
vector<AtomStruct> BALL::MOL2File::atoms_ [protected] |
vector<BondStruct> BALL::MOL2File::bonds_ [protected] |
char BALL::MOL2File::buffer_[4096] [protected] |
String BALL::MOL2File::line_ [protected] |
buffer for the line in use
Reimplemented from BALL::LineBasedFile.
const Size BALL::MOL2File::MAX_LENGTH_ [static, protected] |
MoleculeStruct BALL::MOL2File::molecule_ [protected] |
Size BALL::MOL2File::number_of_lines_ [protected] |
vector<SetStruct> BALL::MOL2File::sets_ [protected] |
vector<SubstructureStruct> BALL::MOL2File::substructures_ [protected] |
const String BALL::MOL2File::TRIPOS [static] |
Tripos Record Type Identifier (RTI)