DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator Struct Reference

#include <DGtal/topology/CubicalComplex.h>

Inheritance diagram for DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator:

Public Types

typedef boost::iterator_facade< ConstIterator, Cell const, std::forward_iterator_tag > Base
 
typedef ConstIterator Self
 
typedef Base::value_type Value
 
typedef Base::pointer Pointer
 
typedef Base::reference Reference
 
typedef Base::difference_type DifferenceType
 

Public Member Functions

 ConstIterator ()
 Default iterator. Invalid. More...
 
 ConstIterator (ConstAlias< CubicalComplex > cc, Dimension d)
 
 ConstIterator (ConstAlias< CubicalComplex > cc, Dimension d, CellMapConstIterator it)
 

Private Member Functions

void nextDimension ()
 
void increment ()
 
bool equal (const ConstIterator &other) const
 
Cell const & dereference () const
 
Dimension dimension () const
 

Private Attributes

const CubicalComplexmyCC
 
Dimension myD
 
CellMapConstIterator myIt
 
CellMapConstIterator myItEnd
 

Friends

class CubicalComplex
 
class boost::iterator_core_access
 

Detailed Description

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
struct DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator

An non-mutable iterator class to visit all the cells (and not their datas) of the complex. A model of boost::ForwardIterator.

Definition at line 306 of file CubicalComplex.h.

Member Typedef Documentation

◆ Base

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef boost::iterator_facade< ConstIterator, Cell const, std::forward_iterator_tag > DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::Base

Definition at line 313 of file CubicalComplex.h.

◆ DifferenceType

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Base::difference_type DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::DifferenceType

Definition at line 318 of file CubicalComplex.h.

◆ Pointer

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Base::pointer DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::Pointer

Definition at line 316 of file CubicalComplex.h.

◆ Reference

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Base::reference DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::Reference

Definition at line 317 of file CubicalComplex.h.

◆ Self

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::Self

Definition at line 314 of file CubicalComplex.h.

◆ Value

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Base::value_type DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::Value

Definition at line 315 of file CubicalComplex.h.

Constructor & Destructor Documentation

◆ ConstIterator() [1/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::ConstIterator ( )
inline

Default iterator. Invalid.

Definition at line 321 of file CubicalComplex.h.

321: myCC( 0 ), myD( 0 ) {}

◆ ConstIterator() [2/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::ConstIterator ( ConstAlias< CubicalComplex cc,
Dimension  d 
)
inline

Constructor from complex cc and cell dimension d. If the dimension is lower or equal to the dimension of the complex,

Parameters
ccany valid cubical complex that is aliased in the iterator.
dthe dimension of the starting cell.

Definition at line 331 of file CubicalComplex.h.

332 : myCC( &cc ), myD( d )
333 {
334 if ( myD <= myCC->dimension )
335 {
336 myIt = myCC->begin( myD );
337 myItEnd = myCC->end( myD );
339 }
340 else
341 {
342 myD = myCC->dimension + 1;
343 myIt = myCC->end( myCC->dimension );
345 }
346 }
ConstIterator end() const
static const Dimension dimension
The dimension of the embedding space.
ConstIterator begin() const

References DGtal::CubicalComplex< TKSpace, TCellContainer >::begin(), DGtal::CubicalComplex< TKSpace, TCellContainer >::dimension, DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::dimension(), DGtal::CubicalComplex< TKSpace, TCellContainer >::end(), DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myCC, DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myD, DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myIt, DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myItEnd, and DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::nextDimension().

◆ ConstIterator() [3/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::ConstIterator ( ConstAlias< CubicalComplex cc,
Dimension  d,
CellMapConstIterator  it 
)
inline

Detailed constructor from complex cc, cell dimension d and iterators.

Parameters
ccany valid cubical complex that is aliased in the iterator.
dthe dimension of the starting cell (0<=d<=dimension).
itan iterator pointing on a cell of the complex.

Definition at line 355 of file CubicalComplex.h.

357 : myCC( &cc ), myD( d ), myIt( it )
358 {
359 ASSERT( d <= myCC->dimension );
360 myItEnd = myCC->end( d );
362 }

References DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::dimension(), DGtal::CubicalComplex< TKSpace, TCellContainer >::end(), DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myCC, DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myItEnd, and DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::nextDimension().

Member Function Documentation

◆ dereference()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Cell const & DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::dereference ( ) const
inlineprivate

Definition at line 389 of file CubicalComplex.h.

390 {
391 return myIt->first;
392 }

References DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myIt.

◆ dimension()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::dimension ( ) const
inlineprivate

◆ equal()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::equal ( const ConstIterator other) const
inlineprivate

Definition at line 384 of file CubicalComplex.h.

385 {
386 return ( myD == other.myD ) && ( myIt == other.myIt );
387 }

References DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myD, and DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myIt.

◆ increment()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::increment ( )
inlineprivate

◆ nextDimension()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::nextDimension ( )
inlineprivate

Friends And Related Function Documentation

◆ boost::iterator_core_access

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
friend class boost::iterator_core_access
friend

Definition at line 365 of file CubicalComplex.h.

◆ CubicalComplex

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
friend class CubicalComplex
friend

Definition at line 310 of file CubicalComplex.h.

Field Documentation

◆ myCC

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
const CubicalComplex* DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myCC
private

◆ myD

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myD
private

◆ myIt

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myIt
private

◆ myItEnd

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myItEnd
private

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