Chemical Data Processing Library C++ API - Version 1.2.0
FeatureGeometryMatchFunctor.hpp
Go to the documentation of this file.
1 /*
2  * FeatureGeometryMatchFunctor.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_PHARM_FEATUREGEOMETRYMATCHFUNCTOR_HPP
30 #define CDPL_PHARM_FEATUREGEOMETRYMATCHFUNCTOR_HPP
31 
32 #include "CDPL/Pharm/APIPrefix.hpp"
33 
34 #include "CDPL/Math/Matrix.hpp"
35 #include "CDPL/Math/Vector.hpp"
36 
37 
38 namespace CDPL
39 {
40 
41  namespace Pharm
42  {
43 
44  class Feature;
45 
50  {
51 
52  public:
53  static constexpr double DEF_MAX_HBA_INTERACTION_DIR_ANGLE = 85.0;
54  static constexpr double DEF_MAX_HBA_ORIENTATION_DEVIATION = 45.0;
55  static constexpr double DEF_MAX_HBD_INTERACTION_DIR_DEVIATION = 45.0;
56  static constexpr double DEF_MAX_XBA_INTERACTION_DIR_DEVIATION = 45.0;
57  static constexpr double DEF_MAX_XBD_INTERACTION_DIR_DEVIATION = 45.0;
58  static constexpr double DEF_MAX_AR_ORIENTATION_DEVIATION = 45.0;
59 
60  FeatureGeometryMatchFunctor(double max_hba_int_dir_angle = DEF_MAX_HBA_INTERACTION_DIR_ANGLE,
61  double max_hba_orient_dev = DEF_MAX_HBA_ORIENTATION_DEVIATION,
62  double max_hbd_int_dir_dev = DEF_MAX_HBD_INTERACTION_DIR_DEVIATION,
63  double max_xba_int_dir_dev = DEF_MAX_XBA_INTERACTION_DIR_DEVIATION,
64  double max_xbd_int_dir_dev = DEF_MAX_XBD_INTERACTION_DIR_DEVIATION,
65  double max_ar_orient_dev = DEF_MAX_AR_ORIENTATION_DEVIATION);
66 
68 
69  void setMaxHBAInteractionDirAngle(double angle);
70 
72 
73  void setMaxHBAOrientationDeviation(double angle);
74 
76 
78 
80 
82 
84 
86 
88 
89  void setMaxAROrientationDeviation(double angle);
90 
98  double operator()(const Feature& ftr1, const Feature& ftr2) const;
99 
108  double operator()(const Feature& ftr1, const Feature& ftr2, const Math::Matrix4D& xform) const;
109 
110  private:
111  double calcHBDFeatureMatchScore(const Feature& ftr1, const Feature& ftr2, const Math::Matrix4D& xform) const;
112  double calcHBAFeatureMatchScore(const Feature& ftr1, const Feature& ftr2, const Math::Matrix4D& xform) const;
113  double calcXBDFeatureMatchScore(const Feature& ftr1, const Feature& ftr2, const Math::Matrix4D& xform) const;
114  double calcXBAFeatureMatchScore(const Feature& ftr1, const Feature& ftr2, const Math::Matrix4D& xform) const;
115  double calcARFeatureMatchScore(const Feature& ftr1, const Feature& ftr2, const Math::Matrix4D& xform) const;
116 
117  void transformOrientation(const Feature& ftr, const Math::Matrix4D& xform, Math::Vector3D& trans_orient) const;
118 
119  double maxHBAInteractionDirAngle;
120  double maxHBAOrientationDeviation;
121  double maxHBDInteractionDirDeviation;
122  double maxXBAInteractionDirDeviation;
123  double maxXBDInteractionDirDeviation;
124  double maxAROrientationDeviation;
125  };
126  } // namespace Pharm
127 } // namespace CDPL
128 
129 #endif // CDPL_PHARM_FEATUREGEOMETRYMATCHFUNCTOR_HPP
Definition of matrix data types.
Definition of the preprocessor macro CDPL_PHARM_API.
#define CDPL_PHARM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of vector data types.
FeatureGeometryMatchFunctor.
Definition: FeatureGeometryMatchFunctor.hpp:50
void setMaxXBDInteractionDirDeviation(double angle)
double operator()(const Feature &ftr1, const Feature &ftr2, const Math::Matrix4D &xform) const
Calculates a score reflecting the goodness of the spatial feature orientation match.
void setMaxAROrientationDeviation(double angle)
void setMaxXBAInteractionDirDeviation(double angle)
void setMaxHBDInteractionDirDeviation(double angle)
FeatureGeometryMatchFunctor(double max_hba_int_dir_angle=DEF_MAX_HBA_INTERACTION_DIR_ANGLE, double max_hba_orient_dev=DEF_MAX_HBA_ORIENTATION_DEVIATION, double max_hbd_int_dir_dev=DEF_MAX_HBD_INTERACTION_DIR_DEVIATION, double max_xba_int_dir_dev=DEF_MAX_XBA_INTERACTION_DIR_DEVIATION, double max_xbd_int_dir_dev=DEF_MAX_XBD_INTERACTION_DIR_DEVIATION, double max_ar_orient_dev=DEF_MAX_AR_ORIENTATION_DEVIATION)
double operator()(const Feature &ftr1, const Feature &ftr2) const
Calculates a score reflecting the goodness of the spatial feature orientation match.
void setMaxHBAOrientationDeviation(double angle)
void setMaxHBAInteractionDirAngle(double angle)
Feature.
Definition: Feature.hpp:48
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
The namespace of the Chemical Data Processing Library.