1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmeshspatialindex.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsMeshSpatialIndex
{
%Docstring(signature="appended")
A spatial index for :py:class:`QgsMeshFace` or :py:class:`QgsMeshEdge`
objects.
:py:class:`QgsMeshSpatialIndex` objects are implicitly shared and can be
inexpensively copied.
.. note::
While the underlying libspatialindex is not thread safe on some platforms, the :py:class:`QgsMeshSpatialIndex`
class implements its own locks and accordingly, a single :py:class:`QgsMeshSpatialIndex` object can safely
be used across multiple threads
.. seealso:: :py:class:`QgsSpatialIndex` which is for vector features
.. versionadded:: 3.6
%End
%TypeHeaderCode
#include "qgsmeshspatialindex.h"
%End
public:
QgsMeshSpatialIndex();
%Docstring
Constructor for :py:class:`QgsSpatialIndex`. Creates an empty R-tree
index.
%End
explicit QgsMeshSpatialIndex( const QgsMesh &mesh, QgsFeedback *feedback = 0, QgsMesh::ElementType elementType = QgsMesh::ElementType::Face );
%Docstring
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.
%End
QgsMeshSpatialIndex( const QgsMeshSpatialIndex &other );
~QgsMeshSpatialIndex();
QList<int> intersects( const QgsRectangle &rectangle ) const;
%Docstring
Returns a list of face ids with a bounding box which intersects the
specified ``rectangle``.
.. note::
The intersection test is performed based on the face bounding boxes only, so it is necessary
to manually test the returned faces for exact geometry intersection when required.
%End
QList<int> nearestNeighbor( const QgsPointXY &point, int neighbors ) const;
%Docstring
Returns nearest neighbors to a ``point``. The number of neighbours
returned is specified by the ``neighbours`` argument.
.. note::
The nearest neighbour test is performed based on the face bounding boxes only,
so this method is not guaranteed to return the actual closest neighbours.
%End
QgsMesh::ElementType elementType() const;
%Docstring
Returns the type of mesh elements that are indexed
.. versionadded:: 3.14
%End
void addFace( int faceIndex, const QgsMesh &mesh );
%Docstring
Adds a face with ``faceIndex`` from the ``mesh`` in the spatial index
%End
void removeFace( int faceIndex, const QgsMesh &mesh );
%Docstring
Removes a face with ``faceIndex`` from the ``mesh`` in the spatial index
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmeshspatialindex.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|