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;
 
  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;
 
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Abstract class to interpolate 3d stacked mesh data to 2d data.
virtual void readXml(const QDomElement &elem)=0
Reads configuration from the given DOM element.
virtual ~QgsMesh3dAveragingMethod()=default
Dtor.
virtual bool equals(const QgsMesh3dAveragingMethod *other) const =0
Returns whether method equals to other.
Method
Type of averaging method.
@ RelativeHeightAveragingMethod
Method to average values defined by range of relative length units to the surface or bed level.
@ MultiLevelsAveragingMethod
Method to average values from selected vertical layers.
@ ElevationAveragingMethod
Method to average values defined by range of absolute length units to the model's datum.
@ SigmaAveragingMethod
Method to average values between 0 (bed level) and 1 (surface)
virtual QDomElement writeXml(QDomDocument &doc) const =0
Writes configuration to a new DOM element.
virtual QgsMesh3dAveragingMethod * clone() const =0
Clone the instance.
QgsMesh3dDataBlock is a block of 3d stacked mesh data related N faces defined on base mesh frame.
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e....
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
Elevation averaging method averages the values based on range defined absolute value to the model's d...
~QgsMeshElevationAveragingMethod() override
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Multi level averaging method specifies limits of vertical layers from the top layer down or reversed.
~QgsMeshMultiLevelsAveragingMethod() override
Relative height averaging method averages the values based on range defined relative to bed elevation...
~QgsMeshRelativeHeightAveragingMethod() override
Sigma averages over the values between 0 (bed level) and 1 (surface).
~QgsMeshSigmaAveragingMethod() override
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)