/************************************************************************ * This file has been generated automatically from * * * * src/core/mesh/qgsmeshlayer.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ class QgsMeshLayer : QgsMapLayer { %Docstring Represents a mesh layer supporting display of data on structured or unstructured meshes The QgsMeshLayer is instantiated by specifying the name of a data provider, such as mdal, and url defining the specific data set to connect to. The vector layer constructor in turn instantiates a QgsMeshDataProvider subclass corresponding to the provider type, and passes it the url. The data provider connects to the data source. The QgsMeshLayer provides a common interface to the different data types. It does not yet support editing transactions. The main data providers supported by QGIS are listed below. \section mesh_providers Mesh data providers \subsection mesh_memory Memory data providerType (mesh_memory) The memory data provider is used to construct in memory data, for example scratch data. There is no inherent persistent storage of the data. The data source uri is constructed. Data can be populated by setMesh(const QString &vertices, const QString &faces), where vertices and faces is comma separated coordinates and connections for mesh. E.g. to create mesh with one quad and one triangle .. code-block:: QString uri( "1.0, 2.0 \n" \ "2.0, 2.0 \n" \ "3.0, 2.0 \n" \ "2.0, 3.0 \n" \ "1.0, 3.0 \n" \ "---" "0, 1, 3, 4 \n" \ "1, 2, 3 \n" ); QgsMeshLayer *scratchLayer = new QgsMeshLayer(uri, "My Scratch layer", "memory_mesh"); \subsection mdal MDAL data provider (mdal) Accesses data using the MDAL drivers (https://github.com/lutraconsulting/MDAL). The url is the MDAL connection string. QGIS must be built with MDAL support to allow this provider. .. code-block:: QString uri = "test/land.2dm"; QgsMeshLayer *scratchLayer = new QgsMeshLayer(uri, "My Scratch Layer", "mdal"); .. note:: The API is considered EXPERIMENTAL and can be changed without a notice .. versionadded:: 3.2 %End %TypeHeaderCode #include "qgsmeshlayer.h" %End public: struct LayerOptions { int unused; //! @todo remove me once there are actual members here (breaks SIP <4.19) }; explicit QgsMeshLayer( const QString &path = QString(), const QString &baseName = QString(), const QString &providerLib = "mesh_memory", const QgsMeshLayer::LayerOptions &options = QgsMeshLayer::LayerOptions() ); %Docstring Constructor - creates a mesh layer The QgsMeshLayer is constructed by instantiating a data provider. The provider interprets the supplied path (url) of the data source to connect to and access the data. :param path: The path or url of the parameter. Typically this encodes parameters used by the data provider as url query items. :param baseName: The name used to represent the layer in the legend :param providerLib: The name of the data provider, e.g., "mesh_memory", "mdal" :param options: general mesh layer options %End ~QgsMeshLayer(); virtual QgsMeshDataProvider *dataProvider(); %Docstring QgsMeshLayer cannot be copied. %End virtual QgsMeshLayer *clone() const /Factory/; virtual QgsRectangle extent() const; virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) /Factory/; virtual bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context ); virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context ) const; virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const; virtual QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const; virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ); virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const; QString providerType() const; %Docstring Returns the provider type for this layer %End QgsMeshRendererMeshSettings rendererNativeMeshSettings() const; %Docstring Returns renderer settings %End void setRendererNativeMeshSettings( const QgsMeshRendererMeshSettings &settings ); %Docstring Sets new renderer settings, triggers repaint %End QgsMeshRendererMeshSettings rendererTriangularMeshSettings() const; %Docstring Returns renderer settings %End void setRendererTriangularMeshSettings( const QgsMeshRendererMeshSettings &settings ); %Docstring Sets new renderer settings, triggers repaint %End QgsMeshRendererScalarSettings rendererScalarSettings() const; %Docstring Returns renderer settings %End void setRendererScalarSettings( const QgsMeshRendererScalarSettings &settings ); %Docstring Sets new renderer settings, triggers repaint %End QgsMeshRendererVectorSettings rendererVectorSettings() const; %Docstring Returns renderer settings %End void setRendererVectorSettings( const QgsMeshRendererVectorSettings &settings ); %Docstring Sets new renderer settings, triggers repaint %End void setActiveScalarDataset( QgsMeshDatasetIndex index = QgsMeshDatasetIndex() ); %Docstring Sets active scalar dataset for rendering Triggers repaint %End QgsMeshDatasetIndex activeScalarDataset() const; %Docstring Returns active scalar dataset %End void setActiveVectorDataset( QgsMeshDatasetIndex index = QgsMeshDatasetIndex() ); %Docstring Sets active vector dataset for rendering. If dataset is not vector based, do nothing. Triggers repaint %End QgsMeshDatasetIndex activeVectorDataset() const; %Docstring Returns active vector dataset %End QgsMeshDatasetValue datasetValue( const QgsMeshDatasetIndex &index, const QgsPointXY &point ) const; %Docstring Interpolates the value on the given point from given dataset. Returns NaN for NaN values, for values outside range or when triangular mesh is not yet initialized on given point .. versionadded:: 3.4 %End signals: void activeScalarDatasetChanged( QgsMeshDatasetIndex index ); %Docstring Emitted when active scalar dataset is changed .. versionadded:: 3.4 %End void activeVectorDatasetChanged( QgsMeshDatasetIndex index ); %Docstring Emitted when active vector dataset is changed .. versionadded:: 3.4 %End private: // Private methods QgsMeshLayer( const QgsMeshLayer &rhs ); }; /************************************************************************ * This file has been generated automatically from * * * * src/core/mesh/qgsmeshlayer.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/