Chemical Data Processing Library C++ API - Version 1.2.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 
49  {
50 
51  public:
52  typedef std::shared_ptr<GaussianShapeOverlapFunction> SharedPointer;
53 
54  typedef std::function<bool(std::size_t)> ColorFilterFunction;
55  typedef std::function<bool(std::size_t, std::size_t)> ColorMatchFunction;
56 
58 
59  virtual void setShapeFunction(const GaussianShapeFunction& func, bool is_ref) = 0;
60 
61  virtual const GaussianShapeFunction* getShapeFunction(bool ref) const = 0;
62 
63  virtual void setColorMatchFunction(const ColorMatchFunction& func) = 0;
64 
65  virtual const ColorMatchFunction& getColorMatchFunction() const = 0;
66 
67  virtual void setColorFilterFunction(const ColorFilterFunction& func) = 0;
68 
69  virtual const ColorFilterFunction& getColorFilterFunction() const = 0;
70 
71  virtual double calcSelfOverlap(bool ref) const = 0;
72 
73  virtual double calcColorSelfOverlap(bool ref) const = 0;
74 
75  virtual double calcOverlap() const = 0;
76 
77  virtual double calcColorOverlap() const = 0;
78 
79  virtual double calcOverlap(const Math::Vector3DArray& coords) const = 0;
80 
81  virtual double calcColorOverlap(const Math::Vector3DArray& coords) const = 0;
82 
83  virtual double calcOverlapGradient(const Math::Vector3DArray& coords, Math::Vector3DArray& grad) const = 0;
84 
85  protected:
87 
89 
91  {
92  return *this;
93  }
94  };
95  } // namespace Shape
96 } // namespace CDPL
97 
98 #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 the class CDPL::Math::VectorArray.
Definition: GaussianShapeFunction.hpp:53
Definition: GaussianShapeOverlapFunction.hpp:49
virtual double calcSelfOverlap(bool ref) const =0
virtual const ColorMatchFunction & getColorMatchFunction() const =0
virtual double calcColorOverlap(const Math::Vector3DArray &coords) const =0
virtual void setShapeFunction(const GaussianShapeFunction &func, bool is_ref)=0
virtual double calcOverlapGradient(const Math::Vector3DArray &coords, Math::Vector3DArray &grad) const =0
GaussianShapeOverlapFunction(const GaussianShapeOverlapFunction &func)
Definition: GaussianShapeOverlapFunction.hpp:88
virtual double calcOverlap(const Math::Vector3DArray &coords) const =0
virtual void setColorMatchFunction(const ColorMatchFunction &func)=0
virtual ~GaussianShapeOverlapFunction()
Definition: GaussianShapeOverlapFunction.hpp:57
GaussianShapeOverlapFunction()
Definition: GaussianShapeOverlapFunction.hpp:86
virtual void setColorFilterFunction(const ColorFilterFunction &func)=0
GaussianShapeOverlapFunction & operator=(const GaussianShapeOverlapFunction &func)
Definition: GaussianShapeOverlapFunction.hpp:90
std::function< bool(std::size_t)> ColorFilterFunction
Definition: GaussianShapeOverlapFunction.hpp:54
virtual double calcOverlap() const =0
virtual const ColorFilterFunction & getColorFilterFunction() const =0
virtual const GaussianShapeFunction * getShapeFunction(bool ref) const =0
virtual double calcColorSelfOverlap(bool ref) const =0
std::function< bool(std::size_t, std::size_t)> ColorMatchFunction
Definition: GaussianShapeOverlapFunction.hpp:55
virtual double calcColorOverlap() const =0
std::shared_ptr< GaussianShapeOverlapFunction > SharedPointer
Definition: GaussianShapeOverlapFunction.hpp:52
VectorArray< Vector3D > Vector3DArray
An array of Math::Vector3D objects.
Definition: VectorArray.hpp:84
The namespace of the Chemical Data Processing Library.