QGIS API Documentation
3.4.15-Madeira (e83d02e274)
|
Triangular/Derived Mesh is mesh with vertices in map coordinates. More...
#include <qgstriangularmesh.h>
Public Member Functions | |
QgsTriangularMesh ()=default | |
Ctor. More... | |
~QgsTriangularMesh ()=default | |
Dtor. More... | |
const QVector< QgsMeshVertex > & | centroids () const |
Returns centroids of the native faces in map CRS. More... | |
QList< int > | faceIndexesForRectangle (const QgsRectangle &rectangle) const |
Finds indexes of triangles intersecting given bounding box It uses spatial indexing. More... | |
int | faceIndexForPoint (const QgsPointXY &point) const |
Finds index of triangle at given point It uses spatial indexing. More... | |
const QVector< QgsMeshFace > & | triangles () const |
Returns triangles. More... | |
const QVector< int > & | trianglesToNativeFaces () const |
Returns mapping between triangles and original faces. More... | |
void | update (QgsMesh *nativeMesh, QgsRenderContext *context) |
Constructs triangular mesh from layer's native mesh and context. More... | |
const QVector< QgsMeshVertex > & | vertices () const |
Returns vertices in map coordinate system. More... | |
Triangular/Derived Mesh is mesh with vertices in map coordinates.
It creates spatial index for identification of a triangle that contains a particular point on the map.
Definition at line 86 of file qgstriangularmesh.h.
|
default |
Ctor.
|
default |
Dtor.
const QVector< QgsMeshVertex > & QgsTriangularMesh::centroids | ( | ) | const |
Returns centroids of the native faces in map CRS.
Definition at line 222 of file qgstriangularmesh.cpp.
QList< int > QgsTriangularMesh::faceIndexesForRectangle | ( | const QgsRectangle & | rectangle | ) | const |
Finds indexes of triangles intersecting given bounding box It uses spatial indexing.
rectangle | bounding box in map coordinate system |
Definition at line 246 of file qgstriangularmesh.cpp.
int QgsTriangularMesh::faceIndexForPoint | ( | const QgsPointXY & | point | ) | const |
Finds index of triangle at given point It uses spatial indexing.
point | point in map coordinate system |
Definition at line 232 of file qgstriangularmesh.cpp.
const QVector< QgsMeshFace > & QgsTriangularMesh::triangles | ( | ) | const |
Returns triangles.
Definition at line 217 of file qgstriangularmesh.cpp.
const QVector< int > & QgsTriangularMesh::trianglesToNativeFaces | ( | ) | const |
Returns mapping between triangles and original faces.
Definition at line 227 of file qgstriangularmesh.cpp.
void QgsTriangularMesh::update | ( | QgsMesh * | nativeMesh, |
QgsRenderContext * | context | ||
) |
Constructs triangular mesh from layer's native mesh and context.
Populates spatial index.
nativeMesh | QgsMesh to access native vertices and faces |
context | Rendering context to estimate number of triagles to create for an face |
Definition at line 111 of file qgstriangularmesh.cpp.
const QVector< QgsMeshVertex > & QgsTriangularMesh::vertices | ( | ) | const |
Returns vertices in map coordinate system.
The list of consist of vertices from native mesh (0-N) and extra vertices needed to create triangles (N+1 - len)
Definition at line 212 of file qgstriangularmesh.cpp.