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" ),
155 SIP_PYOBJECT __repr__();
157 QString
str = QStringLiteral(
"<QgsMeshLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
158 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
167 bool readSymbology( const QDomNode &node, QString &errorMessage,
169 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
171 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const override;
172 bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) override;
173 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
174 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
176 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
178 void reload() override;
179 QStringList subLayers() const override;
180 QString htmlMetadata() const override;
183 QString providerType() const;
194 bool addDatasets( const QString &path, const QDateTime &defaultReferenceTime = QDateTime() );
216 bool saveDataset( const QString &path,
int datasetGroupIndex, QString driver );
252 int triangularMeshLevelOfDetailCount() const
SIP_SKIP;
280 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
321 QString formatTime(
double hours );
328 int datasetGroupCount() const;
335 int extraDatasetGroupCount() const;
345 QList<
int> datasetGroupsIndexes() const;
355 QList<
int> enabledDatasetGroupsIndexes() const;
552 QgsMeshDatasetIndex datasetIndexAtTime( const QgsDateTimeRange &timeRange,
int datasetGroupIndex ) const;
636 void setReferenceTime( const QDateTime &referenceTime );
699 void resetDatasetGroupTreeItem();
738 void activeScalarDatasetGroupChanged(
int index );
745 void activeVectorDatasetGroupChanged(
int index );
752 void timeSettingsChanged( );
759 bool isReadOnly()
const override {
return true;}
767 bool setDataProvider( QString
const &provider,
const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
773 void fillNativeMesh();
774 void assignDefaultStyleToDatasetGroup(
int groupIndex );
775 void setDefaultRendererSettings(
const QList<int> &groupIndexes );
776 void createSimplifiedMeshes();
777 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
779 bool hasSimplifiedMeshes()
const;
785 void onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes );
792 QStringList mExtraDatasetUri;
794 std::unique_ptr<QgsMeshDatasetGroupStore> mDatasetGroupStore;
797 std::unique_ptr<QgsMesh> mNativeMesh;
800 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
803 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
819 int mStaticScalarDatasetIndex = 0;
820 int mStaticVectorDatasetIndex = 0;
822 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
833 void updateActiveDatasetGroups();
835 void setDataSourcePrivate(
const QString &dataSource,
const QString &baseName,
const QString &provider,
Contains information about the context in which a coordinate transform is executed.
A representation of the interval between two datetime values.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Base class for storage of map layer temporal properties.
Base class for all map layer types.
virtual Q_INVOKABLE QgsDataProvider * dataProvider()
Returns the layer's data provider, it may be nullptr.
Abstract class to interpolate 3d stacked mesh data to 2d data.
QgsMesh3dDataBlock is a block of 3d stacked mesh data related N faces defined on base mesh frame.
QgsMeshDataBlock is a block of integers/doubles that can be used to retrieve: active flags (e....
Class for handling properties relating to a mesh data provider's temporal capabilities.
Base class for providing data for QgsMeshLayer.
Class used to register and access all the dataset groups related to a mesh layer.
Tree item for display of the mesh dataset groups.
Abstract class that represents a dataset group.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
QgsMeshDatasetValue represents single dataset value.
Implementation of map layer temporal properties for mesh layers.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
QgsMeshLayer(const QgsMeshLayer &rhs)=delete
QgsMeshLayer cannot be copied.
QgsMeshLayer & operator=(QgsMeshLayer const &rhs)=delete
QgsMeshLayer cannot be copied.
Represents a mesh renderer settings for scalar datasets.
Represents all mesh renderer settings.
Represents a overview renderer settings.
Represents a mesh time settings for mesh datasets.
A class to represent a 2D point.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
Triangular/Derived Mesh is mesh with vertices in map coordinates.
TemporalUnit
Temporal units.
Setting options for creating vector data providers.
Setting options for loading mesh layers.
QgsCoordinateTransformContext transformContext
LayerOptions(const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions with optional transformContext.
Mesh - vertices, edges and faces.