QGIS/python/core/auto_generated/mesh/qgsmeshlayer.sip.in
Peter Petrik 3154102aa6 [FEATURE] Scalar/vector data in mesh data providers
Reading and processing scalar (e.g. water depth) and vector (e.g.
velocity) data from mesh data providers (e.g. MDAL)
2018-05-16 12:47:28 +02:00

152 lines
5.3 KiB
Plaintext

/************************************************************************
* 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");
Add datasets by adding them through data provider, :py:func:`QgsMeshDatasetSource.addDataset`
\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");
.. versionadded:: 3.2
%End
%TypeHeaderCode
#include "qgsmeshlayer.h"
%End
public:
explicit QgsMeshLayer( const QString &path = QString(), const QString &baseName = QString(), const QString &providerLib = "mesh_memory" );
%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"
%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
Return the provider type for this layer
%End
QgsSymbol *nativeMeshSymbol();
%Docstring
Returns a line symbol used for rendering native mesh.
%End
QgsSymbol *triangularMeshSymbol();
%Docstring
Returns a line symbol used for rendering of triangular (derived) mesh.
.. seealso:: :py:func:`toggleTriangularMeshRendering`
%End
void toggleTriangularMeshRendering( bool toggle );
%Docstring
Toggle rendering of triangular (derived) mesh. Off by default
%End
void setActiveScalarDataset( int index = -1 );
void setActiveVectorDataset( int index = -1 );
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 *
************************************************************************/