DGtal  1.1.0
TrueDigitalSurfaceLocalEstimator.h
1 
17 #pragma once
18 
31 #if defined(TrueDigitalSurfaceLocalEstimator_RECURSES)
32 #error Recursive header files inclusion detected in TrueDigitalSurfaceLocalEstimator.h
33 #else // defined(TrueDigitalSurfaceLocalEstimator_RECURSES)
34 
35 #define TrueDigitalSurfaceLocalEstimator_RECURSES
36 
37 #if !defined TrueDigitalSurfaceLocalEstimator_h
38 
39 #define TrueDigitalSurfaceLocalEstimator_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/base/CountedConstPtrOrConstPtr.h"
47 #include "DGtal/topology/CanonicSCellEmbedder.h"
49 
50 namespace DGtal
51 {
52 
54  // template class TrueDigitalSurfaceLocalEstimator
96  template <typename TKSpace, typename TShape, typename TGeometricFunctor>
98  {
100 
101  public:
103  typedef TKSpace KSpace;
104  typedef TShape Shape;
105  typedef TGeometricFunctor GeometricFunctor;
106  typedef typename KSpace::Space Space;
107  typedef typename KSpace::SCell SCell;
108  typedef typename KSpace::Surfel Surfel;
109  typedef typename Space::RealPoint RealPoint;
110  typedef typename RealPoint::Coordinate Scalar;
111  typedef typename GeometricFunctor::Quantity Quantity;
114 
115  // ----------------------- Standard services ------------------------------
116  public:
117 
122 
127 
133 
139  Self& operator=( const Self & other );
140 
142  Scalar h() const;
143 
150  void attach( ConstAlias<Shape> aShape );
151 
169  const int maxIter = 20,
170  const Scalar accuracy = 0.0001,
171  const Scalar gamma = 0.5 );
172 
181  template <typename SurfelConstIterator>
182  void init( const Scalar _h,
183  SurfelConstIterator itb,
184  SurfelConstIterator ite );
185 
190  template <typename SurfelConstIterator>
191  Quantity eval( SurfelConstIterator it ) const;
192 
200  template <typename OutputIterator, typename SurfelConstIterator>
201  OutputIterator eval( SurfelConstIterator itb,
202  SurfelConstIterator ite,
203  OutputIterator result ) const;
204 
209  RealPoint embed( Surfel surfel ) const;
210 
211  // ----------------------- Interface --------------------------------------
212  public:
213 
218  void selfDisplay ( std::ostream & out ) const;
219 
224  bool isValid() const;
225 
226  // ------------------------- Protected Datas ------------------------------
227  protected:
239  bool myNearest;
240 
247 
248  // ------------------------- Private Datas --------------------------------
249  private:
250 
251  // ------------------------- Hidden services ------------------------------
252  protected:
253 
254  private:
255 
256 
257  // ------------------------- Internals ------------------------------------
258  private:
259 
260  }; // end of class TrueDigitalSurfaceLocalEstimator
261 
262 
269  template <typename TKSpace, typename TShape, typename TGeometricFunctor>
270  std::ostream&
272 
273 } // namespace DGtal
274 
275 
277 // Includes inline functions.
278 #include "DGtal/geometry/surfaces/estimation/TrueDigitalSurfaceLocalEstimator.ih"
279 
280 // //
282 
283 #endif // !defined TrueDigitalSurfaceLocalEstimator_h
284 
285 #undef TrueDigitalSurfaceLocalEstimator_RECURSES
286 #endif // else defined(TrueDigitalSurfaceLocalEstimator_RECURSES)
DGtal::Clone
Aim: This class encapsulates its parameter class to indicate that the given parameter is required to ...
Definition: Clone.h:267
DGtal::TrueDigitalSurfaceLocalEstimator::GeometricFunctor
TGeometricFunctor GeometricFunctor
Definition: TrueDigitalSurfaceLocalEstimator.h:105
DGtal::TrueDigitalSurfaceLocalEstimator::h
Scalar h() const
DGtal::TrueDigitalSurfaceLocalEstimator::SCell
KSpace::SCell SCell
Definition: TrueDigitalSurfaceLocalEstimator.h:107
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::TrueDigitalSurfaceLocalEstimator::isValid
bool isValid() const
DGtal::PointVector::Coordinate
Component Coordinate
Type for Point elements.
Definition: PointVector.h:617
DGtal::TrueDigitalSurfaceLocalEstimator::myNearest
bool myNearest
Tells if we look for nearest point.
Definition: TrueDigitalSurfaceLocalEstimator.h:239
DGtal::TrueDigitalSurfaceLocalEstimator::attach
void attach(ConstAlias< Shape > aShape)
DGtal::TrueDigitalSurfaceLocalEstimator::init
void init(const Scalar _h, SurfelConstIterator itb, SurfelConstIterator ite)
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::TrueDigitalSurfaceLocalEstimator::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::TrueDigitalSurfaceLocalEstimator::myKSpace
CountedConstPtrOrConstPtr< KSpace > myKSpace
The cellular space.
Definition: TrueDigitalSurfaceLocalEstimator.h:229
DGtal::TrueDigitalSurfaceLocalEstimator::myH
Scalar myH
The gridstep.
Definition: TrueDigitalSurfaceLocalEstimator.h:237
DGtal::TrueDigitalSurfaceLocalEstimator::myFct
CowPtr< GeometricFunctor > myFct
The functor RealPoint -> Quantity returning some geometric quantity.
Definition: TrueDigitalSurfaceLocalEstimator.h:231
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:209
DGtal::TrueDigitalSurfaceLocalEstimator::Shape
TShape Shape
Definition: TrueDigitalSurfaceLocalEstimator.h:104
DGtal::TrueDigitalSurfaceLocalEstimator::myEmbedder
SCellEmbedder myEmbedder
The surfel embedder. /!\ For now, it is multiplied by myH.
Definition: TrueDigitalSurfaceLocalEstimator.h:233
DGtal::TrueDigitalSurfaceLocalEstimator::operator=
Self & operator=(const Self &other)
DGtal::TrueDigitalSurfaceLocalEstimator::Scalar
RealPoint::Coordinate Scalar
Definition: TrueDigitalSurfaceLocalEstimator.h:110
DGtal::SpaceND
Definition: SpaceND.h:96
DGtal::TrueDigitalSurfaceLocalEstimator::RealPoint
Space::RealPoint RealPoint
Definition: TrueDigitalSurfaceLocalEstimator.h:109
DGtal::TrueDigitalSurfaceLocalEstimator::Self
TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor > Self
Definition: TrueDigitalSurfaceLocalEstimator.h:102
DGtal::TrueDigitalSurfaceLocalEstimator::eval
OutputIterator eval(SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
DGtal::TrueDigitalSurfaceLocalEstimator::~TrueDigitalSurfaceLocalEstimator
~TrueDigitalSurfaceLocalEstimator()
DGtal::CountedConstPtrOrConstPtr< KSpace >
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::TrueDigitalSurfaceLocalEstimator::eval
Quantity eval(SurfelConstIterator it) const
DGtal::TrueDigitalSurfaceLocalEstimator::SCellEmbedder
CanonicSCellEmbedder< KSpace > SCellEmbedder
Definition: TrueDigitalSurfaceLocalEstimator.h:112
DGtal::TrueDigitalSurfaceLocalEstimator::KSpace
TKSpace KSpace
Definition: TrueDigitalSurfaceLocalEstimator.h:103
DGtal::TrueDigitalSurfaceLocalEstimator::embed
RealPoint embed(Surfel surfel) const
DGtal::TrueDigitalSurfaceLocalEstimator::myGamma
Scalar myGamma
coefficient associated with the gradient (size of each step).
Definition: TrueDigitalSurfaceLocalEstimator.h:246
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::TrueDigitalSurfaceLocalEstimator::TrueDigitalSurfaceLocalEstimator
TrueDigitalSurfaceLocalEstimator()
DGtal::TrueDigitalSurfaceLocalEstimator::myAccuracy
Scalar myAccuracy
distance criterion to stop the descent (proximity of implicit function).
Definition: TrueDigitalSurfaceLocalEstimator.h:244
DGtal::TrueDigitalSurfaceLocalEstimator::setParams
void setParams(ConstAlias< KSpace > ks, Clone< GeometricFunctor > fct, const int maxIter=20, const Scalar accuracy=0.0001, const Scalar gamma=0.5)
DGtal::TrueDigitalSurfaceLocalEstimator::myShape
CountedConstPtrOrConstPtr< Shape > myShape
The shape of interest.
Definition: TrueDigitalSurfaceLocalEstimator.h:235
DGtal::TrueDigitalSurfaceLocalEstimator::myMaxIter
int myMaxIter
fixes the maximum number of steps (0: takes the point as is).
Definition: TrueDigitalSurfaceLocalEstimator.h:242
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
DGtal::TrueDigitalSurfaceLocalEstimator::Quantity
GeometricFunctor::Quantity Quantity
Definition: TrueDigitalSurfaceLocalEstimator.h:111
DGtal::TrueDigitalSurfaceLocalEstimator
Aim: An estimator on digital surfaces that returns the reference local geometric quantity....
Definition: TrueDigitalSurfaceLocalEstimator.h:98
DGtal::TrueDigitalSurfaceLocalEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
DGtal::TrueDigitalSurfaceLocalEstimator::TrueDigitalSurfaceLocalEstimator
TrueDigitalSurfaceLocalEstimator(const Self &other)
DGtal::CanonicSCellEmbedder< KSpace >
DGtal::TrueDigitalSurfaceLocalEstimator::Space
KSpace::Space Space
Definition: TrueDigitalSurfaceLocalEstimator.h:106
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:90
DGtal::TrueDigitalSurfaceLocalEstimator::Surfel
KSpace::Surfel Surfel
Definition: TrueDigitalSurfaceLocalEstimator.h:108
DGtal::CowPtr< GeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< GeometricFunctor, RealPoint, Quantity >))