DGtal  0.9.3beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator Class Reference

#include <DGtal/geometry/curves/SaturatedSegmentation.h>

Public Types

typedef SaturatedSegmentation::SegmentComputer SegmentComputer
 
typedef SegmentComputer::ConstIterator ConstIterator
 

Public Member Functions

 SegmentComputerIterator (const SaturatedSegmentation< TSegmentComputer > *aSegmentation, const TSegmentComputer &aSegmentComputer, const bool &aFlag)
 
 SegmentComputerIterator (const SegmentComputerIterator &aOther)
 
SegmentComputerIteratoroperator= (const SegmentComputerIterator &aOther)
 
 ~SegmentComputerIterator ()
 
bool isValid () const
 
const SegmentComputeroperator* () const
 
SegmentComputer get () const
 
const SegmentComputeroperator-> () const
 
SegmentComputerIteratoroperator++ ()
 
bool operator== (const SegmentComputerIterator &aOther) const
 
bool operator!= (const SegmentComputerIterator &aOther) const
 
bool intersectNext () const
 
bool intersectPrevious () const
 
const ConstIterator begin () const
 
const ConstIterator end () const
 

Private Member Functions

bool doesIntersectNext (const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite)
 
bool doesIntersectNext (const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite, IteratorType)
 
bool doesIntersectNext (const ConstIterator &it, const ConstIterator &itb, const ConstIterator &ite, CirculatorType)
 
bool doesIntersectNext (const ConstIterator &it)
 
void nextMaximalSegment ()
 
void initFirstMaximalSegment ()
 
void initLastMaximalSegment ()
 

Private Attributes

const SaturatedSegmentation< TSegmentComputer > * myS
 
SegmentComputer mySegmentComputer
 
bool myFlagIsValid
 
ConstIterator myLastMaximalSegmentBegin
 
ConstIterator myLastMaximalSegmentEnd
 
bool myFlagIntersectNext
 
bool myFlagIntersectPrevious
 
bool myFlagIsLast
 

Friends

class SaturatedSegmentation< TSegmentComputer >
 

Detailed Description

template<typename TSegmentComputer>
class DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator

Aim: Specific iterator to visit all the maximal segments of a saturated segmentation.

Description of template class 'SaturatedSegmentation::SegmentComputerIterator'

Definition at line 179 of file SaturatedSegmentation.h.

Member Typedef Documentation

template<typename TSegmentComputer>
typedef SegmentComputer::ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::ConstIterator

Definition at line 186 of file SaturatedSegmentation.h.

Definition at line 185 of file SaturatedSegmentation.h.

Constructor & Destructor Documentation

template<typename TSegmentComputer>
DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::SegmentComputerIterator ( const SaturatedSegmentation< TSegmentComputer > *  aSegmentation,
const TSegmentComputer &  aSegmentComputer,
const bool &  aFlag 
)

Constructor.

Nb: complexity in O(n).

Parameters
aSegmentationthe object that knows the range bounds
aSegmentComputeran online segment recognition algorithm
aFlag'true' to build a valid object, 'false' otherwise
template<typename TSegmentComputer>
DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::SegmentComputerIterator ( const SegmentComputerIterator aOther)

Copy constructor.

Parameters
aOtherthe iterator to clone.
template<typename TSegmentComputer>
DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::~SegmentComputerIterator ( )

Destructor. Does nothing.

Member Function Documentation

template<typename TSegmentComputer>
const ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::begin ( ) const
Returns
begin iterator on the segment.
template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite 
)
private

Checks if the current segment intersects the next one.

Parameters
itend of the current segment
itbbegin iterator of the underlying range
iteend iterator of the underlying range
Returns
'true' if it != itb and it != ite and –it and it form a valid segment, false otherwise
template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite,
IteratorType   
)
private
template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite,
CirculatorType   
)
private
template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it)
private

Checks if the current segment intersects the next one (if exists).

