QGIS API Documentation 3.27.0-Master (f261cc1f8b)
Public Member Functions | List of all members
QgsMeshContours Class Reference

Exporter of contours lines or polygons from a mesh layer. More...

#include <qgsmeshcontours.h>

Public Member Functions

 QgsMeshContours (const QgsTriangularMesh &triangularMesh, const QgsMesh &nativeMesh, const QVector< double > &datasetValues, const QgsMeshDataBlock scalarActiveFaceFlagValues)
 Constructs the mesh contours exporter directly with triangular mesh and dataset values to populate the cache with them. More...
 
 QgsMeshContours (QgsMeshLayer *layer)
 Constructs the mesh contours exporter. More...
 
 ~QgsMeshContours ()
 
QgsGeometry exportLines (const QgsMeshDatasetIndex &index, double value, QgsMeshRendererScalarSettings::DataResamplingMethod method, QgsFeedback *feedback=nullptr)
 Exports multi line string containing the contour line for particular dataset and value. More...
 
QgsGeometry exportLines (double value, QgsFeedback *feedback=nullptr)
 Exports multi line string containing the contour line for particular value using the data stored in the cache. More...
 
QgsGeometry exportPolygons (const QgsMeshDatasetIndex &index, double min_value, double max_value, QgsMeshRendererScalarSettings::DataResamplingMethod method, QgsFeedback *feedback=nullptr)
 Exports multi polygons representing the areas with values in range for particular dataset. More...
 
QgsGeometry exportPolygons (double min_value, double max_value, QgsFeedback *feedback=nullptr)
 Exports multi polygons representing the areas with values in range using the data stored in the cache. More...
 

Detailed Description

Exporter of contours lines or polygons from a mesh layer.

Since
QGIS 3.12

Definition at line 50 of file qgsmeshcontours.h.

Constructor & Destructor Documentation

◆ QgsMeshContours() [1/2]

QgsMeshContours::QgsMeshContours ( QgsMeshLayer layer)

Constructs the mesh contours exporter.

Caches the native and triangular mesh from data provider

Parameters
layermesh layer to be associated with this exporter

Definition at line 38 of file qgsmeshcontours.cpp.

◆ QgsMeshContours() [2/2]

QgsMeshContours::QgsMeshContours ( const QgsTriangularMesh triangularMesh,
const QgsMesh nativeMesh,
const QVector< double > &  datasetValues,
const QgsMeshDataBlock  scalarActiveFaceFlagValues 
)

Constructs the mesh contours exporter directly with triangular mesh and dataset values to populate the cache with them.

The cache can't be changed. This instance can be used in a thread safe way.

Parameters
triangularMeshtriangular mesh of the meshlayer
nativeMeshthe native mesh of the mesh layer
datasetValuesthe dataset values to used for creating contours defined on vertices
scalarActiveFaceFlagValuesactive face flag values
Note
for data on faces, the values are averaged on vertices to define contours
Since
QGIS 3.18

Definition at line 52 of file qgsmeshcontours.cpp.

◆ ~QgsMeshContours()

QgsMeshContours::~QgsMeshContours ( )
default

Member Function Documentation

◆ exportLines() [1/2]

QgsGeometry QgsMeshContours::exportLines ( const QgsMeshDatasetIndex index,
double  value,
QgsMeshRendererScalarSettings::DataResamplingMethod  method,
QgsFeedback feedback = nullptr 
)

Exports multi line string containing the contour line for particular dataset and value.

Parameters
indexdataset index that is used to update the cache
valuevalue of the contour line
methodfor datasets defined on faces, the method will be used to convert data to vertices
feedbackoptional feedback object for progress and cancellation support
Returns
MultiLineString geometry containing contour lines
Note
not thread safe

Definition at line 267 of file qgsmeshcontours.cpp.

◆ exportLines() [2/2]

QgsGeometry QgsMeshContours::exportLines ( double  value,
QgsFeedback feedback = nullptr 
)

Exports multi line string containing the contour line for particular value using the data stored in the cache.

Parameters
valuevalue of the contour line
feedbackoptional feedback object for progress and cancellation support
Returns
MultiLineString geometry containing contour lines
Note
thread safe
Since
QGIS 3.18

Definition at line 281 of file qgsmeshcontours.cpp.

◆ exportPolygons() [1/2]

QgsGeometry QgsMeshContours::exportPolygons ( const QgsMeshDatasetIndex index,
double  min_value,
double  max_value,
QgsMeshRendererScalarSettings::DataResamplingMethod  method,
QgsFeedback feedback = nullptr 
)

Exports multi polygons representing the areas with values in range for particular dataset.

Parameters
indexdataset index
min_valueminimum of the value interval for contour polygon
max_valuemaximum of the value interval for contour polygon
methodfor datasets defined on faces, the method will be used to convert data to vertices
feedbackoptional feedback object for progress and cancellation support
Returns
MultiPolygon geometry containing contour polygons
Note
not thread safe

Definition at line 64 of file qgsmeshcontours.cpp.

◆ exportPolygons() [2/2]

QgsGeometry QgsMeshContours::exportPolygons ( double  min_value,
double  max_value,
QgsFeedback feedback = nullptr 
)

Exports multi polygons representing the areas with values in range using the data stored in the cache.

Parameters
min_valueminimum of the value interval for contour polygon
max_valuemaximum of the value interval for contour polygon
feedbackoptional feedback object for progress and cancellation support
Returns
MultiPolygon geometry containing contour polygons
Note
thread safe
Since
QGIS 3.18

Definition at line 80 of file qgsmeshcontours.cpp.


The documentation for this class was generated from the following files: