QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsmeshvirtualdatasetgroup.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmeshvirtualdatasetgroup.h
3  ---------------------
4  begin : June 2020
5  copyright : (C) 2020 by Vincent Cloarec
6  email : vcloarec at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSMESHVIRTUALDATASETGROUP_H
19 #define QGSMESHVIRTUALDATASETGROUP_H
20 
21 #include "qgsmeshdataset.h"
22 #include "qgsmeshcalcnode.h"
23 
25 
26 #define SIP_NO_FILE
27 
39 {
40  public:
41 
50  QgsMeshVirtualDatasetGroup( const QString &name,
51  const QString &formulaString,
52  QgsMeshLayer *layer,
53  qint64 relativeStartTime,
54  qint64 relativeEndTime );
55 
56  void initialize() override;
57  int datasetCount() const override;
58  QgsMeshDataset *dataset( int index ) const override;
59  QgsMeshDatasetMetadata datasetMetadata( int datasetIndex ) const override;
60  QStringList datasetGroupNamesDependentOn() const override;
61  QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
62  QString description() const override;
64 
65  private:
66  QString mFormula;
67  std::unique_ptr<QgsMeshCalcNode> mCalcNode;
68  QgsMeshLayer *mLayer = nullptr;
69  qint64 mStartTime = 0;
70  qint64 mEndTime = 0;
71  QStringList mDatasetGroupNameUsed;
72  QStringList mDatasetGroupNameUsedForAggregate;
73  QList<qint64> mDatasetTimes;
74 
75  mutable std::shared_ptr<QgsMeshMemoryDataset> mCacheDataset;
76  mutable QVector<QgsMeshDatasetMetadata> mDatasetMetaData;
77  mutable int mCurrentDatasetIndex = -1;
78 
79  bool calculateDataset() const;
80 };
81 
82 #endif // QGSMESHVIRTUALDATASETGROUP_H
qgsmeshcalcnode.h
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsMeshDatasetGroup::writeXml
virtual QDomElement writeXml(QDomDocument &doc, const QgsReadWriteContext &context) const =0
Write dataset group information in a DOM element.
QgsMeshDatasetGroup::datasetCount
virtual int datasetCount() const =0
Returns the count of datasets in the group.
QgsMeshDataset
Abstract class that represents a dataset.
Definition: qgsmeshdataset.h:543
QgsMeshDatasetMetadata
QgsMeshDatasetMetadata is a collection of mesh dataset metadata such as whether the data is valid or ...
Definition: qgsmeshdataset.h:478
QgsMeshVirtualDatasetGroup
Represents a dataset group calculated from a formula string.
Definition: qgsmeshvirtualdatasetgroup.h:38
QgsMeshLayer
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:98
QgsMeshDatasetGroup::initialize
virtual void initialize()=0
Initialize the dataset group.
QgsMeshDatasetGroup::dataset
virtual QgsMeshDataset * dataset(int index) const =0
Returns the dataset with index.
QgsMeshDatasetGroup
Abstract class that represents a dataset group.
Definition: qgsmeshdataset.h:578
QgsMeshDatasetGroup::datasetMetadata
virtual QgsMeshDatasetMetadata datasetMetadata(int datasetIndex) const =0
Returns the metadata of the dataset with index datasetIndex.
QgsMeshDatasetGroup::description
virtual QString description() const
Returns some information about the dataset group.
Definition: qgsmeshdataset.cpp:991
QgsMeshDatasetGroup::Type
Type
Type of the dataset group.
Definition: qgsmeshdataset.h:587
qgsmeshdataset.h
QgsMeshVirtualDatasetGroup::type
QgsMeshDatasetGroup::Type type() const override
Returns the type of dataset group.
Definition: qgsmeshvirtualdatasetgroup.h:63
QgsMeshDatasetGroup::datasetGroupNamesDependentOn
virtual QStringList datasetGroupNamesDependentOn() const
Returns the dataset group variable name which this dataset group depends on.
Definition: qgsmeshdataset.cpp:986
qgsmeshlayertemporalproperties.h
QgsMeshDatasetGroup::Virtual
@ Virtual
Temporary dataset group in memory.
Definition: qgsmeshdataset.h:592