BALL  1.5.0
MOLFile.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_FORMAT_MOLFILE_H
6 #define BALL_FORMAT_MOLFILE_H
7 
8 #ifndef BALL_FORMAT_GENERICMOLFILE_H
10 #endif
11 
12 #ifndef BALL_MATHS_VECTOR3_H
13 # include <BALL/MATHS/vector3.h>
14 #endif
15 
16 namespace BALL
17 {
18  class System;
19  class Atom;
20  class Molecule;
21 
28  : public GenericMolFile
29  {
30  public:
31 
35 
45  {
53  static const String ATOM_VALENCE;
55  static const String ATOM_H0_DESIGNATOR;
63  static const String ATOM_EXACT_CHANGE;
64 
66  static const String BOND_STEREO;
68  static const String BOND_TOPOLOGY;
71  };
72 
75  {
76  public:
80  bool chiral;
87  };
88 
91  {
92  public:
107  };
108 
111  {
112  public:
119  };
121 
125 
129 
133  MOLFile(const String& filename, File::OpenMode open_mode = std::ios::in);
134 
136  virtual ~MOLFile();
137 
139 
143 
147  virtual bool write(const Molecule& molecule);
148 
152  virtual bool write(const System& system);
153 
157  virtual bool read(System& system);
158 
162  virtual Molecule* read();
163 
165  const MOLFile& operator = (const MOLFile& file);
166 
168 
169  protected:
174  static const String counts_format_;
175 
177  static const String atom_format_;
178 
180  static const String bond_format_;
182 
186  Molecule* readCTAB_(std::vector<Atom*>& atom_map);
187 
190 
193 
196 
198  void writeCountsLine_(const CountsStruct& counts);
199 
201  void writeAtomLine_(const AtomStruct& atom);
202 
204  void writeBondLine_(const BondStruct& bond);
205  };
206 } // namespace BALL
207 
208 #endif // BALL_FORMAT_MOLFILE_H
Definition: constants.h:13
BALL_INDEX_TYPE Index
char Atom[5]
Definition: PDBdefs.h:257
Molecule * readCTAB_(std::vector< Atom * > &atom_map)
static const String bond_format_
The format of an entry of the bond block.
Definition: MOLFile.h:180
virtual ~MOLFile()
Destructor.
MOLFile(const String &filename, File::OpenMode open_mode=std::ios::in)
void writeCountsLine_(const CountsStruct &counts)
Write the Counts line.
virtual bool write(const Molecule &molecule)
bool readBondLine_(BondStruct &bond)
Read a line from the bond block.
virtual Molecule * read()
bool readAtomLine_(AtomStruct &atom)
Read a line from the atom block.
bool readCountsLine_(CountsStruct &counts)
Read the Counts line of a MOL file.
virtual bool read(System &system)
void writeBondLine_(const BondStruct &bond)
Write a line of the bond block.
void writeAtomLine_(const AtomStruct &atom)
Write a line of the atom block.
static const String counts_format_
The format of the counts line.
Definition: MOLFile.h:174
static const String atom_format_
The format of an entry of the atom block.
Definition: MOLFile.h:177
virtual bool write(const System &system)
static const String BOND_REACTING_CENTER_STATUS
Definition: MOLFile.h:70
static const String BOND_TOPOLOGY
Definition: MOLFile.h:68
static const String ATOM_HYDROGEN_COUNT
Definition: MOLFile.h:49
static const String ATOM_MASS_DIFFERENCE
Definition: MOLFile.h:47
static const String ATOM_STEREO_CARE_BOX
Definition: MOLFile.h:51
static const String ATOM_H0_DESIGNATOR
Definition: MOLFile.h:55
static const String ATOM_REACTION_COMPONENT_NUMBER
Definition: MOLFile.h:59
static const String BOND_STEREO
Definition: MOLFile.h:66
static const String ATOM_INVERSION_RETENTION
Definition: MOLFile.h:61
static const String ATOM_VALENCE
Definition: MOLFile.h:53
static const String ATOM_REACTION_COMPONENT_TYPE
Definition: MOLFile.h:57
static const String ATOM_EXACT_CHANGE
Definition: MOLFile.h:63
Position reaction_component_number
Definition: MOLFile.h:103
Position reaction_component_type
Definition: MOLFile.h:102
Position inversion_retention
Definition: MOLFile.h:105
Position reacting_center_status
Definition: MOLFile.h:118
std::ios::openmode OpenMode
Definition: file.h:165
#define BALL_EXPORT
Definition: COMMON/global.h:50