QGIS/python/core/auto_generated/mesh/qgsmeshlayer.sip.in

231 lines
7.2 KiB
Plaintext
Raw Normal View History

/************************************************************************
* 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.
2018-04-20 10:39:28 +02:00
\section mesh_providers Mesh data providers
2018-04-20 10:39:28 +02:00
\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
{
2018-05-27 17:52:22 +02:00
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
2018-05-27 16:33:02 +10:00
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"
2018-05-21 16:27:00 +10:00
: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/;
2018-05-22 14:32:20 +02:00
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
2018-05-16 17:02:35 +02:00
QgsMeshRendererMeshSettings rendererNativeMeshSettings() const;
%Docstring
2018-05-22 14:32:20 +02:00
Returns renderer settings
%End
void setRendererNativeMeshSettings( const QgsMeshRendererMeshSettings &settings );
%Docstring
2018-05-22 14:32:20 +02:00
Sets new renderer settings, triggers repaint
%End
2018-05-16 17:02:35 +02:00
QgsMeshRendererMeshSettings rendererTriangularMeshSettings() const;
%Docstring
2018-05-22 14:32:20 +02:00
Returns renderer settings
%End
void setRendererTriangularMeshSettings( const QgsMeshRendererMeshSettings &settings );
%Docstring
2018-05-22 14:32:20 +02:00
Sets new renderer settings, triggers repaint
%End
2018-05-16 17:02:35 +02:00
QgsMeshRendererScalarSettings rendererScalarSettings() const;
%Docstring
2018-05-22 14:32:20 +02:00
Returns renderer settings
%End
void setRendererScalarSettings( const QgsMeshRendererScalarSettings &settings );
%Docstring
2018-05-22 14:32:20 +02:00
Sets new renderer settings, triggers repaint
%End
2018-05-16 17:02:35 +02:00
QgsMeshRendererVectorSettings rendererVectorSettings() const;
%Docstring
2018-05-22 14:32:20 +02:00
Returns renderer settings
%End
void setRendererVectorSettings( const QgsMeshRendererVectorSettings &settings );
%Docstring
2018-05-22 14:32:20 +02:00
Sets new renderer settings, triggers repaint
%End
void setActiveScalarDataset( QgsMeshDatasetIndex index = QgsMeshDatasetIndex() );
%Docstring
Sets active scalar dataset for rendering
2018-05-16 17:02:35 +02:00
Triggers repaint
%End
QgsMeshDatasetIndex activeScalarDataset() const;
%Docstring
Returns active scalar dataset
%End
void setActiveVectorDataset( QgsMeshDatasetIndex index = QgsMeshDatasetIndex() );
%Docstring
2018-05-16 17:02:35 +02:00
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
2018-08-10 09:24:31 +02:00
.. 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 *
************************************************************************/