DGtal  1.5.beta
DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator Class Reference

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

#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

◆ ConstIterator

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

Definition at line 186 of file SaturatedSegmentation.h.

◆ SegmentComputer

Definition at line 185 of file SaturatedSegmentation.h.

Constructor & Destructor Documentation

◆ SegmentComputerIterator() [1/2]

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

◆ SegmentComputerIterator() [2/2]

template<typename TSegmentComputer >
DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::SegmentComputerIterator ( const SegmentComputerIterator aOther)

Copy constructor.

Parameters
aOtherthe iterator to clone.

◆ ~SegmentComputerIterator()

template<typename TSegmentComputer >
DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::~SegmentComputerIterator ( )

Destructor. Does nothing.

Member Function Documentation

◆ begin()

template<typename TSegmentComputer >
const ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::begin ( ) const
Returns
begin iterator on the segment.

Referenced by SaturatedSegmentationTest(), segmentationIntoDSSs(), and segmentationIntoMaximalDSSs().

◆ doesIntersectNext() [1/4]

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

◆ doesIntersectNext() [2/4]

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

◆ doesIntersectNext() [3/4]

template<typename TSegmentComputer >
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite,
CirculatorType   
)
private

◆ doesIntersectNext() [4/4]

template<typename TSegmentComputer >
bool DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite,
IteratorType   
)
private

◆ end()

template<typename TSegmentComputer >
const ConstIterator DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::end ( ) const
Returns
end iterator on the segment.

Referenced by SaturatedSegmentationTest(), segmentationIntoDSSs(), and segmentationIntoMaximalDSSs().

◆ get()

template<typename TSegmentComputer >
SegmentComputer DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::get ( ) const
Returns
the current segment.

◆ initFirstMaximalSegment()

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

Computes the first maximal segment of the segmentation.

◆ initLastMaximalSegment()

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

Computes the last maximal segment of the segmentation.

◆ intersectNext()

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

◆ intersectPrevious()

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

◆ isValid()

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.

◆ nextMaximalSegment()

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

Goes to the next maximal segment (if possible).

◆ operator!=()

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)

◆ operator*()

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

◆ operator++()

template<typename TSegmentComputer >
SegmentComputerIterator& DGtal::SaturatedSegmentation< TSegmentComputer >::SegmentComputerIterator::operator++ ( )

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

Nb: complexity in O(n).

◆ operator->()

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

◆ operator=()

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

Assignment.

Parameters
aOtherthe iterator to copy.
Returns
a reference on 'this'.

◆ operator==()

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

◆ SaturatedSegmentation< TSegmentComputer >

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

Definition at line 233 of file SaturatedSegmentation.h.

Field Documentation

◆ myFlagIntersectNext

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.

◆ myFlagIntersectPrevious

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.

◆ myFlagIsLast

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.

◆ myFlagIsValid

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().

◆ myLastMaximalSegmentBegin

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.

◆ myLastMaximalSegmentEnd

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.

◆ myS

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

Pointer to the segmentation

Definition at line 194 of file SaturatedSegmentation.h.

◆ mySegmentComputer

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: