DGtal  0.9.4beta
Public Types | Public Member Functions | Private Attributes
DGtal::SetValueIterator< TImage, TIteratorOnPts > Class Template Reference

#include <DGtal/images/SetValueIterator.h>

Inheritance diagram for DGtal::SetValueIterator< TImage, TIteratorOnPts >:
[legend]
Collaboration diagram for DGtal::SetValueIterator< TImage, TIteratorOnPts >:
[legend]

Public Types

typedef TImage Image
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CTrivialImage< Image >))
 
 SetValueIterator (const TIteratorOnPts &aItOnPts, Image &aImg)
 
 SetValueIterator (Image &aImg)
 
 SetValueIterator (const SetValueIterator &other)
 
 ~SetValueIterator ()
 
SetValueIteratoroperator= (const typename Image::Value &aValue)
 
SetValueIteratoroperator* ()
 
SetValueIteratoroperator++ ()
 
SetValueIterator operator++ (int)
 

Private Attributes

ImagemyImg
 
TIteratorOnPts myItOnPts
 

Detailed Description

template<typename TImage, typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
class DGtal::SetValueIterator< TImage, TIteratorOnPts >

Aim: implements an output iterator, which is able to write values in an underlying image, by calling its setValue method.

Description of template class 'SetValueIterator'

Template Parameters
TImagea model of CSetValueImage

Definition at line 67 of file SetValueIterator.h.

Member Typedef Documentation

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
typedef TImage DGtal::SetValueIterator< TImage, TIteratorOnPts >::Image

Definition at line 73 of file SetValueIterator.h.

Constructor & Destructor Documentation

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::SetValueIterator ( const TIteratorOnPts &  aItOnPts,
Image aImg 
)
inline

Constructor.

Parameters
aItOnPtsan iterator on points
aImgany image passed by reference

Definition at line 84 of file SetValueIterator.h.

85 : myImg(&aImg), myItOnPts(aItOnPts) {}
template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::SetValueIterator ( Image aImg)
inline

Overloaded constructor, which can be used with the default template argument.

Parameters
aImgany image passed by reference

Definition at line 92 of file SetValueIterator.h.

93 : myImg(&aImg), myItOnPts(myImg->domain().begin()) {}
template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::SetValueIterator ( const SetValueIterator< TImage, TIteratorOnPts > &  other)
inline

Copy constructor.

Parameters
otherthe object to clone.

Definition at line 99 of file SetValueIterator.h.

100 : myImg(other.myImg), myItOnPts(other.myItOnPts) {}
template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::~SetValueIterator ( )
inline

Destructor.

Definition at line 105 of file SetValueIterator.h.

105 {}

Member Function Documentation

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
DGtal::SetValueIterator< TImage, TIteratorOnPts >::BOOST_CONCEPT_ASSERT ( (concepts::CTrivialImage< Image >)  )
template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator& DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator* ( )
inline

Dereference operator

Returns
a reference to *this

Definition at line 125 of file SetValueIterator.h.

125 { return *this; }
template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator& DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator++ ( )
inline

Pre-increment operator

Returns
a reference to *this

Definition at line 131 of file SetValueIterator.h.

References DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts.

131 { ++myItOnPts; return *this; }
template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator++ ( int  )
inline

Post-increment operator

Returns
*this

Definition at line 137 of file SetValueIterator.h.

References DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts.

138  {
139  SetValueIterator tmp = *this;
140  ++myItOnPts;
141  return tmp;
142  }
SetValueIterator(const TIteratorOnPts &aItOnPts, Image &aImg)
template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
SetValueIterator& DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator= ( const typename Image::Value aValue)
inline

Assignment

Parameters
aValueany value
Returns
a reference to *this

Definition at line 115 of file SetValueIterator.h.

References DGtal::SetValueIterator< TImage, TIteratorOnPts >::myImg, and DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts.

116  {
117  myImg->setValue( *myItOnPts, aValue );
118  return *this;
119  }

Field Documentation

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
Image* DGtal::SetValueIterator< TImage, TIteratorOnPts >::myImg
private

Aliasing pointer on the underlying image

Definition at line 161 of file SetValueIterator.h.

Referenced by DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator=().

template<typename TImage , typename TIteratorOnPts = typename TImage::Domain::ConstIterator>
TIteratorOnPts DGtal::SetValueIterator< TImage, TIteratorOnPts >::myItOnPts
private

Iterator on points that scan the domain of the underlying image

Definition at line 166 of file SetValueIterator.h.

Referenced by DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator++(), and DGtal::SetValueIterator< TImage, TIteratorOnPts >::operator=().


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