BALL  1.5.0
buildBondsProcessor.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
6 #define BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
7 
8 #ifndef BALL_CONCEPT_PROCESSOR_H
9  #include <BALL/CONCEPT/processor.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_ATOMCONTAINER_H
14 #endif
15 
16 #ifndef BALL_DATATYPE_HASHMAP_H
17  #include <BALL/DATATYPE/hashMap.h>
18 #endif
19 
20 #ifndef BALL_KERNEL_BOND_H
21  #include <BALL/KERNEL/bond.h>
22 #endif
23 
24 #ifndef BALL_DATATYPE_OPTIONS_H
25  #include <BALL/DATATYPE/options.h>
26 #endif
27 
28 namespace BALL
29 {
30 
35  : public UnaryProcessor<AtomContainer>
36  {
37 
38  public:
39 
45  {
49  static const char* BONDLENGTHS_FILENAME;
50 
57  static const char* DELETE_EXISTING_BONDS;
58 
64  static const char* REESTIMATE_BONDORDERS_RINGS;
65 
71  static const char* DELETE_OVERESTIMATED_BONDS;
72  };
73 
76  {
78  static const char* BONDLENGTHS_FILENAME;
79 
81  static const bool DELETE_EXISTING_BONDS;
82 
84  static const bool REESTIMATE_BONDORDERS_RINGS;
85 
87  static const bool DELETE_OVERESTIMATED_BONDS;
88  };
90 
91 
95 
97 
100 
103 
107  BuildBondsProcessor(const String& file_name);
108 
112 
116 
118  virtual bool start();
119 
121  virtual Processor::Result operator () (AtomContainer& ac);
123 
129 
133  void setBondLengths(const String& file_name);
134 
137 
139 
144  BuildBondsProcessor& operator = (const BuildBondsProcessor& bbp);
146 
152 
157 
158  protected:
159 
162 
165 
168 
171 
175  void readBondLengthsFromFile_(const String& file_name = "");
176 
179 
182 
185 
188 
189  /*_ returns the best fitting bond order of a bond between atoms of
190  element e1 and element e2 with a distance of length
191  */
193 
194  /*_ Returns true if the atom with atomic number an1 and atom with
195  atomic number an2 can share a bond. If, the parameter length
196  holds the maximal length of such a bond.
197  */
198  bool getMaxBondLength_(float& length, Size an1, Size an2);
199 
200  /*_ Returns true if the atom with atomic number an1 and atom with
201  atomic number an2 can share a bond. If, the parameter length
202  holds the minimal length of such a bond.
203  */
204  bool getMinBondLength_(float& length, Size an1, Size an2);
205 
207  float max_length_;
208  };
209 
210 } // namespace BALL
211 
212 
213 #endif // BALL_STRUCTURE_BUILDBONDSPROCESSOR_H
Definition: constants.h:13
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:74
BondOrder
Definition: bond.h:97
BuildBondsProcessor()
default constructor
Size getNumberOfBondsBuilt()
Return the number of bonds built during the last application.
HashMap< Size, HashMap< Size, float > > max_bond_lengths_
structure were the bond maxima stored in (used in buildBonds_)
Size buildBondsHashGrid3_(AtomContainer &ac)
builds bonds, based on atom distances read from parameter file using a 3D hash grid
Size num_bonds_
number of bonds, which are created during the processor call
virtual bool start()
processor method which is called before the operator () call
HashMap< Size, HashMap< Size, HashMap< int, float > > > bond_lengths_
structure where bond order distances are stored in
HashMap< Size, HashMap< Size, HashMap< int, float > > > getBondMap()
Return the bond length Hashmap.
void setBondLengths(const String &file_name)
bool getMaxBondLength_(float &length, Size an1, Size an2)
float max_length_
parameter which holds the longest possible bond
BuildBondsProcessor(const BuildBondsProcessor &bbp)
copy construcor
Bond::BondOrder getNearestBondOrder_(float length, Size e1, Size e2)
bool getMinBondLength_(float &length, Size an1, Size an2)
void reestimateBondOrdersRings_(AtomContainer &ac)
reestimate the bond orders of rings, as aromatic rings are often detected wrong
void estimateBondOrders_(AtomContainer &ac)
after the bonds are built, the orders are estimated
BALL_CREATE(BuildBondsProcessor)
virtual ~BuildBondsProcessor()
destructor
HashMap< Size, HashMap< Size, float > > min_bond_lengths_
structure were the bond minima stored in (used in buildBonds_)
void deleteOverestimatedBonds_(AtomContainer &ac)
deletes bonds, like from multiple bonded hydrogens or halogens
void readBondLengthsFromFile_(const String &file_name="")
BuildBondsProcessor(const String &file_name)
static const char * REESTIMATE_BONDORDERS_RINGS
static const char * DELETE_OVERESTIMATED_BONDS
Default values for options.
static const char * BONDLENGTHS_FILENAME
default file name for the bond lengths
static const bool DELETE_OVERESTIMATED_BONDS
this option is off by default
static const bool REESTIMATE_BONDORDERS_RINGS
this option is off by default
static const bool DELETE_EXISTING_BONDS
this option is off by default
#define BALL_EXPORT
Definition: COMMON/global.h:50