QGIS/python/core/auto_generated/mesh/qgsmesh3daveraging.sip.in
Nyall Dawson 3f6b490218 Sipify
2025-04-02 11:11:10 +10:00

412 lines
12 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmesh3daveraging.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsMesh3DAveragingMethod /Abstract/
{
%Docstring(signature="appended")
Abstract class for interpolating 3d stacked mesh data to 2d data.
.. note::
In QGIS 3.34 this class was renamed from :py:class:`QgsMesh3dAveragingMethod` to :py:class:`QgsMesh3DAveragingMethod`. The old :py:class:`QgsMesh3dAveragingMethod` name
remains available in PyQGIS for compatibility.
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsmesh3daveraging.h"
%End
%ConvertToSubClassCode
QgsMesh3DAveragingMethod *averagingMethod = dynamic_cast<QgsMesh3DAveragingMethod *>( sipCpp );
sipType = 0;
if ( averagingMethod )
{
switch ( averagingMethod->method() )
{
case QgsMesh3DAveragingMethod::MultiLevelsAveragingMethod:
sipType = sipType_QgsMeshMultiLevelsAveragingMethod;
break;
case QgsMesh3DAveragingMethod::SigmaAveragingMethod:
sipType = sipType_QgsMeshSigmaAveragingMethod;
break;
case QgsMesh3DAveragingMethod::RelativeHeightAveragingMethod:
sipType = sipType_QgsMeshRelativeHeightAveragingMethod;
break;
case QgsMesh3DAveragingMethod::ElevationAveragingMethod:
sipType = sipType_QgsMeshElevationAveragingMethod;
break;
default:
sipType = nullptr;
break;
}
}
%End
public:
enum Method
{
//! Method to average values from selected vertical layers
MultiLevelsAveragingMethod,
//! Method to average values between 0 (bed level) and 1 (surface)
SigmaAveragingMethod,
//! Method to average values defined by range of relative length units to the surface or bed level
RelativeHeightAveragingMethod,
//! Method to average values defined by range of absolute length units to the model's datum
ElevationAveragingMethod
};
QgsMesh3DAveragingMethod( Method method );
%Docstring
Ctor
%End
virtual ~QgsMesh3DAveragingMethod();
QgsMeshDataBlock calculate( const QgsMesh3DDataBlock &block3d, QgsFeedback *feedback = 0 ) const;
%Docstring
Calculated 2d block values from 3d stacked mesh values
%End
virtual QDomElement writeXml( QDomDocument &doc ) const = 0;
%Docstring
Writes configuration to a new DOM element
%End
static QgsMesh3DAveragingMethod *createFromXml( const QDomElement &elem ) /Factory/;
%Docstring
Creates the instance from XML by calling readXml of derived classes
%End
virtual void readXml( const QDomElement &elem ) = 0;
%Docstring
Reads configuration from the given DOM element
%End
static bool equals( const QgsMesh3DAveragingMethod *a, const QgsMesh3DAveragingMethod *b );
%Docstring
Returns whether two methods equal
%End
virtual bool equals( const QgsMesh3DAveragingMethod *other ) const = 0;
%Docstring
Returns whether method equals to other
%End
virtual QgsMesh3DAveragingMethod *clone() const = 0 /Factory/;
%Docstring
Clone the instance
%End
Method method() const;
%Docstring
Returns type of averaging method
%End
};
class QgsMeshMultiLevelsAveragingMethod: QgsMesh3DAveragingMethod
{
%Docstring(signature="appended")
Multi level averaging method specifies limits of vertical layers from
the top layer down or reversed.
The limits will be truncated to the maximum number of vertical layers.
To pick value from a single layer, specify the upper and lower limit to
be the same
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsmesh3daveraging.h"
%End
public:
QgsMeshMultiLevelsAveragingMethod();
%Docstring
Constructs single level averaging method for 1st (top) vertical level
%End
QgsMeshMultiLevelsAveragingMethod( int startLevel, int endLevel, bool countedFromTop );
%Docstring
Constructs multi level averaging method
:param startLevel: starting vertical level index numbered from 1
:param endLevel: ending vertical level index numbered from 1 (higher or
equal than startLevel)
:param countedFromTop: if ``True``, the startLevel index is counted from
surface (index 1 is the top layer). if ``False``,
the startLevel index is counted from the bed
level (index 1 is the bottom layer)
%End
QgsMeshMultiLevelsAveragingMethod( int verticalLevel, bool countedFromTop );
%Docstring
Constructs single level averaging method
:param verticalLevel: vertical level index numbered from 1
:param countedFromTop: if ``True``, the startLevel index is counted from
surface (index 1 is the top layer). if ``False``,
the startLevel index is counted from the bed
level (index 1 is the bottom layer)
%End
~QgsMeshMultiLevelsAveragingMethod();
virtual QDomElement writeXml( QDomDocument &doc ) const;
virtual void readXml( const QDomElement &elem );
virtual bool equals( const QgsMesh3DAveragingMethod *other ) const;
virtual QgsMesh3DAveragingMethod *clone() const /Factory/;
int startVerticalLevel() const;
%Docstring
Returns starting vertical level.
Numbered from 1. If
:py:func:`~QgsMeshMultiLevelsAveragingMethod.countedFromTop`, 1
represents the top (surface) level, otherwise 1 represents the bottom
(bed) level
Always lower or equal than
:py:func:`~QgsMeshMultiLevelsAveragingMethod.endVerticalLevel`
%End
int endVerticalLevel() const;
%Docstring
Returns ending vertical level.
Numbered from 1. If
:py:func:`~QgsMeshMultiLevelsAveragingMethod.countedFromTop`, 1
represents the top (surface) level, otherwise 1 represents the bottom
(bed) level
Always lower or equal than
:py:func:`~QgsMeshMultiLevelsAveragingMethod.endVerticalLevel`
%End
bool countedFromTop() const;
%Docstring
Returns whether the start and end vertical levels are indexed from top
(surface) or bottom (bed) level
%End
bool isSingleLevel() const;
%Docstring
Returns whether the averaging method selects only a single vertical
level
%End
};
class QgsMeshSigmaAveragingMethod: QgsMesh3DAveragingMethod
{
%Docstring(signature="appended")
Sigma averages over the values between 0 (bed level) and 1 (surface).
The fractions will be truncated to 0-1. For example: the average of
between a quarter and 3 quarters of the water column - Sigma from 0.25
to 0.75
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsmesh3daveraging.h"
%End
public:
QgsMeshSigmaAveragingMethod();
%Docstring
Constructs the sigma method for whole value range 0-1
%End
QgsMeshSigmaAveragingMethod( double startFraction, double endFraction );
%Docstring
Constructs the sigma method
:param startFraction: starting fraction (0-1)
:param endFraction: ending fraction, must be higher or equal than
startFraction (0-1)
%End
~QgsMeshSigmaAveragingMethod();
virtual QDomElement writeXml( QDomDocument &doc ) const;
virtual void readXml( const QDomElement &elem );
virtual bool equals( const QgsMesh3DAveragingMethod *other ) const;
virtual QgsMesh3DAveragingMethod *clone() const /Factory/;
double startFraction() const;
%Docstring
Returns starting fraction.
In range 0-1, where 1 means the surface level and 0 bed level. Always
lower or equal than :py:func:`~QgsMeshSigmaAveragingMethod.endFraction`
%End
double endFraction() const;
%Docstring
Returns ending fraction.
In range 0-1, where 1 means the surface level and 0 bed level. Always
higher or equal than
:py:func:`~QgsMeshSigmaAveragingMethod.startFraction`
%End
};
class QgsMeshRelativeHeightAveragingMethod: QgsMesh3DAveragingMethod
{
%Docstring(signature="appended")
Relative height averaging method which averages the values based on
range defined relative to bed elevation or surface.
The range is defined in the same length units as defined by model (e.g.
meters)
If :py:func:`~countedFromTop`, the method represents averaging based on
depth below surface. For example one can pull out results for between 6
to 12 meters below the water surface - depth from 6m to 12m. The depth
will be truncated at the bed level.
If not :py:func:`~countedFromTop`, the method represents averaging based
on height above bed level. For example one can pull out results for
between 6 to 12 meters above the bed - height from 6m to 12m. The height
will be truncated at the bed level.
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsmesh3daveraging.h"
%End
public:
QgsMeshRelativeHeightAveragingMethod();
%Docstring
Constructs default depth averaging method
%End
QgsMeshRelativeHeightAveragingMethod( double startHeight, double endHeight, bool countedFromTop );
%Docstring
Constructs the depth/height averaging method
:param startHeight: starting depth/height, higher or equal than 0
:param endHeight: ending depth/height, higher or equal than startDepth
:param countedFromTop: if ``True``, the startLength and endLength is
relative to surface (0 is surface level). if
``False``, the startLength and endLength is
relative to bed (0 is bed level).
%End
~QgsMeshRelativeHeightAveragingMethod();
virtual QDomElement writeXml( QDomDocument &doc ) const;
virtual void readXml( const QDomElement &elem );
virtual bool equals( const QgsMesh3DAveragingMethod *other ) const;
virtual QgsMesh3DAveragingMethod *clone() const /Factory/;
double startHeight() const;
%Docstring
Returns starting depth/height.
Always lower or equal than
:py:func:`~QgsMeshRelativeHeightAveragingMethod.endLength`
%End
double endHeight() const;
%Docstring
Returns ending depth/height.
Always higher or equal than
:py:func:`~QgsMeshRelativeHeightAveragingMethod.startLength`
%End
bool countedFromTop() const;
%Docstring
Returns whether the start and end vertical levels are relative to top
(surface) or bottom (bed) level
%End
};
class QgsMeshElevationAveragingMethod: QgsMesh3DAveragingMethod
{
%Docstring(signature="appended")
Elevation averaging method averages the values based on range defined
absolute value to the model's datum.
The range is defined in the same length units as defined by model (e.g.
meters)
For example one can pull out results irrespective of water level change
such as between -16m and -10m. The elevation will be truncated at the
surface and bed levels.
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsmesh3daveraging.h"
%End
public:
QgsMeshElevationAveragingMethod();
QgsMeshElevationAveragingMethod( double startElevation, double endElevation );
%Docstring
Constructs elevation averaging method
:param startElevation: start elevation (absolute to model's datum)
:param endElevation: end elevation (absolute to model's datum)
%End
~QgsMeshElevationAveragingMethod();
virtual QDomElement writeXml( QDomDocument &doc ) const;
virtual void readXml( const QDomElement &elem );
virtual bool equals( const QgsMesh3DAveragingMethod *other ) const;
virtual QgsMesh3DAveragingMethod *clone() const /Factory/;
double startElevation() const;
%Docstring
Returns start elevation
%End
double endElevation() const;
%Docstring
Returns end elevation
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmesh3daveraging.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/