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:
62  typedef std::shared_ptr<GaussianShapeOverlapFunction> SharedPointer;
63 
67  typedef std::function<bool(std::size_t)> ColorFilterFunction;
68 
72  typedef std::function<bool(std::size_t, std::size_t)> ColorMatchFunction;
73 
78 
84  virtual void setShapeFunction(const GaussianShapeFunction& func, bool is_ref) = 0;
85 
91  virtual const GaussianShapeFunction* getShapeFunction(bool ref) const = 0;
92 
97  virtual void setColorMatchFunction(const ColorMatchFunction& func) = 0;
98 
103  virtual const ColorMatchFunction& getColorMatchFunction() const = 0;
104 
109  virtual void setColorFilterFunction(const ColorFilterFunction& func) = 0;
110 
115  virtual const ColorFilterFunction& getColorFilterFunction() const = 0;
116 
122  virtual double calcSelfOverlap(bool ref) const = 0;
123 
129  virtual double calcColorSelfOverlap(bool ref) const = 0;
130 
135  virtual double calcOverlap() const = 0;
136 
141  virtual double calcColorOverlap() const = 0;
142 
148  virtual double calcOverlap(const Math::Vector3DArray& coords) const = 0;
149 
155  virtual double calcColorOverlap(const Math::Vector3DArray& coords) const = 0;
156 
163  virtual double calcOverlapGradient(const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const = 0;
164 
165  protected:
167 
169 
171  {
172  return *this;
173  }
174  };
175  } // namespace Shape
176 } // namespace CDPL
177 
178 #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:168
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:77
GaussianShapeOverlapFunction()
Definition: GaussianShapeOverlapFunction.hpp:166
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:170
std::function< bool(std::size_t)> ColorFilterFunction
Type of the function used to filter color (pharmacophore) features by type.
Definition: GaussianShapeOverlapFunction.hpp:67
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:72
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:62
VectorArray< Vector3D > Vector3DArray
Array storing vectors of type Math::Vector3D.
Definition: VectorArray.hpp:87
The namespace of the Chemical Data Processing Library.