RSpatialIndex
Class in Core Module
Header: #include <src/core/RSpatialIndex.h>
Inherits: RRequireHeap
Inherited by: RSpatialIndexNavel, RSpatialIndexSimple
Description
Section titled “Description”Abstract base class for spatial index implementations.
Scriptable: This class is available in script environments.
Public Functions
Section titled “Public Functions”RSpatialIndex() |
|
| virtual | ~RSpatialIndex() |
| virtual void | addToIndex(int id, const QList< RBox > &bbs)Adds a new entry at multiple positions into this spatial index. |
| virtual void | addToIndex(int id, int pos, const RBox &bb)Adds a new entry into this spatial index. |
| virtual void | addToIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)=0 = 0Adds a new entry into this spatial index. |
| virtual void | bulkLoad(const QList< int > &ids, const QList< QList< RBox > > &bbs) |
| virtual void | bulkLoadSimple(const QList< int > &ids, const QList< RBox > &bbs) |
| virtual void | clear()=0 = 0 |
| virtual RSpatialIndex * | create()=0 = 0 |
| virtual QMap< int, QSet< int > > | queryContained(const RBox &b, RSpatialIndexVisitor *dataVisitor=NULL)Queries the index for all items that are completely inside the given box. |
| virtual QMap< int, QSet< int > > | queryContained(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)=0 = 0Queries the index for all items that are completely inside the given box x1,y1,z1,x2,y2,z2. |
| QList< int > | queryContainedIds(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL) |
| virtual QMap< int, QSet< int > > | queryIntersected(const RBox &b, RSpatialIndexVisitor *dataVisitor=NULL)Queries the index for all items that are completely inside or intersect with the given box. |
| virtual QMap< int, QSet< int > > | queryIntersected(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)=0 = 0Queries the index for all items that are completely inside or intersect with the given box x1,y1,z1,x2,y2,z2. |
| virtual QPair< int, int > | queryNearestNeighbor(double x, double y, double z)Convenience implementation for scripts. |
| virtual QMap< int, QSet< int > > | queryNearestNeighbor(unsigned int k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL)=0 = 0Queries the index for closest neighbor items. |
| virtual bool | removeFromIndex(int id, const QList< RBox > &bb)Removes the entry with the given ID from this spatial index. |
| virtual bool | removeFromIndex(int id, int pos, const RBox &bb)Removes the entry with the given ID from this spatial index. |
| virtual bool | removeFromIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)=0 = 0Removes the entry with the given ID from this spatial index. |
Static Public Functions
Section titled “Static Public Functions”| static int | getId(qint64 siid) |
| static int | getPos(qint64 siid) |
| static qint64 | getSIId(int id, int pos) |
Protected Attributes
Section titled “Protected Attributes”| int | idCounter |
Member Documentation
Section titled “Member Documentation”RSpatialIndex
Section titled “RSpatialIndex”RSpatialIndex::RSpatialIndex()inline
~RSpatialIndex
Section titled “~RSpatialIndex”virtual RSpatialIndex::~RSpatialIndex()virtual inline
addToIndex
Section titled “addToIndex”virtual void RSpatialIndex::addToIndex(int id, const QList< RBox > &bbs)virtual
Adds a new entry at multiple positions into this spatial index.
addToIndex
Section titled “addToIndex”virtual void RSpatialIndex::addToIndex(int id, int pos, const RBox &bb)virtual
Adds a new entry into this spatial index.
Reimplemented in addToIndex.
addToIndex
Section titled “addToIndex”virtual void RSpatialIndex::addToIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)=0 = 0pure virtual
Adds a new entry into this spatial index.
Reimplemented in addToIndex, addToIndex.
bulkLoad
Section titled “bulkLoad”virtual void RSpatialIndex::bulkLoad(const QList< int > &ids, const QList< QList< RBox > > &bbs)virtual
Reimplemented in bulkLoad.
bulkLoadSimple
Section titled “bulkLoadSimple”virtual void RSpatialIndex::bulkLoadSimple(const QList< int > &ids, const QList< RBox > &bbs)virtual
virtual void RSpatialIndex::clear()=0 = 0pure virtual
Reimplemented in clear, clear.
create
Section titled “create”virtual RSpatialIndex * RSpatialIndex::create()=0 = 0pure virtual
Reimplemented in create, create.
queryContained
Section titled “queryContained”virtual QMap< int, QSet< int > > RSpatialIndex::queryContained(const RBox &b, RSpatialIndexVisitor *dataVisitor=NULL)virtual
Queries the index for all items that are completely inside the given box.
queryContained
Section titled “queryContained”virtual QMap< int, QSet< int > > RSpatialIndex::queryContained(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)=0 = 0pure virtual
Queries the index for all items that are completely inside the given box x1,y1,z1,x2,y2,z2.
Parameters:
x1: lower region boundary of the first dimension.y1: lower region boundary of the second dimension.z1: lower region boundary of the third dimension.x2: higher region boundary of the first dimension.y2: higher region boundary of the second dimension.z2: higher region boundary of the third dimension.dataVisitor: The item data is handed back to the caller over this object (visitor pattern).
Reimplemented in queryContained, queryContained.
queryContainedIds
Section titled “queryContainedIds”QList< int > RSpatialIndex::queryContainedIds(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)queryIntersected
Section titled “queryIntersected”virtual QMap< int, QSet< int > > RSpatialIndex::queryIntersected(const RBox &b, RSpatialIndexVisitor *dataVisitor=NULL)virtual
Queries the index for all items that are completely inside or intersect with the given box.
queryIntersected
Section titled “queryIntersected”virtual QMap< int, QSet< int > > RSpatialIndex::queryIntersected(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)=0 = 0pure virtual
Queries the index for all items that are completely inside or intersect with the given box x1,y1,z1,x2,y2,z2.
Parameters:
x1: lower region boundary of the first dimension.y1: lower region boundary of the second dimension.z1: lower region boundary of the third dimension.x2: higher region boundary of the first dimension.y2: higher region boundary of the second dimension.z2: higher region boundary of the third dimension.dataVisitor: The item data is handed back to the caller over this object (visitor pattern).
Returns: map with IDs as keys and positions as values
Reimplemented in queryIntersected, queryIntersected.
queryNearestNeighbor
Section titled “queryNearestNeighbor”virtual QPair< int, int > RSpatialIndex::queryNearestNeighbor(double x, double y, double z)virtual
Convenience implementation for scripts.
Reimplemented in queryNearestNeighbor.
queryNearestNeighbor
Section titled “queryNearestNeighbor”virtual QMap< int, QSet< int > > RSpatialIndex::queryNearestNeighbor(unsigned int k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL)=0 = 0pure virtual
Queries the index for closest neighbor items.
Parameters:
x1: position of the first dimension.y1: position of the second dimension.z1: position of the third dimension.dataVisitor: The item data is handed back to the caller over this object (visitor pattern).
Reimplemented in queryNearestNeighbor.
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndex::removeFromIndex(int id, const QList< RBox > &bb)virtual
Removes the entry with the given ID from this spatial index.
the bounding boxes are provided for faster lookup.
Reimplemented in removeFromIndex, removeFromIndex.
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndex::removeFromIndex(int id, int pos, const RBox &bb)virtual
Removes the entry with the given ID from this spatial index.
the bounding box is provided for faster lookup.
Reimplemented in removeFromIndex.
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndex::removeFromIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)=0 = 0pure virtual
Removes the entry with the given ID from this spatial index.
Removes the entry with the given ID from this spatial index. the bounding box is provided for fast lookup.
Reimplemented in removeFromIndex, removeFromIndex.
static int RSpatialIndex::getId(qint64 siid)static
getPos
Section titled “getPos”static int RSpatialIndex::getPos(qint64 siid)static
getSIId
Section titled “getSIId”static qint64 RSpatialIndex::getSIId(int id, int pos)static
idCounter
Section titled “idCounter”int RSpatialIndex::idCounterprotected