te::rst::LineIterator< T > Class Template Reference

This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a line. More...

#include <PositionIterator.h>

Inheritance diagram for te::rst::LineIterator< T >:
te::rst::AbstractPositionIterator< T >

Public Member Functions

unsigned int getColumn () const
 Returns the current column in iterator. More...
 
unsigned int getRow () const
 Returns the current row in iterator. More...
 
 LineIterator ()
 
 LineIterator (const te::rst::Raster *r, const te::gm::Line *l)
 Constructor. More...
 
 LineIterator (const LineIterator &rhs)
 Copy constructor. More...
 
virtual bool operator!= (const AbstractPositionIterator &rhs) const
 Difference operator. More...
 
bool operator!= (const LineIterator< T > &rhs) const
 
const std::vector< T > operator* () const
 Returns a vector of the values in current position (column, row) from iterator. More...
 
void operator++ ()
 Advances to the next position. More...
 
void operator-- ()
 Returns to the previous position. More...
 
LineIteratoroperator= (const LineIterator &rhs)
 
operator[] (const unsigned int i) const
 Returns the value in current position (column, row, band) from iterator. More...
 
void setEnd ()
 Sets the iterator position to the end of the current band. More...
 
 ~LineIterator ()
 

Static Public Member Functions

static LineIterator begin (const te::rst::Raster *r, const te::gm::Line *l)
 Returns an iterator referring to the first value of the band. More...
 
static LineIterator end (const te::rst::Raster *r, const te::gm::Line *l)
 Returns an iterator referring to after the end of the iterator. More...
 

Protected Attributes

int m_currentpixelindex
 The index of the current pixel location. More...
 
const te::gm::Linem_line
 The spatial restriction to be applied in the iterator. More...
 
std::vector< te::gm::Point * > m_pixelsinline
 A vector of pixel locations that intersects the line. More...
 
const te::rst::Rasterm_raster
 The band from where to get the values. More...
 

Detailed Description

template<class T>
class te::rst::LineIterator< T >

This class implements the strategy to iterate with spatial restriction, the iteration occurs inside a line.

Definition at line 229 of file PositionIterator.h.

Constructor & Destructor Documentation

template<class T >
te::rst::LineIterator< T >::LineIterator ( )

Definition at line 766 of file PositionIterator.h.

template<class T >
te::rst::LineIterator< T >::LineIterator ( const LineIterator< T > &  rhs)

Copy constructor.

Parameters
rhsThe right-hand-side copy used to copy from.

Definition at line 829 of file PositionIterator.h.

template<class T >
te::rst::LineIterator< T >::~LineIterator ( )

Definition at line 836 of file PositionIterator.h.

Member Function Documentation

template<class T >
te::rst::LineIterator< T > te::rst::LineIterator< T >::begin ( const te::rst::Raster r,
const te::gm::Line l 
)
static

Returns an iterator referring to the first value of the band.

Definition at line 908 of file PositionIterator.h.

template<class T >
te::rst::LineIterator< T > te::rst::LineIterator< T >::end ( const te::rst::Raster r,
const te::gm::Line l 
)
static

Returns an iterator referring to after the end of the iterator.

Definition at line 913 of file PositionIterator.h.

References te::rst::LineIterator< T >::setEnd().

template<class T >
unsigned int te::rst::LineIterator< T >::getColumn ( ) const
virtual

Returns the current column in iterator.

Implements te::rst::AbstractPositionIterator< T >.

Definition at line 868 of file PositionIterator.h.

template<class T >
unsigned int te::rst::LineIterator< T >::getRow ( ) const
virtual

Returns the current row in iterator.

Implements te::rst::AbstractPositionIterator< T >.

Definition at line 863 of file PositionIterator.h.

template<class T >
bool te::rst::AbstractPositionIterator< T >::operator!= ( const AbstractPositionIterator< T > &  rhs) const
virtualinherited

Difference operator.

Parameters
rhsThe right-hand side to compare.
Returns
Returns true if the iterators are at different positions, or false otherwise.

Definition at line 373 of file PositionIterator.h.

References te::rst::AbstractPositionIterator< T >::m_raster.

template<class T >
bool te::rst::LineIterator< T >::operator!= ( const LineIterator< T > &  rhs) const
template<class T >
const std::vector< T > te::rst::LineIterator< T >::operator* ( ) const
virtual

Returns a vector of the values in current position (column, row) from iterator.

Implements te::rst::AbstractPositionIterator< T >.

Definition at line 841 of file PositionIterator.h.

template<class T >
void te::rst::LineIterator< T >::operator++ ( )
virtual

Advances to the next position.

Implements te::rst::AbstractPositionIterator< T >.

Definition at line 873 of file PositionIterator.h.

template<class T >
void te::rst::LineIterator< T >::operator-- ( )
virtual

Returns to the previous position.

Implements te::rst::AbstractPositionIterator< T >.

Definition at line 881 of file PositionIterator.h.

template<class T >
T te::rst::LineIterator< T >::operator[] ( const unsigned int  i) const
virtual

Returns the value in current position (column, row, band) from iterator.

Parameters
iThe band index.
Returns
The pixel value in current position.

Implements te::rst::AbstractPositionIterator< T >.

Definition at line 855 of file PositionIterator.h.

template<class T >
void te::rst::LineIterator< T >::setEnd ( )
virtual

Sets the iterator position to the end of the current band.

Parameters
bThe band to retrieve the end information.

Implements te::rst::AbstractPositionIterator< T >.

Definition at line 903 of file PositionIterator.h.

Referenced by te::rst::LineIterator< T >::end(), and te::rst::LineIterator< T >::LineIterator().

Member Data Documentation

template<class T>
int te::rst::LineIterator< T >::m_currentpixelindex
protected

The index of the current pixel location.

Definition at line 279 of file PositionIterator.h.

Referenced by te::rst::LineIterator< T >::operator!=(), and te::rst::LineIterator< T >::operator=().

template<class T>
const te::gm::Line* te::rst::LineIterator< T >::m_line
protected

The spatial restriction to be applied in the iterator.

Definition at line 278 of file PositionIterator.h.

Referenced by te::rst::LineIterator< T >::LineIterator(), and te::rst::LineIterator< T >::operator=().

template<class T>
std::vector<te::gm::Point*> te::rst::LineIterator< T >::m_pixelsinline
protected

A vector of pixel locations that intersects the line.

Definition at line 280 of file PositionIterator.h.

Referenced by te::rst::LineIterator< T >::LineIterator(), and te::rst::LineIterator< T >::operator=().


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