DGtal  1.5.beta
DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType > Class Template Reference

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

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

Public Types

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

Public Member Functions

bool isValid () const
 
 PosIndepScaleIndepSCEstimator ()
 
void init (const double, const ConstIterator &itb, const ConstIterator &ite)
 
void attach (const SegmentComputer &aSC)
 
Quantity eval (const ConstIterator &) 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::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >

Description of class 'PosIndepScaleIndepSCEstimator'

Aim: estimates a geometric quantity from a segment computer. The estimation is neither position-dependent nor scale-dependent (e.g. tangent or normal estimation from 'straight' primitives).

Template Parameters
TSegmentComputera model of segment computer.

The computation is delegated to a functor.

Template Parameters
Functora unary functor

This class is a model of CSegmentComputerEstimator

Definition at line 85 of file SegmentComputerEstimators.h.

Member Typedef Documentation

◆ ConstIterator

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

Definition at line 92 of file SegmentComputerEstimators.h.

◆ Quantity

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

Definition at line 93 of file SegmentComputerEstimators.h.

◆ SegmentComputer

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

Definition at line 91 of file SegmentComputerEstimators.h.

Constructor & Destructor Documentation

◆ PosIndepScaleIndepSCEstimator()

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

Member Function Documentation

◆ attach()

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

Attach the estimator to aSC

Parameters
aSCan instance of segment computer.

Definition at line 150 of file SegmentComputerEstimators.h.

151  {
152  mySCPtr = &aSC;
153  };

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

◆ eval() [1/2]

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

◆ eval() [2/2]

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

Estimation for a subrange [itb , ite )

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

Definition at line 175 of file SegmentComputerEstimators.h.

177  {
178  ASSERT( mySCPtr );
179 
180  // do-while loop to deal with the case of a whole circular range
181  if (isNotEmpty(itb, ite))
182  {
183  ConstIterator it = itb;
184  do
185  {
186  *result++ = myFunctor( *mySCPtr );
187  ++it;
188  } while (it != ite);
189  }
190 
191  return result;
192  }
MyDigitalSurface::ConstIterator ConstIterator
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)

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

◆ init()

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

Initialisation. (h grid size unused)

Parameters
itbbegin iterator
iteend iterator

Definition at line 140 of file SegmentComputerEstimators.h.

141  {
142  myBegin = itb;
143  myEnd = ite;
144  }

References DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myBegin, and DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::myEnd.

◆ isValid()

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
bool DGtal::detail::PosIndepScaleIndepSCEstimator< 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 121 of file SegmentComputerEstimators.h.

122  {
123  return (mySCPtr != 0);
124  };

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

Field Documentation

◆ myBegin

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

◆ myEnd

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

◆ myFunctor

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

◆ mySCPtr

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

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