00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00020
00021 #ifndef CRDFACTORY_H
00022 #define CRDFACTORY_H
00023
00025
00026
00027 class QString;
00028 class QStringList;
00029
00030
00031 class AtomSet;
00032
00034 class CrdFactory
00035 {
00036 public:
00037 ~CrdFactory();
00038
00039 static unsigned int readFromFile(AtomSet* atoms, QString filename);
00040 static unsigned int readFromFile(AtomSet* atoms);
00041 static unsigned int writeToFile(AtomSet* atoms, QString filename = QString::null, bool extendedFormat = false);
00042 static unsigned int convert(const QString inputFileName, const QString outputFileName, const bool extendedFormat = false);
00043 static unsigned int readForces(AtomSet* atoms, QString filename);
00044
00045 enum returnCodes{OK, Cancelled, UnknownExtension, ErrorOpen, ErrorRead, ErrorWrite, UnknownFormat, NormalFormat, ExtendedFormat};
00046
00047 private:
00048 CrdFactory();
00049
00050 static QStringList supportedInputFormats();
00051 static QStringList supportedOutputFormats();
00052 static bool validInputFormat(const QString filename);
00053 static bool validForceInputFormat(const QString filename);
00054 static bool validOutputFormat(const QString filename);
00055 static bool braboExtension(const QString filename);
00056 static bool xmolExtension(const QString filename);
00057 static bool gaussianExtension(const QString filename);
00058
00059 static unsigned int readBraboFile(AtomSet* atoms, const QString filename);
00060 static unsigned int writeBraboFile(AtomSet* atoms, const QString filename, const bool extendedFormat);
00061 static unsigned int readBraboForces(AtomSet* atoms, const QString filename);
00062 static void readCrdAtoms(AtomSet* atoms, QStringList& lines, const bool extendedFormat);
00063 static void readPunchForces(AtomSet* atoms, QStringList& lines, const bool extendedFormat);
00064 static unsigned int determineCrdFormat(QStringList& lines);
00065 static unsigned int determinePunchFormat(QStringList& lines);
00066 static bool possiblyNormalCrd(const QString line);
00067 static bool possiblyExtendedCrd(const QString line);
00068
00069 static unsigned int readXmolFile(AtomSet* atoms, const QString filename);
00070 static unsigned int readGaussianFile(AtomSet* atoms, const QString filename);
00071
00072 static const double AUTOANG;
00073 };
00074
00075 #endif
00076