00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_MOLMEC_PARAMETER_TEMPLATES_H
00008 #define BALL_MOLMEC_PARAMETER_TEMPLATES_H
00009
00010 #ifndef BALL_FORMAT_PARAMETERSECTION_H
00011 # include <BALL/FORMAT/parameterSection.h>
00012 #endif
00013
00014 #ifndef BALL_KERNEL_SYSTEM_H
00015 # include <BALL/KERNEL/system.h>
00016 #endif
00017
00018 #ifndef BALL_DATATYPE_HASHSET_H
00019 # include <BALL/DATATYPE/hashset.h>
00020 #endif
00021
00022 #include <BALL/KERNEL/atom.h>
00023
00024 namespace BALL
00025 {
00026 class Atom;
00027
00031 class BALL_EXPORT Templates
00032 : public ParameterSection
00033 {
00034 public:
00035
00039
00042 Templates();
00043
00046 Templates(const Templates& templates, bool deep = true);
00047
00050 virtual ~Templates() ;
00051
00054 virtual void clear() ;
00055
00057
00060
00067 virtual bool extractSection(Parameters& parameters, const String& section_name);
00068
00071 float getCharge(const String& name) const;
00072
00075 String getTypeName(const String& name) const;
00076
00079 bool has(const String& name) const;
00080
00083 void assign(System& system, bool overwrite_existing_typenames = true,
00084 bool overwrite_non_zero_charges = true) const;
00085
00088 void assignCharges(System& system, bool overwrite_non_zero_charges = true) const;
00089
00092 void assignTypeNames(System& system, bool overwrite_existing_typenames = true) const;
00093
00095
00098
00103 Templates& operator = (const Templates& templates);
00104
00109 void setMaximumUnassignedAtoms(Size nr);
00110
00114 Size getMaximumUnassignedAtoms() const;
00115
00117 Size getNumberOfUnassignedAtoms() const;
00118
00120 HashSet<const Atom*>& getUnassignedAtoms();
00121
00123
00124 protected:
00125
00126
00127
00128 StringHashMap<float> charges_;
00129
00130
00131
00132 StringHashMap<String> type_names_;
00133
00134
00135 HashSet<const Atom*> unassigned_atoms_;
00136
00137
00138 Size max_number_unassigned_atoms_;
00139 };
00140 }
00141
00142 #endif // BALL_MOLMEC_PARAMETER_TEMPLATES_H