DGtal  0.9.3beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator Struct Reference

#include <DGtal/topology/CubicalComplex.h>

Inheritance diagram for DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator:
[legend]
Collaboration 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 ()
 
 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 384 of file CubicalComplex.h.

Member Typedef Documentation

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

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

Definition at line 396 of file CubicalComplex.h.

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

Definition at line 394 of file CubicalComplex.h.

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

Definition at line 395 of file CubicalComplex.h.

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

Definition at line 392 of file CubicalComplex.h.

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

Definition at line 393 of file CubicalComplex.h.

Constructor & Destructor Documentation

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

Default iterator. Invalid.

Definition at line 399 of file CubicalComplex.h.

399 : myCC( 0 ), myD( 0 ) {}
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 408 of file CubicalComplex.h.

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

409  : myCC( &cc ), myD( d )
410  {
411  if ( myD <= myCC->dimension )
412  {
413  myIt = myCC->begin( myD );
414  myItEnd = myCC->end( myD );
415  nextDimension();
416  }
417  else
418  {
419  myD = myCC->dimension + 1;
420  myIt = myCC->end( myCC->dimension );
421  myItEnd = myCC->end( myCC->dimension );
422  }
423  }
ConstIterator begin() const
ConstIterator end() const
static const Dimension dimension
The dimension of the embedding space.
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 432 of file CubicalComplex.h.

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

434  : myCC( &cc ), myD( d ), myIt( it )
435  {
436  ASSERT( d <= myCC->dimension );
437  myItEnd = myCC->end( d );
438  nextDimension();
439  }
ConstIterator end() const

Member Function Documentation

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

Definition at line 466 of file CubicalComplex.h.

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

467  {
468  return myIt->first;
469  }
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::dimension ( ) const
inlineprivate

Definition at line 471 of file CubicalComplex.h.

References DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::myD.

472  {
473  return myD;
474  }
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 461 of file CubicalComplex.h.

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

462  {
463  return ( myD == other.myD ) && ( myIt == other.myIt );
464  }
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::increment ( )
inlineprivate
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::nextDimension ( )
inlineprivate

Friends And Related Function Documentation

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

Definition at line 442 of file CubicalComplex.h.

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

Definition at line 388 of file CubicalComplex.h.

Field Documentation

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CubicalComplex* DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::myCC
private
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::myD
private
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::myIt
private
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::myItEnd
private

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