34struct QgsMeshLayerRendererCache;
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() );
184 bool readSymbology(
const QDomNode &node, QString &errorMessage,
186 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
188 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories )
const override;
189 bool readStyle(
const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories )
override;
212 bool addDatasets(
const QString &path,
const QDateTime &defaultReferenceTime = QDateTime() );
222 bool removeDatasets(
const QString &name );
244 bool saveDataset(
const QString &path,
int datasetGroupIndex, QString driver );
280 int triangularMeshLevelOfDetailCount() const
SIP_SKIP;
308 QgsMeshLayerRendererCache *rendererCache()
SIP_SKIP;
355 QString formatTime(
double hours );
362 int datasetGroupCount() const;
369 int extraDatasetGroupCount() const;
379 QList<
int> datasetGroupsIndexes() const;
389 QList<
int> enabledDatasetGroupsIndexes() const;
692 void setReferenceTime( const QDateTime &referenceTime );
762 QList<
int> selectVerticesByExpression(
QgsExpression expression );
772 QList<
int> selectFacesByExpression(
QgsExpression expression );
803 void resetDatasetGroupTreeItem();
900 bool isModified() const override;
906 bool contains( const
QgsMesh::ElementType &type ) const;
915 int meshVertexCount() const;
924 int meshFaceCount() const;
931 int meshEdgeCount() const;
941 bool labelsEnabled() const;
953 void setLabelsEnabled(
bool enabled );
1006 bool datasetsPathUnique(
const QString &path );
1052 bool isReadOnly()
const override {
return true;}
1065 void fillNativeMesh();
1066 void assignDefaultStyleToDatasetGroup(
int groupIndex );
1067 void createSimplifiedMeshes();
1068 int levelsOfDetailsIndex(
double partOfMeshInView )
const;
1070 bool hasSimplifiedMeshes()
const;
1076 void onDatasetGroupsAdded(
const QList<int> &datasetGroupIndexes );
1077 void onMeshEdited();
1084 QStringList mExtraDatasetUri;
1086 std::unique_ptr<QgsMeshDatasetGroupStore> mDatasetGroupStore;
1089 std::unique_ptr<QgsMesh> mNativeMesh;
1092 std::vector<std::unique_ptr<QgsTriangularMesh>> mTriangularMeshes;
1095 std::unique_ptr<QgsMeshLayerRendererCache> mRendererCache;
1112 int mStaticScalarDatasetIndex = 0;
1113 int mStaticVectorDatasetIndex = 0;
1118 bool mLabelsEnabled =
false;
1124 int closestEdge(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1127 int closestVertex(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1130 int closestFace(
const QgsPointXY &point,
double searchRadius,
QgsPointXY &projectedPoint )
const;
1132 void updateActiveDatasetGroups();
1135 void checkSymbologyConsistency();
1137 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
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.
QgsAbstractMeshLayerLabeling * labeling()
Access to labeling configuration.
void reloaded()
Emitted when the mesh layer is reloaded, see reload().
QgsMeshLayer(const QString &path=QString(), const QString &baseName=QString(), const QString &providerLib=QStringLiteral("mesh_memory"), const QgsMeshLayer::LayerOptions &options=QgsMeshLayer::LayerOptions())
Constructor - creates a mesh layer.
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.