templates.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: templates.h,v 1.15 2005/12/23 17:01:55 amoll Exp $
00005 //
00006 
00007 // Molecular Mechanics Parameter: class describing the atom type section of a parameter file
00008 
00009 #ifndef BALL_MOLMEC_PARAMETER_TEMPLATES_H
00010 #define BALL_MOLMEC_PARAMETER_TEMPLATES_H
00011 
00012 #ifndef BALL_FORMAT_PARAMETERSECTION_H
00013 # include <BALL/FORMAT/parameterSection.h>
00014 #endif
00015 
00016 #ifndef BALL_KERNEL_SYSTEM_H
00017 # include <BALL/KERNEL/system.h>
00018 #endif
00019 
00020 #ifndef BALL_DATATYPE_HASHSET_H
00021 # include <BALL/DATATYPE/hashset.h>
00022 #endif
00023 
00024 #include <BALL/KERNEL/atom.h>
00025 
00026 namespace BALL 
00027 {
00028   class Atom;
00029 
00033   class BALL_EXPORT Templates 
00034     : public ParameterSection
00035   {
00036     public:
00037 
00041     
00044     Templates();
00045 
00048     Templates(const Templates& templates, bool deep = true);
00049 
00052     virtual ~Templates() ;
00053 
00056     virtual void clear() ;
00057 
00059 
00062 
00069     virtual bool extractSection(Parameters& parameters, const String& section_name);
00070 
00073     float getCharge(const String& name) const;
00074 
00077     String getTypeName(const String& name) const;
00078 
00081     bool has(const String& name) const;
00082 
00085     void assign(System& system, bool overwrite_existing_typenames = true, 
00086                 bool overwrite_non_zero_charges = true) const;
00087 
00090     void assignCharges(System& system, bool overwrite_non_zero_charges = true) const;
00091 
00094     void assignTypeNames(System& system, bool overwrite_existing_typenames = true) const;
00095 
00097 
00100 
00105     Templates& operator = (const Templates& templates);
00106 
00111     void setMaximumUnassignedAtoms(Size nr);
00112 
00116     Size getMaximumUnassignedAtoms() const;
00117 
00119     Size getNumberOfUnassignedAtoms() const;
00120 
00122     HashSet<const Atom*>& getUnassignedAtoms();
00123 
00125 
00126     protected:
00127     
00128     /*_ Contains the charge for each residue/atom combination
00129     */
00130     StringHashMap<float>  charges_;
00131 
00132     /*_ Contains the atom type names for each residue/atom combination
00133     */
00134     StringHashMap<String> type_names_;
00135 
00136     //_ Atoms, for which the assignment fails
00137     HashSet<const Atom*> unassigned_atoms_;
00138 
00139     //_ max number of unassigned atoms
00140     Size max_number_unassigned_atoms_;
00141   };
00142 } // namespace BALL
00143 
00144 #endif // BALL_MOLMEC_PARAMETER_TEMPLATES_H