QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
18 #ifndef QGSMESHDATASET_H
19 #define QGSMESHDATASET_H
28 #include "qgis_core.h"
65 int mDatasetIndex = -1;
96 void set(
double scalar );
99 void setX(
double x );
102 void setY(
double y ) ;
105 double scalar()
const;
116 double mX = std::numeric_limits<double>::quiet_NaN();
117 double mY = std::numeric_limits<double>::quiet_NaN();
155 DataType type()
const;
161 bool isValid()
const;
173 bool active(
int index )
const;
188 void setActive(
const QVector<int> &vals );
201 QVector<int> active()
const;
209 QVector<double> values()
const;
220 void setValues(
const QVector<double> &vals );
223 void setValid(
bool valid );
226 QVector<double> mDoubleBuffer;
227 QVector<int> mIntegerBuffer;
230 bool mIsValid =
false;
259 void setValid(
bool valid );
262 bool isValid()
const;
265 bool isVector()
const;
271 int firstVolumeIndex()
const;
274 int lastVolumeIndex()
const;
277 int volumesCount()
const;
282 QVector<int> verticalLevelsCount()
const;
287 void setVerticalLevelsCount(
const QVector<int> &verticalLevelsCount );
292 QVector<double> verticalLevels()
const;
297 void setVerticalLevels(
const QVector<double> &verticalLevels );
302 QVector<int> faceToVolumeIndex()
const;
307 void setFaceToVolumeIndex(
const QVector<int> &faceToVolumeIndex );
314 QVector<double> values()
const;
329 void setValues(
const QVector<double> &doubleBuffer );
333 bool mIsValid =
false;
334 bool mIsVector =
false;
335 QVector<int> mVerticalLevelsCount;
336 QVector<double> mVerticalLevels;
337 QVector<int> mFaceToVolumeIndex;
338 QVector<double> mDoubleBuffer;
387 int maximumVerticalLevels,
388 const QDateTime &referenceTime,
390 const QMap<QString, QString> &extraOptions );
395 QString name()
const;
407 QMap<QString, QString> extraOptions()
const;
412 bool isVector()
const;
417 bool isScalar()
const;
422 bool isTemporal()
const;
429 DataType dataType()
const;
434 double minimum()
const;
439 double maximum()
const;
446 int maximumVerticalLevelsCount()
const;
453 QDateTime referenceTime()
const;
458 bool mIsScalar =
false;
459 DataType mDataType = DataType::DataOnFaces;
460 double mMinimumValue = std::numeric_limits<double>::quiet_NaN();
461 double mMaximumValue = std::numeric_limits<double>::quiet_NaN();
462 QMap<QString, QString> mExtraOptions;
463 int mMaximumVerticalLevelsCount = 0;
464 QDateTime mReferenceTime;
465 bool mIsTemporal =
false;
497 int maximumVerticalLevels
508 bool isValid()
const;
513 double minimum()
const;
518 double maximum()
const;
525 int maximumVerticalLevelsCount()
const;
528 double mTime = std::numeric_limits<double>::quiet_NaN();
529 bool mIsValid =
false;
530 double mMinimumValue = std::numeric_limits<double>::quiet_NaN();
531 double mMaximumValue = std::numeric_limits<double>::quiet_NaN();
532 int mMaximumVerticalLevelsCount = 0;
556 virtual QgsMeshDataBlock datasetValues(
bool isScalar,
int valueIndex,
int count )
const = 0;
559 virtual QgsMeshDataBlock areFacesActive(
int faceIndex,
int count )
const = 0;
562 virtual bool isActive(
int faceIndex )
const = 0;
568 virtual int valuesCount()
const = 0;
606 virtual void initialize() = 0;
615 virtual int datasetCount()
const = 0;
624 double minimum()
const;
627 double maximum()
const;
630 void setMinimumMaximum(
double min,
double max )
const;
633 QString name()
const;
636 void setName(
const QString &name );
645 void addExtraMetadata( QString key, QString value );
647 QMap<QString, QString> extraMetadata()
const;
650 bool isScalar()
const;
653 void setIsScalar(
bool isScalar );
656 bool checkValueCountPerDataset(
int count )
const;
659 void calculateStatistic()
const;
662 void setStatisticObsolete()
const;
665 virtual QStringList datasetGroupNamesDependentOn()
const;
668 virtual QDomElement writeXml( QDomDocument &doc,
const QgsReadWriteContext &context )
const = 0;
671 virtual QString description()
const;
674 void setReferenceTime(
const QDateTime &referenceTime );
681 bool mIsScalar =
true;
684 mutable double mMinimum = std::numeric_limits<double>::quiet_NaN();
685 mutable double mMaximum = std::numeric_limits<double>::quiet_NaN();
686 mutable bool mIsStatisticObsolete =
true;
688 void updateStatictic()
const;
690 QDateTime mReferenceTime;
714 bool isActive(
int faceIndex )
const override;
718 void calculateMinMax();
724 double minimum = std::numeric_limits<double>::quiet_NaN();
725 double maximum = std::numeric_limits<double>::quiet_NaN();
757 void addDataset( std::shared_ptr<QgsMeshMemoryDataset> dataset );
760 void clearDatasets();
763 std::shared_ptr<const QgsMeshMemoryDataset> constDataset(
int index )
const;
785 bool isActive(
int )
const override {
return true;};
814 std::unique_ptr<QgsMeshVerticesElevationDataset> mDataset;
861 const QString &sourceName,
923 int childCount()
const;
929 int totalChildCount()
const;
937 QList<int> enabledDatasetGroupIndexes()
const;
956 QString name()
const;
964 void setName(
const QString &name );
973 QString providerName()
const;
978 bool isVector()
const;
983 int datasetGroupIndex()
const;
988 bool isEnabled()
const;
994 void setIsEnabled(
bool isEnabled );
999 QString defaultName()
const;
1014 QList<int> groupIndexDependencies()
const;
1021 QString description()
const;
1039 void setPersistentDatasetGroup(
const QString &uri );
1051 QList< QgsMeshDatasetGroupTreeItem * > mChildren;
1052 QMap<int, QgsMeshDatasetGroupTreeItem *> mDatasetGroupIndexToChild;
1056 QString mOriginalName;
1057 QString mSourceName;
1059 QString mDescription;
1061 bool mIsVector =
false;
1062 int mDatasetGroupIndex = -1;
1063 bool mIsEnabled =
true;
1065 QList<int> mDatasetGroupDependencies;
1066 QList<int> mDatasetGroupDependentOn;
1070 void freeAsDependency();
1071 void freeFromDependencies();
1074 #endif // QGSMESHDATASET_H
bool isActive(int) const override
Returns whether the face is active.
virtual QgsMeshDatasetMetadata metadata() const =0
Returns the metadata of the dataset.
The class is used as a container of context for various read/write operations on other objects.
@ ScalarDouble
Scalar double values.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
QgsMeshDataBlock areFacesActive(int faceIndex, int count) const override
Returns whether faces are active.
Class that represents a dataset group with elevation value of the vertices of a existing mesh that ca...
virtual QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const =0
Write dataset group information in a DOM element.
Class to store memory dataset.
virtual QgsMeshDataBlock areFacesActive(int faceIndex, int count) const =0
Returns whether faces are active.
virtual int datasetCount() const =0
Returns the count of datasets in the group.
int valuesCount() const override
Returns the values count.
QgsMeshDatasetValue represents single dataset value.
QgsMeshDatasetMetadata metadata() const override
Returns the metadata of the dataset.
Abstract class that represents a dataset.
QgsMeshVerticesElevationDataset(QgsMesh *mesh)
Constructor.
@ Persistent
Generic type used for non typed dataset group.
QDomElement writeXml(QDomDocument &, const QgsReadWriteContext &) const override
Write dataset group information in a DOM element.
Tree item for display of the mesh dataset groups. Dataset group is set of datasets with the same name...
Mesh - vertices, edges and faces.
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
A rectangle specified with double values.
QgsMesh3dDataBlock is a block of 3d stacked mesh data related N faces defined on base mesh frame.
virtual QgsMeshDatasetValue datasetValue(int valueIndex) const =0
Returns the value with index valueIndex.
Class that represents a dataset with elevation value of the vertices of a existing mesh that can be e...
virtual QgsMeshDatasetGroup::Type type() const override
Returns the type of dataset group.
QgsMeshDatasetValue datasetValue(int valueIndex) const override
Returns the value with index valueIndex.
@ Vector2DDouble
Vector double pairs (x1, y1, x2, y2, ... )
QgsMeshDatasetIndex is index that identifies the dataset group (e.g. wind speed) and a dataset in thi...
Represents a mesh layer supporting display of data on structured or unstructured meshes.
virtual QgsMeshDataBlock datasetValues(bool isScalar, int valueIndex, int count) const =0
Returns count values from valueIndex.
DataType
Type of data stored in the block.
virtual void initialize()=0
Initialize the dataset group.
virtual QgsMeshDatasetGroup::Type type() const =0
Returns the type of dataset group.
virtual QgsMeshDataset * dataset(int index) const =0
Returns the dataset with index.
Abstract class that represents a dataset group.
virtual QgsMeshDatasetMetadata datasetMetadata(int datasetIndex) const =0
Returns the metadata of the dataset with index datasetIndex.
QgsMeshDataBlock datasetValues(bool isScalar, int valueIndex, int count) const override
Returns count values from valueIndex.
QMap< QString, QString > mMetadata
@ ActiveFlagInteger
Integer boolean flag whether face is active.
Type
Type of the dataset group.
QVector< std::shared_ptr< QgsMeshMemoryDataset > > memoryDatasets
Contains all the memory datasets.
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e....
virtual bool isActive(int faceIndex) const =0
Returns whether the face is active.
virtual int valuesCount() const =0
Returns the values count.
Class that represents a dataset group stored in memory.
@ Virtual
Temporary dataset group in memory.
@ Memory
Dataset group store in a file.
QVector< QgsMeshDatasetValue > values