18#ifndef QGSMESH3DAVERAGING_H 
   19#define QGSMESH3DAVERAGING_H 
   31class 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      int &singleVerticalLevel,
 
  144      const QVector<double> &verticalLevels ) 
const = 0;
 
  183    QDomElement writeXml( QDomDocument &doc ) 
const override;
 
  184    void readXml( 
const QDomElement &elem ) 
override;
 
  196    int startVerticalLevel() const;
 
  206    int endVerticalLevel() const;
 
  211    bool countedFromTop() const;
 
  216    bool isSingleLevel() const;
 
  219    bool hasValidInputs() const override;
 
  220    void volumeRangeForFace( 
double &startVerticalLevel,
 
  221                             double &endVerticalLevel,
 
  222                             int &singleVerticalIndex,
 
  223                             const QVector<
double> &verticalLevels ) const override;
 
  224    void setLevels( 
int startVerticalLevel, 
int endVerticalLevel );
 
  225    int mStartVerticalLevel = 1;
 
  226    int mEndVerticalLevel = 1;
 
  227    bool mCountedFromTop = true;
 
  254    QDomElement writeXml( QDomDocument &doc ) 
const override;
 
  255    void readXml( 
const QDomElement &elem ) 
override;
 
  265    double startFraction() const;
 
  273    double endFraction() const;
 
  276    bool hasValidInputs() const override;
 
  277    void volumeRangeForFace( 
double &startVerticalLevel,
 
  278                             double &endVerticalLevel,
 
  279                             int &singleVerticalIndex,
 
  280                             const QVector<
double> &verticalLevels ) const override;
 
  282    double mStartFraction = 0;
 
  283    double mEndFraction = 1;
 
  319    QDomElement writeXml( QDomDocument &doc ) 
const override;
 
  320    void readXml( 
const QDomElement &elem ) 
override;
 
  329    double startHeight() const;
 
  336    double endHeight() const;
 
  341    bool countedFromTop() const;
 
  344    bool hasValidInputs() const override;
 
  345    void volumeRangeForFace( 
double &startVerticalLevel,
 
  346                             double &endVerticalLevel,
 
  347                             int &singleVerticalIndex,
 
  348                             const QVector<
double> &verticalLevels ) const override;
 
  349    double mStartHeight = 0;
 
  350    double mEndHeight = 0;
 
  351    bool mCountedFromTop = true;
 
  380    QDomElement writeXml( QDomDocument &doc ) 
const override;
 
  381    void readXml( 
const QDomElement &elem ) 
override;
 
  388    double startElevation() const;
 
  393    double endElevation() const;
 
  396    bool hasValidInputs() const override;
 
  397    void volumeRangeForFace( 
double &startVerticalLevel,
 
  398                             double &endVerticalLevel,
 
  399                             int &singleVerticalIndex,
 
  400                             const QVector<
double> &verticalLevels ) const override;
 
  401    double mStartElevation = 0;
 
  402    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 QgsMesh3dAveragingMethod * clone() const =0
Clone the instance.
 
virtual QDomElement writeXml(QDomDocument &doc) const =0
Writes configuration to a new DOM element.
 
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)