File: qgsmeshdataprovider.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 (503 lines) | stat: -rw-r--r-- 14,048 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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/mesh/qgsmeshdataprovider.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/








typedef QgsPoint QgsMeshVertex;

typedef QVector<int> QgsMeshFace;

typedef QPair<int, int> QgsMeshEdge;

struct QgsMesh
{

  enum ElementType /BaseType=IntEnum/
  {
    Vertex,
    Edge,
    Face
  };

  bool contains( const ElementType &type ) const;
%Docstring
Returns whether the mesh contains at mesh elements of given type

.. versionadded:: 3.14
%End

  int vertexCount() const;
%Docstring
Returns number of vertices
%End
  int faceCount() const;
%Docstring
Returns number of faces
%End

  int edgeCount() const;
%Docstring
Returns number of edge

.. versionadded:: 3.14
%End

  QgsMeshVertex vertex( int index ) const;
%Docstring
Returns a vertex at the index
%End
  QgsMeshFace face( int index ) const;
%Docstring
Returns a face at the index
%End

  QgsMeshEdge edge( int index ) const;
%Docstring
Returns an edge at the index

.. versionadded:: 3.14
%End

  void clear();
%Docstring
Remove all vertices, edges and faces

.. versionadded:: 3.14
%End

  static bool compareFaces( const QgsMeshFace &face1, const QgsMeshFace &face2 );
%Docstring
Compare two faces, return ``True`` if they are equivalent : same indexes
and same clock wise

.. versionadded:: 3.16
%End

};



