QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsmeshcalculator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmeshcalculator.h
3  -------------------
4  begin : December 18th, 2018
5  copyright : (C) 2018 by Peter Petrik
6  email : zilolv at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSMESHCALCULATOR_H
19 #define QGSMESHCALCULATOR_H
20 
21 #include <QString>
22 #include <QVector>
23 #include <QStringList>
24 
25 #include "qgis_core.h"
26 #include "qgis_sip.h"
27 #include "qgsrectangle.h"
28 #include "qgsmeshlayer.h"
29 #include "qgsmeshdataprovider.h"
30 #include "qgsprovidermetadata.h"
31 #include "qgsfeedback.h"
32 
48 class CORE_EXPORT QgsMeshCalculator
49 {
50  public:
51 
53  enum Result
54  {
55  Success = 0,
63  };
64 
76  Q_DECL_DEPRECATED QgsMeshCalculator( const QString &formulaString,
77  const QString &outputFile,
78  const QgsRectangle &outputExtent,
79  double startTime,
80  double endTime,
82 
94  Q_DECL_DEPRECATED QgsMeshCalculator( const QString &formulaString,
95  const QString &outputFile,
96  const QgsGeometry &outputMask,
97  double startTime,
98  double endTime,
100 
114  QgsMeshCalculator( const QString &formulaString,
115  const QString &outputDriver,
116  const QString &outputGroupName,
117  const QString &outputFile,
118  const QgsRectangle &outputExtent,
119  double startTime,
120  double endTime,
121  QgsMeshLayer *layer );
122 
136  QgsMeshCalculator( const QString &formulaString,
137  const QString &outputDriver,
138  const QString &outputGroupName,
139  const QString &outputFile,
140  const QgsGeometry &outputMask,
141  double startTime,
142  double endTime,
143  QgsMeshLayer *layer );
144 
158  QgsMeshCalculator( const QString &formulaString,
159  const QString &outputGroupName,
160  const QgsRectangle &outputExtent,
161  const QgsMeshDatasetGroup::Type &destination,
162  QgsMeshLayer *layer,
163  double startTime,
164  double endTime );
165 
179  QgsMeshCalculator( const QString &formulaString,
180  const QString &outputGroupName,
181  const QgsGeometry &outputMask,
182  const QgsMeshDatasetGroup::Type &destination,
183  QgsMeshLayer *layer,
184  double startTime,
185  double endTime );
186 
192  Result processCalculation( QgsFeedback *feedback = nullptr );
193 
202  Q_DECL_DEPRECATED static Result expression_valid( const QString &formulaString,
203  QgsMeshLayer *layer ) SIP_DEPRECATED;
204 
214  static Result expressionIsValid( const QString &formulaString,
215  QgsMeshLayer *layer,
216  QgsMeshDriverMetadata::MeshDriverCapability &requiredCapability );
217 
218  private:
220 
221  QString mFormulaString;
222  QString mOutputDriver;
223  QString mOutputGroupName;
224  QString mOutputFile;
225  QgsRectangle mOutputExtent;
226  QgsGeometry mOutputMask;
227  bool mUseMask = false;
229  double mStartTime = 0.0;
230  double mEndTime = 0.0;
231  QgsMeshLayer *mMeshLayer = nullptr;
232 };
233 
234 #endif // QGSMESHCALCULATOR_H
QgsMeshCalculator::ParserError
@ ParserError
Error parsing formula.
Definition: qgsmeshcalculator.h:59
qgsrectangle.h
QgsMeshCalculator::MemoryError
@ MemoryError
Error allocating memory for result.
Definition: qgsmeshcalculator.h:62
QgsMeshDatasetGroup::Persistent
@ Persistent
Generic type used for non typed dataset group.
Definition: qgsmeshdataset.h:587
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
qgsprovidermetadata.h
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:44
QgsMeshLayer
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:95
qgis_sip.h
QgsMeshCalculator::Canceled
@ Canceled
Calculation canceled.
Definition: qgsmeshcalculator.h:56
QgsMeshCalculator::CreateOutputError
@ CreateOutputError
Error creating output data file.
Definition: qgsmeshcalculator.h:57
qgsmeshlayer.h
QgsMeshCalculator::InputLayerError
@ InputLayerError
Error reading input layer.
Definition: qgsmeshcalculator.h:58
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsMeshDatasetGroup::Type
Type
Type of the dataset group.
Definition: qgsmeshdataset.h:585
QgsMeshCalculator::InvalidDatasets
@ InvalidDatasets
Datasets with different time outputs or not part of the mesh.
Definition: qgsmeshcalculator.h:60
QgsMeshCalculator
Performs mesh layer calculations.
Definition: qgsmeshcalculator.h:49
qgsfeedback.h
qgsmeshdataprovider.h
QgsMeshCalculator::EvaluateError
@ EvaluateError
Error during evaluation.
Definition: qgsmeshcalculator.h:61
QgsMeshCalculator::Result
Result
Result of the calculation.
Definition: qgsmeshcalculator.h:54
QgsMeshDriverMetadata::MeshDriverCapability
MeshDriverCapability
Flags for the capabilities of the driver.
Definition: qgsprovidermetadata.h:64