File: qgsmesh3daveraging.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (412 lines) | stat: -rw-r--r-- 12,203 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
/************************************************************************
 * 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 to interpolate 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 /BaseType=IntEnum/
    {
      //! 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 averages the values based on range
defined relative to bed elevation or surface (when
:py:func:`~countedFromTop`)

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   *
 ************************************************************************/