DGtal  0.9.3beta
Public Types | Public Member Functions | Data Fields
DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType > Class Template Reference

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

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

Public Types

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

Public Member Functions

 PosIndepScaleDepSCEstimator ()
 
 PosIndepScaleDepSCEstimator (const PosIndepScaleDepSCEstimator &other)
 
PosIndepScaleDepSCEstimatoroperator= (const PosIndepScaleDepSCEstimator &other)
 
 ~PosIndepScaleDepSCEstimator ()
 
bool isValid () const
 
void init (const double h, 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

double myH
 
ConstIterator myBegin
 
ConstIterator myEnd
 
const SegmentComputermySCPtr
 
Functor myFunctor
 

Detailed Description

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

Description of class 'PosIndepScaleDepSCEstimator'

Aim: estimates a geometric quantity from a segment computer. The estimation is not position-dependent, but is scale-dependent (e.g. curvature or radius estimation from 'circular' 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 217 of file SegmentComputerEstimators.h.

Member Typedef Documentation

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

Definition at line 224 of file SegmentComputerEstimators.h.

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

Definition at line 225 of file SegmentComputerEstimators.h.

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

Definition at line 223 of file SegmentComputerEstimators.h.

Constructor & Destructor Documentation

template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::PosIndepScaleDepSCEstimator ( )
inline
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::PosIndepScaleDepSCEstimator ( const PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType > &  other)
inline

Copy constructor.

Parameters
otherthe object to copy.

Definition at line 265 of file SegmentComputerEstimators.h.

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

Destructor

Definition at line 289 of file SegmentComputerEstimators.h.

289 {}

Member Function Documentation

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

Attach the estimator to aSC

Parameters
aSCan instance of segment computer.

Definition at line 323 of file SegmentComputerEstimators.h.

324  {
325  mySCPtr = &aSC;
326  ASSERT( mySCPtr );
327  };
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Quantity DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval ( const ConstIterator ) const
inline

Estimation depending on myH

Returns
the estimated quantity

Definition at line 333 of file SegmentComputerEstimators.h.

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

351  {
352  ASSERT( isValid() );
353 
354  // do-while loop to deal with the case of a whole circular range
355  if (isNotEmpty(itb, ite))
356  {
357  ConstIterator it = itb;
358  do
359  {
360  *result++ = myFunctor( *mySCPtr, myH );
361  ++it;
362  } while (it != ite);
363  }
364 
365  return result;
366  }
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
void DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::init ( const double  h,
const ConstIterator itb,
const ConstIterator ite 
)
inline

Initialisation.

Parameters
hgrid size
itbbegin iterator
iteend iterator

Definition at line 311 of file SegmentComputerEstimators.h.

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

Referenced by DGtal::detail::PosIndepScaleDepSCEstimator< DCAComputer, detail::CurvatureFromDCA< isCCW > >::eval().

296  {
297  return (myH > 0)&&(mySCPtr != 0);
298  };
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
PosIndepScaleDepSCEstimator& DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::operator= ( const PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType > &  other)
inline

Assignement.

Parameters
otherthe object to copy.

Definition at line 274 of file SegmentComputerEstimators.h.

275  {
276  if (this != &other)
277  {
278  myH = other.myH;
279  myBegin = other.myBegin;
280  myEnd = other.myEnd;
281  mySCPtr = other.mySCPtr;
282  myFunctor = other.myFunctor;
283  }
284  return *this;
285  }

Field Documentation

template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
ConstIterator DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myBegin
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
ConstIterator DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myEnd
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Functor DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myFunctor
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
double DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myH
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
const SegmentComputer* DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::mySCPtr

Aliasing pointer on a constant segment computer

Definition at line 244 of file SegmentComputerEstimators.h.

Referenced by DGtal::detail::PosIndepScaleDepSCEstimator< DCAComputer, detail::CurvatureFromDCA< isCCW > >::operator=().


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