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::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType > Class Template Reference

#include <SegmentComputerEstimators.h>

Inheritance diagram for DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >:
Inheritance graph
[legend]
Collaboration diagram for DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >:
Collaboration graph
[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 218 of file SegmentComputerEstimators.h.


Member Typedef Documentation

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

Definition at line 225 of file SegmentComputerEstimators.h.

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

Definition at line 226 of file SegmentComputerEstimators.h.

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

Definition at line 224 of file SegmentComputerEstimators.h.


Constructor & Destructor Documentation

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

Default constructor. NB: not valid.

Definition at line 258 of file SegmentComputerEstimators.h.

: myH( 0.0 ), myBegin(), myEnd(), mySCPtr(0), myFunctor()
{
}
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 266 of file SegmentComputerEstimators.h.

: myH( other.myH ), myBegin( other.myBegin ), myEnd( other.myEnd ),
mySCPtr( other.mySCPtr ), myFunctor( other.myFunctor )
{
}
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::~PosIndepScaleDepSCEstimator ( )
inline

Destructor

Definition at line 290 of file SegmentComputerEstimators.h.

{}

Member Function Documentation

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

{
mySCPtr = &aSC;
ASSERT( mySCPtr );
};
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

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

Definition at line 335 of file SegmentComputerEstimators.h.

{
ASSERT( isValid() );
return myFunctor( *mySCPtr, myH );
}
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 351 of file SegmentComputerEstimators.h.

{
ASSERT( isValid() );
// do-while loop to deal with the case of a whole circular range
if (isNotEmpty(itb, ite))
{
ConstIterator it = itb;
do
{
*result++ = myFunctor( *mySCPtr, myH );
++it;
} while (it != ite);
}
return result;
}
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
itb,beginiterator
ite,enditerator

Definition at line 312 of file SegmentComputerEstimators.h.

{
myH = h;
myBegin = itb;
myEnd = ite;
ASSERT( myH > 0 );
}
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 296 of file SegmentComputerEstimators.h.

Referenced by DGtal::detail::PosIndepScaleDepSCEstimator< DCAComputer, detail::CurvatureFromDCA< isCCW > >::eval().

{
return (myH > 0)&&(mySCPtr != 0);
};
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 275 of file SegmentComputerEstimators.h.

{
if (this != &other)
{
myH = other.myH;
myBegin = other.myBegin;
myEnd = other.myEnd;
mySCPtr = other.mySCPtr;
myFunctor = other.myFunctor;
}
return *this;
}

Field Documentation

template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
ConstIterator DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myBegin
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
ConstIterator DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myEnd
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Functor DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myFunctor
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
double DGtal::detail::PosIndepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myH
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: