DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Data Fields
DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType > Class Template Reference

#include <SegmentComputerEstimators.h>

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

Public Types

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

Public Member Functions

bool isValid () const
 PosIndepScaleIndepSCEstimator ()
void init (const double, 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

ConstIterator myBegin
ConstIterator myEnd
const SegmentComputermySCPtr
Functor myFunctor

Detailed Description

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

Description of class 'PosIndepScaleIndepSCEstimator'

Aim: estimates a geometric quantity from a segment computer. The estimation is neither position-dependent nor scale-dependent (e.g. tangent or normal estimation from 'straight' primitives).

Template Parameters:
TSegmentComputera model of segment computer.

The computation is delegated to a functor.

Template Parameters:
Functora unary functor

This class is a model of CSegmentComputerEstimator

Definition at line 85 of file SegmentComputerEstimators.h.


Member Typedef Documentation

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

Definition at line 92 of file SegmentComputerEstimators.h.

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

Definition at line 93 of file SegmentComputerEstimators.h.

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

Definition at line 91 of file SegmentComputerEstimators.h.


Constructor & Destructor Documentation

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

Default constructor

Definition at line 132 of file SegmentComputerEstimators.h.

: myBegin(), myEnd(), mySCPtr(0), myFunctor() {}

Member Function Documentation

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

Attach the estimator to aSC

Parameters:
aSCan instance of segment computer.

Definition at line 150 of file SegmentComputerEstimators.h.

{
mySCPtr = &aSC;
};
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Quantity DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval ( const ConstIterator ) const
inline

Unique estimation

Parameters:
itany iterator (unused)
Returns:
the estimated quantity

Definition at line 160 of file SegmentComputerEstimators.h.

{
ASSERT( mySCPtr );
return myFunctor( *mySCPtr );
}
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
template<typename OutputIterator >
OutputIterator DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::eval ( const ConstIterator itb,
const ConstIterator ite,
OutputIterator  result 
) const
inline

Estimation for a subrange [itb , ite )

Parameters:
itbsubrange begin iterator (unused)
itesubrange end iterator (unused)
resultoutput iterator on the estimated quantity
Returns:
the estimated quantity from itb till ite (excluded)

Definition at line 176 of file SegmentComputerEstimators.h.

{
ASSERT( mySCPtr );
// do-while loop to deal with the case of a whole circular range
if (isNotEmpty(itb, ite))
{
ConstIterator it = itb;
do
{
*result++ = myFunctor( *mySCPtr );
++it;
} while (it != ite);
}
return result;
}
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
void DGtal::detail::PosIndepScaleIndepSCEstimator< TSegmentComputer, Functor, ReturnType >::init ( const double  ,
const ConstIterator itb,
const ConstIterator ite 
)
inline

Initialisation.

Parameters:
hgrid size (unused)
itb,beginiterator
ite,enditerator

Definition at line 140 of file SegmentComputerEstimators.h.

{
myBegin = itb;
myEnd = ite;
}
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
bool DGtal::detail::PosIndepScaleIndepSCEstimator< 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 121 of file SegmentComputerEstimators.h.

{
return (mySCPtr != 0);
};

Field Documentation

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

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