DGtal  1.3.beta
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]

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

Member Typedef Documentation

◆ ConstIterator

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

Definition at line 527 of file SegmentComputerEstimators.h.

◆ Quantity

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

Definition at line 528 of file SegmentComputerEstimators.h.

◆ SegmentComputer

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

Definition at line 526 of file SegmentComputerEstimators.h.

Constructor & Destructor Documentation

◆ PosDepScaleDepSCEstimator() [1/2]

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

Default constructor. NB: not valid.

Definition at line 560 of file SegmentComputerEstimators.h.

561  : myH( 0.0 ), myBegin(), myEnd(), mySCPtr(0), myFunctor()
562  {
563  }

◆ PosDepScaleDepSCEstimator() [2/2]

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

569  : myH( other.myH ), myBegin( other.myBegin ), myEnd( other.myEnd ),
570  mySCPtr( other.mySCPtr ), myFunctor( other.myFunctor )
571  {
572  }

◆ ~PosDepScaleDepSCEstimator()

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

Destructor

Definition at line 592 of file SegmentComputerEstimators.h.

592 {}

Member Function Documentation

◆ attach()

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

627  {
628  mySCPtr = &aSC;
629  ASSERT( mySCPtr );
630  };

◆ eval() [1/2]

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

638  {
639  ASSERT( isValid() );
640  return myFunctor( it, *mySCPtr, myH );
641  }

◆ eval() [2/2]

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

655  {
656  ASSERT( isValid() );
657 
658  // do-while loop to deal with the case of a whole circular range
659  if (isNotEmpty(itb, ite))
660  {
661  ConstIterator it = itb;
662  do
663  {
664  *result++ = myFunctor( it, *mySCPtr, myH );
665  ++it;
666  } while (it != ite);
667  }
668 
669  return result;
670  }

◆ init()

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

615  {
616  myH = h;
617  myBegin = itb;
618  myEnd = ite;
619  ASSERT( myH > 0 );
620  }

◆ isValid()

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

599  {
600  return (myH > 0)&&(mySCPtr != 0);
601  };

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

◆ operator=()

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

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

Field Documentation

◆ myBegin

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

◆ myEnd

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

◆ myFunctor

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

◆ myH

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
double DGtal::detail::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myH

◆ mySCPtr

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

The documentation for this class was generated from the following file:
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::detail::PosDepScaleDepSCEstimator::myEnd
ConstIterator myEnd
Definition: SegmentComputerEstimators.h:543
DGtal::detail::PosDepScaleDepSCEstimator::myBegin
ConstIterator myBegin
Definition: SegmentComputerEstimators.h:539
DGtal::detail::PosDepScaleDepSCEstimator::myH
double myH
Definition: SegmentComputerEstimators.h:535
DGtal::detail::PosDepScaleDepSCEstimator::myFunctor
Functor myFunctor
Definition: SegmentComputerEstimators.h:551
DGtal::detail::PosDepScaleDepSCEstimator::mySCPtr
const SegmentComputer * mySCPtr
Definition: SegmentComputerEstimators.h:547
DGtal::detail::PosDepScaleDepSCEstimator::isValid
bool isValid() const
Definition: SegmentComputerEstimators.h:598
DGtal::detail::isNotEmpty
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)