TerraLib 4.1
TeSAM::TeGridIndex Class Reference

A class that represents a fixed grid. More...

#include <TeGridIndex.h>

List of all members.

Public Types

typedef pair< int, int > gridKey
 grid column/line cell index
typedef multimap< gridKey,
unsigned int > 
gridType
 grid structure

Public Member Functions

 TeGridIndex ()
 Empty constructor.
 TeGridIndex (const TeBox &b, const double &resX, const double &resY)
 Constructor of the grid.
void setBox (const TeBox &b)
 Adjusts grid bounding box.
unsigned int size () const
 Returns the number of associatade cells.
void setResolution (const double &resX, const double &resY)
 Sets grid resolution factor.
int getNumCols () const
 Return number of columns.
int getNumLines () const
 Return number of lines.
bool isValid () const
 Tells if the grid definition is correct.
void insert (const TeCoord2D &c, const unsigned int &itemId)
 Inserts an item with one coordinate.
void getIndex (const TeCoord2D &c1, const TeCoord2D &c2, int &col1, int &line1, int &col2, int &line2)
 Returns lower and upper grid positions.
void insert (const TeCoord2D &c1, const TeCoord2D &c2, const unsigned int &itemId)
 Inserts intem into the grid.
void indexLine (const TeLine2D &l)
 Put line segments over the grid cells.
gridTypegetGrid ()
 Return a reference for internal grid representation.
void getLines (TeLineSet &lset)
 Only for debug purpose.

Public Attributes

double dx_
 grid resolution in x axis.
double dy_
 grid resolution in y axis.
int npartsX_
 Number of columns.
int npartsY_
 Number of lines.
double xi_
 Lower left x.
double yi_
 Lower left y.
double xf_
 Upper right x.
double yf_
 Upper right y.
gridType grid_
 the grid.
unsigned int size_
 Number of elements in the grid (if one element intersects more than one grid cell, they will count many times).

Detailed Description

A class that represents a fixed grid.

WARNING:

1. XXXX

2. XXXX.

3.


Member Typedef Documentation

typedef pair<int, int> TeSAM::TeGridIndex::gridKey

grid column/line cell index

typedef multimap<gridKey, unsigned int> TeSAM::TeGridIndex::gridType

grid structure


Constructor & Destructor Documentation

TeSAM::TeGridIndex::TeGridIndex ( ) [inline]

Empty constructor.

TeSAM::TeGridIndex::TeGridIndex ( const TeBox b,
const double &  resX,
const double &  resY 
) [inline]

Constructor of the grid.


Member Function Documentation

gridType& TeSAM::TeGridIndex::getGrid ( ) [inline]

Return a reference for internal grid representation.

void TeSAM::TeGridIndex::getIndex ( const TeCoord2D c1,
const TeCoord2D c2,
int &  col1,
int &  line1,
int &  col2,
int &  line2 
) [inline]

Returns lower and upper grid positions.

void TeSAM::TeGridIndex::getLines ( TeLineSet lset) [inline]

Only for debug purpose.

int TeSAM::TeGridIndex::getNumCols ( ) const [inline]

Return number of columns.

int TeSAM::TeGridIndex::getNumLines ( ) const [inline]

Return number of lines.

void TeSAM::TeGridIndex::indexLine ( const TeLine2D l) [inline]

Put line segments over the grid cells.

void TeSAM::TeGridIndex::insert ( const TeCoord2D c1,
const TeCoord2D c2,
const unsigned int &  itemId 
) [inline]

Inserts intem into the grid.

void TeSAM::TeGridIndex::insert ( const TeCoord2D c,
const unsigned int &  itemId 
) [inline]

Inserts an item with one coordinate.

bool TeSAM::TeGridIndex::isValid ( ) const [inline]

Tells if the grid definition is correct.

void TeSAM::TeGridIndex::setBox ( const TeBox b) [inline]

Adjusts grid bounding box.

void TeSAM::TeGridIndex::setResolution ( const double &  resX,
const double &  resY 
) [inline]

Sets grid resolution factor.

unsigned int TeSAM::TeGridIndex::size ( ) const [inline]

Returns the number of associatade cells.


Member Data Documentation

grid resolution in x axis.

grid resolution in y axis.

Number of columns.

Number of lines.

Number of elements in the grid (if one element intersects more than one grid cell, they will count many times).

Upper right x.

Lower left x.

Upper right y.

Lower left y.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines