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
objectbrowserpanel.h
Go to the documentation of this file.
1
13#ifndef OBJECTBROWSERPANEL_H
14#define OBJECTBROWSERPANEL_H
15
18
19#include <QPointer>
20#include <QSet>
21#include <QString>
22#include <QWidget>
23
24class QLineEdit;
25class QTimer;
26class QTreeView;
27class QUndoStack;
28class QSortFilterProxyModel;
29class QModelIndex;
31class MapCanvas;
33
45class ObjectBrowserPanel : public QWidget
46{
47 Q_OBJECT
48
49public:
50 explicit ObjectBrowserPanel(QWidget *parent = nullptr);
52
60 void setProject(SWMMModelLayer *layer,
61 SelectionManager *selMgr,
62 MapCanvas *canvas = nullptr);
63
69 void refresh();
70
72 void focusSearch();
73
84
85signals:
90
96 SWMMResultsLayer *layer);
97
102
103public:
108 static bool hasComplexEditor(SWMMModelLayer::DataCategory dc) noexcept;
109
115
121
127
147 QUndoStack *undoStack,
148 const SWMMObjectRef &ref,
149 QWidget *parent);
150
151private slots:
152 void onTreeSelectionChanged();
153 void onSearchTextChanged(const QString &text);
154 void onSelectionManagerChanged(const QSet<SWMMObjectRef> &current,
155 const QSet<SWMMObjectRef> &added,
156 const QSet<SWMMObjectRef> &removed);
157 void onContextMenuRequested(const QPoint &pos);
158 void onItemDoubleClicked(const QModelIndex &proxyIdx);
159
163 void applyFilterNow();
164
165private:
166 void buildUi();
167
171 void zoomToObject(const SWMMObjectRef &ref);
172
175 SWMMObjectRef refForProxyIndex(const QModelIndex &proxyIdx) const;
176
179 void sortCategoryAlphabetically(SWMMModelLayer::Category cat);
180
181 QLineEdit *m_searchEdit = nullptr;
182 QTreeView *m_view = nullptr;
183 SWMMObjectTreeModel *m_model = nullptr;
184 QSortFilterProxyModel *m_proxy = nullptr;
185 QTimer *m_filterDebounce = nullptr;
186
187 QPointer<SWMMModelLayer> m_layer;
188 QPointer<SelectionManager> m_selMgr;
189 QPointer<MapCanvas> m_canvas;
190
194 bool m_applyingFromBus = false;
195};
196
197#endif // OBJECTBROWSERPANEL_H
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Embeddable object-navigation widget. Mirrors the legacy Delphi browser's per-type collapsible groups ...
Definition objectbrowserpanel.h:46
void refresh()
Rebuild the backing model from the bound layer. Call after SWMMModelLayer::modelLoaded fires,...
Definition objectbrowserpanel.cpp:230
static bool hasComplexEditor(SWMMModelLayer::DataCategory dc) noexcept
Definition objectbrowserpanel.cpp:956
void plotTimeSeriesForLayerRequested(const SWMMObjectRef &object, SWMMResultsLayer *layer)
Emitted when more than one .out is loaded and the user picks a specific results layer from the "Plot ...
void selectCategory(SWMMModelLayer::Category c)
Select + scroll to the category header for c (e.g. the "Storage" row when the user clicks the matchin...
Definition objectbrowserpanel.cpp:211
void launchBrowseEditor(SWMMModelLayer::DataCategory dc)
Definition objectbrowserpanel.cpp:985
void launchAddNewEditor(SWMMModelLayer::DataCategory dc)
Definition objectbrowserpanel.cpp:972
void focusSearch()
Show + focus the search box and select its text (toolbar Search).
Definition objectbrowserpanel.cpp:204
~ObjectBrowserPanel() override
static QString gapTooltipFor(SWMMModelLayer::DataCategory dc)
Definition objectbrowserpanel.cpp:961
static void openComprehensiveEditorFor(SWMMModelLayer *layer, QUndoStack *undoStack, const SWMMObjectRef &ref, QWidget *parent)
Definition objectbrowserpanel.cpp:630
void rainfallVisualizationRequested(const SWMMObjectRef &object)
Emitted when the user picks "Rainfall Visualization…" from a rain gage's right-click menu....
void setProject(SWMMModelLayer *layer, SelectionManager *selMgr, MapCanvas *canvas=nullptr)
Bind the panel to a project's model layer + selection bus + canvas.
Definition objectbrowserpanel.cpp:170
void plotTimeSeriesRequested(const SWMMObjectRef &object)
Emitted when the user picks "Plot Time Series" from the right-click menu and exactly one results laye...
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
DataCategory
Slice BM.0 — non-spatial data-object categories surfaced below the spatial section in the Object Brow...
Definition swmmmodellayer.h:182
Definition swmmobjecttreemodel.h:33
Overlays time-stepped simulation results on the SWMM network geometry.
Definition swmmresultslayer.h:96
Owner of the canonical selection set for one SWMM project.
Definition selectionmanager.h:112
SwmmCategory
Stable ordinal categorising every SWMM-element kind that has per-kind styling, per-kind tree rows,...
Definition swmm_category.h:28
EdgeRef ref
Definition pslgminsize.cpp:377
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
int pos
Definition queryparser.cpp:36
QString text
Definition queryparser.cpp:35
Identifies a single SWMM object.
Definition selectionmanager.h:32
Map layer that renders an OpenSWMMEngine network (nodes, links, subcatchments, rain gages) and provid...