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

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

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

Public Types

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

Public Member Functions

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

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::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >

Description of class 'PosDepScaleDepSCEstimator'

Aim: estimates a geometric quantity from a segment computer. The estimation is both position-dependent and scale-dependent (typically distance of a point to an underlying curve).

Template Parameters
TSegmentComputera model of segment computer.

The computation is delegated to a Functor.

Template Parameters
Functora functor

This class is a model of CSegmentComputerEstimator

Definition at line 521 of file SegmentComputerEstimators.h.

Member Typedef Documentation

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

Definition at line 528 of file SegmentComputerEstimators.h.

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

Definition at line 529 of file SegmentComputerEstimators.h.

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

Definition at line 527 of file SegmentComputerEstimators.h.

Constructor & Destructor Documentation

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

Copy constructor.

Parameters
otherthe object to copy.

Definition at line 569 of file SegmentComputerEstimators.h.

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

Destructor

Definition at line 593 of file SegmentComputerEstimators.h.

593 {}

Member Function Documentation

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

Attach the estimator to aSC

Parameters
aSCan instance of segment computer.

Definition at line 627 of file SegmentComputerEstimators.h.

628  {
629  mySCPtr = &aSC;
630  ASSERT( mySCPtr );
631  };
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Quantity DGtal::detail::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval ( const ConstIterator it) const
inline

Unique estimation

Parameters
itany iterator
Returns
the estimated quantity

Definition at line 638 of file SegmentComputerEstimators.h.

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

656  {
657  ASSERT( isValid() );
658 
659  // do-while loop to deal with the case of a whole circular range
660  if (isNotEmpty(itb, ite))
661  {
662  ConstIterator it = itb;
663  do
664  {
665  *result++ = myFunctor( it, *mySCPtr, myH );
666  ++it;
667  } while (it != ite);
668  }
669 
670  return result;
671  }
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
void DGtal::detail::PosDepScaleDepSCEstimator< 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 615 of file SegmentComputerEstimators.h.

616  {
617  myH = h;
618  myBegin = itb;
619  myEnd = ite;
620  ASSERT( myH > 0 );
621  }
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
bool DGtal::detail::PosDepScaleDepSCEstimator< 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 599 of file SegmentComputerEstimators.h.

Referenced by DGtal::detail::PosDepScaleDepSCEstimator< DCAComputer, detail::DistanceFromDCA >::eval().

600  {
601  return (myH > 0)&&(mySCPtr != 0);
602  };
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
PosDepScaleDepSCEstimator& DGtal::detail::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::operator= ( const PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType > &  other)
inline

Assignement.

Parameters
otherthe object to copy.

Definition at line 578 of file SegmentComputerEstimators.h.

579  {
580  if (this != &other)
581  {
582  myH = other.myH;
583  myBegin = other.myBegin;
584  myEnd = other.myEnd;
585  mySCPtr = other.mySCPtr;
586  myFunctor = other.myFunctor;
587  }
588  return *this;
589  }

Field Documentation

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

Aliasing pointer on a constant segment computer

Definition at line 548 of file SegmentComputerEstimators.h.

Referenced by DGtal::detail::PosDepScaleDepSCEstimator< DCAComputer, detail::DistanceFromDCA >::operator=().


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