DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | Private Member Functions
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor > Class Template Reference

Aim: An estimator on digital surfaces that returns the reference local geometric quantity. This is used for comparing estimators. More...

#include <DGtal/geometry/surfaces/estimation/TrueDigitalSurfaceLocalEstimator.h>

Public Types

typedef TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor > Self
 
typedef TKSpace KSpace
 
typedef TShape Shape
 
typedef TGeometricFunctor GeometricFunctor
 
typedef KSpace::Space Space
 
typedef KSpace::SCell SCell
 
typedef KSpace::Surfel Surfel
 
typedef Space::RealPoint RealPoint
 
typedef RealPoint::Coordinate Scalar
 
typedef GeometricFunctor::Quantity Quantity
 
typedef CanonicSCellEmbedder< KSpaceSCellEmbedder
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< GeometricFunctor, RealPoint, Quantity >))
 
 ~TrueDigitalSurfaceLocalEstimator ()
 
 TrueDigitalSurfaceLocalEstimator ()
 
 TrueDigitalSurfaceLocalEstimator (const Self &other)
 
Selfoperator= (const Self &other)
 
Scalar h () const
 
void attach (ConstAlias< Shape > aShape)
 
void setParams (ConstAlias< KSpace > ks, Clone< GeometricFunctor > fct, const int maxIter=20, const Scalar accuracy=0.0001, const Scalar gamma=0.5)
 
template<typename SurfelConstIterator >
void init (const Scalar _h, SurfelConstIterator itb, SurfelConstIterator ite)
 
template<typename SurfelConstIterator >
Quantity eval (SurfelConstIterator it) const
 
template<typename OutputIterator , typename SurfelConstIterator >
OutputIterator eval (SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
 
RealPoint embed (Surfel surfel) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Attributes

CountedConstPtrOrConstPtr< KSpacemyKSpace
 The cellular space. More...
 
CowPtr< GeometricFunctormyFct
 The functor RealPoint -> Quantity returning some geometric quantity. More...
 
SCellEmbedder myEmbedder
 The surfel embedder. /!\ For now, it is multiplied by myH. More...
 
CountedConstPtrOrConstPtr< ShapemyShape
 The shape of interest. More...
 
Scalar myH
 The gridstep. More...
 
bool myNearest
 Tells if we look for nearest point. More...
 
int myMaxIter
 fixes the maximum number of steps (0: takes the point as is). More...
 
Scalar myAccuracy
 distance criterion to stop the descent (proximity of implicit function). More...
 
Scalar myGamma
 coefficient associated with the gradient (size of each step). More...
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< TKSpace >))
 

Detailed Description

template<typename TKSpace, typename TShape, typename TGeometricFunctor>
class DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >

Aim: An estimator on digital surfaces that returns the reference local geometric quantity. This is used for comparing estimators.

Description of template class 'TrueDigitalSurfaceLocalEstimator'

Note that you must call methods setParams, attach, then init before calling eval method(s).

It is a model of CDigitalSurfaceLocalEstimator.

Template Parameters
TKSpacethe type of cellular grid space, a model of CCellularGridSpaceND.
TShapethe type of the shape where geometric estimation are made. It must have methods gradient, meanCurvature, etc depending on the chosen functor.
TGeometricFunctorthe type of the function RealPoint -> Quantity, generally one of ShapeGeometricFunctors::ShapePositionFunctor, ShapeGeometricFunctors::ShapeNormalVectorFunctor, ShapeGeometricFunctors::ShapeMeanCurvatureFunctor, ShapeGeometricFunctors::ShapeGaussianCurvatureFunctor, ShapeGeometricFunctors::ShapeFirstPrincipalCurvatureFunctor, ShapeGeometricFunctors::ShapeSecondPrincipalCurvatureFunctor, ShapeGeometricFunctors::ShapeCurvatureTensorFunctor.
typedef ShapeGeometricFunctors::ShapeNormalVectorFunctor<ImplicitShape> NormalFunctor;
TrueNormalEstimator true_estimator;
true_estimator.setParams( K, NormalFunctor() ); // K is some KSpace
true_estimator.attach( shape ); // shape is some ImplicitShape
true_estimator.init( 1.0, surface.begin(), surface.end() ); // surface is a digital surface.
Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial.
Aim: An estimator on digital surfaces that returns the reference local geometric quantity....
void setParams(ConstAlias< KSpace > ks, Clone< GeometricFunctor > fct, const int maxIter=20, const Scalar accuracy=0.0001, const Scalar gamma=0.5)
KSpace K
Todo:

add precise concept CShape

for now we use a CanonicSCellEmbedder times the gridstep to embed surfels.

Definition at line 97 of file TrueDigitalSurfaceLocalEstimator.h.

Member Typedef Documentation

◆ GeometricFunctor

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TGeometricFunctor DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::GeometricFunctor

Definition at line 105 of file TrueDigitalSurfaceLocalEstimator.h.

◆ KSpace

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TKSpace DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::KSpace

Definition at line 103 of file TrueDigitalSurfaceLocalEstimator.h.

◆ Quantity

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef GeometricFunctor::Quantity DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Quantity

Definition at line 111 of file TrueDigitalSurfaceLocalEstimator.h.

◆ RealPoint

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef Space::RealPoint DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::RealPoint

Definition at line 109 of file TrueDigitalSurfaceLocalEstimator.h.

◆ Scalar

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef RealPoint::Coordinate DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Scalar

Definition at line 110 of file TrueDigitalSurfaceLocalEstimator.h.

◆ SCell

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef KSpace::SCell DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::SCell

