DGtal 1.3.0
Loading...
Searching...
No Matches
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 >:
DGtal::CurvatureFromDCAEstimator< DCAComputer, isCCW >

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

◆ ConstIterator

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.

◆ Quantity

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.

◆ SegmentComputer

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

◆ PosIndepScaleDepSCEstimator() [1/2]

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

◆ PosIndepScaleDepSCEstimator() [2/2]

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.

266 : myH( other.myH ), myBegin( other.myBegin ), myEnd( other.myEnd ),
267 mySCPtr( other.mySCPtr ), myFunctor( other.myFunctor )
268 {
269 }

◆ ~PosIndepScaleDepSCEstimator()

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

◆ attach()

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

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

◆ eval() [1/2]

template<typename TSegmentComputer , typename Functor , typename ReturnType = typename Functor::Value>
Quantity DGtal::detail::PosIndepScaleDepSCEstimator< 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::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 return result;
365 }
MyDigitalSurface::ConstIterator ConstIterator
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)

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

◆ init()

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

◆ isValid()

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.

296 {
297 return (myH > 0)&&(mySCPtr != 0);
298 };

References DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myH, and DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::mySCPtr.

Referenced by DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval().

◆ operator=()

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

Field Documentation

◆ myBegin

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

◆ myEnd

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

◆ myFunctor

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

◆ myH

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

◆ mySCPtr

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

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