Skip to content

Commit

Permalink
[mesh] [feature] App widgets for styling mesh layers
Browse files Browse the repository at this point in the history
- Adding datasets to mesh layer from properties panel
- Information and source panel in properties panel
- Selection of active dataset (properties or styling panel)
- Styling of contours/scalars (properties or styling panel)
- Styling of mesh frame (properties or styling panel)
- Styling of vector arrows (properties or styling panel)
  • Loading branch information
PeterPetrik committed Jun 26, 2018
1 parent b3d2619 commit aeea184
Show file tree
Hide file tree
Showing 50 changed files with 4,760 additions and 199 deletions.
2 changes: 2 additions & 0 deletions python/core/auto_generated/mesh/qgsmeshdataprovider.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ or read on demand
virtual bool addDataset( const QString &uri ) = 0;
%Docstring
Associate dataset with the mesh

emits dataChanged when successful
%End

virtual int datasetCount() const = 0;
Expand Down
48 changes: 7 additions & 41 deletions python/core/auto_generated/mesh/qgsmeshrenderersettings.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@




class QgsMeshRendererMeshSettings
{
%Docstring
Expand Down Expand Up @@ -73,54 +74,19 @@ Represents a mesh renderer settings for scalar datasets
#include "qgsmeshrenderersettings.h"
%End
public:
QColor maxColor() const;
%Docstring
Returns color representing maximum scalar value in the dataset
%End
void setMaxColor( const QColor &maxColor );
%Docstring
Sets color representing maximum scalar value in the dataset
%End

QColor minColor() const;
QgsColorRampShader colorRampShader() const;
%Docstring
Returns color representing minimum scalar value in the dataset
Returns color ramp shader function
%End
void setMinColor( const QColor &minColor );
void setColorRampShader( const QgsColorRampShader &shader );
%Docstring
Sets color representing maximum scalar value in the dataset
Sets color ramp shader function
%End

double minValue() const;
%Docstring
Returns min scalar value that represents minColor()

if set to numerical_limits<double>.quiet_NaN(), value for minColor() is
taken from minimum value of active scalar dataset
%End

void setMinValue( double minValue );
%Docstring
Sets min scalar value that represents minColor()

.. seealso:: :py:func:`QgsMeshRendererScalarSettings.minValue`
%End

double maxValue() const;
%Docstring
Returns max scalar value that represents maxColor()

if set to numerical_limits<double>.quiet_NaN(), value for maxColor() is
taken from maximum value of active scalar dataset
%End

void setMaxValue( double maxValue );
bool isEnabled() const;
%Docstring
Sets min scalar value that represents minColor()

.. seealso:: :py:func:`QgsMeshRendererScalarSettings.maxValue`
Returns whether color ramp has any items assigned
%End

};

class QgsMeshRendererVectorSettings
Expand Down
7 changes: 7 additions & 0 deletions python/core/auto_generated/raster/qgscolorrampshader.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ Returns the color ramp type as a string.
void setColorRampType( QgsColorRampShader::Type colorRampType );
%Docstring
Sets the color ramp type
%End

bool isEmpty() const;
%Docstring
Whether the color ramp contains any items

.. versionadded:: 3.4
%End

QgsColorRamp *sourceColorRamp() const /Factory/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ class QgsSingleBandPseudoColorRendererWidget: QgsRasterRendererWidget
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) /Factory/;
virtual QgsRasterRenderer *renderer();


QgsColorRampShader *shaderFunction() const /Factory/;
%Docstring
Returns shader function used in the renderer. Caller takes ownership and deletes it.
%End
virtual void setMapCanvas( QgsMapCanvas *canvas );

virtual void doComputations();

virtual QgsRasterMinMaxWidget *minMaxWidget();

int currentBand() const;
%Docstring
Returns the current raster band number
%End

void setFromRenderer( const QgsRasterRenderer *r );

public slots:
Expand Down
18 changes: 18 additions & 0 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ SET(QGIS_APP_SRCS
qgssettingstree.cpp
qgsvariantdelegate.cpp
qgscrashhandler.cpp

mesh/qgsmeshlayerproperties.cpp
mesh/qgsrenderermeshpropertieswidget.cpp
mesh/qgsmeshrenderermeshsettingswidget.cpp
mesh/qgsmeshrendererscalarsettingswidget.cpp
mesh/qgsmeshrenderervectorsettingswidget.cpp
mesh/qgsmeshrendereractivedatasetwidget.cpp
mesh/qgsmeshdatasetgrouptreeview.cpp
)

SET (QGIS_APP_MOC_HDRS
Expand Down Expand Up @@ -410,6 +418,14 @@ SET (QGIS_APP_MOC_HDRS

qgssettingstree.h
qgsvariantdelegate.h

mesh/qgsmeshlayerproperties.h
mesh/qgsrenderermeshpropertieswidget.h
mesh/qgsmeshrenderermeshsettingswidget.h
mesh/qgsmeshrendererscalarsettingswidget.h
mesh/qgsmeshrenderervectorsettingswidget.h
mesh/qgsmeshrendereractivedatasetwidget.h
mesh/qgsmeshdatasetgrouptreeview.h
)


Expand Down Expand Up @@ -584,6 +600,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/app/pluginmanager
${CMAKE_SOURCE_DIR}/src/app/gps
${CMAKE_SOURCE_DIR}/src/app/dwg
${CMAKE_SOURCE_DIR}/src/app/mesh
${CMAKE_SOURCE_DIR}/src/app/locator
${CMAKE_SOURCE_DIR}/src/analysis/raster
${CMAKE_SOURCE_DIR}/src/core
Expand Down Expand Up @@ -660,6 +677,7 @@ INCLUDE_DIRECTORIES(
../core/processing
../core/providers/memory
../core/raster
../core/mesh
../core/scalebar
../core/symbology
../gui
Expand Down
Loading

0 comments on commit aeea184

Please sign in to comment.