QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
A spatial index for QgsMeshFace or QgsMeshEdge objects. More...
#include <qgsmeshspatialindex.h>
Public Member Functions | |
QgsMeshSpatialIndex () | |
Constructor for QgsSpatialIndex. More... | |
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. More... | |
QgsMeshSpatialIndex (const QgsMeshSpatialIndex &other) | |
Copy constructor. More... | |
~QgsMeshSpatialIndex () | |
Destructor finalizes work with spatial index. More... | |
void | addFace (int faceIndex, const QgsMesh &mesh) |
Adds a face with faceIndex from the mesh in the spatial index. More... | |
QgsMesh::ElementType | elementType () const |
Returns the type of mesh elements that are indexed. More... | |
QList< int > | intersects (const QgsRectangle &rectangle) const |
Returns a list of face ids with a bounding box which intersects the specified rectangle. More... | |
QList< int > | nearestNeighbor (const QgsPointXY &point, int neighbors) const |
Returns nearest neighbors to a point. More... | |
QgsMeshSpatialIndex & | operator= (const QgsMeshSpatialIndex &other) |
Implement assignment operator. More... | |
void | removeFace (int faceIndex, const QgsMesh &mesh) |
Removes a face with faceIndex from the mesh in the spatial index. More... | |
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 | ) |
Copy constructor.
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 402 of file qgsmeshspatialindex.cpp.
QgsMesh::ElementType QgsMeshSpatialIndex::elementType | ( | ) | const |
Returns the type of mesh elements that are indexed.
Definition at line 397 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 370 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 383 of file qgsmeshspatialindex.cpp.
QgsMeshSpatialIndex & QgsMeshSpatialIndex::operator= | ( | const QgsMeshSpatialIndex & | other | ) |
Implement assignment operator.
Definition at line 363 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 434 of file qgsmeshspatialindex.cpp.