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
initialqualitydialog.h
Go to the documentation of this file.
1
25#ifndef OPENSWMM_UI_DIALOGS_INITIALQUALITYDIALOG_H
26#define OPENSWMM_UI_DIALOGS_INITIALQUALITYDIALOG_H
27
28#include <openswmm/engine/openswmm_engine.h>
29
30#include <QDialog>
31#include <QSet>
32
33class QTableWidget;
34class QLabel;
35class QLineEdit;
36
37namespace OpenSWMMVis
38{
39
43class InitialQualityDialog : public QDialog
44{
45 Q_OBJECT
46
47public:
48 explicit InitialQualityDialog(SWMM_Engine engine,
49 QWidget *parent = nullptr);
50 ~InitialQualityDialog() override = default;
51
58 void setElementScope(int isLink, const QString &elementName);
59
61 [[nodiscard]] bool wroteAnyChanges() const { return m_wroteAnyChanges; }
62
65 [[nodiscard]] int lastWriteCount() const { return m_lastWriteCount; }
66
67private slots:
68 void onAddRow();
69 void onRemoveRow();
70 void onAccept();
72 void onImportCsv();
73
74private:
75 void buildUi();
76 void readFromEngine();
77 int writeToEngine();
78 void populateElementCombo(int row);
79
80 SWMM_Engine m_engine = nullptr;
81 QTableWidget *m_table = nullptr;
82 QLabel *m_hintLabel = nullptr;
85 QLineEdit *m_fileEdit = nullptr;
86 QSet<int> m_fileRows;
87 bool m_wroteAnyChanges = false;
88 int m_lastWriteCount = 0;
89 int m_scopeIsLink = -1;
90 int m_scopeElemIdx = -1;
91};
92
93} // namespace OpenSWMMVis
94
95#endif // OPENSWMM_UI_DIALOGS_INITIALQUALITYDIALOG_H
Non-modal editor for the per-element initial-quality table.
Definition initialqualitydialog.h:44
bool wroteAnyChanges() const
True once OK has written at least one change to the engine.
Definition initialqualitydialog.h:61
int lastWriteCount() const
Number of engine writes the last OK performed (0 when the dialog was accepted with no edits)....
Definition initialqualitydialog.h:65
~InitialQualityDialog() override=default
void setElementScope(int isLink, const QString &elementName)
Restrict the dialog to one node (isLink 0) or link (isLink 1). The Scope / Element columns collapse,...
Definition initialqualitydialog.cpp:158
Definition gwsourcesummary.h:21
void * SWMM_Engine
Definition objectdefaultsapplier.h:19
QVector< int > parent
union-find
Definition pslgminsize.cpp:176