DGtal  0.9.3beta
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:
[legend]
Collaboration diagram for DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator:
[legend]

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 ()
 
 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 279 of file CubicalComplex.h.

Member Typedef Documentation

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

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

Definition at line 291 of file CubicalComplex.h.

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

Definition at line 289 of file CubicalComplex.h.

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

Definition at line 290 of file CubicalComplex.h.

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

Definition at line 287 of file CubicalComplex.h.

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

Definition at line 288 of file CubicalComplex.h.

Constructor & Destructor Documentation

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

Default iterator. Invalid.

Definition at line 294 of file CubicalComplex.h.

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

References DGtal::CubicalComplex< TKSpace, TCellContainer >::begin(), DGtal::CubicalComplex< TKSpace, TCellContainer >::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().

305  : myCC( &cc ), myD( d )
306  {
307  if ( myD <= myCC->dimension )
308  {
309  myIt = myCC->begin( myD );
310  myItEnd = myCC->end( myD );
311  nextDimension();
312  }
313  else
314  {
315  myD = myCC->dimension + 1;
316  myIt = myCC->end( myCC->dimension );
317  myItEnd = myCC->end( myCC->dimension );
318  }
319  }
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 >::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 328 of file CubicalComplex.h.

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

330  : myCC( &cc ), myD( d ), myIt( it )
331  {
332  ASSERT( d <= myCC->dimension );
333  myItEnd = myCC->end( d );
334  nextDimension();
335  }
ConstIterator end() const

Member Function Documentation

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

Definition at line 362 of file CubicalComplex.h.

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

363  {
364  return myIt->first;
365  }
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::dimension ( ) const
inlineprivate

Definition at line 367 of file CubicalComplex.h.

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

368  {
369  return myD;
370  }
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::equal ( const ConstIterator other) const
inlineprivate
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::increment ( )
inlineprivate
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::nextDimension ( )
inlineprivate

Definition at line 340 of file CubicalComplex.h.

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

Referenced by DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::ConstIterator(), and DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::increment().

341  {
342  while ( myIt == myItEnd )
343  {
344  if ( ++myD > myCC->dimension ) break;
345  myIt = myCC->begin( myD );
346  myItEnd = myCC->end( myD );
347  }
348  }
ConstIterator begin() const
ConstIterator end() const
static const Dimension dimension
The dimension of the embedding space.

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

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

Definition at line 283 of file CubicalComplex.h.

Field Documentation

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
const CubicalComplex* DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myCC
private
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myD
private
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::myIt
private
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: