34struct 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" ),
168 SIP_PYOBJECT __repr__();
170 QString str = QStringLiteral(
"<QgsMeshLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
171 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
182 bool readSymbology(
const QDomNode &node, QString &errorMessage,
184 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
186 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories )
const override;
187 bool readStyle(
const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories )
override;
210 bool addDatasets(
const QString &path,
const QDateTime &defaultReferenceTime = QDateTime() );
220 bool removeDatasets(
const QString &name );
242 bool saveDataset(
const QString &path,
int datasetGroupIndex, QString driver );
278 int triangularMeshLevelOfDetailCount() const
SIP_SKIP;
306 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
353 QString formatTime(
double hours );
360 int datasetGroupCount() const;
367 int extraDatasetGroupCount() const;
377 QList<
int> datasetGroupsIndexes() const;
387 QList<
int> enabledDatasetGroupsIndexes() const;
690 void setReferenceTime( const QDateTime &referenceTime );
760 QList<
int> selectVerticesByExpression(
QgsExpression expression );
770 QList<
int> selectFacesByExpression(
QgsExpression expression );
801 void resetDatasetGroupTreeItem();
898 bool isModified() const override;
904 bool contains( const
QgsMesh::ElementType &type ) const;
913 int meshVertexCount() const;
922 int meshFaceCount() const;
929 int meshEdgeCount() const;
939 bool labelsEnabled() const;
951 void setLabelsEnabled(
bool enabled );
1004 bool datasetsPathUnique(
const QString &path );
1050 bool isReadOnly()
const override {
return true;}
1063 void fillNativeMesh();
1064 void assignDefaultStyleToDatasetGroup(
int groupIndex );
1065 void createSimplifiedMeshes();
1066 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
1068 bool hasSimplifiedMeshes()
const;
1074 void onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes );
1075 void onMeshEdited();
1082 QStringList mExtraDatasetUri;
1084 std::unique_ptr<QgsMeshDatasetGroupStore> mDatasetGroupStore;
1087 std::unique_ptr<QgsMesh> mNativeMesh;
1090 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
1093 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
1110 int mStaticScalarDatasetIndex = 0;
1111 int mStaticVectorDatasetIndex = 0;
1116 bool mLabelsEnabled =
false;
1122 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1125 int closestVertex(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1128 int closestFace(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1130 void updateActiveDatasetGroups();
1133 void checkSymbologyConsistency();
1135 void setDataSourcePrivate(
const QString &dataSource,
const QString &baseName,
const QString &provider,
TemporalUnit
Temporal units.
QFlags< DataProviderReadFlag > DataProviderReadFlags
Flags which control data provider construction.
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.
virtual QgsAbstractProfileGenerator * createProfileGenerator(const QgsProfileRequest &request)=0
Given a profile request, returns a new profile generator ready for generating elevation profiles.
Contains information about the context in which a coordinate transform is executed.
Handles 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.
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const =0
Write the style for the layer into the document provided.
virtual QString encodedSource(const QString &source, const QgsReadWriteContext &context) const
Called by writeLayerXML(), used by derived classes to encode provider's specific data source to proje...
virtual bool readXml(const QDomNode &layer_node, QgsReadWriteContext &context)
Called by readLayerXML(), used by children to read state specific to them from project files.
virtual QString loadDefaultStyle(bool &resultFlag)
Retrieve the default style for this layer if one exists (either as a .qml file on disk or as a record...
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document, const QgsReadWriteContext &context) const
Called by writeLayerXML(), used by children to write state specific to them to project files.
virtual bool readStyle(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories)
Read the style for the current layer from the DOM node supplied.
virtual bool supportsEditing() const
Returns whether the layer supports editing or not.
QFlags< StyleCategory > StyleCategories
virtual bool isEditable() const
Returns true if the layer can be edited.
virtual QgsMapLayerTemporalProperties * temporalProperties()
Returns the layer's temporal properties.
virtual QStringList subLayers() const
Returns the sublayers of this layer.
virtual QString htmlMetadata() const
Obtain a formatted HTML string containing assorted metadata for this layer.
virtual bool readSymbology(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories)=0
Read the symbology for the current layer from the DOM node supplied.
virtual QgsMapLayerElevationProperties * elevationProperties()
Returns the layer's elevation properties.
virtual void setTransformContext(const QgsCoordinateTransformContext &transformContext)=0
Sets the coordinate transform context to transformContext.
virtual QString decodedSource(const QString &source, const QString &dataProvider, const QgsReadWriteContext &context) const
Called by readLayerXML(), used by derived classes to decode provider's specific data source from proj...
virtual bool writeStyle(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const
Write just the symbology information for the layer into the document.
virtual Q_INVOKABLE QgsDataProvider * dataProvider()
Returns the layer's data provider, it may be nullptr.
virtual Q_INVOKABLE void reload()
Synchronises with changes in the datasource.
Abstract class for interpolating 3d stacked mesh data to 2d data.
A block of 3d stacked mesh data related N faces defined on base mesh frame.
A block of integers/doubles from a mesh dataset.
Handles properties relating to a mesh data provider's temporal capabilities.
Base class for providing data for QgsMeshLayer.
Registers and accesses 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.
An index that identifies the dataset group (e.g.
Represents a single mesh dataset value.
Represents an error which occurred during mesh editing.
Handles edit operations on a mesh layer.
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 & operator=(QgsMeshLayer const &rhs)=delete
QgsMeshLayer(const QgsMeshLayer &rhs)=delete
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.
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
A container for the context for various read/write operations on objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
A triangular/derived 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.