Parameters
itend of the current segment
Returns
'true' if –it and it form a valid segment, false otherwise

NB: no verification

template<typename TSegmentComputer>
const ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::end ( ) const
Returns
end iterator on the segment.
template<typename TSegmentComputer>
SegmentComputer DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::get ( ) const
Returns
the current segment.
template<typename TSegmentComputer>
void DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::initFirstMaximalSegment ( )
private

Computes the first maximal segment of the segmentation.

template<typename TSegmentComputer>
void DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::initLastMaximalSegment ( )
private

Computes the last maximal segment of the segmentation.

template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::intersectNext ( ) const
Returns
TRUE if the current segment intersects the next one, FALSE otherwise.
template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::intersectPrevious ( ) const
Returns
TRUE if the current segment intersects the previous one, FALSE otherwise.
template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

Definition at line 278 of file SaturatedSegmentation.h.

References DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myFlagIsValid.

template<typename TSegmentComputer>
void DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::nextMaximalSegment ( )
private

Goes to the next maximal segment (if possible).

template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator!= ( const SegmentComputerIterator aOther) const

Inequality operator.

Parameters
aOtherthe iterator to compare with
Returns
'true' if their current positions differs. (different front and back iterators)
template<typename TSegmentComputer>
const SegmentComputer& DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator* ( ) const
Returns
a constant reference to the current segment
template<typename TSegmentComputer>
SegmentComputerIterator& DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator++ ( )

Pre-increment. Goes to the next maximal segment (if possible).

Nb: complexity in O(n).

template<typename TSegmentComputer>
const SegmentComputer* DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator-> ( ) const
Returns
a constant pointer to the current segment
template<typename TSegmentComputer>
SegmentComputerIterator& DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator= ( const SegmentComputerIterator aOther)

Assignment.

Parameters
aOtherthe iterator to copy.
Returns
a reference on 'this'.
template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator== ( const SegmentComputerIterator aOther) const

Equality operator.

Parameters
aOtherthe iterator to compare with
Returns
'true' if their current positions coincide. (same front and back iterators)

Friends And Related Function Documentation

template<typename TSegmentComputer>
friend class SaturatedSegmentation< TSegmentComputer >
friend

Definition at line 239 of file SaturatedSegmentation.h.

Field Documentation

template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myFlagIntersectNext
private

A flag equal to TRUE if the current segment intersects the next one, FALSE otherwise (and FALSE if the current segment is the last one)

Definition at line 220 of file SaturatedSegmentation.h.

template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myFlagIntersectPrevious
private

A flag equal to TRUE if the current segment intersects the previous one, FALSE otherwise (and FALSE if the current segment is the first one)

Definition at line 227 of file SaturatedSegmentation.h.

template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myFlagIsLast
private

A flag equal to TRUE if *this is the last maximal segment, FALSE otherwise

Definition at line 233 of file SaturatedSegmentation.h.

template<typename TSegmentComputer>
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myFlagIsValid
private

A flag equal to TRUE if *this is valid, FALSE otherwise

Definition at line 204 of file SaturatedSegmentation.h.

Referenced by DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::isValid().

template<typename TSegmentComputer>
ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myLastMaximalSegmentBegin
private

Begin iterator of the last maximal segment of the segmentation

Definition at line 209 of file SaturatedSegmentation.h.

template<typename TSegmentComputer>
ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myLastMaximalSegmentEnd
private

End iterator of the last maximal segment of the segmentation

Definition at line 213 of file SaturatedSegmentation.h.

template<typename TSegmentComputer>
const SaturatedSegmentation<TSegmentComputer>* DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::myS
private

Pointer to the segmentation

Definition at line 194 of file SaturatedSegmentation.h.

template<typename TSegmentComputer>
SegmentComputer DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::mySegmentComputer
private

The current segment

Definition at line 199 of file SaturatedSegmentation.h.


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