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;
174 QString providerType() const;
185 bool addDatasets( const QString &path, const QDateTime &defaultReferenceTime = QDateTime() );
229 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
270 QString formatTime(
double hours );
341 QgsMeshDatasetIndex datasetIndexAtTime( const QgsDateTimeRange &timeRange,
int datasetGroupIndex ) const;
408 void setReferenceTime( const QDateTime &referenceTime );
471 void resetDatasetGroupTreeItem();
496 void activeScalarDatasetGroupChanged(
int index );
503 void activeVectorDatasetGroupChanged(
int index );
510 void timeSettingsChanged( );
517 bool isReadOnly()
const override {
return true;}
531 void fillNativeMesh();
532 void assignDefaultStyleToDatasetGroup(
int groupIndex );
533 void setDefaultRendererSettings();
534 void createSimplifiedMeshes();
535 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
537 bool hasSimplifiedMeshes()
const;
543 void onDatasetGroupsAdded(
int count );
550 std::unique_ptr<QgsMesh> mNativeMesh;
553 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
556 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
569 int mStaticScalarDatasetIndex = 0;
570 int mStaticVectorDatasetIndex = 0;
572 std::unique_ptr<QgsMeshDatasetGroupTreeItem> mDatasetGroupTreeRootItem;
574 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
585 void updateActiveDatasetGroups();
588 #endif //QGSMESHLAYER_H