DGtal  1.1.0
ImplicitFunctionDiff1LinearCellEmbedder.h
1 
17 #pragma once
18 
31 #if defined(ImplicitFunctionDiff1LinearCellEmbedder_RECURSES)
32 #error Recursive header files inclusion detected in ImplicitFunctionDiff1LinearCellEmbedder.h
33 #else // defined(ImplicitFunctionDiff1LinearCellEmbedder_RECURSES)
34 
35 #define ImplicitFunctionDiff1LinearCellEmbedder_RECURSES
36 
37 #if !defined ImplicitFunctionDiff1LinearCellEmbedder_h
38 
39 #define ImplicitFunctionDiff1LinearCellEmbedder_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/kernel/NumberTraits.h"
47 #include "DGtal/kernel/CPointEmbedder.h"
48 #include "DGtal/topology/CCellularGridSpaceND.h"
49 #include "DGtal/shapes/implicit/CImplicitFunction.h"
50 #include "DGtal/shapes/implicit/CImplicitFunctionDiff1.h"
52 
53 namespace DGtal
54 {
55 
57  template < typename TKSpace,
58  typename TImplicitFunctionDiff1,
59  typename TEmbedder >
60  class ImplicitFunctionDiff1LinearCellEmbedderGradientMap;
61 
63 
76  template < typename TKSpace,
77  typename TImplicitFunctionDiff1,
78  typename TEmbedder >
80  {
84 
85  public:
86  typedef TKSpace KSpace;
87  typedef TImplicitFunctionDiff1 ImplicitFunctionDiff1;
88  typedef TEmbedder Embedder;
89  typedef typename KSpace::Cell Cell;
90  typedef typename KSpace::SCell SCell;
91  typedef typename KSpace::Space Space;
92  typedef typename Space::Point Point;
93  typedef typename Space::RealPoint RealPoint;
94  typedef typename Space::RealVector RealVector;
96  typedef Cell Argument;
97  typedef RealPoint Value;
100 
105 
110 
116 
124 
135 
136  // ----------------------- Interface --------------------------------------
137  public:
138 
143 
151  RealPoint embed( const Point & p ) const;
152 
160  RealPoint embedCell( const Cell & cell ) const;
161 
170  RealPoint embedSCell( const SCell & scell ) const;
171 
179  RealPoint operator()( const Cell & cell ) const;
180 
190  void embed( const Point & p, RealPoint & x, RealVector & grad ) const;
191 
201  void embedCell( const Cell & cell,
202  RealPoint & x, RealVector & grad ) const;
203 
214  void embedSCell( const SCell & scell,
215  RealPoint & x, RealVector & grad ) const;
216 
217  // ----------------------- Interface --------------------------------------
218  public:
219 
224  void selfDisplay ( std::ostream & out ) const;
225 
230  bool isValid() const;
231 
232  // ------------------------- Protected Datas ------------------------------
233  protected:
234 
236  const KSpace* myPtrK;
241 
242  }; // end of class ImplicitFunctionDiff1LinearCellEmbedder
243 
248  template < typename TKSpace,
249  typename TImplicitFunctionDiff1,
250  typename TEmbedder >
252  : public ImplicitFunctionDiff1LinearCellEmbedder< TKSpace,
253  TImplicitFunctionDiff1,
254  TEmbedder>
255  {
256  public:
258  < TKSpace, TImplicitFunctionDiff1, TEmbedder> Self;
260  < TKSpace, TImplicitFunctionDiff1, TEmbedder> Base;
261  typedef typename Base::Cell Cell;
262  typedef typename Base::RealPoint RealPoint;
263  typedef typename Base::RealVector RealVector;
264  typedef Cell Argument;
265  typedef RealVector Value;
266  using Base::myPtrFct;
267 
268  inline
270  ( const Base & other )
271  : Base( other )
272  {}
273 
274  inline
275  Self & operator=( const Base & other )
276  {
277  Base::operator=( other );
278  return *this;
279  }
280 
281  inline
282  Value operator()( const Argument & arg ) const
283  {
284  RealPoint x = Base::operator()( arg );
285  return myPtrFct->gradient( x );
286  }
287  };
288 
295  template < typename TKSpace, typename TImplicitFunctionDiff1, typename TEmbedder >
296  std::ostream&
297  operator<< ( std::ostream & out,
299 
300 } // namespace DGtal
301 
302 
304 // Includes inline functions.
305 #include "DGtal/shapes/implicit/ImplicitFunctionDiff1LinearCellEmbedder.ih"
306 
307 // //
309 
310 #endif // !defined ImplicitFunctionDiff1LinearCellEmbedder_h
311 
312 #undef ImplicitFunctionDiff1LinearCellEmbedder_RECURSES
313 #endif // else defined(ImplicitFunctionDiff1LinearCellEmbedder_RECURSES)
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::Cell
Base::Cell Cell
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:261
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::myPtrFct
const ImplicitFunctionDiff1 * myPtrFct
A pointer on the implicit function.
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:238
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::Space
KSpace::Space Space
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:91
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::RealPoint
Base::RealPoint RealPoint
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:262
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::Embedder
TEmbedder Embedder
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:88
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::isValid
bool isValid() const
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::myPtrFct
const ImplicitFunctionDiff1 * myPtrFct
A pointer on the implicit function.
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:238
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::Argument
Cell Argument
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:96
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
DGtal::concepts::CImplicitFunctionDiff1
Aim: Describes a 1-differentiable function of the form f(x), where x is some real point in the given ...
Definition: CImplicitFunctionDiff1.h:93
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::KSpace
TKSpace KSpace
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:86
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::~ImplicitFunctionDiff1LinearCellEmbedder
~ImplicitFunctionDiff1LinearCellEmbedder()
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::init
void init(ConstAlias< KSpace > K, ConstAlias< ImplicitFunctionDiff1 > f, ConstAlias< Embedder > e)
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::operator=
ImplicitFunctionDiff1LinearCellEmbedder & operator=(const ImplicitFunctionDiff1LinearCellEmbedder &other)
DGtal::concepts::CCellularGridSpaceND
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Definition: CCellularGridSpaceND.h:164
DGtal::concepts::CPointEmbedder
Aim: A point embedder is a mapping from digital points to Euclidean points. It adds inner types to fu...
Definition: CPointEmbedder.h:96
K
KSpace K
Definition: testCubicalComplex.cpp:62
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::ImplicitFunctionDiff1LinearCellEmbedder
ImplicitFunctionDiff1LinearCellEmbedder()
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap
Forward declaration.
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:255
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::Base
ImplicitFunctionDiff1LinearCellEmbedder< TKSpace, TImplicitFunctionDiff1, TEmbedder > Base
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:260
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::SCell
KSpace::SCell SCell
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:90
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:209
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::Point
Space::Point Point
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:92
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::RealVector
Space::RealVector RealVector
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:94
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::embed
void embed(const Point &p, RealPoint &x, RealVector &grad) const
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::GradientMap
ImplicitFunctionDiff1LinearCellEmbedderGradientMap< KSpace, ImplicitFunctionDiff1, Embedder > GradientMap
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:99
DGtal::SpaceND
Definition: SpaceND.h:96
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::Self
ImplicitFunctionDiff1LinearCellEmbedderGradientMap< TKSpace, TImplicitFunctionDiff1, TEmbedder > Self
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:258
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::Value
RealVector Value
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:265
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::operator()
Value operator()(const Argument &arg) const
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:282
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::embedCell
void embedCell(const Cell &cell, RealPoint &x, RealVector &grad) const
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::embedSCell
void embedSCell(const SCell &scell, RealPoint &x, RealVector &grad) const
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::operator=
Self & operator=(const Base &other)
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:275
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::Cell
KSpace::Cell Cell
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:89
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::RealPoint
Space::RealPoint RealPoint
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:93
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CPointEmbedder< TEmbedder >))
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::ImplicitFunctionDiff1
TImplicitFunctionDiff1 ImplicitFunctionDiff1
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:87
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::operator()
RealPoint operator()(const Cell &cell) const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::embedCell
RealPoint embedCell(const Cell &cell) const
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::RealVector
Base::RealVector RealVector
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:263
DGtal::ImplicitFunctionDiff1LinearCellEmbedder
Aim: a cellular embedder for implicit functions, (default constructible, copy constructible,...
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:80
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::ImplicitFunctionDiff1LinearCellEmbedderGradientMap
ImplicitFunctionDiff1LinearCellEmbedderGradientMap(const Base &other)
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:270
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::gradientMap
GradientMap gradientMap() const
DGtal::PointVector< dim, Integer >
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::myPtrK
const KSpace * myPtrK
A pointer on the cellular grid space.
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:236
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::ImplicitFunctionDiff1LinearCellEmbedder
ImplicitFunctionDiff1LinearCellEmbedder(const ImplicitFunctionDiff1LinearCellEmbedder &other)
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::embed
RealPoint embed(const Point &p) const
DGtal::ImplicitFunctionDiff1LinearCellEmbedderGradientMap::Argument
Cell Argument
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:264
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::ImplicitFctValue
ImplicitFunctionDiff1::Value ImplicitFctValue
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:95
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::embedSCell
RealPoint embedSCell(const SCell &scell) const
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CImplicitFunctionDiff1< TImplicitFunctionDiff1 >))
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::Value
RealPoint Value
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:97
Value
double Value
Definition: testSimpleRandomAccessRangeFromPoint.cpp:38
DGtal::ImplicitFunctionDiff1LinearCellEmbedder::myPtrEmbedder
const Embedder * myPtrEmbedder
A pointer on the digital embedder.
Definition: ImplicitFunctionDiff1LinearCellEmbedder.h:240
DGtal::KhalimskyCell< dim, Integer >