QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 #include "qgis_gui.h"
22 #include "qgsmeshdataprovider.h"
23 
24 #include <QWidget>
25 
27 
28 class QgsMeshLayer;
29 
38 class QgsMeshRendererScalarSettingsWidget : public QWidget, private Ui::QgsMeshRendererScalarSettingsWidgetBase
39 {
40  Q_OBJECT
41 
42  public:
43 
48  QgsMeshRendererScalarSettingsWidget( QWidget *parent = nullptr );
49 
51  void setLayer( QgsMeshLayer *layer );
52 
54  void setActiveDatasetGroup( int groupIndex );
55 
58 
60  void syncToLayer();
61 
62  signals:
64  void widgetChanged();
65 
66  private slots:
67  void minMaxChanged();
68  void recalculateMinMaxButtonClicked();
69  void onEdgeStrokeWidthMethodChanged();
70 
71  private:
72  double spinBoxValue( const QgsDoubleSpinBox *spinBox ) const;
73  QgsMeshRendererScalarSettings::DataResamplingMethod dataIntepolationMethod() const;
74 
75  bool dataIsDefinedOnFaces() const;
76  bool dataIsDefinedOnEdges() const;
77 
78  QgsMeshLayer *mMeshLayer = nullptr; // not owned
79  int mActiveDatasetGroup = -1;
80 };
81 
82 #endif // QGSMESHRENDERERSCALARSETTINGSWIDGET_H
QgsMeshRendererScalarSettingsWidget::setLayer
void setLayer(QgsMeshLayer *layer)
Associates mesh layer with the widget.
Definition: qgsmeshrendererscalarsettingswidget.cpp:70
QgsMeshRendererScalarSettingsWidget::syncToLayer
void syncToLayer()
Synchronizes widgets state with associated mesh layer.
Definition: qgsmeshrendererscalarsettingswidget.cpp:104
QgsMeshRendererScalarSettingsWidget
A widget for setup of the scalar dataset renderer settings of a mesh layer. The layer must be connect...
Definition: qgsmeshrendererscalarsettingswidget.h:38
QgsMeshLayer
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:98
QgsMeshRendererScalarSettingsWidget::QgsMeshRendererScalarSettingsWidget
QgsMeshRendererScalarSettingsWidget(QWidget *parent=nullptr)
A widget to hold the renderer scalar settings for a mesh layer.
Definition: qgsmeshrendererscalarsettingswidget.cpp:28
QgsMeshRendererScalarSettings::DataResamplingMethod
DataResamplingMethod
Resampling of value from dataset.
Definition: qgsmeshrenderersettings.h:105
SIP_NO_FILE
#define SIP_NO_FILE
Definition: fromencodedcomponenthelper.h:18
QgsMeshRendererScalarSettingsWidget::settings
QgsMeshRendererScalarSettings settings() const
Returns scalar settings.
Definition: qgsmeshrendererscalarsettingswidget.cpp:82
qgsmeshrenderersettings.h
QgsMeshRendererScalarSettings
Represents a mesh renderer settings for scalar datasets.
Definition: qgsmeshrenderersettings.h:94
QgsMeshRendererScalarSettingsWidget::widgetChanged
void widgetChanged()
Mesh rendering settings changed.
QgsMeshRendererScalarSettingsWidget::setActiveDatasetGroup
void setActiveDatasetGroup(int groupIndex)
Associates a dataset group with the widget (should be set before syncToLayer())
Definition: qgsmeshrendererscalarsettingswidget.cpp:76
QgsDoubleSpinBox
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value....
Definition: qgsdoublespinbox.h:42
qgsmeshdataprovider.h