QGIS/python/core/auto_generated/mesh/qgsmeshdataprovider.sip.in
2018-08-20 11:56:27 +02:00

423 lines
9.8 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/mesh/qgsmeshdataprovider.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 "qgsmeshdataprovider.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 == ( const QgsMeshDatasetIndex &other ) const;
};
typedef QgsPoint QgsMeshVertex;
typedef QVector<int> QgsMeshFace;
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 "qgsmeshdataprovider.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==( const QgsMeshDatasetValue &other ) const;
};
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 "qgsmeshdataprovider.h"
%End
public:
enum DataType
{
DataOnFaces,
DataOnVertices
};
QgsMeshDatasetGroupMetadata();
%Docstring
Constructs an empty metadata object
%End
QgsMeshDatasetGroupMetadata( const QString &name,
bool isScalar,
bool isOnVertices,
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 isOnVertices: dataset values are defined on mesh's vertices. If false, values are defined on faces.
: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
DataType dataType() const;
%Docstring
Returns whether dataset group data is defined on vertices or faces
%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 "qgsmeshdataprovider.h"
%End
public:
QgsMeshDatasetMetadata();
%Docstring
Constructs an empty metadata object
%End
QgsMeshDatasetMetadata( double time,
bool isValid );
%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
%End
double time() const;
%Docstring
Returns the time value for this dataset
%End
bool isValid() const;
%Docstring
Returns whether dataset is valid
%End
};
class QgsMeshDataSourceInterface /Abstract/
{
%Docstring
Interface for mesh data sources
Mesh is a collection of vertices and faces in 2D or 3D space
- vertex - XY(Z) point (in the mesh's coordinate reference system)
- 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();
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 QgsMeshVertex vertex( int index ) const = 0;
%Docstring
Returns the mesh vertex at index
%End
virtual QgsMeshFace face( int index ) const = 0;
%Docstring
Returns the mesh face at index
%End
};
class QgsMeshDatasetSourceInterface /Abstract/
{
%Docstring
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:
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 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
See QgsMeshDatasetMetadata.isVector() to check if the returned value is vector or scalar
%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
};
class QgsMeshDataProvider: QgsDataProvider, QgsMeshDataSourceInterface, QgsMeshDatasetSourceInterface
{
%Docstring
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 &options );
%Docstring
Ctor
%End
virtual QgsRectangle extent() const;
%Docstring
Returns the extent of the layer
:return: QgsRectangle containing the extent of the layer
%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.pl again *
************************************************************************/