00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OB_REACT_H
00020 #define OB_REACT_H
00021
00022 #include <vector>
00023 #include <openbabel/mol.h>
00024
00025 #ifdef USE_BOOST
00026 #include <boost/shared_ptr.hpp>
00027 namespace std{ namespace tr1=::boost; }
00028 #else
00029 #include <tr1/memory>
00030 #endif
00031
00032 namespace OpenBabel
00033 {
00034
00041 class OBReaction : public OBBase
00042 {
00043 private:
00044 std::vector<std::tr1::shared_ptr<OBMol> > _reactants;
00045 std::vector<std::tr1::shared_ptr<OBMol> > _products;
00046 std::tr1::shared_ptr<OBMol> _ts;
00047 std::tr1::shared_ptr<OBMol> _agent;
00048 std::string _title;
00049 std::string _comment;
00050 bool _reversible;
00051 public:
00052 OBReaction() : _reversible(false)
00053 {}
00054
00055 int NumReactants() const
00056 { return _reactants.size(); }
00057
00058 int NumProducts()const
00059 { return _products.size(); }
00060
00061 void AddReactant(const std::tr1::shared_ptr<OBMol> sp)
00062 { _reactants.push_back(sp); }
00063
00064 void AddProduct(const std::tr1::shared_ptr<OBMol> sp)
00065 { _products.push_back(sp); }
00066
00067 void SetTransitionState(const std::tr1::shared_ptr<OBMol> sp)
00068 { _ts = sp; }
00069
00070 void AddAgent(const std::tr1::shared_ptr<OBMol> sp)
00071 { _agent = sp; }
00072
00073 std::tr1::shared_ptr<OBMol> GetReactant(const unsigned i)
00074 {
00075 std::tr1::shared_ptr<OBMol> sp;
00076 if(i<_reactants.size())
00077 sp = _reactants[i];
00078 return sp;
00079 }
00080 std::tr1::shared_ptr<OBMol> GetProduct(const unsigned i)
00081 {
00082 std::tr1::shared_ptr<OBMol> sp;
00083 if(i<_products.size())
00084 sp = _products[i];
00085 return sp;
00086 }
00087
00088 std::tr1::shared_ptr<OBMol> GetTransitionState()const
00089 { return _ts; }
00090
00091 std::tr1::shared_ptr<OBMol> GetAgent()const
00092 { return _agent; }
00093
00094 std::string GetTitle() const { return _title; }
00095 std::string GetComment() const { return _comment; }
00096 void SetTitle(const std::string& title) { _title=title; }
00097 void SetComment(const std::string& comment) { _comment=comment; }
00098
00099 bool IsReversible() const {return _reversible;}
00100 void SetReversible(bool b=true) {_reversible=b;}
00101
00102 static const char* ClassDescription()
00103 {
00104 return " reactions\n";
00105 }
00106 };
00107
00108
00109 }
00110 #endif
00111