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

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

#include <PositionIterator.h>

Inheritance diagram for te::rst::PolygonIterator< 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...
 
bool operator!= (const PolygonIterator< T > &rhs) const
 
bool operator!= (const AbstractPositionIterator< T > &rhs) const
 Difference operator. More...
 
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...
 
PolygonIteratoroperator= (const PolygonIterator &rhs)
 
AbstractPositionIterator< T > & operator= (const AbstractPositionIterator< T > &rhs)
 Assignment operator. More...
 
operator[] (const unsigned int i) const
 Returns the real value in current position (column, row, band) from iterator. More...
 
 PolygonIterator ()
 
 PolygonIterator (const te::rst::Raster *r, const te::gm::Polygon *p)
 Constructor. More...
 
 PolygonIterator (const PolygonIterator &rhs)
 Copy constructor. More...
 
void setEnd ()
 Sets the iterator position to the end of the current band. More...
 
void setNextLine (bool updatecurrline=true)
 
 ~PolygonIterator ()
 

Static Public Member Functions

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

Protected Member Functions

void clear ()
 Clear all internal allocated objects and reset back to the initial state. More...
 

Protected Attributes

int m_actualintersection
 The actual line of the iterator. More...
 
int m_column
 The current column of the iterator. More...
 
std::vector< std::pair< int, int > > m_columns
 Coordinates of the columns to be transversed. More...
 
te::gm::Linem_currline
 The current line in the iterator. More...
 
int m_endingcolumn
 The column (in current line) to finalize the iteration. More...
 
int m_endingrow
 The ending row of the iteration. More...
 
int m_maxcolumns
 The number of columns in band. More...
 
int m_maxrows
 The number of rows in band. More...
 
int m_nintersections
 The number number of intersected lines in current line of the iterator. More...
 
double m_operatorBrackets_value
 
std::complex< double > m_operatorParenthesis_value
 
const te::gm::Polygonm_polygon
 The spatial restriction to be applied in the iterator. More...
 
const te::rst::Rasterm_raster
 The band from where to get the values. More...
 
int m_row
 The current row of the iterator. More...
 
int m_startingcolumn
 The starting column (in current line) to initialize the iteration. More...
 
int m_startingrow
 The starting row of the iteration. More...
 
std::unique_ptr< te::rst::TileIndexerm_tileIndexer
 Tile indexer used to optimize the geometric operations. More...
 

Detailed Description

template<typename T>
class te::rst::PolygonIterator< T >

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

Definition at line 156 of file PositionIterator.h.

Constructor & Destructor Documentation

◆ PolygonIterator() [1/3]

template<typename T >
te::rst::PolygonIterator< T >::PolygonIterator ( )

Definition at line 407 of file PositionIterator.h.

◆ PolygonIterator() [2/3]

◆ PolygonIterator() [3/3]

template<typename T >
te::rst::PolygonIterator< T >::PolygonIterator ( const PolygonIterator< T > &  rhs)

Copy constructor.

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

Definition at line 506 of file PositionIterator.h.

References te::rst::PolygonIterator< T >::operator=().

◆ ~PolygonIterator()

template<typename T >
te::rst::PolygonIterator< T >::~PolygonIterator ( )

Definition at line 524 of file PositionIterator.h.

Member Function Documentation

◆ begin()

template<typename T >
te::rst::PolygonIterator< T > te::rst::PolygonIterator< T >::begin ( const te::rst::Raster r,
const te::gm::Polygon p 
)
static

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

Definition at line 962 of file PositionIterator.h.

◆ clear()

template<typename T >
void te::rst::PolygonIterator< T >::clear ( )
protected

Clear all internal allocated objects and reset back to the initial state.

Definition at line 988 of file PositionIterator.h.

◆ end()

template<typename T >
te::rst::PolygonIterator< T > te::rst::PolygonIterator< T >::end ( const te::rst::Raster r,
const te::gm::Polygon p 
)
static

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

Definition at line 967 of file PositionIterator.h.

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

◆ getColumn()

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

Returns the current column in iterator.

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

Definition at line 858 of file PositionIterator.h.

◆ getRow()

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

Returns the current row in iterator.

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

Definition at line 853 of file PositionIterator.h.

◆ operator!=() [1/2]

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

◆ operator!=() [2/2]

template<typename T >
bool te::rst::PolygonIterator< 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 982 of file PositionIterator.h.

References operator!=().

◆ operator()()

