1/************************************************************************ 2 * This file has been generated automatically from * 3 * * 4 * src/core/mesh/qgsmesh3daveraging.h * 5 * * 6 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 7 ************************************************************************/ 8 9 10 11 12 13 14class QgsMesh3dAveragingMethod /Abstract/ 15{ 16%Docstring(signature="appended") 17Abstract class to interpolate 3d stacked mesh data to 2d data 18 19.. versionadded:: 3.12 20%End 21 22%TypeHeaderCode 23#include "qgsmesh3daveraging.h" 24%End 25%ConvertToSubClassCode 26 QgsMesh3dAveragingMethod *averagingMethod = dynamic_cast<QgsMesh3dAveragingMethod *>( sipCpp ); 27 28 sipType = 0; 29 30 if ( averagingMethod ) 31 { 32 switch ( averagingMethod->method() ) 33 { 34 case QgsMesh3dAveragingMethod::MultiLevelsAveragingMethod: 35 sipType = sipType_QgsMeshMultiLevelsAveragingMethod; 36 break; 37 case QgsMesh3dAveragingMethod::SigmaAveragingMethod: 38 sipType = sipType_QgsMeshSigmaAveragingMethod; 39 break; 40 case QgsMesh3dAveragingMethod::RelativeHeightAveragingMethod: 41 sipType = sipType_QgsMeshRelativeHeightAveragingMethod; 42 break; 43 case QgsMesh3dAveragingMethod::ElevationAveragingMethod: 44 sipType = sipType_QgsMeshElevationAveragingMethod; 45 break; 46 default: 47 sipType = nullptr; 48 break; 49 } 50 } 51%End 52 public: 53 enum Method 54 { 55 //! Method to average values from selected vertical layers 56 MultiLevelsAveragingMethod, 57 //! Method to average values between 0 (bed level) and 1 (surface) 58 SigmaAveragingMethod, 59 //! Method to average values defined by range of relative length units to the surface or bed level 60 RelativeHeightAveragingMethod, 61 //! Method to average values defined by range of absolute length units to the model's datum 62 ElevationAveragingMethod 63 }; 64 65 QgsMesh3dAveragingMethod( Method method ); 66%Docstring 67Ctor 68%End 69 70 virtual ~QgsMesh3dAveragingMethod(); 71 72 QgsMeshDataBlock calculate( const QgsMesh3dDataBlock &block3d, QgsFeedback *feedback = 0 ) const; 73%Docstring 74Calculated 2d block values from 3d stacked mesh values 75%End 76 77 virtual QDomElement writeXml( QDomDocument &doc ) const = 0; 78%Docstring 79Writes configuration to a new DOM element 80%End 81 82 static QgsMesh3dAveragingMethod *createFromXml( const QDomElement &elem ) /Factory/; 83%Docstring 84Creates the instance from XML by calling readXml of derived classes 85%End 86 87 virtual void readXml( const QDomElement &elem ) = 0; 88%Docstring 89Reads configuration from the given DOM element 90%End 91 92 static bool equals( const QgsMesh3dAveragingMethod *a, const QgsMesh3dAveragingMethod *b ); 93%Docstring 94Returns whether two methods equal 95%End 96 97 virtual bool equals( const QgsMesh3dAveragingMethod *other ) const = 0; 98%Docstring 99Returns whether method equals to other 100%End 101 102 virtual QgsMesh3dAveragingMethod *clone() const = 0 /Factory/; 103%Docstring 104Clone the instance 105%End 106 107 Method method() const; 108%Docstring 109Returns type of averaging method 110%End 111 112}; 113 114class QgsMeshMultiLevelsAveragingMethod: QgsMesh3dAveragingMethod 115{ 116%Docstring(signature="appended") 117 118Multi level averaging method specifies limits of vertical layers from the top layer down or reversed. 119 120The limits will be truncated to the maximum number of vertical layers. 121To pick value from a single layer, specify the upper and lower limit to be the same 122 123.. versionadded:: 3.12 124%End 125 126%TypeHeaderCode 127#include "qgsmesh3daveraging.h" 128%End 129 public: 130 QgsMeshMultiLevelsAveragingMethod(); 131%Docstring 132Constructs single level averaging method for 1st (top) vertical level 133%End 134 135 QgsMeshMultiLevelsAveragingMethod( int startLevel, int endLevel, bool countedFromTop ); 136%Docstring 137Constructs multi level averaging method 138 139:param startLevel: starting vertical level index numbered from 1 140:param endLevel: ending vertical level index numbered from 1 (higher or equal than startLevel) 141:param countedFromTop: if ``True``, the startLevel index is counted from surface (index 1 is the top layer). 142 if ``False``, the startLevel index is counted from the bed level (index 1 is the bottom layer) 143%End 144 145 QgsMeshMultiLevelsAveragingMethod( int verticalLevel, bool countedFromTop ); 146%Docstring 147Constructs single level averaging method 148 149:param verticalLevel: vertical level index numbered from 1 150:param countedFromTop: if ``True``, the startLevel index is counted from surface (index 1 is the top layer). 151 if ``False``, the startLevel index is counted from the bed level (index 1 is the bottom layer) 152%End 153 154 ~QgsMeshMultiLevelsAveragingMethod(); 155 virtual QDomElement writeXml( QDomDocument &doc ) const; 156 157 virtual void readXml( const QDomElement &elem ); 158 159 virtual bool equals( const QgsMesh3dAveragingMethod *other ) const; 160 161 virtual QgsMesh3dAveragingMethod *clone() const /Factory/; 162 163 164 int startVerticalLevel() const; 165%Docstring 166Returns starting vertical level. 167 168Numbered from 1. If :py:func:`~QgsMeshMultiLevelsAveragingMethod.countedFromTop`, 1 represents the top (surface) level, 169otherwise 1 represents the bottom (bed) level 170 171Always lower or equal than :py:func:`~QgsMeshMultiLevelsAveragingMethod.endVerticalLevel` 172%End 173 174 int endVerticalLevel() const; 175%Docstring 176Returns ending vertical level. 177 178Numbered from 1. If :py:func:`~QgsMeshMultiLevelsAveragingMethod.countedFromTop`, 1 represents the top (surface) level, 179otherwise 1 represents the bottom (bed) level 180 181Always lower or equal than :py:func:`~QgsMeshMultiLevelsAveragingMethod.endVerticalLevel` 182%End 183 184 bool countedFromTop() const; 185%Docstring 186Returns whether the start and end vertical levels are indexed from top (surface) or bottom (bed) level 187%End 188 189 bool isSingleLevel() const; 190%Docstring 191Returns whether the averaging method selects only a single vertical level 192%End 193 194}; 195 196class QgsMeshSigmaAveragingMethod: QgsMesh3dAveragingMethod 197{ 198%Docstring(signature="appended") 199 200Sigma averages over the values between 0 (bed level) and 1 (surface). 201 202The fractions will be truncated to 0-1. 203For example: the average of between a quarter and 3 quarters of the water column - Sigma from 0.25 to 0.75 204 205.. versionadded:: 3.12 206%End 207 208%TypeHeaderCode 209#include "qgsmesh3daveraging.h" 210%End 211 public: 212 QgsMeshSigmaAveragingMethod(); 213%Docstring 214Constructs the sigma method for whole value range 0-1 215%End 216 217 QgsMeshSigmaAveragingMethod( double startFraction, double endFraction ); 218%Docstring 219Constructs the sigma method 220 221:param startFraction: starting fraction (0-1) 222:param endFraction: ending fraction, must be higher or equal than startFraction (0-1) 223%End 224 225 ~QgsMeshSigmaAveragingMethod(); 226 virtual QDomElement writeXml( QDomDocument &doc ) const; 227 228 virtual void readXml( const QDomElement &elem ); 229 230 virtual bool equals( const QgsMesh3dAveragingMethod *other ) const; 231 232 virtual QgsMesh3dAveragingMethod *clone() const /Factory/; 233 234 235 double startFraction() const; 236%Docstring 237Returns starting fraction. 238 239In range 0-1, where 1 means the surface level and 0 bed level. 240Always lower or equal than :py:func:`~QgsMeshSigmaAveragingMethod.endFraction` 241%End 242 243 double endFraction() const; 244%Docstring 245Returns ending fraction. 246 247In range 0-1, where 1 means the surface level and 0 bed level. 248Always higher or equal than :py:func:`~QgsMeshSigmaAveragingMethod.startFraction` 249%End 250 251}; 252 253class QgsMeshRelativeHeightAveragingMethod: QgsMesh3dAveragingMethod 254{ 255%Docstring(signature="appended") 256 257Relative height averaging method averages the values based on range defined relative to bed elevation or surface (when :py:func:`~QgsMeshSigmaAveragingMethod.countedFromTop`) 258The range is defined in the same length units as defined by model (e.g. meters) 259 260if :py:func:`~QgsMeshSigmaAveragingMethod.countedFromTop`, the method represents averaging based on depth below surface. 261For example one can pull out results for between 6 to 12 meters below the water surface - depth from 6m to 12m. 262The depth will be truncated at the bed level. 263 264if not :py:func:`~QgsMeshSigmaAveragingMethod.countedFromTop`, the method represents averaging based on height above bed level. 265For example one can pull out results for between 6 to 12 meters above the bed - height from 6m to 12m. 266The height will be truncated at the bed level. 267 268.. versionadded:: 3.12 269%End 270 271%TypeHeaderCode 272#include "qgsmesh3daveraging.h" 273%End 274 public: 275 276 QgsMeshRelativeHeightAveragingMethod(); 277%Docstring 278Constructs default depth averaging method 279%End 280 281 QgsMeshRelativeHeightAveragingMethod( double startHeight, double endHeight, bool countedFromTop ); 282%Docstring 283Constructs the depth/height averaging method 284 285:param startHeight: starting depth/height, higher or equal than 0 286:param endHeight: ending depth/height, higher or equal than startDepth 287:param countedFromTop: if ``True``, the startLength and endLength is relative to surface (0 is surface level). 288 if ``False``, the startLength and endLength is relative to bed (0 is bed level). 289%End 290 291 ~QgsMeshRelativeHeightAveragingMethod(); 292 virtual QDomElement writeXml( QDomDocument &doc ) const; 293 294 virtual void readXml( const QDomElement &elem ); 295 296 virtual bool equals( const QgsMesh3dAveragingMethod *other ) const; 297 298 virtual QgsMesh3dAveragingMethod *clone() const /Factory/; 299 300 301 double startHeight() const; 302%Docstring 303Returns starting depth/height. 304 305Always lower or equal than :py:func:`~QgsMeshRelativeHeightAveragingMethod.endLength` 306%End 307 308 double endHeight() const; 309%Docstring 310Returns ending depth/height. 311 312Always higher or equal than :py:func:`~QgsMeshRelativeHeightAveragingMethod.startLength` 313%End 314 315 bool countedFromTop() const; 316%Docstring 317Returns whether the start and end vertical levels are relative to top (surface) or bottom (bed) level 318%End 319 320}; 321 322class QgsMeshElevationAveragingMethod: QgsMesh3dAveragingMethod 323{ 324%Docstring(signature="appended") 325 326Elevation averaging method averages the values based on range defined absolute value to the model's datum 327The range is defined in the same length units as defined by model (e.g. meters) 328 329For example one can pull out results irrespective of water level change such as between -16m and -10m. 330The elevation will be truncated at the surface and bed levels. 331 332.. versionadded:: 3.12 333%End 334 335%TypeHeaderCode 336#include "qgsmesh3daveraging.h" 337%End 338 public: 339 340 QgsMeshElevationAveragingMethod(); 341%Docstring 342Ctor 343%End 344 345 QgsMeshElevationAveragingMethod( double startElevation, double endElevation ); 346%Docstring 347Constructs elevation averaging method 348 349:param startElevation: start elevation (absolute to model's datum) 350:param endElevation: end elevation (absolute to model's datum) 351%End 352 ~QgsMeshElevationAveragingMethod(); 353 354 virtual QDomElement writeXml( QDomDocument &doc ) const; 355 356 virtual void readXml( const QDomElement &elem ); 357 358 virtual bool equals( const QgsMesh3dAveragingMethod *other ) const; 359 360 virtual QgsMesh3dAveragingMethod *clone() const /Factory/; 361 362 363 double startElevation() const; 364%Docstring 365Returns start elevation 366%End 367 368 double endElevation() const; 369%Docstring 370Returns end elevation 371%End 372 373}; 374 375/************************************************************************ 376 * This file has been generated automatically from * 377 * * 378 * src/core/mesh/qgsmesh3daveraging.h * 379 * * 380 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 381 ************************************************************************/ 382