QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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_analysis.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 
33 struct QgsMeshMemoryDatasetGroup;
34 struct QgsMeshMemoryDataset;
35 
51 class ANALYSIS_EXPORT QgsMeshCalculator
52 {
53  public:
54 
56  enum Result
57  {
58  Success = 0,
66  };
67 
79  Q_DECL_DEPRECATED QgsMeshCalculator( const QString &formulaString,
80  const QString &outputFile,
81  const QgsRectangle &outputExtent,
82  double startTime,
83  double endTime,
85 
97  Q_DECL_DEPRECATED QgsMeshCalculator( const QString &formulaString,
98  const QString &outputFile,
99  const QgsGeometry &outputMask,
100  double startTime,
101  double endTime,
102  QgsMeshLayer *layer ) SIP_DEPRECATED;
103 
117  QgsMeshCalculator( const QString &formulaString,
118  const QString &outputDriver,
119  const QString &outputGroupName,
120  const QString &outputFile,
121  const QgsRectangle &outputExtent,
122  double startTime,
123  double endTime,
124  QgsMeshLayer *layer );
125 
139  QgsMeshCalculator( const QString &formulaString,
140  const QString &outputDriver,
141  const QString &outputGroupName,
142  const QString &outputFile,
143  const QgsGeometry &outputMask,
144  double startTime,
145  double endTime,
146  QgsMeshLayer *layer );
147 
153  Result processCalculation( QgsFeedback *feedback = nullptr );
154 
163  Q_DECL_DEPRECATED static Result expression_valid( const QString &formulaString,
164  QgsMeshLayer *layer ) SIP_DEPRECATED;
165 
175  static Result expressionIsValid( const QString &formulaString,
176  QgsMeshLayer *layer,
177  QgsMeshDriverMetadata::MeshDriverCapability &requiredCapability );
178 
179  private:
181 
182  QString mFormulaString;
183  QString mOutputDriver;
184  QString mOutputGroupName;
185  QString mOutputFile;
186  QgsRectangle mOutputExtent;
187  QgsGeometry mOutputMask;
188  bool mUseMask = false;
189  double mStartTime = 0.0;
190  double mEndTime = 0.0;
191  QgsMeshLayer *mMeshLayer = nullptr;
192 };
193 
194 #endif // QGSMESHCALCULATOR_H
QgsMeshCalculator::ParserError
@ ParserError
Error parsing formula.
Definition: qgsmeshcalculator.h:62
qgsrectangle.h
QgsMeshCalculator::MemoryError
@ MemoryError
Error allocating memory for result.
Definition: qgsmeshcalculator.h:65
QgsRectangle
Definition: qgsrectangle.h:41
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
qgsprovidermetadata.h
QgsFeedback
Definition: qgsfeedback.h:43
QgsMeshLayer
Definition: qgsmeshlayer.h:94
qgis_sip.h
QgsMeshCalculator::Canceled
@ Canceled
Calculation canceled.
Definition: qgsmeshcalculator.h:59
QgsMeshCalculator::CreateOutputError
@ CreateOutputError
Error creating output data file.
Definition: qgsmeshcalculator.h:60
qgsmeshlayer.h
QgsMeshCalculator::InputLayerError
@ InputLayerError
Error reading input layer.
Definition: qgsmeshcalculator.h:61
QgsGeometry
Definition: qgsgeometry.h:122
QgsMeshCalculator::InvalidDatasets
@ InvalidDatasets
Datasets with different time outputs or not part of the mesh.
Definition: qgsmeshcalculator.h:63
QgsMeshCalculator
Definition: qgsmeshcalculator.h:51
qgsfeedback.h
qgsmeshdataprovider.h
QgsMeshCalculator::EvaluateError
@ EvaluateError
Error during evaluation.
Definition: qgsmeshcalculator.h:64
QgsMeshCalculator::Result
Result
Result of the calculation.
Definition: qgsmeshcalculator.h:56
QgsMeshDriverMetadata::MeshDriverCapability
MeshDriverCapability
Flags for the capabilities of the driver.
Definition: qgsprovidermetadata.h:61