18 #ifndef QGSMESHLAYER_H
19 #define QGSMESHLAYER_H
23 #include "qgis_core.h"
33 struct QgsMeshLayerRendererCache;
112 : transformContext( transformContext )
124 bool loadDefaultStyle =
true;
139 bool skipCrsValidation =
false;
155 explicit QgsMeshLayer(
const QString &path = QString(),
const QString &baseName = QString(),
const QString &providerLib = QStringLiteral(
"mesh_memory" ),
166 SIP_PYOBJECT __repr__();
168 QString
str = QStringLiteral(
"<QgsMeshLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
169 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
178 bool readSymbology( const QDomNode &node, QString &errorMessage,
180 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
182 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const override;
183 bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) override;
184 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
185 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
187 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
189 void reload() override;
190 QStringList subLayers() const override;
191 QString htmlMetadata() const override;
192 bool isEditable() const override;
193 bool supportsEditing() const override;
194 QString loadDefaultStyle(
bool &resultFlag
SIP_OUT )
FINAL;
197 QString providerType() const;
208 bool addDatasets( const QString &path, const QDateTime &defaultReferenceTime = QDateTime() );
230 bool saveDataset( const QString &path,
int datasetGroupIndex, QString driver );
266 int triangularMeshLevelOfDetailCount() const
SIP_SKIP;
294 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
335 QString formatTime(
double hours );
342 int datasetGroupCount() const;
349 int extraDatasetGroupCount() const;
359 QList<
int> datasetGroupsIndexes() const;
369 QList<
int> enabledDatasetGroupsIndexes() const;
566 QgsMeshDatasetIndex datasetIndexAtTime( const QgsDateTimeRange &timeRange,
int datasetGroupIndex ) const;
666 void setReferenceTime( const QDateTime &referenceTime );
708 QList<
int> selectVerticesByExpression(
QgsExpression expression );
718 QList<
int> selectFacesByExpression(
QgsExpression expression );
749 void resetDatasetGroupTreeItem();
832 bool isModified() const override;
838 bool contains( const
QgsMesh::ElementType &type ) const;
847 int meshVertexCount() const;
856 int meshFaceCount() const;
863 int meshEdgeCount() const;
881 void activeScalarDatasetGroupChanged(
int index );
888 void activeVectorDatasetGroupChanged(
int index );
895 void timeSettingsChanged( );
902 bool isReadOnly()
const override {
return true;}
910 bool setDataProvider( QString
const &provider,
const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
916 void fillNativeMesh();
917 void assignDefaultStyleToDatasetGroup(
int groupIndex );
918 void setDefaultRendererSettings(
const QList<int> &groupIndexes );
919 void createSimplifiedMeshes();
920 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
922 bool hasSimplifiedMeshes()
const;
928 void onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes );
936 QStringList mExtraDatasetUri;
938 std::unique_ptr<QgsMeshDatasetGroupStore> mDatasetGroupStore;
941 std::unique_ptr<QgsMesh> mNativeMesh;
944 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
947 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
963 int mStaticScalarDatasetIndex = 0;
964 int mStaticVectorDatasetIndex = 0;
968 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
979 void updateActiveDatasetGroups();
981 void setDataSourcePrivate(
const QString &dataSource,
const QString &baseName,
const QString &provider,
Contains information about the context in which a coordinate transform is executed.
Class for parsing and evaluation of expressions (formerly called "search strings").
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.
Class that makes edit operation on a mesh.
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 an 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
Coordinate transform context.
LayerOptions(const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions with optional transformContext.
Mesh - vertices, edges and faces.