18 #ifndef QGSMESHCALCUTILS_H 19 #define QGSMESHCALCUTILS_H 25 #include <QStringList> 37 #include "qgis_analysis.h" 39 struct QgsMeshMemoryDatasetGroup;
40 struct QgsMeshMemoryDataset;
51 class ANALYSIS_EXPORT QgsMeshCalcUtils
63 const QStringList &usedGroupNames,
74 std::shared_ptr<const QgsMeshMemoryDatasetGroup> group(
const QString &groupName )
const;
77 void ones( QgsMeshMemoryDatasetGroup &group1 )
const;
80 void nodata( QgsMeshMemoryDatasetGroup &group1 )
const;
83 std::shared_ptr<QgsMeshMemoryDataset> number(
double val,
double time )
const;
86 void copy( QgsMeshMemoryDatasetGroup &group1,
const QString &groupName )
const;
89 std::shared_ptr<QgsMeshMemoryDataset> copy( std::shared_ptr<const QgsMeshMemoryDataset> dataset0 )
const;
92 void transferDatasets( QgsMeshMemoryDatasetGroup &group1, QgsMeshMemoryDatasetGroup &group2 )
const;
95 void expand( QgsMeshMemoryDatasetGroup &group1,
96 const QgsMeshMemoryDatasetGroup &group2 )
const;
99 void number( QgsMeshMemoryDatasetGroup &group1,
double val )
const;
102 void addIf( QgsMeshMemoryDatasetGroup &trueGroup,
103 const QgsMeshMemoryDatasetGroup &falseGroup,
104 const QgsMeshMemoryDatasetGroup &condition )
const;
107 void filter( QgsMeshMemoryDatasetGroup &group1,
const QgsRectangle &extent )
const;
110 void filter( QgsMeshMemoryDatasetGroup &group1,
const QgsGeometry &mask )
const;
113 void logicalNot( QgsMeshMemoryDatasetGroup &group1 )
const;
116 void changeSign( QgsMeshMemoryDatasetGroup &group1 )
const;
119 void abs( QgsMeshMemoryDatasetGroup &group1 )
const;
122 void sumAggregated( QgsMeshMemoryDatasetGroup &group1 )
const;
125 void minimumAggregated( QgsMeshMemoryDatasetGroup &group1 )
const;
128 void maximumAggregated( QgsMeshMemoryDatasetGroup &group1 )
const;
131 void averageAggregated( QgsMeshMemoryDatasetGroup &group1 )
const;
134 void add( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
137 void subtract( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
140 void multiply( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
143 void divide( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
146 void power( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
149 void equal( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
152 void notEqual( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
155 void greaterThan( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
158 void lesserThan( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
161 void lesserEqual( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
164 void greaterEqual( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
167 void logicalAnd( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
170 void logicalOr( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
173 void minimum( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
176 void maximum( QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
179 double ffilter(
double val1,
double filter )
const;
180 double fadd(
double val1,
double val2 )
const;
181 double fsubtract(
double val1,
double val2 )
const;
182 double fmultiply(
double val1,
double val2 )
const;
183 double fdivide(
double val1,
double val2 )
const;
184 double fpower(
double val1,
double val2 )
const;
185 double fequal(
double val1,
double val2 )
const;
186 double fnotEqual(
double val1,
double val2 )
const;
187 double fgreaterThan(
double val1,
double val2 )
const;
188 double flesserThan(
double val1,
double val2 )
const;
189 double flesserEqual(
double val1,
double val2 )
const;
190 double fgreaterEqual(
double val1,
double val2 )
const;
191 double flogicalAnd(
double val1,
double val2 )
const;
192 double flogicalOr(
double val1,
double val2 )
const;
193 double flogicalNot(
double val1 )
const;
194 double fchangeSign(
double val1 )
const;
195 double fmin(
double val1,
double val2 )
const;
196 double fmax(
double val1,
double val2 )
const;
197 double fabs(
double val1 )
const;
198 double fsumAggregated( QVector<double> &vals )
const;
199 double fminimumAggregated( QVector<double> &vals )
const;
200 double fmaximumAggregated( QVector<double> &vals )
const;
201 double faverageAggregated( QVector<double> &vals )
const;
208 std::shared_ptr<QgsMeshMemoryDatasetGroup> create(
const QString &datasetGroupName )
const;
213 std::shared_ptr<QgsMeshMemoryDataset> create(
const QgsMeshMemoryDatasetGroup &grp )
const;
223 std::shared_ptr<QgsMeshMemoryDataset> canditateDataset( QgsMeshMemoryDatasetGroup &group,
224 int datasetIndex )
const;
229 std::shared_ptr<const QgsMeshMemoryDataset> constCandidateDataset(
const QgsMeshMemoryDatasetGroup &group,
230 int datasetIndex )
const;
235 int datasetCount(
const QgsMeshMemoryDatasetGroup &group1,
const QgsMeshMemoryDatasetGroup &group2 )
const;
242 void activate( std::shared_ptr<QgsMeshMemoryDataset> dataset,
243 std::shared_ptr<const QgsMeshMemoryDataset> refDataset =
nullptr )
const;
246 void activate( QgsMeshMemoryDatasetGroup &group )
const;
249 void populateSpatialFilter( QgsMeshMemoryDatasetGroup &filter,
const QgsRectangle &extent )
const;
252 void populateMaskFilter( QgsMeshMemoryDatasetGroup &filter,
const QgsGeometry &mask )
const;
255 void func1( QgsMeshMemoryDatasetGroup &group,
256 std::function<
double(
double )> func )
const;
259 void func2( QgsMeshMemoryDatasetGroup &group1,
260 const QgsMeshMemoryDatasetGroup &group2,
261 std::function<
double(
double,
double )> func )
const;
264 void funcAggr( QgsMeshMemoryDatasetGroup &group1,
265 std::function<
double( QVector<double>& )> func )
const;
268 const QgsMesh *nativeMesh()
const;
269 void updateMesh()
const;
274 QVector<double> mTimes;
276 QMap < QString, std::shared_ptr<QgsMeshMemoryDatasetGroup> > mDatasetGroupMap;
281 #endif // QGSMESHCALCUTILS_H A rectangle specified with double values.
Triangular/Derived Mesh is mesh with vertices in map coordinates.
A geometry is the spatial representation of a feature.
Mesh - vertices and faces.
Represents a mesh layer supporting display of data on structured or unstructured meshes.