18 #ifndef QGSMESHMEMORYDATAPROVIDER_H 19 #define QGSMESHMEMORYDATAPROVIDER_H 28 #include "qgis_core.h" 33 struct CORE_EXPORT QgsMeshMemoryDataset
35 QgsMeshMemoryDataset();
36 QgsMeshDataBlock datasetValues(
bool isScalar,
int valueIndex,
int count )
const;
39 QVector<QgsMeshDatasetValue> values;
43 double minimum = std::numeric_limits<double>::quiet_NaN();
44 double maximum = std::numeric_limits<double>::quiet_NaN();
47 struct CORE_EXPORT QgsMeshMemoryDatasetGroup
49 QgsMeshMemoryDatasetGroup(
const QString &nm );
50 QgsMeshMemoryDatasetGroup();
52 int datasetCount()
const;
53 void addDataset( std::shared_ptr<QgsMeshMemoryDataset> dataset );
55 std::shared_ptr<const QgsMeshMemoryDataset> constDataset(
int index )
const;
57 QMap<QString, QString> metadata;
58 QVector<std::shared_ptr<QgsMeshMemoryDataset>> datasets;
62 double minimum = std::numeric_limits<double>::quiet_NaN();
63 double maximum = std::numeric_limits<double>::quiet_NaN();
102 QString
name()
const override;
140 bool addDataset(
const QString &uri )
override;
153 const QVector<QgsMeshDataBlock> &datasetValues,
154 const QVector<QgsMeshDataBlock> &datasetActive,
155 const QVector<double> ×
159 static QString providerKey();
161 static QString providerDescription();
166 void calculateMinMaxForDatasetGroup( QgsMeshMemoryDatasetGroup &grp )
const;
167 void calculateMinMaxForDataset( std::shared_ptr<QgsMeshMemoryDataset> &dataset )
const;
170 bool splitMeshSections(
const QString &uri );
171 bool addMeshVertices(
const QString &def );
172 bool addMeshFaces(
const QString &def );
174 bool splitDatasetSections(
const QString &uri, QgsMeshMemoryDatasetGroup &datasetGroup );
175 bool setDatasetGroupType(
const QString &uri, QgsMeshMemoryDatasetGroup &datasetGroup );
176 bool addDatasetGroupMetadata(
const QString &def, QgsMeshMemoryDatasetGroup &datasetGroup );
177 bool addDatasetValues(
const QString &def, std::shared_ptr<QgsMeshMemoryDataset> &dataset,
bool isScalar );
178 bool checkDatasetValidity( std::shared_ptr<QgsMeshMemoryDataset> &dataset,
bool isOnVertices );
180 QVector<QgsMeshVertex> mVertices;
181 QVector<QgsMeshFace> mFaces;
182 QVector<QgsMeshMemoryDatasetGroup> mDatasetGroups;
184 bool mIsValid =
false;
185 QStringList mExtraDatasetUris;
190 #endif // QGSMESHMEMORYDATAPROVIDER_H A rectangle specified with double values.
virtual bool persistDatasetGroup(const QString &path, 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 int faceCount() const =0
Returns number of faces in the native mesh.
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e...
virtual bool addDataset(const QString &uri)=0
Associate dataset with the mesh.
virtual int datasetCount(int groupIndex) const =0
Returns number of datasets loaded in the group.
virtual int vertexCount() const =0
Returns number of vertices in the native mesh.
virtual QString name() const =0
Returns a provider name.
virtual bool isValid() const =0
Returns true if this is a valid layer.
virtual QgsCoordinateReferenceSystem crs() const =0
Returns the coordinate system for the data source.
virtual QgsMeshDataBlock datasetValues(QgsMeshDatasetIndex index, int valueIndex, int count) const =0
Returns N vector/scalar values from the index from the dataset.
virtual void populateMesh(QgsMesh *mesh) const =0
Populates the mesh vertices and faces.
Base class for providing data for QgsMeshLayer.
virtual QgsMeshDatasetMetadata datasetMetadata(QgsMeshDatasetIndex index) const =0
Returns dataset metadata.
Setting options for creating vector data providers.
Mesh - vertices and faces.
virtual bool isFaceActive(QgsMeshDatasetIndex index, int faceIndex) const =0
Returns whether the face is active for particular dataset.
This class represents a coordinate reference system (CRS).
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
virtual QStringList extraDatasets() const =0
Returns list of additional dataset file URIs added using addDataset() calls.
virtual QString description() const =0
Returns description.
virtual QgsRectangle extent() const =0
Returns the extent of the layer.
virtual int datasetGroupCount() const =0
Returns number of datasets groups loaded.
QgsMeshDatasetValue represents single dataset value.
virtual QgsMeshDatasetValue datasetValue(QgsMeshDatasetIndex index, int valueIndex) const =0
Returns vector/scalar value associated with the index from the dataset To read multiple continuous va...
virtual QgsMeshDataBlock areFacesActive(QgsMeshDatasetIndex index, int faceIndex, int count) const =0
Returns whether the faces are active for particular dataset.
virtual QgsMeshDatasetGroupMetadata datasetGroupMetadata(int groupIndex) const =0
Returns dataset group metadata.