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

#include <SegmentComputerEstimators.h>

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


Member Typedef Documentation

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

Definition at line 531 of file SegmentComputerEstimators.h.

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

Definition at line 532 of file SegmentComputerEstimators.h.

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

Definition at line 530 of file SegmentComputerEstimators.h.


Constructor & Destructor Documentation

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

: myH( 0.0 ), myBegin(), myEnd(), mySCPtr(0), myFunctor()
{
}
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 572 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::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::~PosDepScaleDepSCEstimator ( )
inline

Destructor

Definition at line 596 of file SegmentComputerEstimators.h.

{}

Member Function Documentation

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

{
mySCPtr = &aSC;
ASSERT( mySCPtr );
};
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 641 of file SegmentComputerEstimators.h.

{
ASSERT( isValid() );
return myFunctor( it, *mySCPtr, myH );
}
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 657 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( it, *mySCPtr, myH );
++it;
} while (it != ite);
}
return result;
}
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
itb,beginiterator
ite,enditerator

Definition at line 618 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::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 602 of file SegmentComputerEstimators.h.

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

{
return (myH > 0)&&(mySCPtr != 0);
};
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 581 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::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myBegin
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
ConstIterator DGtal::detail::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myEnd
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
Functor DGtal::detail::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myFunctor
template<typename TSegmentComputer, typename Functor, typename ReturnType = typename Functor::Value>
double DGtal::detail::PosDepScaleDepSCEstimator< TSegmentComputer, Functor, ReturnType >::myH
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: