QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 "qgsgeometry.h"
29 #include "qgsmeshdataset.h"
30 #include "qgsprovidermetadata.h"
31 
32 class QgsMeshLayer;
33 class QgsFeedback;
34 
50 class CORE_EXPORT QgsMeshCalculator
51 {
52  public:
53 
55  enum Result
56  {
57  Success = 0,
65  };
66 
78  Q_DECL_DEPRECATED QgsMeshCalculator( const QString &formulaString,
79  const QString &outputFile,
80  const QgsRectangle &outputExtent,
81  double startTime,
82  double endTime,
84 
96  Q_DECL_DEPRECATED QgsMeshCalculator( const QString &formulaString,
97  const QString &outputFile,
98  const QgsGeometry &outputMask,
99  double startTime,
100  double endTime,
101  QgsMeshLayer *layer ) SIP_DEPRECATED;
102 
116  QgsMeshCalculator( const QString &formulaString,
117  const QString &outputDriver,
118  const QString &outputGroupName,
119  const QString &outputFile,
120  const QgsRectangle &outputExtent,
121  double startTime,
122  double endTime,
123  QgsMeshLayer *layer );
124 
138  QgsMeshCalculator( const QString &formulaString,
139  const QString &outputDriver,
140  const QString &outputGroupName,
141  const QString &outputFile,
142  const QgsGeometry &outputMask,
143  double startTime,
144  double endTime,
145  QgsMeshLayer *layer );
146 
160  QgsMeshCalculator( const QString &formulaString,
161  const QString &outputGroupName,
162  const QgsRectangle &outputExtent,
163  const QgsMeshDatasetGroup::Type &destination,
164  QgsMeshLayer *layer,
165  double startTime,
166  double endTime );
167 
181  QgsMeshCalculator( const QString &formulaString,
182  const QString &outputGroupName,
183  const QgsGeometry &outputMask,
184  const QgsMeshDatasetGroup::Type &destination,
185  QgsMeshLayer *layer,
186  double startTime,
187  double endTime );
188 
194  Result processCalculation( QgsFeedback *feedback = nullptr );
195 
204  Q_DECL_DEPRECATED static Result expression_valid( const QString &formulaString,
205  QgsMeshLayer *layer ) SIP_DEPRECATED;
206 
216  static Result expressionIsValid( const QString &formulaString,
217  QgsMeshLayer *layer,
218  QgsMeshDriverMetadata::MeshDriverCapability &requiredCapability );
219 
220  private:
222 
223  QString mFormulaString;
224  QString mOutputDriver;
225  QString mOutputGroupName;
226  QString mOutputFile;
227  QgsRectangle mOutputExtent;
228  QgsGeometry mOutputMask;
229  bool mUseMask = false;
231  double mStartTime = 0.0;
232  double mEndTime = 0.0;
233  QgsMeshLayer *mMeshLayer = nullptr;
234 };
235 
236 #endif // QGSMESHCALCULATOR_H
QgsMeshCalculator::ParserError
@ ParserError
Error parsing formula.
Definition: qgsmeshcalculator.h:61
qgsrectangle.h
QgsMeshCalculator::MemoryError
@ MemoryError
Error allocating memory for result.
Definition: qgsmeshcalculator.h:64
QgsMeshDatasetGroup::Persistent
@ Persistent
Generic type used for non typed dataset group.
Definition: qgsmeshdataset.h:590
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:41
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:98
qgis_sip.h
QgsMeshCalculator::Canceled
@ Canceled
Calculation canceled.
Definition: qgsmeshcalculator.h:58
QgsMeshCalculator::CreateOutputError
@ CreateOutputError
Error creating output data file.
Definition: qgsmeshcalculator.h:59
QgsMeshCalculator::InputLayerError
@ InputLayerError
Error reading input layer.
Definition: qgsmeshcalculator.h:60
qgsgeometry.h
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:587
qgsmeshdataset.h
QgsMeshCalculator::InvalidDatasets
@ InvalidDatasets
Datasets with different time outputs or not part of the mesh.
Definition: qgsmeshcalculator.h:62
QgsMeshCalculator
Performs mesh layer calculations.
Definition: qgsmeshcalculator.h:50
QgsMeshCalculator::EvaluateError
@ EvaluateError
Error during evaluation.
Definition: qgsmeshcalculator.h:63
QgsMeshCalculator::Result
Result
Result of the calculation.
Definition: qgsmeshcalculator.h:55
QgsMeshDriverMetadata::MeshDriverCapability
MeshDriverCapability
Flags for the capabilities of the driver.
Definition: qgsprovidermetadata.h:66