DGtal  0.9.4beta
Public Types | Public Member Functions | Data Fields
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]
Collaboration 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

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.

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.

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

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

Member Function Documentation

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  };
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Quantity DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval ( const ConstIterator ) const
inline

Unique estimation

Returns
the estimated quantity

Definition at line 159 of file SegmentComputerEstimators.h.

160  {
161  ASSERT( mySCPtr );
162  return myFunctor( *mySCPtr );
163  }
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  }
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)
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.

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  };

Field Documentation

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

Begin iterator

Definition at line 100 of file SegmentComputerEstimators.h.

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

End iterator

Definition at line 104 of file SegmentComputerEstimators.h.

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

Aliasing pointer on a constant segment computer

Definition at line 108 of file SegmentComputerEstimators.h.


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