00001
00002
00003
00004
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
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
00091 vector<vector<String> > fields_;
00092
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 }
00101
00102 #endif // BALL_STRUCTURE_ATOMTYPER_H