![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <patterneditordialog.h>
Public Types | |
| enum class | Mode { Edit , CreateNew } |
Dialog mode. Edit opens directly bound to a provider; CreateNew shows a name + type prompt up front and transitions to Edit on Create. More... | |
Public Member Functions | |
| PatternEditorDialog (openswmmvis::pattern::PatternRegistry *registry, QUndoStack *undoStack, QWidget *parent=nullptr) | |
Edit-mode entry point: bind to the registry and select initial (or the first pattern if null/missing). The dialog is non-modal and re-bindable via the list-view selection. | |
| ~PatternEditorDialog () override | |
| void | openForPattern (const QString &name) |
Bring the dialog forward and select name in the list (no-op if absent). Convenience for the Object Browser double-click path. | |
| Mode | mode () const noexcept |
| Current mode. | |
| openswmmvis::pattern::PatternProvider * | currentProvider () const noexcept |
| Currently-bound provider (or nullptr in CreateNew before submit). | |
| QListView * | listView () const noexcept |
| QTableView * | factorTable () const noexcept |
| PatternEditChartView * | chartView () const noexcept |
| PatternFactorTableModel * | tableModel () const noexcept |
| QLineSeries * | previewLineSeries () const noexcept |
| QScatterSeries * | previewMarkerSeries () const noexcept |
| QLineEdit * | searchEdit () const noexcept |
| QStandardItemModel * | patternListModel () const noexcept |
| The source (unfiltered) list model. Tests cast to QStandardItemModel to inspect row count and item text; the view itself binds to a QSortFilterProxyModel so the search edit can hide rows. | |
| QString | pendingName () const |
| CreateNew-mode: name in the create-card. Empty in Edit mode. | |
| int | pendingType () const |
| CreateNew-mode: type currently selected in the create-card combo. | |
| bool | isCreateEnabled () const |
| True iff Create button is enabled. | |
| void | submitCreateNew () |
| Programmatically click Create. | |
| void | invokeNormalize () |
| Programmatically click Normalize (test hook). | |
| void | invokeNew () |
| Reveal the create-card (mirrors the "+ New" button). | |
| bool | renameCurrent (const QString &newName) |
| Rename the currently selected pattern. Returns false if no selection or the new name collides. | |
| openswmmvis::pattern::PatternProvider * | duplicateCurrent (const QString &newName) |
Clone the currently selected pattern under newName. Returns the new provider (also bound in the dialog), or nullptr on failure. Used by the Duplicate button and as a test hook. | |
| void | deleteCurrentSilently () |
| Delete the currently selected pattern from the registry. Bypasses the confirmation dialog (test hook + UX). | |
| bool | isStepLinePreview () const noexcept |
| True iff the preview is drawn as a step line. False = smooth segments between adjacent slot values. | |
| void | setStepLinePreview (bool stepLine) |
| Toggle the preview between step-line and smooth-line. | |
| bool | arePreviewMarkersVisible () const noexcept |
| True iff slot-centre markers are drawn over the step line. | |
| void | setPreviewMarkersVisible (bool visible) |
| Toggle slot-centre markers on/off. | |
Static Public Member Functions | |
| static PatternEditorDialog * | createNew (openswmmvis::pattern::PatternRegistry *registry, QUndoStack *undoStack, QWidget *parent=nullptr) |
| Slice BM.0-Add-New factory: same dialog, started in CreateNew mode. Caller owns the returned dialog (use Qt::WA_DeleteOnClose for fire-and-forget). | |
| static QString | pickPattern (openswmmvis::pattern::PatternRegistry *registry, QUndoStack *undoStack, const QString &initialName, QWidget *parent=nullptr) |
Modal pick / create / edit entry point for callers that round-trip a pattern selection inline (e.g. NodeCompoundEditDialog inflow / DWF pickers). Empty initialName → CreateNew mode; otherwise → Edit mode pre-selecting that pattern. Returns the name of the pattern currently selected on close, or empty if no commit happened. All edits persist through the registry/provider MVC layer regardless of which button closes the dialog. | |
Protected Member Functions | |
| void | closeEvent (QCloseEvent *e) override |
|
strong |
| openswmmvis::ui::PatternEditorDialog::PatternEditorDialog | ( | openswmmvis::pattern::PatternRegistry * | registry, |
| QUndoStack * | undoStack, | ||
| QWidget * | parent = nullptr |
||
| ) |
Edit-mode entry point: bind to the registry and select initial (or the first pattern if null/missing). The dialog is non-modal and re-bindable via the list-view selection.
|
overridedefault |
|
inlinenoexcept |
True iff slot-centre markers are drawn over the step line.
|
inlinenoexcept |
|
overrideprotected |
|
static |
Slice BM.0-Add-New factory: same dialog, started in CreateNew mode. Caller owns the returned dialog (use Qt::WA_DeleteOnClose for fire-and-forget).
|
noexcept |
Currently-bound provider (or nullptr in CreateNew before submit).
| void openswmmvis::ui::PatternEditorDialog::deleteCurrentSilently | ( | ) |
Delete the currently selected pattern from the registry. Bypasses the confirmation dialog (test hook + UX).
| PatternProvider * openswmmvis::ui::PatternEditorDialog::duplicateCurrent | ( | const QString & | newName | ) |
Clone the currently selected pattern under newName. Returns the new provider (also bound in the dialog), or nullptr on failure. Used by the Duplicate button and as a test hook.
|
inlinenoexcept |
| void openswmmvis::ui::PatternEditorDialog::invokeNew | ( | ) |
Reveal the create-card (mirrors the "+ New" button).
| void openswmmvis::ui::PatternEditorDialog::invokeNormalize | ( | ) |
Programmatically click Normalize (test hook).
| bool openswmmvis::ui::PatternEditorDialog::isCreateEnabled | ( | ) | const |
True iff Create button is enabled.
|
inlinenoexcept |
True iff the preview is drawn as a step line. False = smooth segments between adjacent slot values.
|
inlinenoexcept |
|
inlinenoexcept |
Current mode.
| void openswmmvis::ui::PatternEditorDialog::openForPattern | ( | const QString & | name | ) |
Bring the dialog forward and select name in the list (no-op if absent). Convenience for the Object Browser double-click path.
|
inlinenoexcept |
The source (unfiltered) list model. Tests cast to QStandardItemModel to inspect row count and item text; the view itself binds to a QSortFilterProxyModel so the search edit can hide rows.
| QString openswmmvis::ui::PatternEditorDialog::pendingName | ( | ) | const |
CreateNew-mode: name in the create-card. Empty in Edit mode.
| int openswmmvis::ui::PatternEditorDialog::pendingType | ( | ) | const |
CreateNew-mode: type currently selected in the create-card combo.
|
static |
Modal pick / create / edit entry point for callers that round-trip a pattern selection inline (e.g. NodeCompoundEditDialog inflow / DWF pickers). Empty initialName → CreateNew mode; otherwise → Edit mode pre-selecting that pattern. Returns the name of the pattern currently selected on close, or empty if no commit happened. All edits persist through the registry/provider MVC layer regardless of which button closes the dialog.
|
inlinenoexcept |
|
inlinenoexcept |
| bool openswmmvis::ui::PatternEditorDialog::renameCurrent | ( | const QString & | newName | ) |
Rename the currently selected pattern. Returns false if no selection or the new name collides.
|
inlinenoexcept |
| void openswmmvis::ui::PatternEditorDialog::setPreviewMarkersVisible | ( | bool | visible | ) |
Toggle slot-centre markers on/off.
| void openswmmvis::ui::PatternEditorDialog::setStepLinePreview | ( | bool | stepLine | ) |
Toggle the preview between step-line and smooth-line.
| void openswmmvis::ui::PatternEditorDialog::submitCreateNew | ( | ) |
Programmatically click Create.
|
inlinenoexcept |