class QgsMeshDataSourceInterface /Abstract/
{
%Docstring(signature="appended")
Interface for mesh data sources

Mesh is a collection of vertices, edges and faces in 2D or 3D space

- vertex - XY(Z) point (in the mesh's coordinate reference system)
- edge - two XY(Z) points (in the mesh's coordinate reference system)
  representing straight seqment
- faces - sets of vertices forming a closed shape - typically triangles
  or quadrilaterals

Base on the underlying data provider/format, whole mesh is either stored
in memory or read on demand

.. note::

   The API is considered EXPERIMENTAL and can be changed without a notice

.. versionadded:: 3.2
%End

%TypeHeaderCode
#include "qgsmeshdataprovider.h"
%End
  public:

    virtual ~QgsMeshDataSourceInterface();

    bool contains( const QgsMesh::ElementType &type ) const;
%Docstring
Returns whether the mesh contains at mesh elements of given type

.. versionadded:: 3.14
%End

    virtual int vertexCount() const = 0;
%Docstring
Returns number of vertices in the native mesh

:return: Number of vertices in the mesh
%End

    virtual int faceCount() const = 0;
%Docstring
Returns number of faces in the native mesh

:return: Number of faces in the mesh
%End

    virtual int edgeCount() const = 0;
%Docstring
Returns number of edges in the native mesh

:return: Number of edges in the mesh

.. versionadded:: 3.14
%End

    virtual int maximumVerticesCountPerFace() const;
%Docstring
Returns the maximum number of vertices per face supported by the current
mesh, if returns 0, the number of vertices is unlimited

:return: Maximum number of vertices per face

.. versionadded:: 3.22
%End
    virtual void populateMesh( QgsMesh *mesh ) const = 0;
%Docstring
Populates the mesh vertices, edges and faces

.. versionadded:: 3.6
%End

    virtual bool saveMeshFrame( const QgsMesh &mesh ) = 0;
%Docstring
Saves the ``mesh`` frame to the source.

:param mesh: the mesh to save

:return: ``True`` on success

.. versionadded:: 3.22
%End
};

class QgsMeshDatasetSourceInterface /Abstract/
{
%Docstring(signature="appended")
Interface for mesh datasets and dataset groups

Dataset is a collection of vector or scalar values on vertices or faces
of the mesh. Based on the underlying data provider/format, whole dataset
is either stored in memory or read on demand

Datasets are grouped in the dataset groups. A dataset group represents a
measured quantity (e.g. depth or wind speed), dataset represents values
of the quantity in a particular time.

.. note::

   The API is considered EXPERIMENTAL and can be changed without a notice

.. versionadded:: 3.2
%End

%TypeHeaderCode
#include "qgsmeshdataprovider.h"
%End
  public:
    QgsMeshDatasetSourceInterface();
    virtual ~QgsMeshDatasetSourceInterface();

    virtual bool addDataset( const QString &uri ) = 0;
%Docstring
Associate dataset with the mesh

emits dataChanged when successful
%End

    virtual QStringList extraDatasets() const = 0;
%Docstring
Returns list of additional dataset file URIs added using
:py:func:`~QgsMeshDatasetSourceInterface.addDataset` calls.
%End

    virtual int datasetGroupCount( ) const = 0;
%Docstring
Returns number of datasets groups loaded
%End

    virtual int datasetCount( int groupIndex ) const = 0;
%Docstring
Returns number of datasets loaded in the group
%End

    int datasetCount( QgsMeshDatasetIndex index ) const;
%Docstring
Returns number of datasets loaded in the group
%End

    virtual QgsMeshDatasetGroupMetadata datasetGroupMetadata( int groupIndex ) const = 0;
%Docstring
Returns dataset group metadata
%End

    QgsMeshDatasetGroupMetadata datasetGroupMetadata( QgsMeshDatasetIndex index ) const;
%Docstring
Returns dataset group metadata
%End

    virtual QgsMeshDatasetMetadata datasetMetadata( QgsMeshDatasetIndex index ) const = 0;
%Docstring
Returns dataset metadata
%End

    virtual QgsMeshDatasetValue datasetValue( QgsMeshDatasetIndex index, int valueIndex ) const = 0;
%Docstring
Returns vector/scalar value associated with the index from the dataset
To read multiple continuous values, use
:py:func:`~QgsMeshDatasetSourceInterface.datasetValues`

See :py:func:`QgsMeshDatasetMetadata.isVector()` or
:py:func:`QgsMeshDataBlock.type()` to check if the returned value is
vector or scalar

Returns invalid value for DataOnVolumes

.. seealso:: :py:func:`datasetValues`
%End

    virtual QgsMeshDataBlock datasetValues( QgsMeshDatasetIndex index, int valueIndex, int count ) const = 0;
%Docstring
Returns N vector/scalar values from the index from the dataset

See :py:func:`QgsMeshDatasetMetadata.isVector()` or
:py:func:`QgsMeshDataBlock.type()` to check if the returned value is
vector or scalar

Returns invalid block for DataOnVolumes. Use
:py:func:`QgsMeshLayerUtils.datasetValues()` if you need block for any
type of data type

.. versionadded:: 3.6
%End

    virtual QgsMesh3DDataBlock dataset3dValues( QgsMeshDatasetIndex index, int faceIndex, int count ) const = 0;
%Docstring
Returns N vector/scalar values from the face index from the dataset for
3d stacked meshes

See :py:func:`QgsMeshDatasetMetadata.isVector()` to check if the
returned value is vector or scalar

returns invalid block for DataOnFaces and DataOnVertices.

.. seealso:: :py:func:`datasetValues`

.. versionadded:: 3.12
%End

    virtual bool isFaceActive( QgsMeshDatasetIndex index, int faceIndex ) const = 0;
%Docstring
Returns whether the face is active for particular dataset

For example to represent the situation when F1 and F3 are flooded, but
F2 is dry, some solvers store water depth on vertices V1-V8 (all
non-zero values) and set active flag for F2 to ``False``. V1 ---- V2
---- V5-----V7 | F1 | F2 | F3 | V3 ---- V4 ---- V6-----V8
%End

    virtual QgsMeshDataBlock areFacesActive( QgsMeshDatasetIndex index, int faceIndex, int count ) const = 0;
%Docstring
Returns whether the faces are active for particular dataset

.. versionadded:: 3.6
%End

 virtual bool persistDatasetGroup( const QString &path,
        const QgsMeshDatasetGroupMetadata &meta,
        const QVector<QgsMeshDataBlock> &datasetValues,
        const QVector<QgsMeshDataBlock> &datasetActive,
        const QVector<double> &times
                                                      ) /Deprecated/;
%Docstring
Creates a new dataset group from a data and persists it into a
destination path

On success, the mesh's dataset group count is changed

:param path: destination path of the stored file in form
             DRIVER_NAME:path
:param meta: new group's metadata
:param datasetValues: scalar/vector values for all datasets and all
                      faces/vertices in the group
:param datasetActive: active flag values for all datasets in the group.
                      Empty array represents can be used when all faces
                      are active
:param times: times in hours for all datasets in the group

:return: ``True`` on failure, ``False`` on success

.. note::

   Doesn't work if there is ":" in the path (e.g. Windows system)

.. versionadded:: 3.6

.. deprecated:: 3.12.3
%End

    virtual bool persistDatasetGroup( const QString &outputFilePath,
                                      const QString &outputDriver,
                                      const QgsMeshDatasetGroupMetadata &meta,
                                      const QVector<QgsMeshDataBlock> &datasetValues,
                                      const QVector<QgsMeshDataBlock> &datasetActive,
                                      const QVector<double> &times
                                    ) = 0;
%Docstring
Creates a new dataset group from a data and persists it into a
destination path

On success, the mesh's dataset group count is changed

:param outputFilePath: destination path of the stored file
:param outputDriver: output driver name
:param meta: new group's metadata
:param datasetValues: scalar/vector values for all datasets and all
                      faces/vertices in the group
:param datasetActive: active flag values for all datasets in the group.
                      Empty array represents can be used when all faces
                      are active
:param times: times in hours for all datasets in the group

:return: ``True`` on failure, ``False`` on success

.. versionadded:: 3.12.3
%End


    virtual bool persistDatasetGroup( const QString &outputFilePath,
                                      const QString &outputDriver,
                                      QgsMeshDatasetSourceInterface *source,
                                      int datasetGroupIndex
                                    ) = 0;
%Docstring
Saves a an existing dataset group provided by ``source`` to a file with
a specified driver

On success, the mesh's dataset group count is changed

:param outputFilePath: destination path of the stored file
:param outputDriver: output driver name
:param source: source of the dataset group
:param datasetGroupIndex: index of the dataset group in the ``source``

:return: ``True`` on failure, ``False`` on success

.. versionadded:: 3.16
%End

    QgsMeshDatasetIndex datasetIndexAtTime( const QDateTime &referenceTime,
                                            int groupIndex,
                                            qint64 time,
                                            QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod method ) const;
%Docstring
Returns the dataset index of the dataset in a specific dataset group at
``time`` from the ``reference`` time

:param referenceTime: the reference time from where to find the dataset
:param groupIndex: the index of the dataset group
:param time: the relative time from reference time
:param method: the method used to check the time

:return: the dataset index
%End

    QList<QgsMeshDatasetIndex> datasetIndexInTimeInterval( const QDateTime &referenceTime,
        int groupIndex,
        qint64 time1,
        qint64 time2 ) const;
%Docstring
Returns a list of dataset indexes of the dataset in a specific dataset
group that are between ``time1`` and ``time2`` from the ``reference``
time

:param referenceTime: the reference time from where to find the dataset
:param groupIndex: the index of the dataset group
:param time1: the first relative time of the time intervale from
              reference time
:param time2: the second relative time of the time intervale from
              reference time

:return: the dataset index

.. versionadded:: 3.22
%End

  protected:
};


class QgsMeshDataProvider: QgsDataProvider, QgsMeshDataSourceInterface, QgsMeshDatasetSourceInterface
{
%Docstring(signature="appended")
Base class for providing data for :py:class:`QgsMeshLayer`

Responsible for reading native mesh data

.. note::

   The API is considered EXPERIMENTAL and can be changed without a notice

.. versionadded:: 3.2
%End

%TypeHeaderCode
#include "qgsmeshdataprovider.h"
%End
  public:
    QgsMeshDataProvider( const QString &uri,
                         const QgsDataProvider::ProviderOptions &providerOptions,
                         Qgis::DataProviderReadFlags = Qgis::DataProviderReadFlags() );
%Docstring
Ctor
%End

    virtual QgsMeshDataProviderTemporalCapabilities *temporalCapabilities();


    void setTemporalUnit( Qgis::TemporalUnit unit );
%Docstring
Sets the temporal unit of the provider and reload data if it changes.

:param unit: the temporal unit

.. versionadded:: 3.14
%End


    virtual QgsMeshDriverMetadata driverMetadata()  const;
%Docstring
Returns the mesh driver metadata of the provider

:return: the mesh driver metadata of the provider

.. versionadded:: 3.22
%End


    virtual void close() = 0;
%Docstring
Closes the data provider and free every resources used

.. versionadded:: 3.22
%End

  signals:
    void datasetGroupsAdded( int count );
%Docstring
Emitted when some new dataset groups have been added
%End

};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/mesh/qgsmeshdataprovider.h                                  *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/