DGtal  0.9.2
DigitalSurfaceEmbedderWithNormalVectorEstimator.h
1 
17 #pragma once
18 
31 #if defined(DigitalSurfaceEmbedderWithNormalVectorEstimator_RECURSES)
32 #error Recursive header files inclusion detected in DigitalSurfaceEmbedderWithNormalVectorEstimator.h
33 #else // defined(DigitalSurfaceEmbedderWithNormalVectorEstimator_RECURSES)
34 
35 #define DigitalSurfaceEmbedderWithNormalVectorEstimator_RECURSES
36 
37 #if !defined DigitalSurfaceEmbedderWithNormalVectorEstimator_h
38 
39 #define DigitalSurfaceEmbedderWithNormalVectorEstimator_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/topology/CDigitalSurfaceEmbedder.h"
49 
50 namespace DGtal
51 {
52 
53  // Forward declaration.
54  template < typename TDigitalSurfaceEmbedder,
55  typename TNormalVectorEstimator >
57 
59 
72  template < typename TDigitalSurfaceEmbedder,
73  typename TNormalVectorEstimator >
75  {
76  public:
78  < TDigitalSurfaceEmbedder, TNormalVectorEstimator > Self;
80 
81  typedef TDigitalSurfaceEmbedder DigitalSurfaceEmbedder;
82  typedef TNormalVectorEstimator NormalVectorEstimator;
83 
84  typedef typename DigitalSurfaceEmbedder::KSpace KSpace;
85  typedef typename DigitalSurfaceEmbedder::Surface Surface;
86  typedef typename DigitalSurfaceEmbedder::SCell SCell;
87  typedef typename DigitalSurfaceEmbedder::RealPoint RealPoint;
88  typedef typename DigitalSurfaceEmbedder::Argument Argument;
89  typedef typename DigitalSurfaceEmbedder::Value Value;
90 
91  typedef typename KSpace::Space Space;
92  typedef typename Space::RealVector RealVector;
93  typedef typename NormalVectorEstimator::Quantity Quantity;
94  typedef typename NormalVectorEstimator::DigitalSurface NVESurface;
95 
98 
100 
101 
106 
112  Self & operator=( const Self & other );
113 
121  ConstAlias<NormalVectorEstimator> anEstimator );
122 
128  ( const Self & other );
129 
134 
135  // ----------------------- Interface --------------------------------------
136  public:
137 
145  RealPoint operator()( const SCell & scell ) const;
146 
150  const Surface & surface() const;
151 
155  const KSpace & space() const
156  {
157  return myDSEmbedder->space();
158  }
159 
164  GradientMap gradientMap() const;
165 
171  RealVector gradient( const SCell & scell ) const;
172 
173  // ----------------------- Interface --------------------------------------
174  public:
175 
181  void selfDisplay ( std::ostream & out ) const;
182 
187  bool isValid() const;
188 
189  // ------------------------- Protected Datas ------------------------------
190  private:
191  // ------------------------- Private Datas --------------------------------
192  private:
193 
195  const DigitalSurfaceEmbedder* myDSEmbedder;
197  const NormalVectorEstimator* myEstimator;
198 
199  // ------------------------- Hidden services ------------------------------
200  protected:
201 
202  }; // end of class DigitalSurfaceEmbedderWithNormalVectorEstimator
203 
215  template < typename TDigitalSurfaceEmbedder,
216  typename TNormalVectorEstimator >
218  {
219  public:
222 
223  typedef TDigitalSurfaceEmbedder DigitalSurfaceEmbedder;
224  typedef TNormalVectorEstimator NormalVectorEstimator;
225 
227  typedef typename Embedder::SCell Argument;
228  typedef typename Embedder::RealVector Value;
229 
232 
235 
237  Self & operator=( const Self & other );
238 
244  ( const Self & other );
245 
251  ( ConstAlias<Embedder> embedder );
252 
258  Value operator()( const Argument & arg ) const;
259 
260  protected:
262  const Embedder* myEmbedder;
263 
264  private:
265 
266  };
267 
274  template < typename TDigitalSurfaceEmbedder, typename TNormalVectorEstimator >
275  std::ostream&
276  operator<< ( std::ostream & out,
278 
279 } // namespace DGtal
280 
281 
283 // Includes inline functions.
284 #include "DGtal/geometry/surfaces/estimation/DigitalSurfaceEmbedderWithNormalVectorEstimator.ih"
285 
286 // //
288 
289 #endif // !defined DigitalSurfaceEmbedderWithNormalVectorEstimator_h
290 
291 #undef DigitalSurfaceEmbedderWithNormalVectorEstimator_RECURSES
292 #endif // else defined(DigitalSurfaceEmbedderWithNormalVectorEstimator_RECURSES)
const DigitalSurfaceEmbedder * myDSEmbedder
A pointer on the digital surface.
DigitalSurfaceEmbedderWithNormalVectorEstimatorGradientMap< TDigitalSurfaceEmbedder, TNormalVectorEstimator > Self
DigitalSurfaceEmbedderWithNormalVectorEstimator< TDigitalSurfaceEmbedder, TNormalVectorEstimator > Self
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
RealVector gradient(const SCell &scell) const
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
const Embedder * myEmbedder
The digital surface embedder with normal vector estimator.
DigitalSurfaceEmbedderWithNormalVectorEstimatorGradientMap()
Default constructor. The object is not valid.
DigitalSurfaceEmbedderWithNormalVectorEstimator< DigitalSurfaceEmbedder, NormalVectorEstimator > Embedder
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DigitalSurfaceEmbedderWithNormalVectorEstimatorGradientMap< DigitalSurfaceEmbedder, NormalVectorEstimator > GradientMap
RealPoint operator()(const SCell &scell) const
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceEmbedder< TDigitalSurfaceEmbedder >))
DGtal is the top-level namespace which contains all DGtal functions and types.
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< RealVector, Quantity >::value))
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceEmbedder< TDigitalSurfaceEmbedder >))
const NormalVectorEstimator * myEstimator
A pointer on the normal vector estimator.
Aim: Combines a digital surface embedder with a normal vector estimator to get a model of CDigitalSur...
Aim: A digital surface embedder is a specialized mapping from signed cells to Euclidean points...
~DigitalSurfaceEmbedderWithNormalVectorEstimatorGradientMap()
Destructor. Does nothing.