DGtal  0.9.3beta
Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::PreCellDirectionIterator< dim, TInteger > Class Template Reference

#include <DGtal/topology/KhalimskyPreSpaceND.h>

Collaboration diagram for DGtal::PreCellDirectionIterator< dim, TInteger >:
[legend]

Public Types

typedef TInteger Integer
 
typedef KhalimskyPreCell< dim, IntegerCell
 
typedef SignedKhalimskyPreCell< dim, IntegerSCell
 

Public Member Functions

 PreCellDirectionIterator (Cell cell, bool open=true)
 
 PreCellDirectionIterator (SCell scell, bool open=true)
 
Dimension operator* () const
 
PreCellDirectionIteratoroperator++ ()
 
bool operator!= (const Integer) const
 
bool end () const
 
bool operator!= (const PreCellDirectionIterator &other) const
 
bool operator== (const PreCellDirectionIterator &other) const
 

Private Member Functions

void find ()
 

Private Attributes

Dimension myDir
 
Cell myCell
 
bool myOpen
 

Detailed Description

template<Dimension dim, typename TInteger = DGtal::int32_t>
class DGtal::PreCellDirectionIterator< dim, TInteger >

This class is useful for looping on all "interesting" coordinates of a pre-cell. For instance, surfels in Z3 have two interesting coordinates (the ones spanned by the surfel).

KPreSpace::Cell p;
KPreSpace::DirIterator q;
for ( q = KPreSpace::uDirs( p ); q != 0; ++q )
{
KPreSpace::Dimension dir = *q;
...
}

Definition at line 276 of file KhalimskyPreSpaceND.h.

Member Typedef Documentation

template<Dimension dim, typename TInteger = DGtal::int32_t>
typedef KhalimskyPreCell< dim, Integer > DGtal::PreCellDirectionIterator< dim, TInteger >::Cell

Definition at line 281 of file KhalimskyPreSpaceND.h.

template<Dimension dim, typename TInteger = DGtal::int32_t>
typedef TInteger DGtal::PreCellDirectionIterator< dim, TInteger >::Integer

Definition at line 279 of file KhalimskyPreSpaceND.h.

template<Dimension dim, typename TInteger = DGtal::int32_t>
typedef SignedKhalimskyPreCell< dim, Integer > DGtal::PreCellDirectionIterator< dim, TInteger >::SCell

Definition at line 282 of file KhalimskyPreSpaceND.h.

Constructor & Destructor Documentation

template<Dimension dim, typename TInteger = DGtal::int32_t>
DGtal::PreCellDirectionIterator< dim, TInteger >::PreCellDirectionIterator ( Cell  cell,
bool  open = true 
)
explicit

Constructor from a pre-cell.

Parameters
cellany unsigned pre-cell
open'true' if the cell if open.
template<Dimension dim, typename TInteger = DGtal::int32_t>
DGtal::PreCellDirectionIterator< dim, TInteger >::PreCellDirectionIterator ( SCell  scell,
bool  open = true 
)
explicit

Constructor from a signed pre-cell.

Parameters
scellany signed pre-cell
open'true' if the cell if open.

Member Function Documentation

template<Dimension dim, typename TInteger = DGtal::int32_t>
bool DGtal::PreCellDirectionIterator< dim, TInteger >::end ( ) const
Returns
'true' if the iteration is ended.
template<Dimension dim, typename TInteger = DGtal::int32_t>
void DGtal::PreCellDirectionIterator< dim, TInteger >::find ( )
private

Look for next valid coordinate.

template<Dimension dim, typename TInteger = DGtal::int32_t>
bool DGtal::PreCellDirectionIterator< dim, TInteger >::operator!= ( const Integer  ) const

Fast comparison with unsigned integer (unused parameter). Comparison is 'false' at the end of the iteration.

Returns
'true' if the iterator is finished.
template<Dimension dim, typename TInteger = DGtal::int32_t>
bool DGtal::PreCellDirectionIterator< dim, TInteger >::operator!= ( const PreCellDirectionIterator< dim, TInteger > &  other) const

Slow comparison with other iterator. Useful to check for end of loop.

Parameters
otherany direction iterator.
template<Dimension dim, typename TInteger = DGtal::int32_t>
Dimension DGtal::PreCellDirectionIterator< dim, TInteger >::operator* ( ) const
Returns
the current direction.
template<Dimension dim, typename TInteger = DGtal::int32_t>
PreCellDirectionIterator& DGtal::PreCellDirectionIterator< dim, TInteger >::operator++ ( )

Pre-increment. Go to next direction.

template<Dimension dim, typename TInteger = DGtal::int32_t>
bool DGtal::PreCellDirectionIterator< dim, TInteger >::operator== ( const PreCellDirectionIterator< dim, TInteger > &  other) const

Slow comparison with other iterator.

Parameters
otherany direction iterator.

Field Documentation

template<Dimension dim, typename TInteger = DGtal::int32_t>
Cell DGtal::PreCellDirectionIterator< dim, TInteger >::myCell
private

the cell.

Definition at line 338 of file KhalimskyPreSpaceND.h.

template<Dimension dim, typename TInteger = DGtal::int32_t>
Dimension DGtal::PreCellDirectionIterator< dim, TInteger >::myDir
private

the current direction.

Definition at line 336 of file KhalimskyPreSpaceND.h.

template<Dimension dim, typename TInteger = DGtal::int32_t>
bool DGtal::PreCellDirectionIterator< dim, TInteger >::myOpen
private

If 'true', returns open coordinates, otherwise returns closed coordinates.

Definition at line 341 of file KhalimskyPreSpaceND.h.


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