BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_STRUCTURE_ATOMTYPER_H 00006 #define BALL_STRUCTURE_ATOMTYPER_H 00007 00008 #ifndef BALL_DATATYPE_HASHSET_H 00009 # include <BALL/DATATYPE/hashSet.h> 00010 #endif 00011 00012 #ifndef BALL_DATATYPE_STRINGHASHMAP_H 00013 # include <BALL/DATATYPE/stringHashMap.h> 00014 #endif 00015 00016 #include <vector> 00017 00018 namespace BALL 00019 { 00020 using std::vector; 00021 00022 class Molecule; 00023 class System; 00024 class Atom; 00025 00040 class BALL_EXPORT AtomTyper 00041 { 00042 public: 00043 00044 BALL_CREATE(AtomTyper) 00045 00046 00047 AtomTyper(); 00048 00050 AtomTyper(const AtomTyper& t); 00051 00053 virtual ~AtomTyper() {}; 00054 00056 bool setup(const String& filename); 00057 00059 virtual void assignTo(System& s); 00060 00062 void setAromaticRings(const vector<HashSet<Atom*> >& rings) { aromatic_rings_ = rings;} 00063 00065 void setRings(const vector<HashSet<Atom*> >& rings) { rings_ = rings;} 00066 00067 // just for debugging: computational times for the individual SMARTS expressions 00068 static StringHashMap<float> rule_times; 00069 00070 protected: 00071 00073 void assignTo(Molecule& mol); 00074 00078 virtual void assignSpecificValues_(Atom&) {}; 00079 00083 virtual bool specificSetup_() { return true;} 00084 00085 vector<String> names_; 00086 vector<String> rules_; 00087 vector<Index> types_; 00088 // entries in the file for specificSetup_() : 00089 vector<vector<String> > fields_; 00090 // number for fields per line in the config file 00091 Size number_expected_fields_; 00092 vector<HashSet<Atom*> > rings_; 00093 vector<HashSet<Atom*> > aromatic_rings_; 00094 StringHashMap<vector<Position> > element_to_rules_; 00095 HashSet<Atom*> atoms_; 00096 }; 00097 00098 } // namespace BALL 00099 00100 #endif // BALL_STRUCTURE_ATOMTYPER_H