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
linkcompoundeditdialog.h
Go to the documentation of this file.
1
23#ifndef LINKCOMPOUNDEDITDIALOG_H
24#define LINKCOMPOUNDEDITDIALOG_H
25
26#include <QDialog>
27
29
30class QStackedWidget;
31class QDialogButtonBox;
32class QComboBox;
33class QDoubleSpinBox;
34class QPushButton;
35class QSpinBox;
36class QLabel;
37class QListWidget;
38class QSplitter;
40
41namespace openswmmvis::sectionview { class SectionPreviewWidget; }
42
43class LinkCompoundEditDialog : public QDialog
44{
45 Q_OBJECT
46
47public:
49 QWidget *parent = nullptr);
50
53 [[nodiscard]] QString updatedSummary() const { return m_ref.summary; }
54
55private:
56 void buildXSectionPage();
57 void buildInletUsagePage();
58
61 [[nodiscard]] int linkIdx() const;
62
66 QString computeXsectSummary() const;
67
70 void updateXsectFieldVisibility();
71
74 void applyXsect();
75
84 void refreshXsectPreview(int highlightOrdinal = 0);
85
89 void refreshTransectPickerItems(const QString &selected = {});
90
95 void onTransectPickerClicked();
96
100 void refreshStreetPickerItems(const QString &selected = {});
101
106 void onStreetPickerClicked();
107
108 // ── Inlet usage page (§2.4, closes BN-LINK-11) ───────────────────────
109 //
110 // One [INLET_USAGE] row per conduit. The page is populated from the
111 // engine on construction and commits the whole row through a single
112 // SetInletUsageCommand (SWMMModelLayer::pushInletUsageEdit) on Apply, so
113 // an edit here and the same edit on an inlet junction's property rows are
114 // literally the same undoable operation.
115
119 void loadInletUsage();
122 void applyInletUsage();
124 void removeInletUsage();
126 void refreshInletDesignItems(const QString &selected = {});
129 void refreshCaptureNodeItems(const QString &selected = {});
132 void onInletDesignPickerClicked();
133
135
136 // XSection page widgets — §S.SC.1.a (2026-05-25) reworked: the
137 // single QComboBox shape picker is replaced by a horizontal
138 // QSplitter whose left pane is a QListWidget in IconMode (one item
139 // per allowed shape, colored placeholder icon + label below) and
140 // whose right pane is the existing per-shape params form. The
141 // splitter + list expose the same `currentXsectShapeId()` selection
142 // signal the old combo did so the suppress-apply / round-trip
143 // contract is unchanged.
144 QSplitter *m_xsSplitter = nullptr;
145 QListWidget *m_xsShapeList = nullptr;
146 QDoubleSpinBox *m_xsGeom1Spin = nullptr;
147 QDoubleSpinBox *m_xsGeom2Spin = nullptr;
148 QDoubleSpinBox *m_xsGeom3Spin = nullptr;
149 QDoubleSpinBox *m_xsGeom4Spin = nullptr;
150 QSpinBox *m_xsBarrelsSpin = nullptr;
151 QLabel *m_xsSummaryLabel = nullptr;
152 QLabel *m_xsGeom1Label = nullptr;
153 QLabel *m_xsGeom2Label = nullptr;
154 QLabel *m_xsGeom3Label = nullptr;
155 QLabel *m_xsGeom4Label = nullptr;
156
160
161 // §S.SC.1.b (2026-05-25) — When the user picks IRREGULAR the engine
162 // expects geom1 to be a transect *index*. Bare numeric input is
163 // hostile (the indices aren't stable across rename / reorder) so we
164 // hide the geom1 spin and surface a LabeledPickerCombo whose
165 // "..." button opens the TransectEditorDialog CRUD modal
166 // (`pickTransect`). On commit we translate the picked name → engine
167 // transect index → geom1.
168 QLabel *m_xsTransectLabel = nullptr;
169 LabeledPickerCombo *m_xsTransectPicker = nullptr;
170
171 // STREET shape — same picker pattern as IRREGULAR: geom1 is a street
172 // *index*, surfaced as a name dropdown + "..." button that opens the
173 // StreetEditorDialog CRUD modal (`pickStreet`).
174 QLabel *m_xsStreetLabel = nullptr;
175 LabeledPickerCombo *m_xsStreetPicker = nullptr;
176
177 // Re-entrancy guard: when we populate widgets from engine state
178 // on dialog open / page activation, the QSignals fire and would
179 // otherwise bounce right back through `applyXsect()`. Set true
180 // while populating; the slot bails when set.
181 bool m_xsSuppressApply = false;
182
183 // Inlet usage page widgets — the legacy 8-row form (Dinletusage.pas).
184 LabeledPickerCombo *m_iuDesignPicker = nullptr;
185 QComboBox *m_iuCaptureCombo = nullptr;
186 QSpinBox *m_iuNumInlets = nullptr;
187 QDoubleSpinBox *m_iuPctClogged = nullptr;
188 QDoubleSpinBox *m_iuFlowLimit = nullptr;
189 QDoubleSpinBox *m_iuDepressHeight = nullptr;
190 QDoubleSpinBox *m_iuDepressWidth = nullptr;
191 QComboBox *m_iuPlacement = nullptr;
192 QPushButton *m_iuRemoveBtn = nullptr;
193 QLabel *m_iuStatus = nullptr;
196 bool m_iuSuppressApply = false;
197
198 QStackedWidget *m_stack = nullptr;
199 QDialogButtonBox *m_buttons = nullptr;
200};
201
202#endif // LINKCOMPOUNDEDITDIALOG_H
Definition labeledcontrols.h:146
Definition sectionpreviewwidget.h:31
Definition aquifereditordialog.h:41
EdgeRef ref
Definition pslgminsize.cpp:377
QVector< int > parent
union-find
Definition pslgminsize.cpp:176