DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType > Class Template Reference

#include <DGtal/geometry/curves/estimation/SegmentComputerEstimators.h>

Inheritance diagram for DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >:
[legend]

Public Types

typedef TSegmentComputer SegmentComputer
 
typedef SegmentComputer::ConstIterator ConstIterator
 
typedef ReturnType Quantity
 

Public Member Functions

bool isValid () const
 
 PosDepScaleIndepSCEstimator ()
 
void init (const double, const ConstIterator &itb, const ConstIterator &ite)
 
void attach (const SegmentComputer &aSC)
 
Quantity eval (const ConstIterator &it) const
 
template<typename OutputIterator >
OutputIterator eval (const ConstIterator &itb, const ConstIterator &ite, OutputIterator result) const
 

Data Fields

ConstIterator myBegin
 
ConstIterator myEnd
 
const SegmentComputermySCPtr
 
Functor myFunctor
 

Detailed Description

template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
class DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >

Description of class 'PosDepScaleIndepSCEstimator'

Aim: estimates a geometric quantity from a segment computer. The estimation is not scale dependent but position dependent (e.g. tangent or normal estimation from high-order primitives).

Template Parameters
TSegmentComputera model of segment computer.

The computation is delegated to a functor.

Template Parameters
Functora binary functor

This class is a model of CSegmentComputerEstimator

Definition at line 389 of file SegmentComputerEstimators.h.

Member Typedef Documentation

◆ ConstIterator

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
typedef SegmentComputer::ConstIterator DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::ConstIterator

Definition at line 396 of file SegmentComputerEstimators.h.

◆ Quantity

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
typedef ReturnType DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::Quantity

Definition at line 397 of file SegmentComputerEstimators.h.

◆ SegmentComputer

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
typedef TSegmentComputer DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::SegmentComputer

Definition at line 395 of file SegmentComputerEstimators.h.

Constructor & Destructor Documentation

◆ PosDepScaleIndepSCEstimator()

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::PosDepScaleIndepSCEstimator ( )
inline

Member Function Documentation

◆ attach()

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
void DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::attach ( const SegmentComputer & aSC)
inline

Attach the estimator to aSC

Parameters
aSCan instance of segment computer.

Definition at line 453 of file SegmentComputerEstimators.h.

454 {
455 mySCPtr = &aSC;
456 };

References DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::mySCPtr.

◆ eval() [1/2]

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
Quantity DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval ( const ConstIterator & it) const
inline

Unique estimation

Parameters
itany iterator
Returns
the estimated quantity

Definition at line 463 of file SegmentComputerEstimators.h.

464 {
465 ASSERT( mySCPtr );
466 return myFunctor( it, *mySCPtr );
467 }

References DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myFunctor, and DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::mySCPtr.

◆ eval() [2/2]

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
template<typename OutputIterator >
OutputIterator DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval ( const ConstIterator & itb,
const ConstIterator & ite,
OutputIterator result ) const
inline

Estimation for a subrange [itb , ite )

Parameters
itbsubrange begin iterator
itesubrange end iterator
resultoutput iterator on the estimated quantity
Returns
the estimated quantity from itb till ite (excluded)

Definition at line 479 of file SegmentComputerEstimators.h.

481 {
482 ASSERT( mySCPtr );
483
484 // do-while loop to deal with the case of a whole circular range
485 if (isNotEmpty(itb, ite))
486 {
487 ConstIterator it = itb;
488 do
489 {
490 *result++ = myFunctor( it, *mySCPtr );
491 ++it;
492 } while (it != ite);
493 }
494
495 return result;
496 }
MyDigitalSurface::ConstIterator ConstIterator
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)

References DGtal::detail::isNotEmpty(), DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myFunctor, and DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::mySCPtr.

◆ init()

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
void DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::init ( const double ,
const ConstIterator & itb,
const ConstIterator & ite )
inline

◆ isValid()

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
bool DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 425 of file SegmentComputerEstimators.h.

426 {
427 return (mySCPtr != 0);
428 };

References DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::mySCPtr.

Field Documentation

◆ myBegin

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
ConstIterator DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myBegin

◆ myEnd

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
ConstIterator DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myEnd

◆ myFunctor

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
Functor DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myFunctor

◆ mySCPtr


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