18 #ifndef QGSMESHLAYER_H
19 #define QGSMESHLAYER_H
23 #include "qgis_core.h"
34 struct QgsMeshLayerRendererCache;
116 : transformContext( transformContext )
128 bool loadDefaultStyle =
true;
143 bool skipCrsValidation =
false;
159 explicit QgsMeshLayer(
const QString &path = QString(),
const QString &baseName = QString(),
const QString &providerLib = QStringLiteral(
"mesh_memory" ),
170 SIP_PYOBJECT __repr__();
172 QString
str = QStringLiteral(
"<QgsMeshLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
173 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
183 bool readSymbology( const QDomNode &node, QString &errorMessage,
185 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
187 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const
QgsReadWriteContext &context,
StyleCategories categories = AllStyleCategories ) const override;
189 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
190 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
192 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
195 void reload() override;
196 QStringList subLayers() const override;
197 QString htmlMetadata() const override;
198 bool isEditable() const override;
199 bool supportsEditing() const override;
200 QString loadDefaultStyle(
bool &resultFlag
SIP_OUT )
FINAL;
203 QString providerType() const;
214 bool addDatasets( const QString &path, const QDateTime &defaultReferenceTime = QDateTime() );
236 bool saveDataset( const QString &path,
int datasetGroupIndex, QString driver );
272 int triangularMeshLevelOfDetailCount() const
SIP_SKIP;
300 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
341 QString formatTime(
double hours );
348 int datasetGroupCount() const;
355 int extraDatasetGroupCount() const;
365 QList<
int> datasetGroupsIndexes() const;
375 QList<
int> enabledDatasetGroupsIndexes() const;
672 void setReferenceTime( const QDateTime &referenceTime );
714 QList<
int> selectVerticesByExpression(
QgsExpression expression );
724 QList<
int> selectFacesByExpression(
QgsExpression expression );
755 void resetDatasetGroupTreeItem();
852 bool isModified() const override;
858 bool contains( const
QgsMesh::ElementType &type ) const;
867 int meshVertexCount() const;
876 int meshFaceCount() const;
883 int meshEdgeCount() const;
893 bool labelsEnabled() const;
905 void setLabelsEnabled(
bool enabled );
976 bool isReadOnly()
const override {
return true;}
990 void fillNativeMesh();
991 void assignDefaultStyleToDatasetGroup(
int groupIndex );
992 void createSimplifiedMeshes();
993 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
995 bool hasSimplifiedMeshes()
const;
1001 void onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes );
1002 void onMeshEdited();
1009 QStringList mExtraDatasetUri;
1011 std::unique_ptr<QgsMeshDatasetGroupStore> mDatasetGroupStore;
1014 std::unique_ptr<QgsMesh> mNativeMesh;
1017 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
1020 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
1037 int mStaticScalarDatasetIndex = 0;
1038 int mStaticVectorDatasetIndex = 0;
1043 bool mLabelsEnabled =
false;
1048 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1059 void updateActiveDatasetGroups();
1062 void checkSymbologyConsistency();
1064 void setDataSourcePrivate(
const QString &dataSource,
const QString &baseName,
const QString &provider,
TemporalUnit
Temporal units.
Abstract base class - its implementations define different approaches to the labeling of a mesh layer...
Abstract base class for objects which generate elevation profiles.
Interface for classes which can generate elevation profiles.
Contains information about the context in which a coordinate transform is executed.
QFlags< ReadFlag > ReadFlags
Class for parsing and evaluation of expressions (formerly called "search strings").
A representation of the interval between two datetime values.
Base class for storage of map layer elevation properties.
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.
QFlags< StyleCategory > StyleCategories
virtual void setTransformContext(const QgsCoordinateTransformContext &transformContext)=0
Sets the coordinate transform context to transformContext.
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 represents an error during mesh editing.
Class that makes edit operation on a mesh.
Mesh layer specific subclass of QgsMapLayerElevationProperties.
Implementation of map layer temporal properties for mesh layers.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
void activeScalarDatasetGroupChanged(int index)
Emitted when active scalar group dataset is changed.
void activeVectorDatasetGroupChanged(int index)
Emitted when active vector group dataset is changed.
void timeSettingsChanged()
Emitted when time format is changed.
QgsMeshLayer(const QgsMeshLayer &rhs)=delete
QgsMeshLayer cannot be copied.
QgsMeshLayer & operator=(QgsMeshLayer const &rhs)=delete
QgsMeshLayer cannot be copied.
QgsAbstractMeshLayerLabeling * labeling()
Access to labeling configuration.
void reloaded()
Emitted when the mesh layer is reloaded, see reload()
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.
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
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.
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.