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
kindrendererpanel.h
Go to the documentation of this file.
1
26#ifndef OPENSWMMVIS_UI_DIALOGS_EDITORS_KINDRENDERERPANEL_H
27#define OPENSWMMVIS_UI_DIALOGS_EDITORS_KINDRENDERERPANEL_H
28
30
31#include <QWidget>
32
33#include <memory>
34
36class SWMMModelLayer;
38
39class QCheckBox;
40class QComboBox;
41class QDoubleSpinBox;
42class QLabel;
43
44namespace OpenSWMM::Render {
45class IFeatureRenderer;
46class Rule; // Slice B.6a — Rule-aware ctor below.
47}
48
49namespace openswmmvis::ui {
50
51class ClassificationEditor;
52class ColorButton;
53class GraduatedRendererBinding;
54
55class KindRendererPanel : public QWidget
56{
57 Q_OBJECT
58public:
65 QWidget *parent = nullptr);
66
71 QWidget *parent = nullptr);
72
89 OpenSWMMVisLayer *hostLayer,
91 QWidget *parent = nullptr);
92
93 // Out-of-line so unique_ptr<GraduatedRendererBinding> (forward-declared)
94 // is destroyed where the type is complete.
96
99 void refreshFromModel();
100
101private slots:
102 void onModeChanged(int comboRow);
103 // Slice DM.2 — attribute picker. Populated from IAttributeProvider
104 // when the host layer (or the Rule's owning layer) implements it;
105 // hidden otherwise.
106 void onAttributeChanged(int comboRow);
107 // Gap A4.5 — output axes: size-by-value (points) / width-by-value (lines).
108 void onOutputAxisChanged();
110 void onArrowsChanged();
111 // Independent size attribute — "(same as color)" or a numeric field.
112 void onSizeAttributeChanged(int comboRow);
113
114private:
115 void buildUi();
116 OpenSWMM::Render::IFeatureRenderer *currentRenderer() const;
119 OpenSWMMVisLayer *attributeProviderHost() const;
120
123 void syncArrowsFromHost();
124
125 OpenSWMMVisLayer *m_hostLayer = nullptr;
126 SWMMModelLayer *m_modelLayer = nullptr; // either m_modelLayer
127 SWMMResultsLayer *m_resultsLayer = nullptr; // or m_resultsLayer is set
129
130 // Slice B.6a — Rule-aware mode. When non-null, m_modelLayer /
131 // m_resultsLayer are both null and read/write paths route through
132 // Rule::renderer / Rule::setRenderer.
133 OpenSWMM::Render::Rule *m_rule = nullptr;
134
135 // Controls — 1D glue retained by this panel.
136 QComboBox *m_modeCombo = nullptr;
137 QComboBox *m_attrCombo = nullptr; // Slice DM.2
138 QWidget *m_attrRow = nullptr; // Slice DM.2 — hidden when no provider
139 QWidget *m_graduatedBox = nullptr;
140 // Gap A4.5 — output-axis row, archetype-gated (size → points,
141 // width → lines, hidden for polygons).
142 QWidget *m_axisRow = nullptr;
143 QCheckBox *m_axisCheck = nullptr;
144 QDoubleSpinBox *m_axisMinSpin = nullptr;
145 QDoubleSpinBox *m_axisMaxSpin = nullptr;
146 // Independent size attribute picker ("Size by:") — row hidden when the
147 // axis row is hidden; combo disabled until the axis toggle is on.
148 QWidget *m_sizeAttrRow = nullptr;
149 QComboBox *m_sizeAttrCombo = nullptr;
150
151 // Flow-direction arrows — a property of the LINK KIND, not of the
152 // renderer, so it belongs on every editor a link kind can mount. The
153 // single-symbol editors (SwmmElementSymbolEditor for model layers,
154 // the Line feature-style editor for results layers) each carry their
155 // own copy; this one covers the graduated / categorized panels, which
156 // otherwise made the arrows vanish the moment a conduit was themed.
157 // Bound to whichever channel the host exposes — see
158 // syncArrowsFromHost() for the two-channel split.
159 QWidget *m_arrowBox = nullptr;
160 QCheckBox *m_arrowShowChk = nullptr;
161 QDoubleSpinBox *m_arrowSizeSpin = nullptr;
162 QDoubleSpinBox *m_arrowWidSpin = nullptr;
163 ColorButton *m_arrowColorBtn = nullptr;
164
165 // Slice US.1 — shared classification block.
166 ClassificationEditor *m_classEditor = nullptr;
167 std::unique_ptr<GraduatedRendererBinding> m_binding;
168
169 // Re-entrancy guard while rebuilding the controls from the renderer.
170 bool m_suppressEdits = false;
171};
172
173} // namespace openswmmvis::ui
174
175#endif // OPENSWMMVIS_UI_DIALOGS_EDITORS_KINDRENDERERPANEL_H
Abstract interface — every vector layer's paint path goes here.
Definition ifeaturerenderer.h:85
One layer-scope styled aspect — name + renderer + filter + scale.
Definition rule.h:51
Abstract base class for all layers displayed in the MapCanvas.
Definition openswmmvislayer.h:116
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
Overlays time-stepped simulation results on the SWMM network geometry.
Definition swmmresultslayer.h:96
Definition classificationeditor.h:59
Definition colorbutton.h:21
Definition kindrendererpanel.h:56
void refreshFromModel()
Definition kindrendererpanel.cpp:313
Definition gisrasterlayer.h:40
SwmmCategory
Stable ordinal categorising every SWMM-element kind that has per-kind styling, per-kind tree rows,...
Definition swmm_category.h:28
@ CatJunctions
Definition swmm_category.h:29
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Standalone definition of the SWMM-element Category enum used by per-Category APIs across layers,...