QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsmeshrendererscalarsettingswidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshrendererscalarsettingswidget.h
3 -------------------------------------
4 begin : June 2018
5 copyright : (C) 2018 by Peter Petrik
6 email : zilolv at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMESHRENDERERSCALARSETTINGSWIDGET_H
17#define QGSMESHRENDERERSCALARSETTINGSWIDGET_H
18
19#include "ui_qgsmeshrendererscalarsettingswidgetbase.h"
20
21#include "qgis_gui.h"
22#include "qgsmeshdataprovider.h"
24
25#include <QWidget>
26
28
29class QgsMeshLayer;
30
39class GUI_EXPORT QgsMeshRendererScalarSettingsWidget : public QWidget, private Ui::QgsMeshRendererScalarSettingsWidgetBase
40{
41 Q_OBJECT
42
43 public:
48 QgsMeshRendererScalarSettingsWidget( QWidget *parent = nullptr );
49
51 void setLayer( QgsMeshLayer *layer );
52
54 void setActiveDatasetGroup( int groupIndex );
55
58
60 void syncToLayer();
61
63 void setCanvas( QgsMapCanvas *canvas );
64
65 signals:
68
69 private slots:
70 void minMaxChanged();
71 void recalculateMinMaxButtonClicked();
72 void onEdgeStrokeWidthMethodChanged();
73
74 private:
75 double spinBoxValue( const QgsDoubleSpinBox *spinBox ) const;
76 QgsMeshRendererScalarSettings::DataResamplingMethod dataIntepolationMethod() const;
77 void mUserDefinedRadioButton_toggled( bool toggled );
78 void mMinMaxRadioButton_toggled( bool toggled );
79
80 void recalculateMinMax();
81
82 bool dataIsDefinedOnFaces() const;
83 bool dataIsDefinedOnEdges() const;
84
85 QgsMeshLayer *mMeshLayer = nullptr; // not owned
86 int mActiveDatasetGroup = -1;
87 QgsMapCanvas *mCanvas = nullptr;
88};
89
90#endif // QGSMESHRENDERERSCALARSETTINGSWIDGET_H
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
Map canvas is a class for displaying all GIS data types on a canvas.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
void syncToLayer()
Synchronizes widgets state with associated mesh layer.
void setCanvas(QgsMapCanvas *canvas)
Associates map canvas with the widget.
void setLayer(QgsMeshLayer *layer)
Associates mesh layer with the widget.
void widgetChanged()
Mesh rendering settings changed.
QgsMeshRendererScalarSettings settings() const
Returns scalar settings.
QgsMeshRendererScalarSettingsWidget(QWidget *parent=nullptr)
A widget to hold the renderer scalar settings for a mesh layer.
void setActiveDatasetGroup(int groupIndex)
Associates a dataset group with the widget (should be set before syncToLayer()).
Represents a mesh renderer settings for scalar datasets.
DataResamplingMethod
Resampling of value from dataset.
#define SIP_NO_FILE