DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Attributes | Friends
DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator Class Reference

#include <ImageContainerBySTLVector.h>

Public Types

typedef
std::bidirectional_iterator_tag 
iterator_category
typedef Value value_type
typedef ptrdiff_t difference_type
typedef Valuepointer
typedef Valuereference

Public Member Functions

 SpanIterator (const Point &p, const Dimension aDim, ImageContainerBySTLVector< Domain, Value > *aMap)
void setValue (const Value aVal)
const Valueoperator* ()
bool operator== (const SpanIterator &it) const
bool operator!= (const SpanIterator &it) const
void next ()
void prev ()
SpanIteratoroperator++ ()
SpanIteratoroperator++ (int)
SpanIteratoroperator-- ()
SpanIteratoroperator-- (int)

Private Attributes

Size myPos
ImageContainerBySTLVector
< Domain, Value > * 
myMap
Dimension myDimension
Size myShift

Friends

class ImageContainerBySTLVector< Domain, Value >

Detailed Description

template<typename TDomain, typename TValue>
class DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator

Specific SpanIterator on ImageContainerBySTLVector.

Template Parameters:
Domainthe HyperRectDomain on which the iterator iterates.
Value

Definition at line 299 of file ImageContainerBySTLVector.h.


Member Typedef Documentation

template<typename TDomain, typename TValue>
typedef ptrdiff_t DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::difference_type

Definition at line 309 of file ImageContainerBySTLVector.h.

template<typename TDomain, typename TValue>
typedef std::bidirectional_iterator_tag DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::iterator_category
Todo:
construct a RANDOM-ACCESS iterator

Definition at line 307 of file ImageContainerBySTLVector.h.

template<typename TDomain, typename TValue>
typedef Value* DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::pointer

Definition at line 310 of file ImageContainerBySTLVector.h.

template<typename TDomain, typename TValue>
typedef Value& DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::reference

Definition at line 311 of file ImageContainerBySTLVector.h.

template<typename TDomain, typename TValue>
typedef Value DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::value_type

Definition at line 308 of file ImageContainerBySTLVector.h.


Constructor & Destructor Documentation

template<typename TDomain, typename TValue>
DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::SpanIterator ( const Point p,
const Dimension  aDim,
ImageContainerBySTLVector< Domain, Value > *  aMap 
)
inline

Constructor.

Parameters:
pstarting point of the SpanIterator
aDimspecifies the dimension along which the iterator will iterate
aMappointer to the imageContainer

Definition at line 320 of file ImageContainerBySTLVector.h.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::linearized(), DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myDimension, DGtal::ImageContainerBySTLVector< TDomain, TValue >::myExtent, DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myPos, and DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myShift.

: myMap ( aMap ), myDimension ( aDim )
{
myPos = aMap->linearized ( p );
//We compute the myShift quantity
myShift = 1;
for ( Dimension k = 0; k < myDimension ; k++ )
myShift *= aMap->myExtent[k];
}

Member Function Documentation

template<typename TDomain, typename TValue>
void DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::next ( )
inline
template<typename TDomain, typename TValue>
bool DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator!= ( const SpanIterator it) const
inline

Operator !=

Returns:
true if this and it are different.

Definition at line 373 of file ImageContainerBySTLVector.h.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myPos.

{
return ( myPos != it.myPos );
}
template<typename TDomain, typename TValue>
const Value& DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator* ( )
inline

operator* on SpanIterators.

Returns:
the value associated to the current position.

Definition at line 351 of file ImageContainerBySTLVector.h.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myMap, and DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myPos.

{
return ( *myMap ) [ myPos ];
}
template<typename TDomain, typename TValue>
SpanIterator& DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator++ ( )
inline

Operator ++ (++it)

Definition at line 404 of file ImageContainerBySTLVector.h.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::next().

{
this->next();
return *this;
}
template<typename TDomain, typename TValue>
SpanIterator& DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator++ ( int  )
inline

Operator ++ (it++)

Definition at line 415 of file ImageContainerBySTLVector.h.

{
SpanIterator tmp = *this;
++*this;
return tmp;
}
template<typename TDomain, typename TValue>
SpanIterator& DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator-- ( )
inline

Operator – (–it)

Definition at line 427 of file ImageContainerBySTLVector.h.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::prev().

{
this->prev();
return *this;
}
template<typename TDomain, typename TValue>
SpanIterator& DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator-- ( int  )
inline

Operator – (it–)

Definition at line 438 of file ImageContainerBySTLVector.h.

{
SpanIterator tmp = *this;
--*this;
return tmp;
}
template<typename TDomain, typename TValue>
bool DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator== ( const SpanIterator it) const
inline

Operator ==.

Returns:
true if this and it are equals.

Definition at line 362 of file ImageContainerBySTLVector.h.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myPos.

{
return ( myPos == it.myPos );
}
template<typename TDomain, typename TValue>
void DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::prev ( )
inline
template<typename TDomain, typename TValue>
void DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::setValue ( const Value  aVal)
inline

Set a value at a SpanIterator position.

Parameters:
aValthe value to set.

Definition at line 340 of file ImageContainerBySTLVector.h.

References DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myPos.

{
( *myMap ) [ myPos ] = aVal;
}

Friends And Related Function Documentation

template<typename TDomain, typename TValue>
friend class ImageContainerBySTLVector< Domain, Value >
friend

Definition at line 302 of file ImageContainerBySTLVector.h.


Field Documentation

template<typename TDomain, typename TValue>
Dimension DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myDimension
private

Dimension on which the iterator must iterate.

Definition at line 453 of file ImageContainerBySTLVector.h.

Referenced by DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::SpanIterator().

template<typename TDomain, typename TValue>
ImageContainerBySTLVector<Domain, Value>* DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myMap
private

Copy of the underlying images.

Definition at line 450 of file ImageContainerBySTLVector.h.

Referenced by DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::operator*().

template<typename TDomain, typename TValue>
Size DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myPos
private
template<typename TDomain, typename TValue>
Size DGtal::ImageContainerBySTLVector< TDomain, TValue >::SpanIterator::myShift
private

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