QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Interface for mesh datasets and dataset groups. More...
#include <qgsmeshdataprovider.h>
Public Member Functions | |
QgsMeshDatasetSourceInterface () | |
virtual | ~QgsMeshDatasetSourceInterface ()=default |
virtual bool | addDataset (const QString &uri)=0 |
Associate dataset with the mesh. | |
virtual QgsMeshDataBlock | areFacesActive (QgsMeshDatasetIndex index, int faceIndex, int count) const =0 |
Returns whether the faces are active for particular dataset. | |
virtual QgsMesh3DDataBlock | dataset3dValues (QgsMeshDatasetIndex index, int faceIndex, int count) const =0 |
Returns N vector/scalar values from the face index from the dataset for 3d stacked meshes. | |
virtual int | datasetCount (int groupIndex) const =0 |
Returns number of datasets loaded in the group. | |
int | datasetCount (QgsMeshDatasetIndex index) const |
Returns number of datasets loaded in the group. | |
virtual int | datasetGroupCount () const =0 |
Returns number of datasets groups loaded. | |
virtual QgsMeshDatasetGroupMetadata | datasetGroupMetadata (int groupIndex) const =0 |
Returns dataset group metadata. | |
QgsMeshDatasetGroupMetadata | datasetGroupMetadata (QgsMeshDatasetIndex index) const |
Returns dataset group metadata. | |
QgsMeshDatasetIndex | datasetIndexAtTime (const QDateTime &referenceTime, int groupIndex, qint64 time, QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod method) const |
Returns the dataset index of the dataset in a specific dataset group at time from the reference time. | |
QList< QgsMeshDatasetIndex > | datasetIndexInTimeInterval (const QDateTime &referenceTime, int groupIndex, qint64 time1, qint64 time2) const |
Returns a list of dataset indexes of the dataset in a specific dataset group that are between time1 and time2 from the reference time. | |
virtual QgsMeshDatasetMetadata | datasetMetadata (QgsMeshDatasetIndex index) const =0 |
Returns dataset metadata. | |
virtual QgsMeshDatasetValue | datasetValue (QgsMeshDatasetIndex index, int valueIndex) const =0 |
Returns vector/scalar value associated with the index from the dataset To read multiple continuous values, use datasetValues() | |
virtual QgsMeshDataBlock | datasetValues (QgsMeshDatasetIndex index, int valueIndex, int count) const =0 |
Returns N vector/scalar values from the index from the dataset. | |
virtual QStringList | extraDatasets () const =0 |
Returns list of additional dataset file URIs added using addDataset() calls. | |
virtual bool | isFaceActive (QgsMeshDatasetIndex index, int faceIndex) const =0 |
Returns whether the face is active for particular dataset. | |
virtual bool | persistDatasetGroup (const QString &outputFilePath, const QString &outputDriver, const QgsMeshDatasetGroupMetadata &meta, const QVector< QgsMeshDataBlock > &datasetValues, const QVector< QgsMeshDataBlock > &datasetActive, const QVector< double > ×)=0 |
Creates a new dataset group from a data and persists it into a destination path. | |
virtual bool | persistDatasetGroup (const QString &outputFilePath, const QString &outputDriver, QgsMeshDatasetSourceInterface *source, int datasetGroupIndex)=0 |
Saves a an existing dataset group provided by source to a file with a specified driver. | |
virtual Q_DECL_DEPRECATED bool | persistDatasetGroup (const QString &path, const QgsMeshDatasetGroupMetadata &meta, const QVector< QgsMeshDataBlock > &datasetValues, const QVector< QgsMeshDataBlock > &datasetActive, const QVector< double > ×) |
Creates a new dataset group from a data and persists it into a destination path. | |
Protected Attributes | |
std::unique_ptr< QgsMeshDataProviderTemporalCapabilities > | mTemporalCapabilities |
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.
Definition at line 214 of file qgsmeshdataprovider.h.
QgsMeshDatasetSourceInterface::QgsMeshDatasetSourceInterface | ( | ) |
Definition at line 116 of file qgsmeshdataprovider.cpp.
|
virtualdefault |
|
pure virtual |
Associate dataset with the mesh.
emits dataChanged when successful
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
Returns whether the faces are active for particular dataset.
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
Returns N vector/scalar values from the face index from the dataset for 3d stacked meshes.
See QgsMeshDatasetMetadata::isVector() to check if the returned value is vector or scalar
returns invalid block for DataOnFaces and DataOnVertices.
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
Returns number of datasets loaded in the group.
Implemented in QgsMeshExtraDatasetStore.
int QgsMeshDatasetSourceInterface::datasetCount | ( | QgsMeshDatasetIndex | index | ) | const |
Returns number of datasets loaded in the group.
Definition at line 119 of file qgsmeshdataprovider.cpp.
|
pure virtual |
Returns number of datasets groups loaded.
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
Returns dataset group metadata.
Implemented in QgsMeshExtraDatasetStore.
QgsMeshDatasetGroupMetadata QgsMeshDatasetSourceInterface::datasetGroupMetadata | ( | QgsMeshDatasetIndex | index | ) | const |
Returns dataset group metadata.
Definition at line 124 of file qgsmeshdataprovider.cpp.
QgsMeshDatasetIndex QgsMeshDatasetSourceInterface::datasetIndexAtTime | ( | const QDateTime & | referenceTime, |
int | groupIndex, | ||
qint64 | time, | ||
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod | method | ||
) | const |
Returns the dataset index of the dataset in a specific dataset group at time from the reference time.
referenceTime | the reference time from where to find the dataset |
groupIndex | the index of the dataset group |
time | the relative time from reference time |
method | the method used to check the time |
Definition at line 61 of file qgsmeshdataprovider.cpp.
QList< QgsMeshDatasetIndex > QgsMeshDatasetSourceInterface::datasetIndexInTimeInterval | ( | const QDateTime & | referenceTime, |
int | groupIndex, | ||
qint64 | time1, | ||
qint64 | time2 | ||
) | const |
Returns a list of dataset indexes of the dataset in a specific dataset group that are between time1 and time2 from the reference time.
referenceTime | the reference time from where to find the dataset |
groupIndex | the index of the dataset group |
time1 | the first relative time of the time intervale from reference time |
time2 | the second relative time of the time intervale from reference time |
Definition at line 87 of file qgsmeshdataprovider.cpp.
|
pure virtual |
Returns dataset metadata.
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
Returns vector/scalar value associated with the index from the dataset To read multiple continuous values, use datasetValues()
See QgsMeshDatasetMetadata::isVector() or QgsMeshDataBlock::type() to check if the returned value is vector or scalar
Returns invalid value for DataOnVolumes
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
Returns N vector/scalar values from the index from the dataset.
See QgsMeshDatasetMetadata::isVector() or QgsMeshDataBlock::type() to check if the returned value is vector or scalar
Returns invalid block for DataOnVolumes. Use QgsMeshLayerUtils::datasetValues() if you need block for any type of data type
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
Returns list of additional dataset file URIs added using addDataset() calls.
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
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
Implemented in QgsMeshExtraDatasetStore.
|
pure virtual |
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
outputFilePath | destination path of the stored file |
outputDriver | output driver name |
meta | new group's metadata |
datasetValues | scalar/vector values for all datasets and all faces/vertices in the group |
datasetActive | active flag values for all datasets in the group. Empty array represents can be used when all faces are active |
times | times in hours for all datasets in the group |
true
on failure, false
on successImplemented in QgsMeshExtraDatasetStore.
|
pure virtual |
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
outputFilePath | destination path of the stored file |
outputDriver | output driver name |
source | source of the dataset group |
datasetGroupIndex | index of the dataset group in the source |
true
on failure, false
on successImplemented in QgsMeshExtraDatasetStore.
|
virtual |
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
path | destination path of the stored file in form DRIVER_NAME:path |
meta | new group's metadata |
datasetValues | scalar/vector values for all datasets and all faces/vertices in the group |
datasetActive | active flag values for all datasets in the group. Empty array represents can be used when all faces are active |
times | times in hours for all datasets in the group |
true
on failure, false
on successDefinition at line 129 of file qgsmeshdataprovider.cpp.
|
protected |
Definition at line 425 of file qgsmeshdataprovider.h.