00001
00002
00003
00004
00005 #ifndef BALL_FORMAT_GAMESSLOGFILE_H
00006 #define BALL_FORMAT_GAMESSLOGFILE_H
00007
00008 #ifndef BALL_FORMAT_GENERICMOLFILE_H
00009 # include <BALL/FORMAT/genericMolFile.h>
00010 #endif
00011
00012 #ifndef BALL_STRUCTURE_QMBASISSET_H
00013 # include <BALL/STRUCTURE/QMBasisSet.h>
00014 #endif
00015
00016 #ifndef BALL_STRUCTURE_SPLITVALENCESET_H
00017 # include <BALL/STRUCTURE/splitValenceSet.h>
00018 #endif
00019
00020 namespace BALL
00021 {
00028 class BALL_EXPORT GAMESSLogFile
00029 : public GenericMolFile
00030 {
00031 public:
00032
00033 BALL_CREATE(GAMESSLogFile)
00034
00035
00036 struct State
00037 {
00038 GAMESSLogFile* current_parser;
00039 };
00040
00044
00047 GAMESSLogFile();
00048
00052 GAMESSLogFile(const GAMESSLogFile& file);
00053
00057 GAMESSLogFile(const String& filename, File::OpenMode open_mode = std::ios::in);
00058
00061 virtual ~GAMESSLogFile();
00062
00064
00067
00071 const GAMESSLogFile& operator = (const GAMESSLogFile& rhs);
00072
00074
00078
00084 virtual bool write(const Molecule& molecule);
00085
00091 virtual bool write(const System& molecule);
00092
00098 virtual Molecule* read();
00099
00105 virtual bool read(System& system);
00106
00108
00112 void newMolecule();
00113
00114 void setMoleculeName(char* name);
00115
00116 void insertAtom(const String& element, float charge, float x, float y, float z);
00117
00118 void insertBond(Index a1, Index a2);
00119
00120 void clearBonds();
00121
00122 void setCurrentCharge(float charge);
00123
00124 void setUnitConversionFactor(float factor);
00125
00126 void addCoefficient(float coefficient);
00127
00128 void initializeBasisSet();
00129
00130 QMBasisSet& getBasisSet();
00131
00132 const QMBasisSet& getBasisSet() const;
00133
00134 void addBasisOption(const String& key, const String& value);
00135
00136 String getBasisOption(const String& key);
00138
00139 static State state;
00140 Index current_atom;
00141 Index current_set;
00142 Index current_coefficient_line;
00143 Size basis_size;
00144 bool molecule_already_defined;
00145
00150 System *system;
00151
00152 protected:
00153 virtual void initRead_();
00154
00155 Molecule* molecule_;
00156 float factor_;
00157
00158 splitValenceSet qmbs_;
00159
00160 StringHashMap<String> basis_options_;
00161 };
00162 }
00163
00164 #endif // BALL_FORMAT_GAMESSLOGFILE_H