DGtal 2.0.0
Loading...
Searching...
No Matches
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]

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.

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

◆ 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

Estimation depending on myH

Returns
the estimated quantity

Definition at line 333 of file SegmentComputerEstimators.h.

334 {
335 ASSERT( isValid() );
336 return myFunctor( *mySCPtr, myH );
337 }

◆ 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 {
358 do
359 {
360 *result++ = myFunctor( *mySCPtr, myH );
361 ++it;
362 } while (it != ite);
363 }
364 return result;
365 }
bool isNotEmpty(const IC &itb, const IC &ite, IteratorType)

◆ 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

Initialisation.

Parameters
hgrid size
itbbegin iterator
iteend iterator

Definition at line 311 of file SegmentComputerEstimators.h.

312 {
313 myH = h;
314 myBegin = itb;
315 myEnd = ite;
316 ASSERT( myH > 0 );
317 }

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

Referenced by DGtal::detail::PosIndepScaleDepSCEstimator< DCAComputer, detail::CurvatureFromDCA< isCCW > >::eval(), and DGtal::detail::PosIndepScaleDepSCEstimator< DCAComputer, detail::CurvatureFromDCA< isCCW > >::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

Assignement.

Parameters
otherthe object to copy.

Definition at line 274 of file SegmentComputerEstimators.h.

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

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

◆ 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

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: