QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSMESHDATASET_H
19 #define QGSMESHDATASET_H
28 #include "qgis_core.h"
63 int mDatasetIndex = -1;
94 void set(
double scalar );
97 void setX(
double x );
100 void setY(
double y ) ;
103 double scalar()
const;
114 double mX = std::numeric_limits<double>::quiet_NaN();
115 double mY = std::numeric_limits<double>::quiet_NaN();
153 DataType type()
const;
159 bool isValid()
const;
171 bool active(
int index )
const;
186 void setActive(
const QVector<int> &vals );
199 QVector<int> active()
const;
207 QVector<double> values()
const;
218 void setValues(
const QVector<double> &vals );
221 void setValid(
bool valid );
224 QVector<double> mDoubleBuffer;
225 QVector<int> mIntegerBuffer;
228 bool mIsValid =
false;
257 void setValid(
bool valid );
260 bool isValid()
const;
263 bool isVector()
const;
269 int firstVolumeIndex()
const;
272 int lastVolumeIndex()
const;
275 int volumesCount()
const;
280 QVector<int> verticalLevelsCount()
const;
285 void setVerticalLevelsCount(
const QVector<int> &verticalLevelsCount );
290 QVector<double> verticalLevels()
const;
295 void setVerticalLevels(
const QVector<double> &verticalLevels );
300 QVector<int> faceToVolumeIndex()
const;
305 void setFaceToVolumeIndex(
const QVector<int> &faceToVolumeIndex );
312 QVector<double> values()
const;
327 void setValues(
const QVector<double> &doubleBuffer );
331 bool mIsValid =
false;
332 bool mIsVector =
false;
333 QVector<int> mVerticalLevelsCount;
334 QVector<double> mVerticalLevels;
335 QVector<int> mFaceToVolumeIndex;
336 QVector<double> mDoubleBuffer;
384 int maximumVerticalLevels,
385 const QDateTime &referenceTime,
387 const QMap<QString, QString> &extraOptions );
392 QString name()
const;
404 QMap<QString, QString> extraOptions()
const;
409 bool isVector()
const;
414 bool isScalar()
const;
419 bool isTemporal()
const;
431 double minimum()
const;
436 double maximum()
const;
443 int maximumVerticalLevelsCount()
const;
450 QDateTime referenceTime()
const;
455 bool mIsScalar =
false;
456 DataType mDataType = DataType::DataOnFaces;
457 double mMinimumValue = std::numeric_limits<double>::quiet_NaN();
458 double mMaximumValue = std::numeric_limits<double>::quiet_NaN();
459 QMap<QString, QString> mExtraOptions;
460 int mMaximumVerticalLevelsCount = 0;
461 QDateTime mReferenceTime;
462 bool mIsTemporal =
false;
494 int maximumVerticalLevels
505 bool isValid()
const;
510 double minimum()
const;
515 double maximum()
const;
522 int maximumVerticalLevelsCount()
const;
525 double mTime = std::numeric_limits<double>::quiet_NaN();
526 bool mIsValid =
false;
527 double mMinimumValue = std::numeric_limits<double>::quiet_NaN();
528 double mMaximumValue = std::numeric_limits<double>::quiet_NaN();
529 int mMaximumVerticalLevelsCount = 0;
621 double minimum()
const;
624 double maximum()
const;
627 void setMinimumMaximum(
double min,
double max );
630 QString name()
const;
633 void setName(
const QString &name );
642 void addExtraMetadata( QString key, QString value );
644 QMap<QString, QString> extraMetadata()
const;
647 bool isScalar()
const;
650 void setIsScalar(
bool isScalar );
653 bool checkValueCountPerDataset(
int count )
const;
656 void calculateStatistic();
659 virtual QStringList datasetGroupNamesDependentOn()
const;
665 virtual QString description()
const;
668 void setReferenceTime(
const QDateTime &referenceTime );
675 bool mIsScalar =
true;
678 double mMinimum = std::numeric_limits<double>::quiet_NaN();
679 double mMaximum = std::numeric_limits<double>::quiet_NaN();
681 QDateTime mReferenceTime;
704 bool isActive(
int faceIndex )
const override;
708 void calculateMinMax();
714 double minimum = std::numeric_limits<double>::quiet_NaN();
715 double maximum = std::numeric_limits<double>::quiet_NaN();
746 void addDataset( std::shared_ptr<QgsMeshMemoryDataset> dataset );
749 void clearDatasets();
752 std::shared_ptr<const QgsMeshMemoryDataset> constDataset(
int index )
const;
802 const QString &sourceName,
865 int childCount() const;
871 int totalChildCount() const;
890 QString name() const;
898 void setName( const QString &name );
907 QString providerName() const;
912 bool isVector() const;
917 int datasetGroupIndex() const;
922 bool isEnabled() const;
928 void setIsEnabled(
bool isEnabled );
933 QString defaultName() const;
948 QList<
int> groupIndexDependencies() const;
955 QString description() const;
973 void setPersistentDatasetGroup( const QString &uri );
990 QString mOriginalName;
993 QString mDescription;
995 bool mIsVector = false;
996 int mDatasetGroupIndex = -1;
997 bool mIsEnabled = true;
999 QList<
int> mDatasetGroupDependencies;
1000 QList<
int> mDatasetGroupDependentOn;
1004 void freeAsDependency();
1005 void freeFromDependencies();
1008 #endif // QGSMESHDATASET_H
QgsMeshDatasetGroup()=default
Default constructor.
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)
virtual QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const =0
Write dataset group information in a DOM element.
Class to store memory dataset The QgsMeshDatasetValue objects and whether the faces are active are st...
virtual ~QgsMeshDataset()=default
Destructor.
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.
QgsMeshDatasetValue represents single dataset value.
Abstract class that represents a dataset.
@ Persistent
Generic type used for non typed dataset group.
Tree item for display of the mesh dataset groups.
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.
virtual QgsMeshDatasetGroup::Type type() const override
Returns the type of dataset group.
QgsMesh3dDataBlock()
Constructs an invalid block.
QgsMeshDatasetGroupTreeItem()
Constructor for an empty dataset group tree item.
@ Vector2DDouble
Vector double pairs (x1, y1, x2, y2, ... )
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
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.
~QgsMeshDatasetValue()=default
Dtor.
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.
QgsMeshMemoryDataset()=default
Constructor.
Abstract class that represents a dataset group.
virtual QgsMeshDatasetMetadata datasetMetadata(int datasetIndex) const =0
Returns the metadata of the dataset with index datasetIndex.
QMap< QString, QString > mMetadata
QgsMeshMemoryDatasetGroup()=default
Constructor.
@ 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 ~QgsMeshDatasetGroup()
virtual bool isActive(int faceIndex) const =0
Returns whether the face is active.
virtual int valuesCount() const =0
Returns the values count.
QgsMeshDataset()=default
Constructor.
Class that represents a dataset group stored in memory The QgsMeshMemoryDataset objects stores in a Q...
QgsMeshDatasetValue()=default
Default Ctor, initialize to NaN.
@ Virtual
Temporary dataset group in memory.
@ Memory
Dataset group store in a file.
QVector< QgsMeshDatasetValue > values