QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
A spatial index for QgsMeshFace or QgsMeshEdge objects. More...
#include <qgsmeshspatialindex.h>
Public Member Functions | |
QgsMeshSpatialIndex () | |
Constructor for QgsSpatialIndex. | |
QgsMeshSpatialIndex (const QgsMesh &mesh, QgsFeedback *feedback=nullptr, QgsMesh::ElementType elementType=QgsMesh::ElementType::Face) | |
Constructor - creates R-tree and bulk loads faces or edges from the specified mesh. | |
QgsMeshSpatialIndex (const QgsMeshSpatialIndex &other) | |
~QgsMeshSpatialIndex () | |
Destructor finalizes work with spatial index. | |
void | addFace (int faceIndex, const QgsMesh &mesh) |
Adds a face with faceIndex from the mesh in the spatial index. | |
QgsMesh::ElementType | elementType () const |
Returns the type of mesh elements that are indexed. | |
QList< int > | intersects (const QgsRectangle &rectangle) const |
Returns a list of face ids with a bounding box which intersects the specified rectangle. | |
QList< int > | nearestNeighbor (const QgsPointXY &point, int neighbors) const |
Returns nearest neighbors to a point. | |
QgsMeshSpatialIndex & | operator= (const QgsMeshSpatialIndex &other) |
void | removeFace (int faceIndex, const QgsMesh &mesh) |
Removes a face with faceIndex from the mesh in the spatial index. | |
A spatial index for QgsMeshFace or QgsMeshEdge objects.
QgsMeshSpatialIndex objects are implicitly shared and can be inexpensively copied.
Definition at line 49 of file qgsmeshspatialindex.h.
QgsMeshSpatialIndex::QgsMeshSpatialIndex | ( | ) |
Constructor for QgsSpatialIndex.
Creates an empty R-tree index.
Definition at line 345 of file qgsmeshspatialindex.cpp.
|
explicit |
Constructor - creates R-tree and bulk loads faces or edges from the specified mesh.
Not implemented to construct R-tree for vertices Since QGIS 3.14 possibility to create R-tree for edges
The optional feedback object can be used to allow cancellation of bulk face loading. Ownership of feedback is not transferred, and callers must take care that the lifetime of feedback exceeds that of the spatial index construction.
Definition at line 350 of file qgsmeshspatialindex.cpp.
QgsMeshSpatialIndex::QgsMeshSpatialIndex | ( | const QgsMeshSpatialIndex & | other | ) |
Definition at line 356 of file qgsmeshspatialindex.cpp.
|
default |
Destructor finalizes work with spatial index.
void QgsMeshSpatialIndex::addFace | ( | int | faceIndex, |
const QgsMesh & | mesh | ||
) |
Adds a face with faceIndex from the mesh in the spatial index.
Definition at line 406 of file qgsmeshspatialindex.cpp.
QgsMesh::ElementType QgsMeshSpatialIndex::elementType | ( | ) | const |
Returns the type of mesh elements that are indexed.
Definition at line 401 of file qgsmeshspatialindex.cpp.
QList< int > QgsMeshSpatialIndex::intersects | ( | const QgsRectangle & | rectangle | ) | const |
Returns a list of face ids with a bounding box which intersects the specified rectangle.
Definition at line 374 of file qgsmeshspatialindex.cpp.
QList< int > QgsMeshSpatialIndex::nearestNeighbor | ( | const QgsPointXY & | point, |
int | neighbors | ||
) | const |
Returns nearest neighbors to a point.
The number of neighbours returned is specified by the neighbours argument.
Definition at line 387 of file qgsmeshspatialindex.cpp.
QgsMeshSpatialIndex & QgsMeshSpatialIndex::operator= | ( | const QgsMeshSpatialIndex & | other | ) |
Definition at line 364 of file qgsmeshspatialindex.cpp.
void QgsMeshSpatialIndex::removeFace | ( | int | faceIndex, |
const QgsMesh & | mesh | ||
) |
Removes a face with faceIndex from the mesh in the spatial index.
Definition at line 438 of file qgsmeshspatialindex.cpp.