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 
43  struct BALL_EXPORT Option
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 
110  virtual ~BuildBondsProcessor();
112 
116 
118  virtual bool start();
119 
121  virtual Processor::Result operator () (AtomContainer& ac);
123 
127  Size getNumberOfBondsBuilt();
129 
133  void setBondLengths(const String& file_name);
134 
137 
139 
143  BuildBondsProcessor& operator = (const BuildBondsProcessor& bbp);
146 
150  Options options;
152 
155  void setDefaultOptions();
157 
158  protected:
159 
161  Size buildBondsHashGrid3_(AtomContainer& ac);
162 
164  void estimateBondOrders_(AtomContainer& ac);
165 
167  void reestimateBondOrdersRings_(AtomContainer& ac);
168 
170  void deleteOverestimatedBonds_(AtomContainer& ac);
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  */
192  Bond::BondOrder getNearestBondOrder_(float length, Size e1, Size e2);
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
BALL::BuildBondsProcessor::Default::DELETE_OVERESTIMATED_BONDS
static const bool DELETE_OVERESTIMATED_BONDS
this option is off by default
Definition: buildBondsProcessor.h:87
BALL::BuildBondsProcessor::bond_lengths_
HashMap< Size, HashMap< Size, HashMap< int, float > > > bond_lengths_
structure where bond order distances are stored in
Definition: buildBondsProcessor.h:181
BALL::BuildBondsProcessor::Option::REESTIMATE_BONDORDERS_RINGS
static const char * REESTIMATE_BONDORDERS_RINGS
Definition: buildBondsProcessor.h:64
BALL::BuildBondsProcessor::Option::BONDLENGTHS_FILENAME
static const char * BONDLENGTHS_FILENAME
Definition: buildBondsProcessor.h:49
BALL::Options
Definition: options.h:46
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::BuildBondsProcessor::Default::DELETE_EXISTING_BONDS
static const bool DELETE_EXISTING_BONDS
this option is off by default
Definition: buildBondsProcessor.h:81
hashMap.h
bond.h
BALL::BuildBondsProcessor::Default::BONDLENGTHS_FILENAME
static const char * BONDLENGTHS_FILENAME
default file name for the bond lengths
Definition: buildBondsProcessor.h:78
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:73
BALL::BuildBondsProcessor::num_bonds_
Size num_bonds_
number of bonds, which are created during the processor call
Definition: buildBondsProcessor.h:178
BALL::BuildBondsProcessor::min_bond_lengths_
HashMap< Size, HashMap< Size, float > > min_bond_lengths_
structure were the bond minima stored in (used in buildBonds_)
Definition: buildBondsProcessor.h:187
BALL::AtomContainer
Definition: atomContainer.h:29
BALL_SIZE_TYPE
BALL::BuildBondsProcessor::Option::DELETE_EXISTING_BONDS
static const char * DELETE_EXISTING_BONDS
Definition: buildBondsProcessor.h:57
BALL::BuildBondsProcessor::getBondMap
HashMap< Size, HashMap< Size, HashMap< int, float > > > getBondMap()
Return the bond length Hashmap.
Definition: buildBondsProcessor.h:136
BALL
Definition: constants.h:12
BALL::String
Definition: string.h:56
options.h
BALL::BuildBondsProcessor::Option
Option names.
Definition: buildBondsProcessor.h:44
processor.h
BALL::BuildBondsProcessor::Default::REESTIMATE_BONDORDERS_RINGS
static const bool REESTIMATE_BONDORDERS_RINGS
this option is off by default
Definition: buildBondsProcessor.h:84
BALL::UnaryProcessor
Definition: processor.h:58
BALL::BuildBondsProcessor::max_bond_lengths_
HashMap< Size, HashMap< Size, float > > max_bond_lengths_
structure were the bond maxima stored in (used in buildBonds_)
Definition: buildBondsProcessor.h:184
BALL::Bond::BondOrder
BondOrder
Definition: bond.h:96
BALL::BuildBondsProcessor::Option::DELETE_OVERESTIMATED_BONDS
static const char * DELETE_OVERESTIMATED_BONDS
Definition: buildBondsProcessor.h:71
BALL::BuildBondsProcessor::max_length_
float max_length_
parameter which holds the longest possible bond
Definition: buildBondsProcessor.h:207
atomContainer.h
BALL::Processor::Result
int Result
Definition: processor.h:36
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
BALL::BuildBondsProcessor
Definition: buildBondsProcessor.h:34
BALL::BuildBondsProcessor::Default
Default values for options.
Definition: buildBondsProcessor.h:75