template<typename T >
std::complex< T > te::rst::PolygonIterator< 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 846 of file PositionIterator.h.

◆ operator*()

template<typename T >
const std::vector< T > te::rst::PolygonIterator< 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 825 of file PositionIterator.h.

◆ operator++()

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

Advances to the next position.

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

Definition at line 863 of file PositionIterator.h.

◆ operator--()

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

Returns to the previous position.

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

Definition at line 887 of file PositionIterator.h.

References TE_TR.

◆ operator=() [1/2]

◆ operator=() [2/2]

template<typename T >
AbstractPositionIterator< T > & te::rst::PolygonIterator< 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 950 of file PositionIterator.h.

◆ operator[]()

template<typename T >
T te::rst::PolygonIterator< 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 839 of file PositionIterator.h.

◆ setEnd()

template<typename T >
void te::rst::PolygonIterator< 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 956 of file PositionIterator.h.

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

◆ setNextLine()

Member Data Documentation

◆ m_actualintersection

template<typename T>
int te::rst::PolygonIterator< T >::m_actualintersection
protected

The actual line of the iterator.

Definition at line 225 of file PositionIterator.h.

Referenced by te::rst::PolygonIterator< T >::operator=().

◆ m_column

template<typename T>
int te::rst::PolygonIterator< T >::m_column
protected

◆ m_columns

template<typename T>
std::vector<std::pair<int, int> > te::rst::PolygonIterator< T >::m_columns
protected

Coordinates of the columns to be transversed.

Definition at line 228 of file PositionIterator.h.

Referenced by te::rst::PolygonIterator< T >::operator=().

◆ m_currline

template<typename T>
te::gm::Line* te::rst::PolygonIterator< T >::m_currline
protected

The current line in the iterator.

Definition at line 216 of file PositionIterator.h.

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

◆ m_endingcolumn

template<typename T>
int te::rst::PolygonIterator< T >::m_endingcolumn
protected

The column (in current line) to finalize the iteration.

Definition at line 220 of file PositionIterator.h.

Referenced by te::rst::PolygonIterator< T >::operator=().

◆ m_endingrow

template<typename T>
int te::rst::PolygonIterator< T >::m_endingrow
protected

The ending row of the iteration.

Definition at line 222 of file PositionIterator.h.

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

◆ m_maxcolumns

template<typename T>
int te::rst::PolygonIterator< T >::m_maxcolumns
protected

The number of columns in band.

Definition at line 223 of file PositionIterator.h.

Referenced by te::rst::PolygonIterator< T >::operator=().

◆ m_maxrows

template<typename T>
int te::rst::PolygonIterator< T >::m_maxrows
protected

The number of rows in band.

Definition at line 224 of file PositionIterator.h.

Referenced by te::rst::PolygonIterator< T >::operator=().

◆ m_nintersections

template<typename T>
int te::rst::PolygonIterator< T >::m_nintersections
protected

The number number of intersected lines in current line of the iterator.

Definition at line 226 of file PositionIterator.h.

Referenced by te::rst::PolygonIterator< T >::operator=().

◆ m_operatorBrackets_value

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

Definition at line 231 of file PositionIterator.h.

◆ m_operatorParenthesis_value

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

Definition at line 232 of file PositionIterator.h.

◆ m_polygon

template<typename T>
const te::gm::Polygon* te::rst::PolygonIterator< T >::m_polygon
protected

The spatial restriction to be applied in the iterator.

Definition at line 215 of file PositionIterator.h.

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

◆ m_raster

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

The band from where to get the values.

Definition at line 214 of file PositionIterator.h.

Referenced by te::rst::PolygonIterator< T >::operator=().

◆ m_row

template<typename T>
int te::rst::PolygonIterator< T >::m_row
protected

◆ m_startingcolumn

template<typename T>
int te::rst::PolygonIterator< T >::m_startingcolumn
protected

The starting column (in current line) to initialize the iteration.

Definition at line 219 of file PositionIterator.h.

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

◆ m_startingrow

template<typename T>
int te::rst::PolygonIterator< T >::m_startingrow
protected

The starting row of the iteration.

Definition at line 221 of file PositionIterator.h.

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

◆ m_tileIndexer

template<typename T>
std::unique_ptr<te::rst::TileIndexer> te::rst::PolygonIterator< T >::m_tileIndexer
protected

Tile indexer used to optimize the geometric operations.

Definition at line 227 of file PositionIterator.h.

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


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