Skip to content
Permalink
Browse files

various small fixes from review

  • Loading branch information
PeterPetrik committed May 22, 2018
1 parent e9c8145 commit 33390123e3e485c0e0d346d22e09816ea42ccd84
@@ -92,7 +92,7 @@ class QgsMeshDatasetMetadata
%Docstring

QgsMeshDatasetMetadata is a collection of mesh dataset metadata such
as if the data is vector or scalar, etc.
as whether the data is vector or scalar, etc.

.. note::

@@ -109,12 +109,18 @@ as if the data is vector or scalar, etc.
%Docstring
Constructs an empty metadata object
%End

QgsMeshDatasetMetadata( bool isScalar,
bool isValid,
bool isOnVertices,
const QMap<QString, QString> &extraOptions );
%Docstring
Consutructs a valid metadata object
Constructs a valid metadata object

:param isScalar: dataset contains scalar data, particulary the y-value of QgsMeshDatasetValue is NaN
:param isValid: dataset is loadad and valid for fetching the data
:param isOnVertices: dataset values are defined on mesh's vertices. If false, values are defined on faces.
:param extraOptions: dataset's extra options stored by the provider. Usually contains the name, time value, time units, data file vendor, ...
%End

QMap<QString, QString> extraOptions() const;
@@ -145,9 +151,12 @@ Usually including name, description or time variable

};

