DGtal  0.9.4beta
Public Types | Public Member Functions | Data Fields
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]
Collaboration 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 390 of file SegmentComputerEstimators.h.

Member Typedef Documentation

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

Definition at line 397 of file SegmentComputerEstimators.h.

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

Definition at line 398 of file SegmentComputerEstimators.h.

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

Definition at line 396 of file SegmentComputerEstimators.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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 454 of file SegmentComputerEstimators.h.

455  {
456  mySCPtr = &aSC;
457  };
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 464 of file SegmentComputerEstimators.h.

465  {
466  ASSERT( mySCPtr );
467  return myFunctor( it, *mySCPtr );
468  }
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 480 of file SegmentComputerEstimators.h.

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

Initialisation.

Parameters
itbbegin iterator
iteend iterator

Definition at line 444 of file SegmentComputerEstimators.h.

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 426 of file SegmentComputerEstimators.h.

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

Field Documentation

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

Begin iterator

Definition at line 405 of file SegmentComputerEstimators.h.

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

End iterator

Definition at line 409 of file SegmentComputerEstimators.h.

template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Functor DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myFunctor
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
const SegmentComputer* DGtal::detail::PosDepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::mySCPtr

Aliasing pointer on a constant segment computer

Definition at line 413 of file SegmentComputerEstimators.h.


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