18 #ifndef QGSMESHLAYER_H
19 #define QGSMESHLAYER_H
23 #include "qgis_core.h"
32 struct QgsMeshLayerRendererCache;
110 : transformContext( transformContext )
128 bool skipCrsValidation =
false;
144 explicit QgsMeshLayer(
const QString &path = QString(),
const QString &baseName = QString(),
const QString &providerLib = QStringLiteral(
"mesh_memory" ),
159 bool readSymbology( const QDomNode &node, QString &errorMessage,
161 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
163 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const override;
164 bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) override;
165 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
166 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
168 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
170 void reload() override;
171 QStringList subLayers() const override;
172 QString htmlMetadata() const override;
175 QString providerType() const;
186 bool addDatasets( const QString &path, const QDateTime &defaultReferenceTime = QDateTime() );
208 bool saveDataset( const QString &path,
int datasetGroupIndex, QString driver );
252 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
293 QString formatTime(
double hours );
300 int datasetGroupCount() const;
307 int extraDatasetGroupCount() const;
317 QList<
int> datasetGroupsIndexes() const;
513 QgsMeshDatasetIndex datasetIndexAtTime( const QgsDateTimeRange &timeRange,
int datasetGroupIndex ) const;
596 void setReferenceTime( const QDateTime &referenceTime );
659 void resetDatasetGroupTreeItem();
698 void activeScalarDatasetGroupChanged(
int index );
705 void activeVectorDatasetGroupChanged(
int index );
712 void timeSettingsChanged( );
719 bool isReadOnly()
const override {
return true;}
727 bool setDataProvider( QString
const &provider,
const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
733 void fillNativeMesh();
734 void assignDefaultStyleToDatasetGroup(
int groupIndex );
735 void setDefaultRendererSettings(
const QList<int> &groupIndexes );
736 void createSimplifiedMeshes();
737 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
739 bool hasSimplifiedMeshes()
const;
745 void onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes );
751 std::unique_ptr<QgsMeshDatasetGroupStore> mDatasetGroupStore;
754 std::unique_ptr<QgsMesh> mNativeMesh;
757 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
760 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
773 int mStaticScalarDatasetIndex = 0;
774 int mStaticVectorDatasetIndex = 0;
776 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
787 void updateActiveDatasetGroups();
790 #endif //QGSMESHLAYER_H