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

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

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

Public Types

typedef GreedySegmentation::SegmentComputer SegmentComputer
 
typedef SegmentComputer::ConstIterator ConstIterator
 

Public Member Functions

 SegmentComputerIterator (const GreedySegmentation< 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++ ()
 
void next ()
 
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

void longestSegment (const ConstIterator &it)
 
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)
 

Private Attributes

const GreedySegmentation< TSegmentComputer > * myS
 
SegmentComputer mySegmentComputer
 
bool myFlagIsValid
 
bool myFlagIntersectNext
 
bool myFlagIntersectPrevious
 
bool myFlagIsLast
 

Friends

class GreedySegmentation< TSegmentComputer >
 

Detailed Description

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

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

Description of template class 'SaturatedSegmentation::SegmentComputerIterator'

Definition at line 169 of file GreedySegmentation.h.

Member Typedef Documentation

◆ ConstIterator

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

Definition at line 176 of file GreedySegmentation.h.

◆ SegmentComputer

template<typename TSegmentComputer >
typedef GreedySegmentation::SegmentComputer DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::SegmentComputer

Definition at line 175 of file GreedySegmentation.h.

Constructor & Destructor Documentation

◆ SegmentComputerIterator() [1/2]

template<typename TSegmentComputer >
DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::SegmentComputerIterator ( const GreedySegmentation< 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::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::SegmentComputerIterator ( const SegmentComputerIterator aOther)

Copy constructor.

Parameters
aOtherthe iterator to clone.

◆ ~SegmentComputerIterator()

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

Destructor. Does nothing.

Member Function Documentation

◆ begin()

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

◆ doesIntersectNext() [1/4]

template<typename TSegmentComputer >
bool DGtal::GreedySegmentation< 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::GreedySegmentation< 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::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite,
CirculatorType   
)
private

◆ doesIntersectNext() [4/4]

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

◆ end()

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

◆ get()

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

◆ intersectNext()

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

◆ intersectPrevious()

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

◆ isValid()

template<typename TSegmentComputer >
bool DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::isValid ( ) const
inline

Checks the validity/consistency of the object.

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

Definition at line 259 of file GreedySegmentation.h.

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

◆ longestSegment()

template<typename TSegmentComputer >
void DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::longestSegment ( const ConstIterator it)
private

Computes the longest possible segment from [it]

Parameters
ita given iterator

Nb: complexity in O(n).

◆ next()

template<typename TSegmentComputer >
void DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::next ( )

Goes to the next segment (if possible).

Nb: complexity in O(n).

◆ operator!=()

template<typename TSegmentComputer >
bool DGtal::GreedySegmentation< 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::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::operator* ( ) const
Returns
a constant reference to the current segment

◆ operator++()

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

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

Nb: complexity in O(n).

◆ operator->()

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

◆ operator=()

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

Assignment.

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

◆ operator==()

template<typename TSegmentComputer >
bool DGtal::GreedySegmentation< 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

◆ GreedySegmentation< TSegmentComputer >

template<typename TSegmentComputer >
friend class GreedySegmentation< TSegmentComputer >
friend

Definition at line 213 of file GreedySegmentation.h.

Field Documentation

◆ myFlagIntersectNext

template<typename TSegmentComputer >
bool DGtal::GreedySegmentation< 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 201 of file GreedySegmentation.h.

◆ myFlagIntersectPrevious

template<typename TSegmentComputer >
bool DGtal::GreedySegmentation< 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 208 of file GreedySegmentation.h.

◆ myFlagIsLast

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

A flag equal to TRUE if *this has reached the end, FALSE otherwise

Definition at line 213 of file GreedySegmentation.h.

◆ myFlagIsValid

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

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

Definition at line 194 of file GreedySegmentation.h.

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

◆ myS

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

Pointer to the segmentation

Definition at line 184 of file GreedySegmentation.h.

◆ mySegmentComputer

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

The current segment

Definition at line 189 of file GreedySegmentation.h.


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