RSpatialIndexSimple
Class in Core Module
Header: #include <src/core/RSpatialIndexSimple.h>
Inherits: RSpatialIndex
Description
Section titled “Description”Simple spatial index implementation.
Scriptable: This class is available in script environments.
Public Functions
Section titled “Public Functions”RSpatialIndexSimple() |
|
| virtual | ~RSpatialIndexSimple() |
| virtual void | addToIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2) |
| virtual void | clear() |
| virtual RSpatialIndex * | create() |
| 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)Queries the index for all items that are completely inside or intersect with the given box x1,y1,z1,x2,y2,z2. |
| virtual QMap< int, QSet< int > > | queryNearestNeighbor(uint k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL) |
| 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, double x1, double y1, double z1, double x2, double y2, double z2)Removes the entry with the given ID from this spatial index. |
Protected Attributes
Section titled “Protected Attributes”| QMap< int, QList< RBox > > | si |
Member Documentation
Section titled “Member Documentation”RSpatialIndexSimple
Section titled “RSpatialIndexSimple”RSpatialIndexSimple::RSpatialIndexSimple()All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.
~RSpatialIndexSimple
Section titled “~RSpatialIndexSimple”virtual RSpatialIndexSimple::~RSpatialIndexSimple()virtual
addToIndex
Section titled “addToIndex”virtual void RSpatialIndexSimple::addToIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)virtual
Non-Scriptable: This function is not available in script environments.
Reimplemented from addToIndex.
virtual void RSpatialIndexSimple::clear()virtual
Reimplemented from clear.
create
Section titled “create”virtual RSpatialIndex * RSpatialIndexSimple::create()virtual
Reimplemented from create.
queryContained
Section titled “queryContained”virtual QMap< int, QSet< int > > RSpatialIndexSimple::queryContained(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)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 from queryContained.
queryIntersected
Section titled “queryIntersected”virtual QMap< int, QSet< int > > RSpatialIndexSimple::queryIntersected(double x1, double y1, double z1, double x2, double y2, double z2, RSpatialIndexVisitor *dataVisitor=NULL)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 from queryIntersected.
queryNearestNeighbor
Section titled “queryNearestNeighbor”virtual QMap< int, QSet< int > > RSpatialIndexSimple::queryNearestNeighbor(uint k, double x, double y, double z, RSpatialIndexVisitor *dataVisitor=NULL)virtual
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndexSimple::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 from removeFromIndex.
removeFromIndex
Section titled “removeFromIndex”virtual bool RSpatialIndexSimple::removeFromIndex(int id, int pos, double x1, double y1, double z1, double x2, double y2, double z2)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 from removeFromIndex.
QMap<int, QList<RBox> > RSpatialIndexSimple::siprotected