Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <openbabel/babelconfig.h>
00019 #include <openbabel/mol.h>
00020 #include <openbabel/phmodel.h>
00021 #include <openbabel/op.h>
00022 #include <vector>
00023
00024 namespace OpenBabel
00025 {
00026
00031 class OpTransform : public OBOp
00032 {
00033 public:
00035 OpTransform(const char* ID, const char* filename, const char* descr)
00036 : OBOp(ID, false), _filename(filename), _descr(descr), _dataLoaded(false){}
00037
00038 ~OpTransform(){}
00039
00040 virtual const char* Description();
00041
00043 virtual bool WorksWith(OBBase* pOb)const{ return dynamic_cast<OBMol*>(pOb)!=NULL; }
00044
00046 virtual bool Do(OBBase* pOb, const char* OptionText=NULL, OpMap* pOptions=NULL, OBConversion* pConv=NULL);
00047
00048 virtual OpTransform* MakeInstance(const std::vector<std::string>& textlines)
00049 {
00050 OpTransform* pTransform = new OpTransform(
00051 textlines[1].c_str(),textlines[2].c_str(),textlines[3].c_str());
00052 pTransform->_textlines = textlines;
00053 return pTransform;
00054 }
00055
00056 private:
00057 bool Initialize();
00058 void ParseLine(const char *buffer);
00059
00060 private:
00061 const char* _filename;
00062 const char* _descr;
00063 std::vector<std::string> _textlines;
00064
00065 bool _dataLoaded;
00066 std::vector<OBChemTsfm> _transforms;
00067 };
00068
00069 }
00070