|
QCAD Application Framework
CAD Application Development and Automation.
|
Spatial index class. More...
#include <RSpatialIndexNavel.h>
Classes | |
| class | RSiPoint |
| Internal representation of a point. More... | |
| class | RSiRegion |
| Internal representation of a rectangular region. More... | |
| class | Visitor |
| Internal node and data visitor. More... | |
Public Member Functions | |
| virtual void | addToIndex (int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2) |
| Adds an item to the index. | |
| virtual void | addToIndex (int id, int pos, const RBox &bb) |
| Adds a new entry into this spatial index. | |
| virtual void | clear () |
| virtual QMap< int, QSet< int > > | queryContained (double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL) |
| Queries the index for all items that are completely inside the given box x1,y1,z1,x2,y2,z2. | |
| virtual QMap< int, QSet< int > > | queryIntersected (double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL) |
| Removes the item with the given ID from this spatial index. | |
| virtual QMap< int, QSet< int > > | queryNearestNeighbor (uint k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL) |
| Queries the index for closest neighbor items. | |
| virtual QPair< int, int > | queryNearestNeighbor (double x, double y, double z) |
| For scripts. | |
| 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) |
| Removes the entry with the given ID from this spatial index. | |
| RSpatialIndexNavel () | |
| Creates a 2d spatial index in memory (r-tree, star shape). | |
| ~RSpatialIndexNavel () | |
Public Member Functions inherited from RSpatialIndex | |
| virtual void | addToIndex (int id, const QList< RBox > &bbs) |
| Adds a new entry at multiple positions into this spatial index. | |
| 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 > > | queryIntersected (const RBox &b, RSpatialIndexVisitor *dataVisitor=NULL) |
| Queries the index for all items that are completely inside or intersect with the given box. | |
| RSpatialIndex () | |
| virtual | ~RSpatialIndex () |
Public Member Functions inherited from RRequireHeap | |
| void | doDelete () |
Protected Member Functions | |
| void | addToIndex (int id, int pos, const RSiRegion ®ion, size_t dataLength=0, const uint8_t *data=NULL) |
| Internal. | |
| void | init () |
| QMap< int, QSet< int > > | queryContained (const RSiRegion ®ion, RSpatialIndexVisitor *dataVisitor=NULL) |
| Internal. | |
| QMap< int, QSet< int > > | queryIntersected (const RSiRegion ®ion, RSpatialIndexVisitor *dataVisitor=NULL) |
| Internal. | |
| QMap< int, QSet< int > > | queryNearestNeighbor (uint k, const RSiPoint &point, RSpatialIndexVisitor *dataVisitor=NULL) |
| Internal. | |
| void | uninit () |
Protected Attributes | |
| SpatialIndex::IStorageManager * | buff |
| SpatialIndex::ISpatialIndex * | tree |
Protected Attributes inherited from RSpatialIndex | |
| int | idCounter |
Additional Inherited Members | |
Static Public Member Functions inherited from RSpatialIndex | |
| static int | getId (qint64 siid) |
| static int | getPos (qint64 siid) |
| static qint64 | getSIId (int id, int pos) |
Spatial index class.
Each instance of this class offers a spatial index. This class wraps the API of the "spatial index" library.
| RSpatialIndexNavel::RSpatialIndexNavel | ( | ) |
Creates a 2d spatial index in memory (r-tree, star shape).
| RSpatialIndexNavel::~RSpatialIndexNavel | ( | ) |
|
virtual |
Adds an item to the index.
| id | ID of the item. |
| x1 | lower value of the first dimension. |
| y1 | lower value of the second dimension. |
| z1 | lower value of the third dimension. |
| x2 | higher value of the first dimension. |
| y2 | higher value of the second dimension. |
| z2 | higher value of the third dimension. |
| dataLength | Legth of the data in bytes or 0. |
| data | Pointer to the data associated with the item. The index makes a deep copy of the data, the caller is responsible for deleting the data. NULL indicates that the item data is stored externally (e.g. in a map or list). |
Implements RSpatialIndex.
|
virtual |
Adds a new entry into this spatial index.
Reimplemented from RSpatialIndex.
|
protected |
Internal.
\par Non-Scriptable:
This function is not available in script environments.
|
virtual |
Implements RSpatialIndex.
|
protected |
|
virtual |
Queries the index for all items that are completely inside the given box x1,y1,z1,x2,y2,z2.
| 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). |
Implements RSpatialIndex.
|
protected |
Internal.
\par Non-Scriptable:
This function is not available in script environments.
|
virtual |
Removes the item with the given ID from this spatial index.
Implements RSpatialIndex.
|
protected |
Internal.
\par Non-Scriptable:
This function is not available in script environments.
|
virtual |
Queries the index for closest neighbor items.
| 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). |
Implements RSpatialIndex.
|
virtual |
For scripts.
Reimplemented from RSpatialIndex.
|
protected |
Internal.
\par Non-Scriptable:
This function is not available in script environments.
|
virtual |
Removes the entry with the given ID from this spatial index.
the bounding boxes are provided for faster lookup.
Reimplemented from RSpatialIndex.
|
virtual |
Removes the entry with the given ID from this spatial index.
the bounding box is provided for faster lookup.
Reimplemented from RSpatialIndex.
|
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.
Implements RSpatialIndex.
|
protected |
|
protected |
|
protected |