QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | Protected Attributes | List of all members
QgsMeshDatasetSourceInterface Class Referenceabstract

Interface for mesh datasets and dataset groups. More...

#include <qgsmeshdataprovider.h>

Inheritance diagram for QgsMeshDatasetSourceInterface:
Inheritance graph
[legend]

Public Member Functions

 QgsMeshDatasetSourceInterface ()
 
virtual ~QgsMeshDatasetSourceInterface ()=default
 Dtor. More...
 
virtual bool addDataset (const QString &uri)=0
 Associate dataset with the mesh. More...
 
virtual QgsMeshDataBlock areFacesActive (QgsMeshDatasetIndex index, int faceIndex, int count) const =0
 Returns whether the faces are active for particular dataset. More...
 
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. More...
 
virtual int datasetCount (int groupIndex) const =0
 Returns number of datasets loaded in the group. More...
 
int datasetCount (QgsMeshDatasetIndex index) const
 Returns number of datasets loaded in the group. More...
 
virtual int datasetGroupCount () const =0
 Returns number of datasets groups loaded. More...
 
virtual QgsMeshDatasetGroupMetadata datasetGroupMetadata (int groupIndex) const =0
 Returns dataset group metadata. More...
 
QgsMeshDatasetGroupMetadata datasetGroupMetadata (QgsMeshDatasetIndex index) const
 Returns dataset group metadata. More...
 
QgsMeshDatasetIndex datasetIndexAtTime (const QDateTime &referenceTime, int groupIndex, quint64 time, QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod method) const
 Returns the dataset index of the dataset in a specific dataet group at time from the reference time. More...
 
virtual QgsMeshDatasetMetadata datasetMetadata (QgsMeshDatasetIndex index) const =0
 Returns dataset metadata. More...
 
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() More...
 
virtual QgsMeshDataBlock datasetValues (QgsMeshDatasetIndex index, int valueIndex, int count) const =0
 Returns N vector/scalar values from the index from the dataset. More...
 
virtual QStringList extraDatasets () const =0
 Returns list of additional dataset file URIs added using addDataset() calls. More...
 
virtual bool isFaceActive (QgsMeshDatasetIndex index, int faceIndex) const =0
 Returns whether the face is active for particular dataset. More...
 
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
 Creates a new dataset group from a data and persists it into a destination path. More...
 
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. More...
 
virtual Q_DECL_DEPRECATED bool persistDatasetGroup (const QString &path, const QgsMeshDatasetGroupMetadata &meta, const QVector< QgsMeshDataBlock > &datasetValues, const QVector< QgsMeshDataBlock > &datasetActive, const QVector< double > &times)
 Creates a new dataset group from a data and persists it into a destination path. More...
 

Protected Attributes

std::unique_ptr< QgsMeshDataProviderTemporalCapabilitiesmTemporalCapabilities
 

Detailed Description

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
Since
QGIS 3.2

Definition at line 188 of file qgsmeshdataprovider.h.

Constructor & Destructor Documentation

◆ QgsMeshDatasetSourceInterface()

QgsMeshDatasetSourceInterface::QgsMeshDatasetSourceInterface ( )

Definition at line 73 of file qgsmeshdataprovider.cpp.

◆ ~QgsMeshDatasetSourceInterface()

virtual QgsMeshDatasetSourceInterface::~QgsMeshDatasetSourceInterface ( )
virtualdefault

Dtor.

Member Function Documentation

◆ addDataset()

virtual bool QgsMeshDatasetSourceInterface::addDataset ( const QString &  uri)
pure virtual

Associate dataset with the mesh.

emits dataChanged when successful

Implemented in QgsMeshExtraDatasetStore.

◆ areFacesActive()

virtual QgsMeshDataBlock QgsMeshDatasetSourceInterface::areFacesActive ( QgsMeshDatasetIndex  index,
int  faceIndex,
int  count 
) const
pure virtual

Returns whether the faces are active for particular dataset.

Since
QGIS 3.6

Implemented in QgsMeshExtraDatasetStore.

◆ dataset3dValues()

virtual QgsMesh3dDataBlock QgsMeshDatasetSourceInterface::dataset3dValues ( QgsMeshDatasetIndex  index,
int  faceIndex,
int  count 
) const
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.

See also
datasetValues
Since
QGIS 3.12

Implemented in QgsMeshExtraDatasetStore.

◆ datasetCount() [1/2]

virtual int QgsMeshDatasetSourceInterface::datasetCount ( int  groupIndex) const
pure virtual

Returns number of datasets loaded in the group.

Implemented in QgsMeshExtraDatasetStore.

◆ datasetCount() [2/2]

int QgsMeshDatasetSourceInterface::datasetCount ( QgsMeshDatasetIndex  index) const

Returns number of datasets loaded in the group.

Definition at line 76 of file qgsmeshdataprovider.cpp.

◆ datasetGroupCount()

virtual int QgsMeshDatasetSourceInterface::datasetGroupCount ( ) const
pure virtual

Returns number of datasets groups loaded.

Implemented in QgsMeshExtraDatasetStore.

