DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator Struct Reference

#include <DGtal/topology/CubicalComplex.h>

Inheritance diagram for DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator:
[legend]

Public Types

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

Public Member Functions

 Iterator ()
 Default iterator. Invalid.
 Iterator (Alias< CubicalComplex > cc, Dimension d)
 Iterator (Alias< CubicalComplex > cc, Dimension d, CellMapIterator it)

Private Member Functions

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

Private Attributes

CubicalComplexmyCC
Dimension myD
CellMapIterator myIt
CellMapIterator 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 >::Iterator

A mutable iterator class to visit all the cells (and not their datas) of the complex. A model of boost::ForwardIterator. Note that, as for associative container, values are not modifiable.

Definition at line 411 of file CubicalComplex.h.

Member Typedef Documentation

◆ Base

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

Definition at line 418 of file CubicalComplex.h.

◆ DifferenceType

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

Definition at line 423 of file CubicalComplex.h.

◆ Pointer

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

Definition at line 421 of file CubicalComplex.h.

◆ Reference

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

Definition at line 422 of file CubicalComplex.h.

◆ Self

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

Definition at line 419 of file CubicalComplex.h.

◆ Value

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

Definition at line 420 of file CubicalComplex.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

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

Default iterator. Invalid.

Definition at line 426 of file CubicalComplex.h.

426: myCC( 0 ), myD( 0 ) {}
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space....

References myCC, and myD.

Referenced by CubicalComplex, and equal().

◆ Iterator() [2/3]

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

Constructor from complex cc and cell dimension d.

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

Definition at line 435 of file CubicalComplex.h.

436 : myCC( &cc ), myD( d )
437 {
439 {
440 myIt = myCC->begin( myD );
441 myItEnd = myCC->end( myD );
443 }
444 else
445 {
446 myD = myCC->dimension + 1;
447 myIt = myCC->end( myCC->dimension );
449 }
450 }
ConstIterator end() const
static const Dimension dimension
The dimension of the embedding space.
ConstIterator begin() const

References dimension(), myCC, myD, myIt, myItEnd, and nextDimension().

◆ Iterator() [3/3]

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::Iterator ( Alias< CubicalComplex > cc,
Dimension d,
CellMapIterator 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 459 of file CubicalComplex.h.

461 : myCC( &cc ), myD( d ), myIt( it )
462 {
464 myItEnd = myCC->end( d );
466 }

References dimension(), myCC, myD, myIt, myItEnd, and nextDimension().

Member Function Documentation

◆ dereference()

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

Definition at line 493 of file CubicalComplex.h.

494 {
495 return myIt->first;
496 }

References myIt.

◆ dimension()

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

Definition at line 498 of file CubicalComplex.h.

499 {
500 return myD;
501 }

References myD.

Referenced by Iterator(), and Iterator().

◆ equal()

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

Definition at line 488 of file CubicalComplex.h.

489 {
490 return ( myD == other.myD ) && ( myIt == other.myIt );
491 }

References Iterator(), myD, and myIt.

◆ increment()

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

Definition at line 481 of file CubicalComplex.h.

482 {
483 ASSERT( myCC != 0 );
484 ++myIt;
486 }

References myCC, myIt, and nextDimension().

◆ nextDimension()

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

Definition at line 471 of file CubicalComplex.h.

472 {
473 while ( myIt == myItEnd )
474 {
475 if ( ++myD > myCC->dimension ) break;
476 myIt = myCC->begin( myD );
477 myItEnd = myCC->end( myD );
478 }
479 }

References myCC, myD, myIt, and myItEnd.

Referenced by increment(), Iterator(), and Iterator().

◆ 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 469 of file CubicalComplex.h.

References boost::iterator_core_access.

Referenced by boost::iterator_core_access.

◆ CubicalComplex

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

Definition at line 415 of file CubicalComplex.h.

References CubicalComplex, and Iterator().

Referenced by CubicalComplex.

Field Documentation

◆ myCC

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

Definition at line 504 of file CubicalComplex.h.

Referenced by increment(), Iterator(), Iterator(), Iterator(), and nextDimension().

◆ myD

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

Definition at line 505 of file CubicalComplex.h.

Referenced by dimension(), equal(), Iterator(), Iterator(), Iterator(), and nextDimension().

◆ myIt

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

Definition at line 506 of file CubicalComplex.h.

Referenced by dereference(), equal(), increment(), Iterator(), Iterator(), and nextDimension().

◆ myItEnd

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

Definition at line 507 of file CubicalComplex.h.

Referenced by Iterator(), Iterator(), and nextDimension().


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