Definition at line 107 of file TrueDigitalSurfaceLocalEstimator.h.

◆ SCellEmbedder

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef CanonicSCellEmbedder<KSpace> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::SCellEmbedder

Definition at line 112 of file TrueDigitalSurfaceLocalEstimator.h.

◆ Self

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TrueDigitalSurfaceLocalEstimator<TKSpace,TShape,TGeometricFunctor> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Self

Definition at line 102 of file TrueDigitalSurfaceLocalEstimator.h.

◆ Shape

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef TShape DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Shape

Definition at line 104 of file TrueDigitalSurfaceLocalEstimator.h.

◆ Space

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef KSpace::Space DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Space

Definition at line 106 of file TrueDigitalSurfaceLocalEstimator.h.

◆ Surfel

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
typedef KSpace::Surfel DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::Surfel

Definition at line 108 of file TrueDigitalSurfaceLocalEstimator.h.

Constructor & Destructor Documentation

◆ ~TrueDigitalSurfaceLocalEstimator()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::~TrueDigitalSurfaceLocalEstimator ( )

Destructor.

◆ TrueDigitalSurfaceLocalEstimator() [1/2]

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::TrueDigitalSurfaceLocalEstimator ( )

Default constructor. The estimator is not valid.

◆ TrueDigitalSurfaceLocalEstimator() [2/2]

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::TrueDigitalSurfaceLocalEstimator ( const Self other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

◆ attach()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::attach ( ConstAlias< Shape aShape)

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< TKSpace >)  )
private

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::BOOST_CONCEPT_ASSERT ( (concepts::CUnaryFunctor< GeometricFunctor, RealPoint, Quantity >)  )

◆ embed()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
RealPoint DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::embed ( Surfel  surfel) const
Parameters
surfelany surfel.
Returns
the associated point on the shape (the one that is closest to its centroid).

◆ eval() [1/2]

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
template<typename SurfelConstIterator >
Quantity DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval ( SurfelConstIterator  it) const

◆ eval() [2/2]

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
template<typename OutputIterator , typename SurfelConstIterator >
OutputIterator DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::eval ( SurfelConstIterator  itb,
SurfelConstIterator  ite,
OutputIterator  result 
) const
Returns
the estimated quantity in the range [itb,ite)
Parameters
[in]itbstarting surfel iterator.
[in]iteend surfel iterator.
[in]resultresulting output iterator

◆ h()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::h ( ) const
Returns
the grid step.

◆ init()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
template<typename SurfelConstIterator >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::init ( const Scalar  _h,
SurfelConstIterator  itb,
SurfelConstIterator  ite 
)

◆ isValid()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
bool DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Self & DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::operator= ( const Self other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ selfDisplay()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setParams()

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
void DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::setParams ( ConstAlias< KSpace ks,
Clone< GeometricFunctor fct,
const int  maxIter = 20,
const Scalar  accuracy = 0.0001,
const Scalar  gamma = 0.5 
)

Set specific parameters. They specify the space, the estimated quantity and how the nearest point on the surface is approached.

Parameters
ksthe cellular grid space. The alias can be secured if a some counted pointer is handed.
fctthe functor RealPoint -> Quantity returning some geometric quantity.
maxIterfixes the maximum number of steps (0: takes the point as is).
accuracydistance criterion to stop the descent (proximity of implicit function).
gammacoefficient associated with the gradient (size of each step).

Referenced by DGtal::ShortcutsGeometry< TKSpace >::getFirstPrincipalCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getFirstPrincipalDirections(), DGtal::ShortcutsGeometry< TKSpace >::getGaussianCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getMeanCurvatures(), DGtal::ShortcutsGeometry< TKSpace >::getNormalVectors(), DGtal::ShortcutsGeometry< TKSpace >::getPositions(), DGtal::ShortcutsGeometry< TKSpace >::getPrincipalCurvaturesAndDirections(), DGtal::ShortcutsGeometry< TKSpace >::getSecondPrincipalCurvatures(), and DGtal::ShortcutsGeometry< TKSpace >::getSecondPrincipalDirections().

Field Documentation

◆ myAccuracy

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myAccuracy
protected

distance criterion to stop the descent (proximity of implicit function).

Definition at line 244 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myEmbedder

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
SCellEmbedder DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myEmbedder
protected

The surfel embedder. /!\ For now, it is multiplied by myH.

Definition at line 233 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myFct

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
CowPtr<GeometricFunctor> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myFct
protected

The functor RealPoint -> Quantity returning some geometric quantity.

Definition at line 231 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myGamma

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myGamma
protected

coefficient associated with the gradient (size of each step).

Definition at line 246 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myH

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
Scalar DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myH
protected

The gridstep.

Definition at line 237 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myKSpace

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
CountedConstPtrOrConstPtr<KSpace> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myKSpace
protected

The cellular space.

Definition at line 229 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myMaxIter

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
int DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myMaxIter
protected

fixes the maximum number of steps (0: takes the point as is).

Definition at line 242 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myNearest

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
bool DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myNearest
protected

Tells if we look for nearest point.

Definition at line 239 of file TrueDigitalSurfaceLocalEstimator.h.

◆ myShape

template<typename TKSpace , typename TShape , typename TGeometricFunctor >
CountedConstPtrOrConstPtr<Shape> DGtal::TrueDigitalSurfaceLocalEstimator< TKSpace, TShape, TGeometricFunctor >::myShape
protected

The shape of interest.

Definition at line 235 of file TrueDigitalSurfaceLocalEstimator.h.


The documentation for this class was generated from the following file: