All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::rst::TileIndexer Class Reference

Polygon tile indexing class for optmized geometrical relational tests. More...

#include <TileIndexer.h>

Public Types

typedef std::vector< std::pair
< unsigned int, unsigned int > > 
TileSegIndex
 

Public Member Functions

void addRing (const unsigned int &ri)
 Update the tile index with the information of the supplied ring. More...
 
void clear ()
 Clear all internal resources. More...
 
const te::gm::PolygongetPolygon () const
 Returns the polygon. More...
 
void getTile (const double &y, TileSegIndex **index) const
 Gets tile index. More...
 
 TileIndexer (const te::gm::Polygon &pol, const double &dy)
 Alternative Constructor. More...
 
 ~TileIndexer ()
 Destructor. More...
 

Protected Member Functions

void getTileIndex (const te::gm::Point &p1, const te::gm::Point &p2, unsigned int &firstTile, unsigned int &lastTile) const
 Gets tile index intervals in y direction for a given segment. More...
 
void getTileIndex (const double &y, unsigned int &tileIndex) const
 Gets tile index for y coordinate value. More...
 
void init ()
 Init internal variables. More...
 
const TileIndexeroperator= (const TileIndexer &)
 Copy overload. More...
 
 TileIndexer (const TileIndexer &)
 Constructor. More...
 

Protected Attributes

double m_dy
 Tile resolution along "y" axis. More...
 
const te::gm::Polygonm_referencePolygon
 Reference polygon. More...
 
std::vector< TileSegIndex * > m_tileIndex
 Each tile segments index vector. More...
 

Detailed Description

Polygon tile indexing class for optmized geometrical relational tests.

Note
The related polygon instance must always be valid (only the polygon reference is stored internally).

Definition at line 55 of file TileIndexer.h.

Member Typedef Documentation

typedef std::vector<std::pair<unsigned int, unsigned int> > te::rst::TileIndexer::TileSegIndex

Definition at line 59 of file TileIndexer.h.

Constructor & Destructor Documentation

te::rst::TileIndexer::TileIndexer ( const TileIndexer )
protected

Constructor.

te::rst::TileIndexer::TileIndexer ( const te::gm::Polygon pol,
const double &  dy 
)

Alternative Constructor.

Parameters
polThe polygon to index.
dyTile size along "y" axis.

Definition at line 59 of file TileIndexer.cpp.

References addRing(), te::gm::Envelope::getHeight(), te::gm::Geometry::getMBR(), te::gm::CurvePolygon::getNumRings(), init(), m_dy, m_referencePolygon, and m_tileIndex.

te::rst::TileIndexer::~TileIndexer ( )

Destructor.

Definition at line 89 of file TileIndexer.cpp.

Member Function Documentation

void te::rst::TileIndexer::addRing ( const unsigned int &  ri)

Update the tile index with the information of the supplied ring.

Parameters
riThe ring index.

Definition at line 94 of file TileIndexer.cpp.

Referenced by te::rst::Vectorizer::run(), and TileIndexer().

void te::rst::TileIndexer::clear ( )

Clear all internal resources.

Definition at line 82 of file TileIndexer.cpp.

References te::common::FreeContents().

Referenced by te::rst::Vectorizer::run().

const te::gm::Polygon & te::rst::TileIndexer::getPolygon ( ) const

Returns the polygon.

Definition at line 138 of file TileIndexer.cpp.

Referenced by te::rst::Vectorizer::run().

void te::rst::TileIndexer::getTile ( const double &  y,
TileSegIndex **  index 
) const

Gets tile index.

Parameters
yThe Y value.
indexOutput tile pointer (NULL if not found).

Definition at line 127 of file TileIndexer.cpp.

void te::rst::TileIndexer::getTileIndex ( const te::gm::Point p1,
const te::gm::Point p2,
unsigned int &  firstTile,
unsigned int &  lastTile 
) const
protected

Gets tile index intervals in y direction for a given segment.

Parameters
p1First segment coordinate.
p2Second segment coordinate.
firstTileThe first tile index that this segment intersects.
lastTileThe last tile index that this segment intersects.
Note
The segment does NOT need to be oriented.

Definition at line 34 of file TileIndexer.cpp.

References te::gm::Envelope::getLowerLeftY(), te::gm::Geometry::getMBR(), te::gm::Point::getY(), m_dy, and m_referencePolygon.

void te::rst::TileIndexer::getTileIndex ( const double &  y,
unsigned int &  tileIndex 
) const
protected

Gets tile index for y coordinate value.

Parameters
yValue of "y" coordinate.
tileIndexIndex of corresponding tile.

Definition at line 47 of file TileIndexer.cpp.

void te::rst::TileIndexer::init ( )
protected

Init internal variables.

Definition at line 54 of file TileIndexer.cpp.

Referenced by TileIndexer().

const TileIndexer& te::rst::TileIndexer::operator= ( const TileIndexer )
protected

Copy overload.

Member Data Documentation

double te::rst::TileIndexer::m_dy
protected

Tile resolution along "y" axis.

Definition at line 127 of file TileIndexer.h.

Referenced by getTileIndex(), and TileIndexer().

const te::gm::Polygon& te::rst::TileIndexer::m_referencePolygon
protected

Reference polygon.

Definition at line 128 of file TileIndexer.h.

Referenced by getTileIndex(), and TileIndexer().

std::vector<TileSegIndex*> te::rst::TileIndexer::m_tileIndex
protected

Each tile segments index vector.

Definition at line 129 of file TileIndexer.h.

Referenced by TileIndexer().


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