18 #ifndef QGSMESH3DAVERAGING_H
19 #define QGSMESH3DAVERAGING_H
21 #include "qgis_core.h"
24 #include <QDomElement>
31 class QgsMeshRenderer3dAveragingSettings;
48 if ( averagingMethod )
50 switch ( averagingMethod->method() )
53 sipType = sipType_QgsMeshMultiLevelsAveragingMethod;
56 sipType = sipType_QgsMeshSigmaAveragingMethod;
59 sipType = sipType_QgsMeshRelativeHeightAveragingMethod;
62 sipType = sipType_QgsMeshElevationAveragingMethod;
77 MultiLevelsAveragingMethod = 0,
83 ElevationAveragingMethod
98 virtual QDomElement writeXml( QDomDocument &doc )
const = 0;
104 virtual void readXml(
const QDomElement &elem ) = 0;
116 Method method()
const;
120 virtual bool hasValidInputs()
const = 0;
125 void averageVolumeValuesForFace(
127 int volumesBelowFaceCount,
128 int startVolumeIndex,
129 double methodLevelTop,
130 double methodLevelBottom,
132 const QVector<double> &verticalLevelsForFace,
133 const QVector<double> &volumeValues,
134 QVector<double> &valuesFaces
140 virtual void volumeRangeForFace(
141 double &startVerticalLevel,
142 double &endVerticalLevel,
143 const QVector<double> &verticalLevels )
const = 0;
182 QDomElement
writeXml( QDomDocument &doc )
const override;
183 void readXml(
const QDomElement &elem )
override;
195 int startVerticalLevel()
const;
205 int endVerticalLevel()
const;
210 bool countedFromTop()
const;
215 bool isSingleLevel()
const;
218 bool hasValidInputs()
const override;
219 void volumeRangeForFace(
double &startVerticalLevel,
220 double &endVerticalLevel,
221 const QVector<double> &verticalLevels )
const override;
222 void setLevels(
int startVerticalLevel,
int endVerticalLevel );
223 int mStartVerticalLevel = 1;
224 int mEndVerticalLevel = 1;
225 bool mCountedFromTop =
true;
252 QDomElement
writeXml( QDomDocument &doc )
const override;
253 void readXml(
const QDomElement &elem )
override;
263 double startFraction()
const;
271 double endFraction()
const;
274 bool hasValidInputs()
const override;
275 void volumeRangeForFace(
double &startVerticalLevel,
276 double &endVerticalLevel,
277 const QVector<double> &verticalLevels )
const override;
279 double mStartFraction = 0;
280 double mEndFraction = 1;
316 QDomElement
writeXml( QDomDocument &doc )
const override;
317 void readXml(
const QDomElement &elem )
override;
326 double startHeight()
const;
333 double endHeight()
const;
338 bool countedFromTop()
const;
341 bool hasValidInputs()
const override;
342 void volumeRangeForFace(
double &startVerticalLevel,
343 double &endVerticalLevel,
344 const QVector<double> &verticalLevels )
const override;
345 double mStartHeight = 0;
346 double mEndHeight = 0;
347 bool mCountedFromTop =
true;
376 QDomElement
writeXml( QDomDocument &doc )
const override;
377 void readXml(
const QDomElement &elem )
override;
384 double startElevation()
const;
389 double endElevation()
const;
392 bool hasValidInputs()
const override;
393 void volumeRangeForFace(
double &startVerticalLevel,
394 double &endVerticalLevel,
395 const QVector<double> &verticalLevels )
const override;
396 double mStartElevation = 0;
397 double mEndElevation = 0;
400 #endif // QGSMESH3DAVERAGING_H