QGIS/python/core/auto_generated/mesh/qgsmeshspatialindex.sip.in
Vincent Cloarec d326d38660
[mesh] mesh frame editing part-1 (qgis_core) (#43828)
[feature] qgis_core changes to allow mesh layer editing (part-1 or QEP#228)
2021-06-25 16:17:13 +02:00

112 lines
3.6 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmeshspatialindex.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl 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`
.. 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 );
%Docstring
Copy constructor
%End
~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.pl again *
************************************************************************/