QGIS API Documentation  3.8.0-Zanzibar (11aff65)
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 
24 #include "qgis_analysis.h"
25 #include "qgsrectangle.h"
26 #include "qgsmeshlayer.h"
27 #include "qgsmeshdataprovider.h"
28 #include "qgsfeedback.h"
29 
30 struct QgsMeshMemoryDatasetGroup;
31 struct QgsMeshMemoryDataset;
32 
49 class ANALYSIS_EXPORT QgsMeshCalculator
50 {
51  public:
52 
54  enum Result
55  {
56  Success = 0,
64  };
65 
75  QgsMeshCalculator( const QString &formulaString,
76  const QString &outputFile,
77  const QgsRectangle &outputExtent,
78  double startTime,
79  double endTime,
80  QgsMeshLayer *layer );
81 
91  QgsMeshCalculator( const QString &formulaString,
92  const QString &outputFile,
93  const QgsGeometry &outputMask,
94  double startTime,
95  double endTime,
96  QgsMeshLayer *layer );
97 
103  Result processCalculation( QgsFeedback *feedback = nullptr );
104 
111  static Result expression_valid( const QString &formulaString, QgsMeshLayer *layer );
112 
113  private:
115 
116  QString mFormulaString;
117  QString mOutputFile;
118  QgsRectangle mOutputExtent;
119  QgsGeometry mOutputMask;
120  bool mUseMask = false;
121  double mStartTime = 0.0;
122  double mEndTime = 0.0;
123  QgsMeshLayer *mMeshLayer = nullptr;
124 };
125 
126 #endif // QGSMESHCALCULATOR_H
Result
Result of the calculation.
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Error allocating memory for result.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:111
Error during evaluation.
Base class for feedback objects to be used for cancellation of something running in a worker thread...
Definition: qgsfeedback.h:44
Error parsing formula.
Datasets with different time outputs or not part of the mesh.
Performs mesh layer calculations.
Error reading input layer.
Error creating output data file.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:90
Calculation canceled.