GAMESSLogFile.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: GAMESSLogFile.h,v 1.2 2005/10/05 09:59:46 anhi Exp $
00005 //
00006 
00007 #ifndef BALL_FORMAT_GAMESSLOGFILE_H
00008 #define BALL_FORMAT_GAMESSLOGFILE_H
00009 
00010 #ifndef BALL_FORMAT_GENERICMOLFILE_H
00011 # include <BALL/FORMAT/genericMolFile.h>
00012 #endif
00013 
00014 #ifndef BALL_STRUCTURE_QMBASISSET_H
00015 # include <BALL/STRUCTURE/QMBasisSet.h>
00016 #endif
00017 
00018 #ifndef BALL_STRUCTURE_SPLITVALENCESET_H
00019 # include <BALL/STRUCTURE/splitValenceSet.h>
00020 #endif
00021 
00022 namespace BALL
00023 {
00030   class BALL_EXPORT GAMESSLogFile
00031     : public GenericMolFile
00032   {
00033     public:
00034 
00035       BALL_CREATE(GAMESSLogFile)
00036 
00037       
00038       struct State
00039       {
00040         GAMESSLogFile* current_parser;
00041       };
00042 
00046       
00049       GAMESSLogFile()
00050         ;
00051 
00054       GAMESSLogFile(const GAMESSLogFile& file)
00055         throw(Exception::FileNotFound);
00056 
00059       GAMESSLogFile(const String& filename, File::OpenMode open_mode = std::ios::in)
00060         throw(Exception::FileNotFound);
00061 
00064       virtual ~GAMESSLogFile()
00065         ;
00066       
00068 
00071       
00074       const GAMESSLogFile& operator = (const GAMESSLogFile& rhs)
00075         throw(Exception::FileNotFound);
00076 
00078 
00082       
00087       virtual bool write(const Molecule& molecule)
00088         throw(File::CannotWrite);
00089 
00094       virtual bool write(const System& molecule)
00095         throw(File::CannotWrite);
00096 
00101       virtual Molecule* read()
00102         throw(Exception::ParseError);
00103 
00108       virtual bool read(System& system)
00109         throw(Exception::ParseError);
00110 
00112 
00116       void newMolecule()
00117         ;
00118 
00119       void setMoleculeName(char* name)
00120         ;     
00121       
00122       void insertAtom(const String& element, float charge, float x, float y, float z)
00123         ;
00124 
00125       void insertBond(Index a1, Index a2)
00126         ;
00127 
00128       void clearBonds()
00129         ;
00130 
00131       void setCurrentCharge(float charge)
00132         ;
00133 
00134       void setUnitConversionFactor(float factor)
00135         ;
00136 
00137       void addCoefficient(float coefficient)
00138         ;
00139 
00140       void initializeBasisSet()
00141         ;
00142 
00143       QMBasisSet& getBasisSet()
00144         ;
00145 
00146       const QMBasisSet& getBasisSet() const
00147         ;
00148 
00149       void addBasisOption(const String& key, const String& value)
00150         ;
00151 
00152       String getBasisOption(const String& key)
00153         ;
00155       
00156       static State state;
00157       Index  current_atom;
00158       Index  current_set;
00159       Index  current_coefficient_line;
00160       Size   basis_size;
00161       bool   molecule_already_defined;
00162       
00167       System *system; // needed for the datasetControl stuff
00168     protected:
00169       virtual void initRead_();
00170 
00171       Molecule*   molecule_;
00172       float       factor_;
00173       //QMBasisSet  qmbs_;
00174       splitValenceSet  qmbs_;
00175 
00176       StringHashMap<String> basis_options_;
00177   };
00178 }
00179 
00180 #endif // BALL_FORMAT_GAMESSLOGFILE_H