simpleBase.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2: -*-
00002 // vi: set ts=2:
00003 //
00004 //
00005 
00006 #ifndef BALL_QSAR_SIMPLEBASE_H
00007 #define BALL_QSAR_SIMPLEBASE_H
00008 
00009 #ifndef BALL_QSAR_DESCRIPTOR_H
00010 #include <BALL/QSAR/descriptor.h>
00011 #endif
00012 
00013 namespace BALL
00014 {
00020   class BALL_EXPORT SimpleBase
00021     : public Descriptor
00022   {
00023     public:
00024   
00030     SimpleBase();
00031 
00034     SimpleBase(const SimpleBase& sb);
00035 
00038     SimpleBase(const String& name);
00039 
00042     SimpleBase(const String& name, const String& unit);
00043 
00046     virtual ~SimpleBase();
00048     
00054     SimpleBase& operator = (const SimpleBase& sb);
00056 
00057 
00058     protected:
00059 
00063     /*_ Returns true if the data is calculated already, and the data is still correct,
00064         otherwise false is returned
00065         @param molecule to examine
00066     */
00067     bool isValid_(AtomContainer& ac);
00069 
00073     /*_ Performs the calculation of some of the simple descriptors.
00074     */
00075     void calculate_(AtomContainer& ac);
00077     
00078     
00079     private:
00080     
00085     /*_ This method calculates the pmi of the x, y and z axis, return the pmi 
00086         @param referenced double which holds the pmi x component after calculation
00087         @param referenced double which holds the pmi y component after calculation
00088         @param referenced double which holds the pmi z component after calculation
00089         @param molecule from which the pmi is calculated
00090     */
00091     double calcPrincipalMomentOfInertia_(double& pmi_x, double& pmi_y, double& pmi_z, AtomContainer& ac);
00092     
00093     /*_ Helper function that reads the atomic polarizabilities 
00094         from a file from the data section of BALL. It is called from
00095         getAtomicPolarizability_ and reads into a static variable, hence
00096         it is read one time per instance.
00097     */
00098     void readAtomicPolarizabilities_(std::vector<float>& polarizabilities);
00099 
00100     /*_ Method which returns the atomic polarizability of the element given as parameter
00101         @param the atomic number of the element
00102     */
00103     float getAtomicPolarizability_(int atomic_number);
00105 
00109     /*_ Predicate that returns true if the atom is a carbon and in an
00110         exclusively aromatic or aliphatic surrounding, means is only
00111         bound to carbon an hydrogen!
00112     */
00113     bool isHydrophobic_(const Atom* atom) const;
00115   };
00116 } // namespace BALL
00117 
00118 #endif