Chemical Data Processing Library C++ API - Version 1.4.0
GaussianShapeOverlapFunction.hpp
Go to the documentation of this file.
1 /*
2  * GaussianShapeOverlapFunction.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_SHAPE_GAUSSIANSHAPEOVERLAPFUNCTION_HPP
30 #define CDPL_SHAPE_GAUSSIANSHAPEOVERLAPFUNCTION_HPP
31 
32 #include <cstddef>
33 #include <memory>
34 #include <functional>
35 
36 #include "CDPL/Shape/APIPrefix.hpp"
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Shape
44  {
45 
46  class GaussianShapeFunction;
47 
56  {
57 
58  public:
60  typedef std::shared_ptr<GaussianShapeOverlapFunction> SharedPointer;
61 
63  typedef std::function<bool(std::size_t)> ColorFilterFunction;
64 
66  typedef std::function<bool(std::size_t, std::size_t)> ColorMatchFunction;
67 
70 
76  virtual void setShapeFunction(const GaussianShapeFunction& func, bool is_ref) = 0;
77 
83  virtual const GaussianShapeFunction* getShapeFunction(bool ref) const = 0;
84 
89  virtual void setColorMatchFunction(const ColorMatchFunction& func) = 0;
90 
95  virtual const ColorMatchFunction& getColorMatchFunction() const = 0;
96 
101  virtual void setColorFilterFunction(const ColorFilterFunction& func) = 0;
102 
107  virtual const ColorFilterFunction& getColorFilterFunction() const = 0;
108 
114  virtual double calcSelfOverlap(bool ref) const = 0;
115 
121  virtual double calcColorSelfOverlap(bool ref) const = 0;
122 
127  virtual double calcOverlap() const = 0;
128 
133  virtual double calcColorOverlap() const = 0;
134 
140  virtual double calcOverlap(const Math::Vector3DArray& coords) const = 0;
141 
147  virtual double calcColorOverlap(const Math::Vector3DArray& coords) const = 0;
148 
155  virtual double calcOverlapGradient(const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const = 0;
156 
157  protected:
159 
161 
163  {
164  return *this;
165  }
166  };
167  } // namespace Shape
168 } // namespace CDPL
169 
170 #endif // CDPL_SHAPE_GAUSSIANSHAPEOVERLAPFUNCTION_HPP
Definition of the preprocessor macro CDPL_SHAPE_API.
#define CDPL_SHAPE_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Math::VectorArray.
Function representation of a Gaussian shape, used to evaluate the shape's density,...
Definition: GaussianShapeFunction.hpp:61
Abstract base class for functions evaluating the overlap between two Gaussian shape functions.
Definition: GaussianShapeOverlapFunction.hpp:56
virtual double calcSelfOverlap(bool ref) const =0
Calculates the shape-only self-overlap of the reference or aligned shape function.
virtual const ColorMatchFunction & getColorMatchFunction() const =0
Returns the currently configured color-match function.
virtual double calcColorOverlap(const Math::Vector3DArray &coords) const =0
Calculates the color overlap with the aligned shape element positions taken from coords.
virtual void setShapeFunction(const GaussianShapeFunction &func, bool is_ref)=0
Specifies the reference or aligned shape function used by the overlap evaluation.
virtual double calcOverlapGradient(const Math::Vector3DArray &coords, Math::Vector3DArray &grad) const =0
Calculates the shape overlap with the aligned shape element positions taken from coords and returns t...
GaussianShapeOverlapFunction(const GaussianShapeOverlapFunction &func)
Definition: GaussianShapeOverlapFunction.hpp:160
virtual double calcOverlap(const Math::Vector3DArray &coords) const =0
Calculates the shape-only overlap with the aligned shape element positions taken from coords.
virtual void setColorMatchFunction(const ColorMatchFunction &func)=0
Specifies the function used to decide whether two color features match.
virtual ~GaussianShapeOverlapFunction()
Virtual destructor.
Definition: GaussianShapeOverlapFunction.hpp:69
GaussianShapeOverlapFunction()
Definition: GaussianShapeOverlapFunction.hpp:158
virtual void setColorFilterFunction(const ColorFilterFunction &func)=0
Specifies the function used to filter color features by type.
GaussianShapeOverlapFunction & operator=(const GaussianShapeOverlapFunction &func)
Definition: GaussianShapeOverlapFunction.hpp:162
std::function< bool(std::size_t)> ColorFilterFunction
Type of the function used to filter color (pharmacophore) features by type.
Definition: GaussianShapeOverlapFunction.hpp:63
virtual double calcOverlap() const =0
Calculates the shape-only overlap of the reference and aligned shape functions.
virtual const ColorFilterFunction & getColorFilterFunction() const =0
Returns the currently configured color-filter function.
virtual const GaussianShapeFunction * getShapeFunction(bool ref) const =0
Returns the reference or aligned shape function.
virtual double calcColorSelfOverlap(bool ref) const =0
Calculates the color self-overlap of the reference or aligned shape function.
std::function< bool(std::size_t, std::size_t)> ColorMatchFunction
Type of the function used to decide whether two color features match.
Definition: GaussianShapeOverlapFunction.hpp:66
virtual double calcColorOverlap() const =0
Calculates the color overlap of the reference and aligned shape functions.
std::shared_ptr< GaussianShapeOverlapFunction > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated GaussianShapeOverlapFunction inst...
Definition: GaussianShapeOverlapFunction.hpp:60
VectorArray< Vector3D > Vector3DArray
Array storing vectors of type Math::Vector3D.
Definition: VectorArray.hpp:85
The namespace of the Chemical Data Processing Library.