00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OB_PATTY_H
00021 #define OB_PATTY_H
00022
00023 namespace OpenBabel
00024 {
00025 #define PT_CATION 1
00026 #define PT_ANION 2
00027 #define PT_ACCEPTOR 3
00028 #define PT_POLAR 4
00029 #define PT_DONOR 5
00030 #define PT_HYDROPHOBIC 6
00031 #define PT_OTHER 7
00032 #define PT_METAL 8
00033
00034
00035 class OBAPI patty
00036 {
00037 std::vector<OBSmartsPattern*> _sp;
00038 std::vector<std::string> smarts;
00039 std::vector<std::string> typ;
00040 bool debug;
00041
00042 public :
00043
00044 patty()
00045 {
00046 debug = false;
00047 }
00048 patty(char *s)
00049 {
00050 debug = false;
00051 read_rules(std::string(s));
00052 }
00053
00054 patty(const std::string &s)
00055 {
00056 debug = false;
00057 read_rules(s);
00058 }
00059 ~patty()
00060 {
00061 std::vector<OBSmartsPattern*>::iterator i;
00062 for (i = _sp.begin();i != _sp.end();i++)
00063 delete *i;
00064 }
00065 void debug_on()
00066 {
00067 debug = true;
00068 }
00069 void debug_off()
00070 {
00071 debug = false;
00072 }
00073 void read_rules(const std::string &infile);
00074 void assign_rules(std::vector<std::string> &rules);
00075 void assign_types(OBMol &mol,std::vector<std::string> &atm_typ);
00076 void assign_types(OBMol &mol,std::vector<int> &atm_typ);
00077 int type_to_int(const std::string &type, bool failOnUndefined= false);
00078 int Istype(const std::string &type);
00079 };
00080
00081 }
00082
00083 #endif // OB_PATTY_H
00084