00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: atomTyper.h,v 1.1.4.1 2007/03/25 21:25:24 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_STRUCTURE_ATOMTYPER_H 00008 #define BALL_STRUCTURE_ATOMTYPER_H 00009 00010 #ifndef BALL_DATATYPE_HASHSET_H 00011 # include <BALL/DATATYPE/hashSet.h> 00012 #endif 00013 00014 #ifndef BALL_DATATYPE_STRINGHASHMAP_H 00015 # include <BALL/DATATYPE/stringHashMap.h> 00016 #endif 00017 00018 #include <vector> 00019 00020 namespace BALL 00021 { 00022 using std::vector; 00023 00024 class Molecule; 00025 class System; 00026 class Atom; 00027 00042 class BALL_EXPORT AtomTyper 00043 { 00044 public: 00045 00046 BALL_CREATE(AtomTyper) 00047 00048 00049 AtomTyper(); 00050 00052 AtomTyper(const AtomTyper& t); 00053 00055 virtual ~AtomTyper() {}; 00056 00058 bool setup(const String& filename); 00059 00061 virtual void assignTo(System& s); 00062 00064 void setAromaticRings(const vector<HashSet<Atom*> >& rings) { aromatic_rings_ = rings;} 00065 00067 void setRings(const vector<HashSet<Atom*> >& rings) { rings_ = rings;} 00068 00069 // just for debugging: computational times for the individual SMARTS expressions 00070 static StringHashMap<float> rule_times; 00071 00072 protected: 00073 00075 void assignTo(Molecule& mol); 00076 00080 virtual void assignSpecificValues_(Atom&) {}; 00081 00085 virtual bool specificSetup_() { return true;} 00086 00087 vector<String> names_; 00088 vector<String> rules_; 00089 vector<Index> types_; 00090 // entries in the file for specificSetup_() : 00091 vector<vector<String> > fields_; 00092 // number for fields per line in the config file 00093 Size number_expected_fields_; 00094 vector<HashSet<Atom*> > rings_; 00095 vector<HashSet<Atom*> > aromatic_rings_; 00096 StringHashMap<vector<Position> > element_to_rules_; 00097 HashSet<Atom*> atoms_; 00098 }; 00099 00100 } // namespace BALL 00101 00102 #endif // BALL_STRUCTURE_ATOMTYPER_H