35using namespace Qt::StringLiterals;
38struct QgsMeshLayerRendererCache;
163 explicit QgsMeshLayer(
const QString &path = QString(),
const QString &baseName = QString(),
const QString &providerLib = u
"mesh_memory"_s,
172 SIP_PYOBJECT __repr__();
174 QString str = u
"<QgsMeshLayer: '%1' (%2)>"_s.arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : u
"Invalid"_s );
175 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
188 bool readSymbology(
const QDomNode &node, QString &errorMessage,
190 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
192 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories )
const override;
193 bool readStyle(
const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories )
override;
216 bool addDatasets(
const QString &path,
const QDateTime &defaultReferenceTime = QDateTime() );
226 bool removeDatasets(
const QString &name );
248 bool saveDataset(
const QString &path,
int datasetGroupIndex, QString driver );
284 int triangularMeshLevelOfDetailCount() const
SIP_SKIP;
312 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
359 QString formatTime(
double hours );
366 int datasetGroupCount() const;
373 int extraDatasetGroupCount() const;
383 QList<
int> datasetGroupsIndexes() const;
393 QList<
int> enabledDatasetGroupsIndexes() const;
696 void setReferenceTime( const QDateTime &referenceTime );
766 QList<
int> selectVerticesByExpression(
QgsExpression expression );
776 QList<
int> selectFacesByExpression(
QgsExpression expression );
807 void resetDatasetGroupTreeItem();
904 bool isModified() const override;
910 bool contains( const
QgsMesh::ElementType &type ) const;
919 int meshVertexCount() const;
928 int meshFaceCount() const;
935 int meshEdgeCount() const;
945 bool labelsEnabled() const;
957 void setLabelsEnabled(
bool enabled );
1010 bool datasetsPathUnique(
const QString &path );
1063 bool isReadOnly()
const override {
return true;}
1076 void fillNativeMesh();
1077 void assignDefaultStyleToDatasetGroup(
int groupIndex );
1078 void createSimplifiedMeshes();
1079 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
1081 bool hasSimplifiedMeshes()
const;
1087 void onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes );
1088 void onMeshEdited();
1095 QStringList mExtraDatasetUri;
1097 std::unique_ptr<QgsMeshDatasetGroupStore> mDatasetGroupStore;
1100 std::unique_ptr<QgsMesh> mNativeMesh;
1103 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
1106 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
1123 int mStaticScalarDatasetIndex = 0;
1124 int mStaticVectorDatasetIndex = 0;
1129 bool mLabelsEnabled =
false;
1135 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1138 int closestVertex(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1141 int closestFace(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1143 void updateActiveDatasetGroups();
1146 void checkSymbologyConsistency();
1148 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.
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.
QgsMapLayer(Qgis::LayerType type=Qgis::LayerType::Vector, const QString &name=QString(), const QString &source=QString())
Constructor for QgsMapLayer.
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.
QString profileSourceName() const override
Returns a name for displaying this profile source in the elevation profile layer tree.
QgsRectangle extent() const override
Returns the extent of the layer.
QgsAbstractProfileSource * profileSource() override
Returns the layer's profile source if it has profile capabilities.
void activeScalarDatasetGroupChanged(int index)
Emitted when active scalar group dataset is changed.
void activeVectorDatasetGroupChanged(int index)
Emitted when active vector group dataset is changed.
const QgsAbstractMeshLayerLabeling * labeling() const
Access to const labeling configuration.
QgsMeshLayer * clone() const override
Returns a new instance equivalent to this one except for the id which is still unique.
void timeSettingsChanged()
Emitted when time format is changed.
QgsMeshLayer & operator=(QgsMeshLayer const &rhs)=delete
QStringList extraDatasetUris() const
Returns the list of extra dataset URIs associated with this layer.
QgsMeshLayer(const QgsMeshLayer &rhs)=delete
QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext) override
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context.
QString profileSourceId() const override
Returns a unique identifier for this profile source.
QgsMeshLayer(const QString &path=QString(), const QString &baseName=QString(), const QString &providerLib=u"mesh_memory"_s, const QgsMeshLayer::LayerOptions &options=QgsMeshLayer::LayerOptions())
Constructor - creates a mesh layer.
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.
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Setting options for creating vector data providers.
Setting options for loading mesh layers.
QgsCoordinateTransformContext transformContext
Coordinate transform context.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.
LayerOptions(const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions with optional transformContext.
Mesh - vertices, edges and faces.