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

#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

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

Definition at line 176 of file GreedySegmentation.h.

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

Definition at line 175 of file GreedySegmentation.h.

Constructor & Destructor Documentation

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

Copy constructor.

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

Destructor. Does nothing.

Member Function Documentation

template<typename TSegmentComputer>
const ConstIterator DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::begin ( ) const
Returns
begin iterator on the segment.
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
template<typename TSegmentComputer>
bool DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite,
IteratorType   
)
private
template<typename TSegmentComputer>
bool DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::doesIntersectNext ( const ConstIterator it,
const ConstIterator itb,
const ConstIterator ite,
CirculatorType   
)
private
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

template<typename TSegmentComputer>
const ConstIterator DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::end ( ) const
Returns
end iterator on the segment.
Examples:
geometry/curves/exampleFrechetShortcut.cpp.
template<typename TSegmentComputer>
SegmentComputer DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::get ( ) const
Returns
the current segment.
template<typename TSegmentComputer>
bool DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::intersectNext ( ) const
Returns
TRUE if the current segment intersects the next one, FALSE otherwise.
template<typename TSegmentComputer>
bool DGtal::GreedySegmentation< TSegmentComputer >::SegmentComputerIterator::intersectPrevious ( ) const
Returns
TRUE if the current segment intersects the previous one, FALSE otherwise.
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.

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

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

Goes to the next segment (if possible).

Nb: complexity in O(n).

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

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

Nb: complexity in O(n).

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

Assignment.

Parameters
aOtherthe iterator to copy.
Returns
a reference on 'this'.
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

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

Definition at line 219 of file GreedySegmentation.h.

Field Documentation

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.

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.

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.

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

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

Pointer to the segmentation

Definition at line 184 of file GreedySegmentation.h.

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: