2018-12-18 14:25:08 +01:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/mesh/qgsmeshcalculator.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsMeshCalculator
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Performs mesh layer calculations.
|
|
|
|
|
|
|
|
Mesh calculator can do various mathematical operations
|
|
|
|
between dataset groups from a single mesh layer.
|
|
|
|
Resulting dataset group is added to the mesh layer.
|
|
|
|
Result can be filtered by extent or a vector layer mask
|
|
|
|
spatially and by selection of times.
|
|
|
|
|
2019-12-06 18:27:28 +01:00
|
|
|
Resulting dataset is always scalar
|
2018-12-18 14:25:08 +01:00
|
|
|
|
|
|
|
.. versionadded:: 3.6
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmeshcalculator.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum Result
|
|
|
|
{
|
|
|
|
Success,
|
|
|
|
Canceled,
|
|
|
|
CreateOutputError,
|
|
|
|
InputLayerError,
|
|
|
|
ParserError,
|
|
|
|
InvalidDatasets,
|
|
|
|
EvaluateError,
|
|
|
|
MemoryError,
|
|
|
|
};
|
|
|
|
|
2019-12-06 18:27:28 +01:00
|
|
|
QgsMeshCalculator( const QString &formulaString,
|
|
|
|
const QString &outputFile,
|
|
|
|
const QgsRectangle &outputExtent,
|
|
|
|
double startTime,
|
|
|
|
double endTime,
|
|
|
|
QgsMeshLayer *layer ) /Deprecated/;
|
|
|
|
%Docstring
|
|
|
|
Creates calculator with bounding box (rectangular) mask
|
|
|
|
|
|
|
|
:param formulaString: formula/expression to evaluate. Consists of dataset group names, operators and numbers
|
|
|
|
:param outputFile: file to store the resulting dataset group data
|
|
|
|
:param outputExtent: spatial filter defined by rectangle
|
|
|
|
:param startTime: time filter defining the starting dataset
|
|
|
|
:param endTime: time filter defining the ending dataset
|
|
|
|
:param layer: mesh layer with dataset groups references in formulaString
|
|
|
|
|
|
|
|
.. deprecated::
|
|
|
|
QGIS 3.12
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsMeshCalculator( const QString &formulaString,
|
|
|
|
const QString &outputFile,
|
|
|
|
const QgsGeometry &outputMask,
|
|
|
|
double startTime,
|
|
|
|
double endTime,
|
|
|
|
QgsMeshLayer *layer ) /Deprecated/;
|
|
|
|
%Docstring
|
|
|
|
Creates calculator with geometry mask
|
|
|
|
|
|
|
|
:param formulaString: formula/expression to evaluate. Consists of dataset group names, operators and numbers
|
|
|
|
:param outputFile: file to store the resulting dataset group data
|
|
|
|
:param outputMask: spatial filter defined by geometry
|
|
|
|
:param startTime: time filter defining the starting dataset
|
|
|
|
:param endTime: time filter defining the ending dataset
|
|
|
|
:param layer: mesh layer with dataset groups references in formulaString
|
|
|
|
|
|
|
|
.. deprecated::
|
|
|
|
QGIS 3.12
|
|
|
|
%End
|
|
|
|
|
2018-12-18 14:25:08 +01:00
|
|
|
QgsMeshCalculator( const QString &formulaString,
|
2019-12-06 18:27:28 +01:00
|
|
|
const QString &outputDriver,
|
|
|
|
const QString &outputGroupName,
|
2018-12-18 14:25:08 +01:00
|
|
|
const QString &outputFile,
|
|
|
|
const QgsRectangle &outputExtent,
|
|
|
|
double startTime,
|
|
|
|
double endTime,
|
|
|
|
QgsMeshLayer *layer );
|
|
|
|
%Docstring
|
|
|
|
Creates calculator with bounding box (rectangular) mask
|
|
|
|
|
|
|
|
:param formulaString: formula/expression to evaluate. Consists of dataset group names, operators and numbers
|
2019-12-06 18:27:28 +01:00
|
|
|
:param outputDriver: output driver name
|
|
|
|
:param outputGroupName: output group name
|
2018-12-18 14:25:08 +01:00
|
|
|
:param outputFile: file to store the resulting dataset group data
|
|
|
|
:param outputExtent: spatial filter defined by rectangle
|
|
|
|
:param startTime: time filter defining the starting dataset
|
|
|
|
:param endTime: time filter defining the ending dataset
|
|
|
|
:param layer: mesh layer with dataset groups references in formulaString
|
2019-12-06 18:27:28 +01:00
|
|
|
|
|
|
|
.. versionadded:: 3.12
|
2018-12-18 14:25:08 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsMeshCalculator( const QString &formulaString,
|
2019-12-06 18:27:28 +01:00
|
|
|
const QString &outputDriver,
|
|
|
|
const QString &outputGroupName,
|
2018-12-18 14:25:08 +01:00
|
|
|
const QString &outputFile,
|
|
|
|
const QgsGeometry &outputMask,
|
|
|
|
double startTime,
|
|
|
|
double endTime,
|
|
|
|
QgsMeshLayer *layer );
|
|
|
|
%Docstring
|
|
|
|
Creates calculator with geometry mask
|
|
|
|
|
|
|
|
:param formulaString: formula/expression to evaluate. Consists of dataset group names, operators and numbers
|
2019-12-06 18:27:28 +01:00
|
|
|
:param outputDriver: output driver name
|
|
|
|
:param outputGroupName: output group name
|
2018-12-18 14:25:08 +01:00
|
|
|
:param outputFile: file to store the resulting dataset group data
|
|
|
|
:param outputMask: spatial filter defined by geometry
|
|
|
|
:param startTime: time filter defining the starting dataset
|
|
|
|
:param endTime: time filter defining the ending dataset
|
|
|
|
:param layer: mesh layer with dataset groups references in formulaString
|
2019-12-06 18:27:28 +01:00
|
|
|
|
|
|
|
.. versionadded:: 3.12
|
2018-12-18 14:25:08 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
Result processCalculation( QgsFeedback *feedback = 0 );
|
|
|
|
%Docstring
|
|
|
|
Starts the calculation, writes new dataset group to file and adds it to the mesh layer
|
|
|
|
|
2019-02-24 10:15:32 +01:00
|
|
|
:param feedback: The optional feedback argument for progress reporting and cancellation support
|
2018-12-18 14:25:08 +01:00
|
|
|
|
|
|
|
:return: QgsMeshCalculator.Success in case of success
|
|
|
|
%End
|
|
|
|
|
2019-12-06 18:27:28 +01:00
|
|
|
static Result expression_valid( const QString &formulaString,
|
|
|
|
QgsMeshLayer *layer ) /Deprecated/;
|
|
|
|
%Docstring
|
|
|
|
Returns whether formula is valid for particular mesh layer
|
|
|
|
|
|
|
|
:param formulaString: formula/expression to evaluate. Consists of dataset group names, operators and numbers
|
|
|
|
:param layer: mesh layer with dataset groups references in formulaString
|
|
|
|
|
|
|
|
:return: QgsMeshCalculator.Success in case of success
|
|
|
|
|
|
|
|
.. deprecated::
|
|
|
|
QGIS 3.12 - use expressionIsValid
|
|
|
|
%End
|
|
|
|
|
|
|
|
static Result expressionIsValid( const QString &formulaString,
|
|
|
|
QgsMeshLayer *layer,
|
|
|
|
QgsMeshDriverMetadata::MeshDriverCapability &requiredCapability );
|
2018-12-18 14:25:08 +01:00
|
|
|
%Docstring
|
|
|
|
Returns whether formula is valid for particular mesh layer
|
|
|
|
|
|
|
|
:param formulaString: formula/expression to evaluate. Consists of dataset group names, operators and numbers
|
|
|
|
:param layer: mesh layer with dataset groups references in formulaString
|
2019-12-06 18:27:28 +01:00
|
|
|
:param requiredCapability: returns required capability of driver to store results of the calculation
|
2018-12-18 14:25:08 +01:00
|
|
|
|
|
|
|
:return: QgsMeshCalculator.Success in case of success
|
2019-12-06 18:27:28 +01:00
|
|
|
|
|
|
|
.. versionadded:: 3.12
|
2018-12-18 14:25:08 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/mesh/qgsmeshcalculator.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|