QGIS API Documentation 3.41.0-Master (cea29feecf2)
|
Base class for providing data for QgsMeshLayer. More...
#include <qgsmeshdataprovider.h>
Signals | |
void | datasetGroupsAdded (int count) |
Emitted when some new dataset groups have been added. | |
Signals inherited from QgsDataProvider | |
void | dataChanged () |
Emitted whenever a change is made to the data provider which may have caused changes in the provider's data OUTSIDE of QGIS. | |
void | fullExtentCalculated () |
Emitted whenever a deferred extent calculation is completed by the provider. | |
void | notify (const QString &msg) |
Emitted when the datasource issues a notification. | |
Public Member Functions | |
QgsMeshDataProvider (const QString &uri, const QgsDataProvider::ProviderOptions &providerOptions, Qgis::DataProviderReadFlags=Qgis::DataProviderReadFlags()) | |
Ctor. | |
virtual void | close ()=0 |
Closes the data provider and free every resources used. | |
virtual QgsMeshDriverMetadata | driverMetadata () const |
Returns the mesh driver metadata of the provider. | |
virtual bool | removeDatasetGroup (int index)=0 |
Remove dataset group from the mesh. | |
void | setTemporalUnit (Qgis::TemporalUnit unit) |
Sets the temporal unit of the provider and reload data if it changes. | |
const QgsMeshDataProviderTemporalCapabilities * | temporalCapabilities () const override |
Returns the provider's temporal capabilities. | |
QgsMeshDataProviderTemporalCapabilities * | temporalCapabilities () override |
Returns the provider's temporal capabilities. | |
Public Member Functions inherited from QgsDataProvider | |
QgsDataProvider (const QString &uri=QString(), const QgsDataProvider::ProviderOptions &providerOptions=QgsDataProvider::ProviderOptions(), Qgis::DataProviderReadFlags flags=Qgis::DataProviderReadFlags()) | |
Create a new dataprovider with the specified in the uri. | |
virtual QgsCoordinateReferenceSystem | crs () const =0 |
Returns the coordinate system for the data source. | |
virtual QString | dataComment () const |
Returns a short comment for the data that this provider is providing access to (e.g. | |
virtual QString | dataSourceUri (bool expandAuthConfig=false) const |
Gets the data source specification. | |
virtual QDateTime | dataTimestamp () const |
Current time stamp of data source. | |
virtual QString | description () const =0 |
Returns description. | |
virtual QgsDataProviderElevationProperties * | elevationProperties () |
Returns the provider's elevation properties. | |
virtual const QgsDataProviderElevationProperties * | elevationProperties () const |
Returns the provider's elevation properties. | |
virtual bool | enterUpdateMode () |
Enter update mode. | |
virtual QgsError | error () const |
Gets current status error. | |
virtual QgsRectangle | extent () const =0 |
Returns the extent of the layer. | |
virtual QgsBox3D | extent3D () const |
Returns the 3D extent of the layer. | |
virtual QString | fileRasterFilters () const |
Returns raster file filter string. | |
virtual QString | fileVectorFilters () const |
Returns vector file filter string. | |
virtual Qgis::DataProviderFlags | flags () const |
Returns the generic data provider flags. | |
virtual QString | htmlMetadata () const |
Obtain a formatted HTML string containing assorted metadata for this data provider. | |
virtual void | invalidateConnections (const QString &connection) |
Invalidate connections corresponding to specified name. | |
virtual bool | isValid () const =0 |
Returns true if this is a valid layer. | |
virtual QgsLayerMetadata | layerMetadata () const |
Returns layer metadata collected from the provider's source. | |
virtual bool | leaveUpdateMode () |
Leave update mode. | |
virtual QString | name () const =0 |
Returns a provider name. | |
QVariant | providerProperty (int property, const QVariant &defaultValue) const |
Gets the current value of a certain provider property. | |
QVariant | providerProperty (ProviderProperty property, const QVariant &defaultValue=QVariant()) const |
Gets the current value of a certain provider property. | |
virtual void | reloadData () |
Reloads the data from the source for providers with data caches to synchronize, changes in the data source, feature counts and other specific actions. | |
virtual bool | renderInPreview (const QgsDataProvider::PreviewContext &context) |
Returns whether the layer must be rendered in preview jobs. | |
virtual void | setDataSourceUri (const QString &uri) |
Set the data source specification. | |
virtual void | setLayerOrder (const QStringList &layers) |
Reorder the list of layer names to be rendered by this provider (in order from bottom to top) | |
virtual void | setListening (bool isListening) |
Set whether the provider will listen to datasource notifications If set, the provider will issue notify signals. | |
void | setProviderProperty (int property, const QVariant &value) |
Allows setting arbitrary properties on the provider. | |
void | setProviderProperty (ProviderProperty property, const QVariant &value) |
Allows setting arbitrary properties on the provider. | |
virtual void | setSubLayerVisibility (const QString &name, bool vis) |
Set the visibility of the given sublayer name. | |
virtual bool | setSubsetString (const QString &subset, bool updateFeatureCount=true) |
Set the subset string used to create a subset of features in the layer. | |
virtual void | setTransformContext (const QgsCoordinateTransformContext &transformContext) |
Sets data coordinate transform context to transformContext. | |
void | setUri (const QgsDataSourceUri &uri) |
Set the data source specification. | |
void | setUri (const QString &uri) |
Set the data source specification. | |
virtual Qgis::ProviderStyleStorageCapabilities | styleStorageCapabilities () const |
Returns the style storage capabilities. | |
virtual uint | subLayerCount () const |
Returns the number of layers for the current data source. | |
virtual QStringList | subLayers () const |
Sub-layers handled by this provider, in order from bottom to top. | |
virtual QStringList | subLayerStyles () const |
Sub-layer styles for each sub-layer handled by this provider, in order from bottom to top. | |
virtual QString | subsetString () const |
Returns the subset definition string currently in use by the layer and used by the provider to limit the feature set. | |
virtual QString | subsetStringDialect () const |
Returns a user-friendly string describing the dialect which is supported for subset strings by the provider. | |
virtual QString | subsetStringHelpUrl () const |
Returns a URL pointing to documentation describing the dialect which is supported for subset strings by the provider. | |
virtual bool | supportsSubsetString () const |
Returns true if the provider supports setting of subset strings. | |
virtual QDateTime | timestamp () const |
Time stamp of data source in the moment when data/metadata were loaded by provider. | |
QgsCoordinateTransformContext | transformContext () const |
Returns data provider coordinate transform context. | |
virtual void | updateExtents () |
Update the extents of the layer. | |
QgsDataSourceUri | uri () const |
Gets the data source specification. | |
virtual bool | writeLayerMetadata (const QgsLayerMetadata &metadata) |
Writes layer metadata to the underlying provider source. | |
Public Member Functions inherited from QgsMeshDataSourceInterface | |
virtual | ~QgsMeshDataSourceInterface ()=default |
bool | contains (const QgsMesh::ElementType &type) const |
Returns whether the mesh contains at mesh elements of given type. | |
virtual int | edgeCount () const =0 |
Returns number of edges in the native mesh. | |
virtual int | faceCount () const =0 |
Returns number of faces in the native mesh. | |
virtual int | maximumVerticesCountPerFace () const |
Returns the maximum number of vertices per face supported by the current mesh, if returns 0, the number of vertices is unlimited. | |
virtual void | populateMesh (QgsMesh *mesh) const =0 |
Populates the mesh vertices, edges and faces. | |
virtual bool | saveMeshFrame (const QgsMesh &mesh)=0 |
Saves the mesh frame to the source. | |
virtual int | vertexCount () const =0 |
Returns number of vertices in the native mesh. | |
Public Member Functions inherited from QgsMeshDatasetSourceInterface | |
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. | |
Additional Inherited Members | |
Public Types inherited from QgsDataProvider | |
enum | ProviderProperty { EvaluateDefaultValues , CustomData = 3000 } |
Properties are used to pass custom configuration options into data providers. More... | |
Static Public Member Functions inherited from QgsDataProvider | |
static QString | sublayerSeparator () |
String sequence used for separating components of sublayers strings. | |
Protected Member Functions inherited from QgsDataProvider | |
void | appendError (const QgsErrorMessage &message) |
Add error message. | |
void | setError (const QgsError &error) |
Sets error message. | |
Protected Attributes inherited from QgsDataProvider | |
QgsError | mError |
Error. | |
Qgis::DataProviderReadFlags | mReadFlags |
Read flags. It's up to the subclass to respect these when needed. | |
QDateTime | mTimestamp |
Timestamp of data in the moment when the data were loaded by provider. | |
Protected Attributes inherited from QgsMeshDatasetSourceInterface | |
std::unique_ptr< QgsMeshDataProviderTemporalCapabilities > | mTemporalCapabilities |
Base class for providing data for QgsMeshLayer.
Responsible for reading native mesh data
Definition at line 439 of file qgsmeshdataprovider.h.
QgsMeshDataProvider::QgsMeshDataProvider | ( | const QString & | uri, |
const QgsDataProvider::ProviderOptions & | providerOptions, | ||
Qgis::DataProviderReadFlags | flags = Qgis::DataProviderReadFlags() |
||
) |
Ctor.
Definition at line 24 of file qgsmeshdataprovider.cpp.
|
pure virtual |
Closes the data provider and free every resources used.
|
signal |
Emitted when some new dataset groups have been added.
|
virtual |
Returns the mesh driver metadata of the provider.
Definition at line 54 of file qgsmeshdataprovider.cpp.
|
pure virtual |
Remove dataset group from the mesh.
emits dataChanged when successful
true
on successvoid QgsMeshDataProvider::setTemporalUnit | ( | Qgis::TemporalUnit | unit | ) |
Sets the temporal unit of the provider and reload data if it changes.
unit | the temporal unit |
Definition at line 44 of file qgsmeshdataprovider.cpp.
|
overridevirtual |
Returns the provider's temporal capabilities.
This may be nullptr
, depending on the data provider.
Reimplemented from QgsDataProvider.
Definition at line 37 of file qgsmeshdataprovider.cpp.
|
overridevirtual |
Returns the provider's temporal capabilities.
This may be nullptr
, depending on the data provider.
Reimplemented from QgsDataProvider.
Definition at line 30 of file qgsmeshdataprovider.cpp.