QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Signals | Public Member Functions | List of all members
QgsMeshDataProvider Class Referenceabstract

Base class for providing data for QgsMeshLayer. More...

#include <qgsmeshdataprovider.h>

Inheritance diagram for QgsMeshDataProvider:
Inheritance graph
[legend]

Signals

void datasetGroupsAdded (int count)
 Emitted when some new dataset groups have been added. More...
 
- 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. More...
 
void fullExtentCalculated ()
 Emitted whenever a deferred extent calculation is completed by the provider. More...
 
void notify (const QString &msg)
 Emitted when the datasource issues a notification. More...
 

Public Member Functions

 QgsMeshDataProvider (const QString &uri, const QgsDataProvider::ProviderOptions &providerOptions, QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
 Ctor. More...
 
virtual void close ()=0
 Closes the data provider and free every resources used. More...
 
virtual QgsMeshDriverMetadata driverMetadata () const
 Returns the mesh driver metadata of the provider. More...
 
void setTemporalUnit (QgsUnitTypes::TemporalUnit unit)
 Sets the temporal unit of the provider and reload data if it changes. More...
 
const QgsMeshDataProviderTemporalCapabilitiestemporalCapabilities () const override
 Returns the provider's temporal capabilities. More...
 
QgsMeshDataProviderTemporalCapabilitiestemporalCapabilities () override
 Returns the provider's temporal capabilities. More...
 
- Public Member Functions inherited from QgsDataProvider
 QgsDataProvider (const QString &uri=QString(), const QgsDataProvider::ProviderOptions &providerOptions=QgsDataProvider::ProviderOptions(), QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
 Create a new dataprovider with the specified in the uri. More...
 
virtual QgsCoordinateReferenceSystem crs () const =0
 Returns the coordinate system for the data source. More...
 
virtual QString dataComment () const
 Returns a short comment for the data that this provider is providing access to (e.g. More...
 
virtual QString dataSourceUri (bool expandAuthConfig=false) const
 Gets the data source specification. More...
 
virtual QDateTime dataTimestamp () const
 Current time stamp of data source. More...
 
virtual QString description () const =0
 Returns description. More...
 
virtual bool enterUpdateMode ()
 Enter update mode. More...
 
virtual QgsError error () const
 Gets current status error. More...
 
virtual QgsRectangle extent () const =0
 Returns the extent of the layer. More...
 
virtual QString fileRasterFilters () const
 Returns raster file filter string. More...
 
virtual QString fileVectorFilters () const
 Returns vector file filter string. More...
 
virtual Qgis::DataProviderFlags flags () const
 Returns the generic data provider flags. More...
 
virtual void invalidateConnections (const QString &connection)
 Invalidate connections corresponding to specified name. More...
 
virtual bool isValid () const =0
 Returns true if this is a valid layer. More...
 
virtual QgsLayerMetadata layerMetadata () const
 Returns layer metadata collected from the provider's source. More...
 
virtual bool leaveUpdateMode ()
 Leave update mode. More...
 
virtual QString name () const =0
 Returns a provider name. More...
 
QVariant providerProperty (int property, const QVariant &defaultValue) const
 Gets the current value of a certain provider property. More...
 
QVariant providerProperty (ProviderProperty property, const QVariant &defaultValue=QVariant()) const
 Gets the current value of a certain provider property. More...
 
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. More...
 
virtual bool renderInPreview (const QgsDataProvider::PreviewContext &context)
 Returns whether the layer must be rendered in preview jobs. More...
 
virtual void setDataSourceUri (const QString &uri)
 Set the data source specification. More...
 
virtual void setLayerOrder (const QStringList &layers)
 Reorder the list of layer names to be rendered by this provider (in order from bottom to top) More...
 
virtual void setListening (bool isListening)
 Set whether the provider will listen to datasource notifications If set, the provider will issue notify signals. More...
 
void setProviderProperty (int property, const QVariant &value)
 Allows setting arbitrary properties on the provider. More...
 
void setProviderProperty (ProviderProperty property, const QVariant &value)
 Allows setting arbitrary properties on the provider. More...
 
virtual void setSubLayerVisibility (const QString &name, bool vis)
 Set the visibility of the given sublayer name. More...
 
virtual bool setSubsetString (const QString &subset, bool updateFeatureCount=true)
 Set the subset string used to create a subset of features in the layer. More...
 
virtual void setTransformContext (const QgsCoordinateTransformContext &transformContext)
 Sets data coordinate transform context to transformContext. More...
 
void setUri (const QgsDataSourceUri &uri)
 Set the data source specification. More...
 
virtual uint subLayerCount () const
 Returns the number of layers for the current data source. More...
 
virtual QStringList subLayers () const
 Sub-layers handled by this provider, in order from bottom to top. More...
 
virtual QStringList subLayerStyles () const
 Sub-layer styles for each sub-layer handled by this provider, in order from bottom to top. More...
 
virtual QString subsetString () const
 Returns the subset definition string (typically sql) currently in use by the layer and used by the provider to limit the feature set. More...
 
virtual bool supportsSubsetString () const
 Returns true if the provider supports setting of subset strings. More...
 
virtual QgsDataProviderTemporalCapabilitiestemporalCapabilities ()
 Returns the provider's temporal capabilities. More...
 
virtual const QgsDataProviderTemporalCapabilitiestemporalCapabilities () const
 Returns the provider's temporal capabilities. More...
 
virtual QDateTime timestamp () const
 Time stamp of data source in the moment when data/metadata were loaded by provider. More...
 
QgsCoordinateTransformContext transformContext () const
 Returns data provider coordinate transform context. More...
 
virtual void updateExtents ()
 Update the extents of the layer. More...
 
QgsDataSourceUri uri () const
 Gets the data source specification. More...
 
virtual bool writeLayerMetadata (const QgsLayerMetadata &metadata)
 Writes layer metadata to the underlying provider source. More...
 
- Public Member Functions inherited from QgsMeshDataSourceInterface
virtual ~QgsMeshDataSourceInterface ()=default
 Dtor. More...
 
bool contains (const QgsMesh::ElementType &type) const
 Returns whether the mesh contains at mesh elements of given type. More...
 
virtual int edgeCount () const =0
 Returns number of edges in the native mesh. More...
 
virtual int faceCount () const =0
 Returns number of faces in the native mesh. More...
 
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. More...
 
virtual void populateMesh (QgsMesh *mesh) const =0
 Populates the mesh vertices, edges and faces. More...
 
virtual bool saveMeshFrame (const QgsMesh &mesh)=0
 Saves the mesh frame to the source. More...
 
virtual int vertexCount () const =0
 Returns number of vertices in the native mesh. More...
 
- Public Member Functions inherited from QgsMeshDatasetSourceInterface
 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, qint64 time, QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod method) const
 Returns the dataset index of the dataset in a specific dataset group at time from the reference time. More...
 
QList< QgsMeshDatasetIndexdatasetIndexInTimeInterval (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. 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...
 

Additional Inherited Members

- Public Types inherited from QgsDataProvider
enum  DataCapability {
  NoDataCapabilities = 0 , File = 1 , Dir = 1 << 1 , Database = 1 << 2 ,
  Net = 1 << 3
}
 Used in browser model to understand which items for which providers should be populated. More...
 
enum  ProviderProperty { EvaluateDefaultValues , CustomData = 3000 }
 Properties are used to pass custom configuration options into data providers. More...
 
enum  ReadFlag {
  FlagTrustDataSource = 1 << 0 , SkipFeatureCount = 1 << 1 , FlagLoadDefaultStyle = 1 << 2 , SkipGetExtent = 1 << 3 ,
  SkipFullScan = 1 << 4 , ForceReadOnly = 1 << 5
}
 Flags which control dataprovider construction. More...
 
- Static Public Member Functions inherited from QgsDataProvider
static QString sublayerSeparator ()
 String sequence used for separating components of sublayers strings. More...
 
- Protected Member Functions inherited from QgsDataProvider
void appendError (const QgsErrorMessage &message)
 Add error message. More...
 
void setError (const QgsError &error)
 Sets error message. More...
 
- Protected Attributes inherited from QgsDataProvider
QgsError mError
 Error. More...
 
QgsDataProvider::ReadFlags mReadFlags = QgsDataProvider::ReadFlags()
 Read flags. It's up to the subclass to respect these when needed. More...
 
QDateTime mTimestamp
 Timestamp of data in the moment when the data were loaded by provider. More...
 
- Protected Attributes inherited from QgsMeshDatasetSourceInterface
std::unique_ptr< QgsMeshDataProviderTemporalCapabilitiesmTemporalCapabilities
 

Detailed Description

Base class for providing data for QgsMeshLayer.

Responsible for reading native mesh data

Note
The API is considered EXPERIMENTAL and can be changed without a notice
Since
QGIS 3.2

Definition at line 436 of file qgsmeshdataprovider.h.

Constructor & Destructor Documentation

◆ QgsMeshDataProvider()

QgsMeshDataProvider::QgsMeshDataProvider ( const QString &  uri,
const QgsDataProvider::ProviderOptions providerOptions,
QgsDataProvider::ReadFlags  flags = QgsDataProvider::ReadFlags() 
)

Ctor.

Definition at line 23 of file qgsmeshdataprovider.cpp.

Member Function Documentation

◆ close()

virtual void QgsMeshDataProvider::close ( )
pure virtual

Closes the data provider and free every resources used.

Since
QGIS 3.22

◆ datasetGroupsAdded

void QgsMeshDataProvider::datasetGroupsAdded ( int  count)
signal

Emitted when some new dataset groups have been added.

◆ driverMetadata()

QgsMeshDriverMetadata QgsMeshDataProvider::driverMetadata ( ) const
virtual

Returns the mesh driver metadata of the provider.

Returns
the mesh driver metadata of the provider
Since
QGIS 3.22

Definition at line 47 of file qgsmeshdataprovider.cpp.

◆ setTemporalUnit()

void QgsMeshDataProvider::setTemporalUnit ( QgsUnitTypes::TemporalUnit  unit)

Sets the temporal unit of the provider and reload data if it changes.

Parameters
unitthe temporal unit
Since
QGIS 3.14

Definition at line 39 of file qgsmeshdataprovider.cpp.

◆ temporalCapabilities() [1/2]

const QgsMeshDataProviderTemporalCapabilities * QgsMeshDataProvider::temporalCapabilities ( ) const
overridevirtual

Returns the provider's temporal capabilities.

This may be nullptr, depending on the data provider.

Since
QGIS 3.14

Reimplemented from QgsDataProvider.

Definition at line 34 of file qgsmeshdataprovider.cpp.

◆ temporalCapabilities() [2/2]

QgsMeshDataProviderTemporalCapabilities * QgsMeshDataProvider::temporalCapabilities ( )
overridevirtual

Returns the provider's temporal capabilities.

This may be nullptr, depending on the data provider.

Since
QGIS 3.14

Reimplemented from QgsDataProvider.

Definition at line 29 of file qgsmeshdataprovider.cpp.


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