◆ datasetGroupMetadata() [1/2]

virtual QgsMeshDatasetGroupMetadata QgsMeshDatasetSourceInterface::datasetGroupMetadata ( int  groupIndex) const
pure virtual

Returns dataset group metadata.

Implemented in QgsMeshExtraDatasetStore.

◆ datasetGroupMetadata() [2/2]

QgsMeshDatasetGroupMetadata QgsMeshDatasetSourceInterface::datasetGroupMetadata ( QgsMeshDatasetIndex  index) const

Returns dataset group metadata.

Definition at line 81 of file qgsmeshdataprovider.cpp.

◆ datasetIndexAtTime()

QgsMeshDatasetIndex QgsMeshDatasetSourceInterface::datasetIndexAtTime ( const QDateTime &  referenceTime,
int  groupIndex,
quint64  time,
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod  method 
) const

Returns the dataset index of the dataset in a specific dataet group at time from the reference time.

Parameters
referenceTimethe reference time from where to find the dataset
groupIndexthe index of the dataset group
timethe relative time from reference time
methodthe method used to check the time
Returns
the dataset index

Definition at line 47 of file qgsmeshdataprovider.cpp.

◆ datasetMetadata()

virtual QgsMeshDatasetMetadata QgsMeshDatasetSourceInterface::datasetMetadata ( QgsMeshDatasetIndex  index) const
pure virtual

Returns dataset metadata.

Implemented in QgsMeshExtraDatasetStore.

◆ datasetValue()

virtual QgsMeshDatasetValue QgsMeshDatasetSourceInterface::datasetValue ( QgsMeshDatasetIndex  index,
int  valueIndex 
) const
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

See also
datasetValues

Implemented in QgsMeshExtraDatasetStore.

◆ datasetValues()

virtual QgsMeshDataBlock QgsMeshDatasetSourceInterface::datasetValues ( QgsMeshDatasetIndex  index,
int  valueIndex,
int  count 
) const
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

Since
QGIS 3.6

Implemented in QgsMeshExtraDatasetStore.

◆ extraDatasets()

virtual QStringList QgsMeshDatasetSourceInterface::extraDatasets ( ) const
pure virtual

Returns list of additional dataset file URIs added using addDataset() calls.

Implemented in QgsMeshExtraDatasetStore.

◆ isFaceActive()

virtual bool QgsMeshDatasetSourceInterface::isFaceActive ( QgsMeshDatasetIndex  index,
int  faceIndex 
) const
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.

◆ persistDatasetGroup() [1/3]

virtual bool QgsMeshDatasetSourceInterface::persistDatasetGroup ( const QString &  outputFilePath,
const QString &  outputDriver,
const QgsMeshDatasetGroupMetadata meta,
const QVector< QgsMeshDataBlock > &  datasetValues,
const QVector< QgsMeshDataBlock > &  datasetActive,
const QVector< double > &  times 
)
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

Parameters
outputFilePathdestination path of the stored file
outputDriveroutput driver name
metanew group's metadata
datasetValuesscalar/vector values for all datasets and all faces/vertices in the group
datasetActiveactive flag values for all datasets in the group. Empty array represents can be used when all faces are active
timestimes in hours for all datasets in the group
Returns
true on failure, false on success
Since
QGIS 3.12.3

Implemented in QgsMeshExtraDatasetStore.

◆ persistDatasetGroup() [2/3]

virtual bool QgsMeshDatasetSourceInterface::persistDatasetGroup ( const QString &  outputFilePath,
const QString &  outputDriver,
QgsMeshDatasetSourceInterface source,
int  datasetGroupIndex 
)
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

Parameters
outputFilePathdestination path of the stored file
outputDriveroutput driver name
sourcesource of the dataset group
datasetGroupIndexindex of the dataset group in the source
Returns
true on failure, false on success
Since
QGIS 3.16

Implemented in QgsMeshExtraDatasetStore.

◆ persistDatasetGroup() [3/3]

bool QgsMeshDatasetSourceInterface::persistDatasetGroup ( const QString &  path,
const QgsMeshDatasetGroupMetadata meta,
const QVector< QgsMeshDataBlock > &  datasetValues,
const QVector< QgsMeshDataBlock > &  datasetActive,
const QVector< double > &  times 
)
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

Parameters
pathdestination path of the stored file in form DRIVER_NAME:path
metanew group's metadata
datasetValuesscalar/vector values for all datasets and all faces/vertices in the group
datasetActiveactive flag values for all datasets in the group. Empty array represents can be used when all faces are active
timestimes in hours for all datasets in the group
Returns
true on failure, false on success
Note
Doesn't work if there is ":" in the path (e.g. Windows system)
Since
QGIS 3.6
Deprecated:
QGIS 3.12.3

Definition at line 86 of file qgsmeshdataprovider.cpp.

Member Data Documentation

◆ mTemporalCapabilities

std::unique_ptr<QgsMeshDataProviderTemporalCapabilities> QgsMeshDatasetSourceInterface::mTemporalCapabilities
protected

Definition at line 383 of file qgsmeshdataprovider.h.


The documentation for this class was generated from the following files: