BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleBase.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2: -*-
2 // vi: set ts=2:
3 //
4 //
5 
6 #ifndef BALL_QSAR_SIMPLEBASE_H
7 #define BALL_QSAR_SIMPLEBASE_H
8 
9 #ifndef BALL_QSAR_DESCRIPTOR_H
10 #include <BALL/QSAR/descriptor.h>
11 #endif
12 
13 namespace BALL
14 {
21  : public Descriptor
22  {
23  public:
24 
30  SimpleBase();
31 
34  SimpleBase(const SimpleBase& sb);
35 
38  SimpleBase(const String& name);
39 
42  SimpleBase(const String& name, const String& unit);
43 
46  virtual ~SimpleBase();
48 
54  virtual SimpleBase& operator = (const SimpleBase& sb);
55 
56 
60  void computeAllDescriptors(AtomContainer& ac);
61 
63  void setDataFolder(const char* folder);
65 
66 
67  protected:
68 
72  /*_ Returns true if the data is calculated already, and the data is still correct,
73  otherwise false is returned
74  @param molecule to examine
75  */
76  bool isValid_(AtomContainer& ac);
78 
82  /*_ Performs the calculation of some of the simple descriptors.
83  */
84  void calculate_(AtomContainer& ac);
86 
87 
88  private:
89 
94  /*_ This method calculates the pmi of the x, y and z axis, return the pmi
95  @param referenced double which holds the pmi x component after calculation
96  @param referenced double which holds the pmi y component after calculation
97  @param referenced double which holds the pmi z component after calculation
98  @param molecule from which the pmi is calculated
99  */
100  double calcPrincipalMomentOfInertia_(double& pmi_x, double& pmi_y, double& pmi_z, AtomContainer& ac);
101 
102  /*_ Helper function that reads the atomic polarizabilities
103  from a file from the data section of BALL. It is called from
104  getAtomicPolarizability_ and reads into a static variable, hence
105  it is read one time per instance.
106  */
107  void readAtomicPolarizabilities_(std::vector<float>& polarizabilities);
108 
109  /*_ Method which returns the atomic polarizability of the element given as parameter
110  @param the atomic number of the element
111  */
112  float getAtomicPolarizability_(int atomic_number);
114 
118  /*_ Predicate that returns true if the atom is a carbon and in an
119  exclusively aromatic or aliphatic surrounding, means is only
120  bound to carbon an hydrogen!
121  */
122  bool isHydrophobic_(const Atom* atom) const;
123 
124  String data_folder_;
126  };
127 } // namespace BALL
128 
129 #endif
#define BALL_EXPORT
Definition: COMMON/global.h:50