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 LineIterator &rhs)
 Copy constructor. More...
 
 LineIterator (const te::rst::Raster *r, const te::gm::Line *l)
 Constructor. More...
 
bool operator!= (const AbstractPositionIterator< T > &rhs) const
 Difference operator. More...
 
bool operator!= (const LineIterator< T > &rhs) const
 
std::complex< T > operator() (const unsigned int i) const
 Returns the complex value in current position (column, row, band) from iterator. More...
 
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...
 
AbstractPositionIterator< T > & operator= (const AbstractPositionIterator< T > &rhs)
 Assignment operator. More...
 
LineIteratoroperator= (const LineIterator &rhs)
 
operator[] (const unsigned int i) const
 Returns the real 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...
 
double m_operatorBrackets_value
 Used by the operator[] method. More...
 
std::complex< double > m_operatorParenthesis_value
 Used by the operator() method. 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<typename 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 325 of file PositionIterator.h.

Constructor & Destructor Documentation

◆ LineIterator() [1/3]

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

Definition at line 1279 of file PositionIterator.h.

◆ LineIterator() [2/3]

◆ LineIterator() [3/3]

template<typename 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 1350 of file PositionIterator.h.

◆ ~LineIterator()

template<typename T >
te::rst::LineIterator< T >::~LineIterator

Definition at line 1357 of file PositionIterator.h.

Member Function Documentation

◆ begin()

template<typename 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 1442 of file PositionIterator.h.

◆ end()

template<typename 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 1447 of file PositionIterator.h.

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

◆ getColumn()

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

Returns the current column in iterator.

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

Definition at line 1395 of file PositionIterator.h.

◆ getRow()

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

Returns the current row in iterator.

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

Definition at line 1390 of file PositionIterator.h.

◆ operator!=() [1/2]

template<typename T >
bool te::rst::LineIterator< T >::operator!= ( const AbstractPositionIterator< T > &  rhs) const
virtual

Difference operator.

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

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

Definition at line 1462 of file PositionIterator.h.

References operator!=().

◆ operator!=() [2/2]

template<typename T >
bool te::rst::LineIterator< T >::operator!= ( const LineIterator< T > &  rhs) const

◆ operator()()

template<typename T >
std::complex< T > te::rst::LineIterator< T >::operator() ( const unsigned int  i) const
virtual

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

Parameters
iThe band index.
Returns
The pixel comples value in current position.
Note
For real values use operator[]

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

Definition at line 1383 of file PositionIterator.h.

◆ operator*()

template<typename 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 1362 of file PositionIterator.h.

◆ operator++()

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

Advances to the next position.

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

Definition at line 1400 of file PositionIterator.h.

◆ operator--()

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

Returns to the previous position.

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

Definition at line 1408 of file PositionIterator.h.

◆ operator=() [1/2]

template<typename T >
AbstractPositionIterator< T > & te::rst::LineIterator< T >::operator= ( const AbstractPositionIterator< T > &  rhs)
virtual

Assignment operator.

Parameters
rhsThe right-hand-side copy used to copy from.
Returns
A reference to this object.

Reimplemented from te::rst::AbstractPositionIterator< T >.

Definition at line 1431 of file PositionIterator.h.

◆ operator=() [2/2]

◆ operator[]()

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

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

Parameters
iThe band index.
Returns
The pixel real value in current position.
Note
For complex values use operator()

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

Definition at line 1376 of file PositionIterator.h.

◆ setEnd()

template<typename 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 1437 of file PositionIterator.h.

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

Member Data Documentation

◆ m_currentpixelindex

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

The index of the current pixel location.

Definition at line 382 of file PositionIterator.h.

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

◆ m_line

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

The spatial restriction to be applied in the iterator.

Definition at line 381 of file PositionIterator.h.

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

◆ m_operatorBrackets_value

template<typename T >
double te::rst::LineIterator< T >::m_operatorBrackets_value
mutableprotected

Used by the operator[] method.

Definition at line 384 of file PositionIterator.h.

◆ m_operatorParenthesis_value

template<typename T >
std::complex< double > te::rst::LineIterator< T >::m_operatorParenthesis_value
mutableprotected

Used by the operator() method.

Definition at line 385 of file PositionIterator.h.

◆ m_pixelsinline

template<typename 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 383 of file PositionIterator.h.

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

◆ m_raster

template<typename T >
const te::rst::Raster* te::rst::LineIterator< T >::m_raster
protected

The band from where to get the values.

Definition at line 380 of file PositionIterator.h.

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


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