class QgsMeshSource /Abstract/
class QgsMeshDataSourceInterface /Abstract/
{
%Docstring

Interface for mesh data sources

Mesh is a collection of vertices and faces in 2D or 3D space
- vertex - XY(Z) point (in the mesh's coordinate reference system)
- faces - sets of vertices forming a closed shape - typically triangles or quadrilaterals
@@ -166,7 +175,7 @@ read on demand
#include "qgsmeshdataprovider.h"
%End
public:
virtual ~QgsMeshSource();
virtual ~QgsMeshDataSourceInterface();

virtual int vertexCount() const = 0;
%Docstring
@@ -197,13 +206,14 @@ read on demand
%End
};

class QgsMeshDatasetSource /Abstract/
class QgsMeshDatasetSourceInterface /Abstract/
{
%Docstring
Dataset is a collection of vector or scalar values on vertices or faces of the mesh
Interface for mesh datasets

Based on the underlying data provider/format, whole dataset is either stored in memory or
read on demand
Dataset is a collection of vector or scalar values on vertices or faces of the mesh.
Based on the underlying data provider/format, whole dataset is either stored in memory
or read on demand

.. note::

@@ -216,7 +226,7 @@ read on demand
#include "qgsmeshdataprovider.h"
%End
public:
virtual ~QgsMeshDatasetSource();
virtual ~QgsMeshDatasetSourceInterface();

virtual bool addDataset( const QString &uri ) = 0;
%Docstring
@@ -242,7 +252,7 @@ See QgsMeshDatasetMetadata.isVector() to check if the returned value is vector o
};


class QgsMeshDataProvider: QgsDataProvider, QgsMeshSource, QgsMeshDatasetSource
class QgsMeshDataProvider: QgsDataProvider, QgsMeshDataSourceInterface, QgsMeshDatasetSourceInterface
{
%Docstring
Base class for providing data for :py:class:`QgsMeshLayer`
@@ -103,6 +103,7 @@ QgsMeshLayer cannot be copied.
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;
@@ -125,42 +126,42 @@ Returns the provider type for this layer

QgsMeshRendererMeshSettings rendererNativeMeshSettings() const;
%Docstring
Returns rendrer settings
Returns renderer settings
%End

void setRendererNativeMeshSettings( const QgsMeshRendererMeshSettings &settings );
%Docstring
Sets new rendering settings, triggers repaint
Sets new renderer settings, triggers repaint
%End

QgsMeshRendererMeshSettings rendererTriangularMeshSettings() const;
%Docstring
Returns rendrer settings
Returns renderer settings
%End

void setRendererTriangularMeshSettings( const QgsMeshRendererMeshSettings &settings );
%Docstring
Sets new rendering settings, triggers repaint
Sets new renderer settings, triggers repaint
%End

QgsMeshRendererScalarSettings rendererScalarSettings() const;
%Docstring
Returns rendrer settings
Returns renderer settings
%End

void setRendererScalarSettings( const QgsMeshRendererScalarSettings &settings );
%Docstring
Sets new rendering settings, triggers repaint
Sets new renderer settings, triggers repaint
%End

QgsMeshRendererVectorSettings rendererVectorSettings() const;
%Docstring
Returns rendrer settings
Returns renderer settings
%End

void setRendererVectorSettings( const QgsMeshRendererVectorSettings &settings );
%Docstring
Sets new rendering settings, triggers repaint
Sets new renderer settings, triggers repaint
%End

void setActiveScalarDataset( int index = NO_ACTIVE_MESH_DATASET );
@@ -202,7 +202,7 @@ Sets filter value for vector magnitudes.
%Docstring
Returns method used for drawing arrows
%End
void setShaftLengthMethod( const QgsMeshRendererVectorSettings::ArrowScalingMethod &shaftLengthMethod );
void setShaftLengthMethod( ArrowScalingMethod shaftLengthMethod );
%Docstring
Sets method used for drawing arrows
%End
@@ -40,10 +40,12 @@ QgsRectangle QgsMeshDataProvider::extent() const

}

QgsMeshDatasetValue::QgsMeshDatasetValue( double x, double y ): mX( x ), mY( y )
QgsMeshDatasetValue::QgsMeshDatasetValue( double x, double y )
: mX( x ), mY( y )
{}

QgsMeshDatasetValue::QgsMeshDatasetValue( double scalar ): mX( scalar )
QgsMeshDatasetValue::QgsMeshDatasetValue( double scalar )
: mX( scalar )
{}

double QgsMeshDatasetValue::scalar() const
@@ -79,7 +79,6 @@ class CORE_EXPORT QgsMeshDatasetValue
//! Returns y value
double y() const;

//! Equals
bool operator==( const QgsMeshDatasetValue &other ) const;

private:
@@ -93,7 +92,7 @@ class CORE_EXPORT QgsMeshDatasetValue
* \ingroup core
*
* QgsMeshDatasetMetadata is a collection of mesh dataset metadata such
* as if the data is vector or scalar, etc.
* as whether the data is vector or scalar, etc.
*
* \note The API is considered EXPERIMENTAL and can be changed without a notice
*
@@ -104,7 +103,15 @@ class CORE_EXPORT QgsMeshDatasetMetadata
public:
//! Constructs an empty metadata object
QgsMeshDatasetMetadata() = default;
//! Consutructs a valid metadata object

/**
* Constructs a valid metadata object
*
* \param isScalar dataset contains scalar data, particulary the y-value of QgsMeshDatasetValue is NaN
* \param isValid dataset is loadad and valid for fetching the data
* \param isOnVertices dataset values are defined on mesh's vertices. If false, values are defined on faces.
* \param extraOptions dataset's extra options stored by the provider. Usually contains the name, time value, time units, data file vendor, ...
*/
QgsMeshDatasetMetadata( bool isScalar,
bool isValid,
bool isOnVertices,
@@ -145,6 +152,9 @@ class CORE_EXPORT QgsMeshDatasetMetadata

/**
* \ingroup core
*
* Interface for mesh data sources
*
* Mesh is a collection of vertices and faces in 2D or 3D space
* - vertex - XY(Z) point (in the mesh's coordinate reference system)
* - faces - sets of vertices forming a closed shape - typically triangles or quadrilaterals
@@ -156,11 +166,11 @@ class CORE_EXPORT QgsMeshDatasetMetadata
*
* \since QGIS 3.2
*/
class CORE_EXPORT QgsMeshSource SIP_ABSTRACT
class CORE_EXPORT QgsMeshDataSourceInterface SIP_ABSTRACT
{
public:
//! Dtor
virtual ~QgsMeshSource() = default;
virtual ~QgsMeshDataSourceInterface() = default;

/**
* \brief Returns number of vertices in the native mesh
@@ -189,20 +199,21 @@ class CORE_EXPORT QgsMeshSource SIP_ABSTRACT

/**
* \ingroup core
* Dataset is a collection of vector or scalar values on vertices or faces of the mesh
* Interface for mesh datasets
*
* Based on the underlying data provider/format, whole dataset is either stored in memory or
* read on demand
* Dataset is a collection of vector or scalar values on vertices or faces of the mesh.
* Based on the underlying data provider/format, whole dataset is either stored in memory
* or read on demand
*
* \note The API is considered EXPERIMENTAL and can be changed without a notice
*
* \since QGIS 3.2
*/
class CORE_EXPORT QgsMeshDatasetSource SIP_ABSTRACT
class CORE_EXPORT QgsMeshDatasetSourceInterface SIP_ABSTRACT
{
public:
//! Dtor
virtual ~QgsMeshDatasetSource() = default;
virtual ~QgsMeshDatasetSourceInterface() = default;

/**
* \brief Associate dataset with the mesh
@@ -239,7 +250,7 @@ class CORE_EXPORT QgsMeshDatasetSource SIP_ABSTRACT
* \see QgsMeshSource
* \since QGIS 3.2
*/
class CORE_EXPORT QgsMeshDataProvider: public QgsDataProvider, public QgsMeshSource, public QgsMeshDatasetSource
class CORE_EXPORT QgsMeshDataProvider: public QgsDataProvider, public QgsMeshDataSourceInterface, public QgsMeshDatasetSourceInterface
{
Q_OBJECT

@@ -116,7 +116,7 @@ class CORE_EXPORT QgsMeshLayer : public QgsMapLayer
const QgsMeshDataProvider *dataProvider() const override SIP_SKIP;
QgsMeshLayer *clone() const override SIP_FACTORY;
QgsRectangle extent() const override;
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override SIP_FACTORY;
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override SIP_FACTORY;
bool readSymbology( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context ) override;
bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context ) const override;
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const override;
@@ -127,34 +127,34 @@ class CORE_EXPORT QgsMeshLayer : public QgsMapLayer
//! Returns the provider type for this layer
QString providerType() const;

//! Returns native mesh (nullprt before rendering)
//! Returns native mesh (nullptr before rendering)
QgsMesh *nativeMesh() SIP_SKIP;

//! Returns triangular mesh (nullprt before rendering)
//! Returns triangular mesh (nullptr before rendering)
QgsTriangularMesh *triangularMesh() SIP_SKIP;

//! Returns rendrer settings
//! Returns renderer settings
QgsMeshRendererMeshSettings rendererNativeMeshSettings() const;

//! Sets new rendering settings, triggers repaint
//! Sets new renderer settings, triggers repaint
void setRendererNativeMeshSettings( const QgsMeshRendererMeshSettings &settings );

//! Returns rendrer settings
//! Returns renderer settings
QgsMeshRendererMeshSettings rendererTriangularMeshSettings() const;

//! Sets new rendering settings, triggers repaint
//! Sets new renderer settings, triggers repaint
void setRendererTriangularMeshSettings( const QgsMeshRendererMeshSettings &settings );

//! Returns rendrer settings
//! Returns renderer settings
QgsMeshRendererScalarSettings rendererScalarSettings() const;

//! Sets new rendering settings, triggers repaint
//! Sets new renderer settings, triggers repaint
void setRendererScalarSettings( const QgsMeshRendererScalarSettings &settings );

//! Returns rendrer settings
//! Returns renderer settings
QgsMeshRendererVectorSettings rendererVectorSettings() const;

//! Sets new rendering settings, triggers repaint
//! Sets new renderer settings, triggers repaint
void setRendererVectorSettings( const QgsMeshRendererVectorSettings &settings );

/**

0 comments on commit 3339012

Please sign in to comment.
You can’t perform that action at this time.