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
propertiespanel.h
Go to the documentation of this file.
1
11#ifndef PROPERTIESPANEL_H
12#define PROPERTIESPANEL_H
13
15
16#include <QDockWidget>
17#include <QList>
18#include <QPointer>
19#include <QVariantMap>
20
21class QTreeView;
22class QComboBox;
23class QPushButton;
24class QAbstractItemModel;
25class QAbstractItemDelegate;
26#ifdef HAVE_QPROPERTYMODEL
27class QPropertyModel; // from QPropertyModel library
28class QPropertyItemDelegate;
29#endif
31class SWMMModelLayer;
37struct IdentifyResult;
38
39namespace openswmmvis { class OutputStatsRegistry; } // Slice QA.2
40
56class PropertiesPanel : public QDockWidget
57{
58 Q_OBJECT
59
60public:
61
62 explicit PropertiesPanel(QWidget *parent = nullptr);
63 ~PropertiesPanel() override;
64
65 // ----- Content -------------------------------------------------------
66
73 void showObject(QObject *object, const QString &title = {});
74
79 void showIdentifyResults(const QList<IdentifyResult> &results);
80
85
89 void clear();
90
95 void setProject(SWMMModelLayer *layer);
96
103
114
124 void showDataObject(SWMMModelLayer *layer, int objectKind,
125 const QString &name);
126
127public slots:
128
129 void onIdentifyResult(const QList<IdentifyResult> &results);
130
135 void onObjectEditedExternally(const QString &name);
136
140 void onOffsetModeChanged();
141
142signals:
143
151 void propertyChanged(QObject *object,
152 const QString &propertyName,
153 const QVariant &oldValue,
154 const QVariant &newValue);
155
160 void objectEdited(const QString &name);
161
165 void rainfallPlotRequested(const QString &gageId);
166
167private slots:
168 void onLayerComboIndexChanged(int index);
169
176 void onTreeContextMenu(const QPoint &pos);
177
184 void onOpenInEditorClicked();
185
186private:
187 bool eventFilter(QObject *watched, QEvent *event) override;
188
189 void setupUi();
190
196 void refreshStatsSourceCombo();
197
204 void applyStatsSourceToAdapter();
205
211 void refreshAdapterStatValues();
212
213 QTreeView *m_treeView = nullptr;
214 QComboBox *m_layerCombo = nullptr;
215 QComboBox *m_statsSourceCombo = nullptr;
216 class QLabel *m_statsSourceLabel = nullptr;
220 QPushButton *m_openEditorButton = nullptr;
223 QPushButton *m_plotRainGageButton = nullptr;
228 SWMMModelLayer::DataCategory m_dataObjectCategory =
230 QAbstractItemModel *m_model = nullptr;
231 QAbstractItemDelegate *m_delegate = nullptr;
232
233 QList<IdentifyResult> m_lastResults;
234
235 // Slice Z.5.3 / AG.3 — engine binding for typed adapters.
236 SWMMModelLayer *m_swmmLayer = nullptr;
237 SWMMNodePropertyAdapter *m_nodeAdapter = nullptr;
238 SWMMLinkPropertyAdapter *m_linkAdapter = nullptr;
239 SWMMSubcatchPropertyAdapter *m_subcatchAdapter = nullptr;
240 // SWMM_NodeType / SWMM_LinkType the bound adapter subclass was built
241 // for, so an external type conversion (right-click "Convert To") can
242 // detect the kind changed and rebind the correct subclass instead of
243 // refreshing a now-wrong one. -1 when no adapter is bound.
244 int m_nodeAdapterKind = -1;
245 int m_linkAdapterKind = -1;
246 // Slice DA.2 — single cached adapter for the 14 non-spatial Data
247 // Object kinds. Replaced on every selection; the previous instance
248 // is `deleteLater()`d so the QPropertyModel stops referencing it
249 // before the new one binds.
250 SWMMDataObjectPropertyAdapter *m_dataAdapter = nullptr;
251
252 bool m_suppressEditForward = false;
253
256 openswmmvis::OutputStatsRegistry *m_statsRegistry = nullptr;
257
261 QPointer<SWMMResultsLayer> m_activeStatsLayer;
262};
263
264#endif // PROPERTIESPANEL_H
Abstract base class for all layers displayed in the MapCanvas.
Definition openswmmvislayer.h:116
A dock widget that displays and edits object attributes using QPropertyModel.
Definition propertiespanel.h:57
void rainfallPlotRequested(const QString &gageId)
The rain gage "Plot Rainfall…" button was clicked; the main window opens the shared Rainfall Visualiz...
void clear()
Clears the panel.
Definition propertiespanel.cpp:479
void onOffsetModeChanged()
Definition propertiespanel.cpp:557
void propertyChanged(QObject *object, const QString &propertyName, const QVariant &oldValue, const QVariant &newValue)
Emitted when the user changes a property value in the view.
void setProject(SWMMModelLayer *layer)
Definition propertiespanel.cpp:563
~PropertiesPanel() override
Definition propertiespanel.cpp:192
void showIdentifyResults(const QList< IdentifyResult > &results)
Shows the attribute results from an identify operation.
Definition propertiespanel.cpp:451
void onIdentifyResult(const QList< IdentifyResult > &results)
Definition propertiespanel.cpp:497
void showObject(QObject *object, const QString &title={})
Switches the panel to show the Q_PROPERTY attributes of object.
Definition propertiespanel.cpp:425
void onObjectEditedExternally(const QString &name)
Definition propertiespanel.cpp:502
void setActiveResultsLayer(SWMMResultsLayer *layer)
Definition propertiespanel.cpp:1490
void showLayerProperties(OpenSWMMVisLayer *layer)
Shows the editable properties of the given layer.
Definition propertiespanel.cpp:474
void showDataObject(SWMMModelLayer *layer, int objectKind, const QString &name)
Definition propertiespanel.cpp:934
void objectEdited(const QString &name)
void setStatsRegistry(openswmmvis::OutputStatsRegistry *registry)
Definition propertiespanel.cpp:1465
Common base for non-spatial Data Object property adapters.
Definition swmmdataobjectpropertyadapter.h:38
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
@ NumDataCategories
Definition swmmmodellayer.h:196
Definition swmmnodepropertyadapter.h:52
Overlays time-stepped simulation results on the SWMM network geometry.
Definition swmmresultslayer.h:96
Definition swmmsubcatchpropertyadapter.h:28
Definition outputstatsregistry.h:70
int index
Position in m_quadRegions / m_quadReports.
Definition meshgenerator.cpp:153
Definition aquiferprovider.h:21
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
int pos
Definition queryparser.cpp:36
QString name
Definition sectionmodelbuilders.cpp:474
const char * title
Definition snowpackeditordialog.cpp:71
Holds identify results from a single layer.
Definition maptoolidentify.h:24
Map layer that renders an OpenSWMMEngine network (nodes, links, subcatchments, rain gages) and provid...