SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
classificationeditor.h
Go to the documentation of this file.
1
33#ifndef OPENSWMMVIS_UI_WIDGETS_CLASSIFICATIONEDITOR_H
34#define OPENSWMMVIS_UI_WIDGETS_CLASSIFICATIONEDITOR_H
35
37
38#include <QWidget>
39
40#include <memory>
41
43
44class QCheckBox;
45class QComboBox;
46class QDoubleSpinBox;
47class QLabel;
48class QSpinBox;
49class QStandardItem;
50class QStandardItemModel;
51class QTableView;
52class QToolButton;
53
54namespace openswmmvis::ui {
55
56class IClassificationBinding;
57
58class ClassificationEditor : public QWidget
59{
60 Q_OBJECT
61public:
65 bool ownBinding = false,
66 QWidget *parent = nullptr);
67 ~ClassificationEditor() override;
68
71 void setBinding(IClassificationBinding *binding, bool ownBinding = false);
72
75 void refresh();
76
77signals:
80 void edited();
81
82private slots:
83 void onModeChanged();
84 void onAttributeChanged(int row);
85 void onRampChanged(const RasterColorRamp &ramp);
86 void onInvertToggled(bool on);
87 void onMethodChanged(int row);
88 void onClassCountChanged(int n);
89 void onRangeModeChanged(int row);
90 void onCustomRangeToggled(bool on);
91 void onCustomRangeEdited();
92 void onLabelFormatChanged(int row);
93 void onLabelPrecisionChanged(int digits);
94 void onAutoClassify();
95 void onTableItemChanged(QStandardItem *item);
96
97private:
98 void buildUi();
99 void rebuildTable();
100 void applyVisibility();
102 template <class Fn> void mutateScheme(Fn fn);
103
104 IClassificationBinding *m_binding = nullptr;
105 bool m_ownBinding = false;
106
107 // Controls
108 QWidget *m_modeRow = nullptr;
109 QComboBox *m_modeCombo = nullptr;
110 QWidget *m_attrRow = nullptr;
111 QComboBox *m_attrCombo = nullptr;
112 ColorRampComboBox *m_rampCombo = nullptr;
113 QCheckBox *m_invertCheck = nullptr;
114 QComboBox *m_methodCombo = nullptr;
115 QSpinBox *m_countSpin = nullptr;
116 QLabel *m_methodLabel = nullptr;
117 QLabel *m_countLabel = nullptr;
118 QWidget *m_rangeModeRow = nullptr;
119 QComboBox *m_rangeModeCombo = nullptr;
120 QWidget *m_customRangeRow = nullptr;
121 QCheckBox *m_customRangeCheck = nullptr;
122 QDoubleSpinBox *m_rangeMinSpin = nullptr;
123 QDoubleSpinBox *m_rangeMaxSpin = nullptr;
124 QWidget *m_labelFormatRow = nullptr;
125 QComboBox *m_labelFormatCombo = nullptr;
126 QSpinBox *m_labelPrecisionSpin = nullptr;
127 QToolButton *m_autoBtn = nullptr;
128 QTableView *m_table = nullptr;
129 QStandardItemModel *m_tableModel = nullptr;
130
131 bool m_suppress = false; // re-entrancy guard during refresh()
132};
133
134} // namespace openswmmvis::ui
135
136#endif // OPENSWMMVIS_UI_WIDGETS_CLASSIFICATIONEDITOR_H
Definition colorrampcombobox.h:32
Slice US.1 (UNIFIED_STYLING_AND_UI_CONSISTENCY_PLAN.md S1) — the shared classification value type emb...
Definition classificationeditor.h:59
void setBinding(IClassificationBinding *binding, bool ownBinding=false)
Definition classificationeditor.cpp:69
~ClassificationEditor() override
Definition classificationeditor.cpp:63
void refresh()
Definition classificationeditor.cpp:267
What ClassificationEditor talks to instead of a concrete model.
Definition classificationbindings.h:55
std::size_t n
Definition mesh2dresultsexport.cpp:426
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Gradient mapping from a normalised value in [0,1] to a QColor.
Definition colorramp.h:71