INET Framework for OMNeT++/OMNEST
|
This class implements a spatial grid data structure using a 3 dimensional grid. More...
#include <SpatialGrid.h>
Classes | |
class | LineSegmentIterator |
class | Triplet |
Public Types | |
typedef std::list< const cObject * > | Voxel |
typedef std::vector< Voxel > | Grid |
Public Member Functions | |
bool | insertObject (const cObject *object, const Coord &pos, const Coord &boundingBoxSize) |
bool | insertPoint (const cObject *point, const Coord &pos) |
bool | removePoint (const cObject *point) |
bool | movePoint (const cObject *point, const Coord &newPos) |
void | clearGrid () |
void | rangeQuery (const Coord &pos, double range, const IVisitor *visitor) const |
void | lineSegmentQuery (const LineSegment &lineSegment, const IVisitor *visitor) const |
SpatialGrid (const Coord &voxelSizes, const Coord &constraintAreaMin, const Coord &constraintAreaMax) | |
Protected Member Functions | |
Coord | computeConstraintAreaSideLengths () const |
Triplet< int > | computeNumberOfVoxels () const |
unsigned int | computeGridVectorLength () const |
Triplet< int > | decodeRowMajorIndex (unsigned int ind) const |
unsigned int | rowMajorIndex (const Triplet< int > &indices) const |
unsigned int | coordToRowMajorIndex (const Coord &pos) const |
Triplet< int > | coordToMatrixIndices (const Coord &pos) const |
void | computeBoundingVoxels (const Coord &pos, const Triplet< double > &boundings, Triplet< int > &start, Triplet< int > &end) const |
Protected Attributes | |
Grid | grid |
unsigned int | gridVectorLength |
Triplet< double > | voxelSizes |
Coord | constraintAreaSideLengths |
Coord | constraintAreaMin |
Coord | constraintAreaMax |
Triplet< int > | numVoxels |
This class implements a spatial grid data structure using a 3 dimensional grid.
It can also be used with zero-length {X, Y, Z} sides, and then it operates in 1 or 2 dimensional mode.
NOTE: With minimal effort, it can be extended to work in arbitrary dimension spaces.
typedef std::vector<Voxel> inet::SpatialGrid::Grid |
typedef std::list<const cObject *> inet::SpatialGrid::Voxel |
inet::SpatialGrid::SpatialGrid | ( | const Coord & | voxelSizes, |
const Coord & | constraintAreaMin, | ||
const Coord & | constraintAreaMax | ||
) |
void inet::SpatialGrid::clearGrid | ( | ) |
|
protected |
Referenced by insertObject(), and rangeQuery().
|
protected |
Referenced by SpatialGrid().
|
protected |
Referenced by SpatialGrid().
|
protected |
Referenced by SpatialGrid().
|
protected |
Referenced by computeBoundingVoxels(), coordToRowMajorIndex(), and inet::SpatialGrid::LineSegmentIterator::LineSegmentIterator().
|
protected |
Referenced by insertPoint().
|
protected |
bool inet::SpatialGrid::insertObject | ( | const cObject * | object, |
const Coord & | pos, | ||
const Coord & | boundingBoxSize | ||
) |
Referenced by inet::physicalenvironment::GridObjectCache::insertObject().
bool inet::SpatialGrid::insertPoint | ( | const cObject * | point, |
const Coord & | pos | ||
) |
Referenced by inet::physicallayer::GridNeighborCache::addRadio(), and inet::physicallayer::GridNeighborCache::fillCubeVector().
void inet::SpatialGrid::lineSegmentQuery | ( | const LineSegment & | lineSegment, |
const IVisitor * | visitor | ||
) | const |
Referenced by inet::physicalenvironment::GridObjectCache::visitObjects().
bool inet::SpatialGrid::movePoint | ( | const cObject * | point, |
const Coord & | newPos | ||
) |
void inet::SpatialGrid::rangeQuery | ( | const Coord & | pos, |
double | range, | ||
const IVisitor * | visitor | ||
) | const |
Referenced by inet::physicallayer::GridNeighborCache::sendToNeighbors().
bool inet::SpatialGrid::removePoint | ( | const cObject * | point | ) |
|
protected |
Referenced by coordToRowMajorIndex(), insertObject(), lineSegmentQuery(), and rangeQuery().
|
protected |
Referenced by computeConstraintAreaSideLengths(), and SpatialGrid().
|
protected |
|
protected |
Referenced by computeBoundingVoxels(), computeNumberOfVoxels(), and SpatialGrid().
|
protected |
Referenced by clearGrid(), insertObject(), insertPoint(), lineSegmentQuery(), rangeQuery(), and SpatialGrid().
|
protected |
Referenced by clearGrid(), computeGridVectorLength(), insertPoint(), lineSegmentQuery(), and SpatialGrid().
|
protected |
|
protected |
Referenced by computeNumberOfVoxels(), coordToMatrixIndices(), and lineSegmentQuery().