QGIS/python/core/auto_generated/mesh/qgsmeshdataset.sip.in
Vincent Cloarec 838faf8a3f
[MESH][FEATURE] use only specified dataset group (#36334)
[MESH][FEATURE] Allow to select only specific subset of dataset groups in mesh layer tree 

This could be done in the mesh layer properties dialog in the source tab.
A new tree view displays all the available dataset groups from the data provider. The dataset groups can be checked/unckecked and renamed.
This widget provides also buttons to load extra dataset group from files, to expand/collpase the tree, to check/unchek all items and to reset to default from the provider (for now, only the original name).
Then only the checked dataset group will be displayed in the active dataset widget in renderer settings.
2020-05-14 09:56:48 +02:00

739 lines
16 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmeshdataset.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMeshDatasetIndex
{
%Docstring
QgsMeshDatasetIndex is index that identifies the dataset group (e.g. wind speed)
and a dataset in this group (e.g. magnitude of wind speed in particular time)
.. note::
The API is considered EXPERIMENTAL and can be changed without a notice
.. versionadded:: 3.4
%End
%TypeHeaderCode
#include "qgsmeshdataset.h"
%End
public:
QgsMeshDatasetIndex( int group = -1, int dataset = -1 );
%Docstring
Creates an index. -1 represents invalid group/dataset
%End
int group() const;
%Docstring
Returns a group index
%End
int dataset() const;
%Docstring
Returns a dataset index within group()
%End
bool isValid() const;
%Docstring
Returns whether index is valid, ie at least groups is set
%End
bool operator == ( QgsMeshDatasetIndex other ) const;
bool operator != ( QgsMeshDatasetIndex other ) const;
};
class QgsMeshDatasetValue
{
%Docstring
QgsMeshDatasetValue represents single dataset value
could be scalar or vector. Nodata values are represented by NaNs.
.. note::
The API is considered EXPERIMENTAL and can be changed without a notice
.. versionadded:: 3.2
%End
%TypeHeaderCode
#include "qgsmeshdataset.h"
%End
public:
QgsMeshDatasetValue( double x,
double y );
%Docstring
Constructor for vector value
%End
QgsMeshDatasetValue( double scalar );
%Docstring
Constructor for scalar value
%End
QgsMeshDatasetValue();
%Docstring
Default Ctor, initialize to NaN
%End
~QgsMeshDatasetValue();
void set( double scalar );
%Docstring
Sets scalar value
%End
void setX( double x );
%Docstring
Sets X value
%End
void setY( double y );
%Docstring
Sets Y value
%End
double scalar() const;
%Docstring
Returns magnitude of vector for vector data or scalar value for scalar data
%End
double x() const;
%Docstring
Returns x value
%End
double y() const;
%Docstring
Returns y value
%End
bool operator==( QgsMeshDatasetValue other ) const;
};
class QgsMeshDataBlock
{
%Docstring
QgsMeshDataBlock is a block of integers/doubles that can be used
to retrieve:
active flags (e.g. face's active integer flag)
scalars (e.g. scalar dataset double values)
vectors (e.g. vector dataset doubles x,y values)
data are implicitly shared, so the class can be quickly copied
std.numeric_limits<double>.quiet_NaN() represents NODATA value
Data can be accessed all at once with values() (faster) or
value by value (slower) with active() or value()
.. versionadded:: 3.6
%End
%TypeHeaderCode
#include "qgsmeshdataset.h"
%End
public:
enum DataType
{
ActiveFlagInteger,
ScalarDouble,
Vector2DDouble,
};
QgsMeshDataBlock();
%Docstring
Constructs an invalid block
%End
QgsMeshDataBlock( DataType type, int count );
%Docstring
Constructs a new block
%End
DataType type() const;
%Docstring
Type of data stored in the block
%End
int count() const;
%Docstring
Number of items stored in the block
%End
bool isValid() const;
%Docstring
Whether the block is valid
%End
QgsMeshDatasetValue value( int index ) const;
%Docstring
Returns a value represented by the index
For active flag the behavior is undefined
%End
bool active( int index ) const;
%Docstring
Returns a value for active flag by the index
For scalar and vector 2d the behavior is undefined
%End
void setActive( const QVector<int> &vals );
%Docstring
Sets active flag values.
If the data provider/datasets does not have active
flag capability (== all values are valid), just
set block validity by setValid( true )
:param vals: value vector with size count()
For scalar and vector 2d the behavior is undefined
.. versionadded:: 3.12
%End
QVector<int> active() const;
%Docstring
Returns active flag array
Even for active flag valid dataset, the returned array could be empty.
This means that the data provider/dataset does not support active flag
capability, so all faces are active by default.
For scalar and vector 2d the behavior is undefined
.. versionadded:: 3.12
%End
QVector<double> values() const;
%Docstring
Returns buffer to the array with values
For vector it is pairs (x1, y1, x2, y2, ... )
.. versionadded:: 3.12
%End
void setValues( const QVector<double> &vals );
%Docstring
Sets values
For scalar datasets, it must have size count()
For vector datasets, it must have size 2 * count()
For active flag the behavior is undefined
.. versionadded:: 3.12
%End
void setValid( bool valid );
%Docstring
Sets block validity
%End
};
class QgsMesh3dDataBlock
{
%Docstring
QgsMesh3dDataBlock is a block of 3d stacked mesh data related N
faces defined on base mesh frame.
data are implicitly shared, so the class can be quickly copied
std.numeric_limits<double>.quiet_NaN() represents NODATA value
.. note::
The API is considered EXPERIMENTAL and can be changed without a notice
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgsmeshdataset.h"
%End
public:
QgsMesh3dDataBlock();
%Docstring
Constructs an invalid block
%End
~QgsMesh3dDataBlock();
QgsMesh3dDataBlock( int count, bool isVector );
%Docstring
Constructs a new block for count faces
%End
void setValid( bool valid );
%Docstring
Sets block validity
%End
bool isValid() const;
%Docstring
Whether the block is valid
%End
bool isVector() const;
%Docstring
Whether we store vector values
%End
int count() const;
%Docstring
Number of 2d faces for which the volume data is stored in the block
%End
int firstVolumeIndex() const;
%Docstring
Index of the first volume stored in the buffer (absolute)
%End
int lastVolumeIndex() const;
%Docstring
Index of the last volume stored in the buffer (absolute)
%End
int volumesCount() const;
%Docstring
Returns number of volumes stored in the buffer
%End
QVector<int> verticalLevelsCount() const;
%Docstring
Returns number of vertical level above 2d faces
%End
void setVerticalLevelsCount( const QVector<int> &verticalLevelsCount );
%Docstring
Sets the vertical level counts
%End
QVector<double> verticalLevels() const;
%Docstring
Returns the vertical levels height
%End
void setVerticalLevels( const QVector<double> &verticalLevels );
%Docstring
Sets the vertical levels height
%End
QVector<int> faceToVolumeIndex() const;
%Docstring
Returns the indexing between faces and volumes
%End
void setFaceToVolumeIndex( const QVector<int> &faceToVolumeIndex );
%Docstring
Sets the indexing between faces and volumes
%End
QVector<double> values() const;
%Docstring
Returns the values at volume centers
For vector datasets the number of values is doubled (x1, y1, x2, y2, ... )
%End
QgsMeshDatasetValue value( int volumeIndex ) const;
%Docstring
Returns the value at volume centers
:param volumeIndex: volume index relative to firstVolumeIndex()
:return: value (scalar or vector)
%End
void setValues( const QVector<double> &doubleBuffer );
%Docstring
Sets the values at volume centers
For vector datasets the number of values is doubled (x1, y1, x2, y2, ... )
%End
};
class QgsMeshDatasetGroupMetadata
{
%Docstring
QgsMeshDatasetGroupMetadata is a collection of dataset group metadata
such as whether the data is vector or scalar, name
.. note::
The API is considered EXPERIMENTAL and can be changed without a notice
.. versionadded:: 3.4
%End
%TypeHeaderCode
#include "qgsmeshdataset.h"
%End
public:
enum DataType
{
DataOnFaces,
DataOnVertices,
DataOnVolumes,
DataOnEdges
};
QgsMeshDatasetGroupMetadata();
%Docstring
Constructs an empty metadata object
%End
QgsMeshDatasetGroupMetadata( const QString &name,
bool isScalar,
DataType dataType,
double minimum,
double maximum,
int maximumVerticalLevels,
const QDateTime &referenceTime,
bool isTemporal,
const QMap<QString, QString> &extraOptions );
%Docstring
Constructs a valid metadata object
:param name: name of the dataset group
:param isScalar: dataset contains scalar data, specifically the y-value of QgsMeshDatasetValue is NaN
:param dataType: where the data are defined on (vertices, faces or volumes)
:param minimum: minimum value (magnitude for vectors) present among all group's dataset values
:param maximum: maximum value (magnitude for vectors) present among all group's dataset values
:param maximumVerticalLevels: maximum number of vertical levels for 3d stacked meshes, 0 for 2d meshes
:param referenceTime: reference time of the dataset group
:param isTemporal: weither the dataset group is temporal (contains time-related dataset)
:param extraOptions: dataset's extra options stored by the provider. Usually contains the name, time value, time units, data file vendor, ...
%End
QString name() const;
%Docstring
Returns name of the dataset group
%End
QMap<QString, QString> extraOptions() const;
%Docstring
Returns extra metadata options, for example description
%End
bool isVector() const;
%Docstring
Returns whether dataset group has vector data
%End
bool isScalar() const;
%Docstring
Returns whether dataset group has scalar data
%End
bool isTemporal() const;
%Docstring
Returns whether the dataset group is temporal (contains time-related dataset)
%End
DataType dataType() const;
%Docstring
Returns whether dataset group data is defined on vertices or faces or volumes
.. versionadded:: 3.12
%End
double minimum() const;
%Docstring
Returns minimum scalar value/vector magnitude present for whole dataset group
%End
double maximum() const;
%Docstring
Returns maximum scalar value/vector magnitude present for whole dataset group
%End
int maximumVerticalLevelsCount() const;
%Docstring
Returns maximum number of vertical levels for 3d stacked meshes
.. versionadded:: 3.12
%End
QDateTime referenceTime() const;
%Docstring
Returns the reference time
.. versionadded:: 3.12
%End
};
class QgsMeshDatasetMetadata
{
%Docstring
QgsMeshDatasetMetadata is a collection of mesh dataset metadata such
as whether the data is valid or associated time for the dataset
.. note::
The API is considered EXPERIMENTAL and can be changed without a notice
.. versionadded:: 3.2
%End
%TypeHeaderCode
#include "qgsmeshdataset.h"
%End
public:
QgsMeshDatasetMetadata();
%Docstring
Constructs an empty metadata object
%End
QgsMeshDatasetMetadata( double time,
bool isValid,
double minimum,
double maximum,
int maximumVerticalLevels
);
%Docstring
Constructs a valid metadata object
:param time: a time which this dataset represents in the dataset group
:param isValid: dataset is loadad and valid for fetching the data
:param minimum: minimum value (magnitude for vectors) present among dataset values
:param maximum: maximum value (magnitude for vectors) present among dataset values
:param maximumVerticalLevels: maximum number of vertical levels for 3d stacked meshes, 0 for 2d meshes
%End
double time() const;
%Docstring
Returns the time value for this dataset
%End
bool isValid() const;
%Docstring
Returns whether dataset is valid
%End
double minimum() const;
%Docstring
Returns minimum scalar value/vector magnitude present for the dataset
%End
double maximum() const;
%Docstring
Returns maximum scalar value/vector magnitude present for the dataset
%End
int maximumVerticalLevelsCount() const;
%Docstring
Returns maximum number of vertical levels for 3d stacked meshes
.. versionadded:: 3.12
%End
};
class QgsMeshDatasetGroupTreeItem
{
%Docstring
Tree item for display of the mesh dataset groups.
Dataset group is set of datasets with the same name,
but different control variable (e.g. time)
Support for multiple levels, because groups can have
subgroups, for example
Groups:
Depth
Minimum
Maximum
Velocity
Wind speed
Minimum
Maximum
.. versionadded:: 3.14
%End
%TypeHeaderCode
#include "qgsmeshdataset.h"
%End
public:
QgsMeshDatasetGroupTreeItem();
%Docstring
Constructor for an empty dataset group tree item
%End
QgsMeshDatasetGroupTreeItem( const QString &defaultName,
bool isVector,
int index );
%Docstring
Constructor
:param defaultName: the name that will be used to display the item if iot not overrides (:py:func:`setName`)
:param isVector: whether the dataset group is a vector dataset group
:param index: index of the dataset group
%End
QgsMeshDatasetGroupTreeItem( const QDomElement &itemElement, const QgsReadWriteContext &context );
%Docstring
Constructor from a DOM element, contruct also the children
:param itemElement: the DOM element
:param context: writing context (e.g. for conversion between relative and absolute paths)
%End
~QgsMeshDatasetGroupTreeItem();
QgsMeshDatasetGroupTreeItem *clone() const /Factory/;
%Docstring
Clones the item
:return: the cloned item
%End
void appendChild( QgsMeshDatasetGroupTreeItem *item /Transfer/ );
%Docstring
Appends a item child
:param item: the item to append
.. note::
takes ownership of item
%End
QgsMeshDatasetGroupTreeItem *child( int row ) const;
%Docstring
Returns a child
:param row: the position of the child
:return: the item at the positon ``row``
%End
QgsMeshDatasetGroupTreeItem *childFromDatasetGroupIndex( int index );
%Docstring
Returns the child with dataset group ``index``
Searches as depper as needed on the child hierarchy
:param index: the index of the dataset group index
:return: the item with index as dataset group index, None if no item is found
%End
int childCount() const;
%Docstring
Returns the count of children
:return: the children's count
%End
int totalChildCount() const;
%Docstring
Returns the total count of children, that is included deeper children
:return:
%End
QgsMeshDatasetGroupTreeItem *parentItem() const;
%Docstring
Returns the parent item, None if it is root item
:return: the parent item
%End
int row() const;
%Docstring
Returns the position of the item in the parent
:return: tow position of the item
%End
QString name() const;
%Docstring
Returns the name of the item
This mame is the default name if the name has not been overrided (:py:func:`setName`)
:return: the name to display
%End
void setName( const QString &name );
%Docstring
Overrides the default name with the name to display.
The default name is still stored in the item
but will not be displayed anymore except if the empty string is setted.
:param name: to display
%End
bool isVector() const;
%Docstring
:return: whether the dataset group is vector
%End
int datasetGroupIndex() const;
%Docstring
:return: the dataset group index
%End
bool isEnabled() const;
%Docstring
:return: whether the item is enabled, that is if it is displayed in view
%End
void setIsEnabled( bool isEnabled );
%Docstring
Sets whether the item is enabled, that is if it is displayed in view
:param isEnabled: whether the item is enabled
%End
QString defaultName() const;
%Docstring
:return: the default name
%End
QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context );
%Docstring
Write the item and its children in a DOM document
:param doc: the DOM document
:param context: writing context (e.g. for conversion between relative and absolute paths)
:return: the dom element where the item is written
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmeshdataset.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/