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
openswmmvis::ui::PatternEditorDialog Class Reference

#include <patterneditordialog.h>

Inheritance diagram for openswmmvis::ui::PatternEditorDialog:
Collaboration diagram for openswmmvis::ui::PatternEditorDialog:

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::PatternProvidercurrentProvider () const noexcept
 Currently-bound provider (or nullptr in CreateNew before submit).
 
QListView * listView () const noexcept
 
QTableView * factorTable () const noexcept
 
PatternEditChartViewchartView () const noexcept
 
PatternFactorTableModeltableModel () 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::PatternProviderduplicateCurrent (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 PatternEditorDialogcreateNew (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
 

Member Enumeration Documentation

◆ Mode

Dialog mode. Edit opens directly bound to a provider; CreateNew shows a name + type prompt up front and transitions to Edit on Create.

Enumerator
Edit 
CreateNew 

Constructor & Destructor Documentation

◆ PatternEditorDialog()

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.

Here is the call graph for this function:

◆ ~PatternEditorDialog()

openswmmvis::ui::PatternEditorDialog::~PatternEditorDialog ( )
overridedefault

Member Function Documentation

◆ arePreviewMarkersVisible()

bool openswmmvis::ui::PatternEditorDialog::arePreviewMarkersVisible ( ) const
inlinenoexcept

True iff slot-centre markers are drawn over the step line.

◆ chartView()

PatternEditChartView * openswmmvis::ui::PatternEditorDialog::chartView ( ) const
inlinenoexcept

◆ closeEvent()

void openswmmvis::ui::PatternEditorDialog::closeEvent ( QCloseEvent *  e)
overrideprotected

◆ createNew()

PatternEditorDialog * openswmmvis::ui::PatternEditorDialog::createNew ( openswmmvis::pattern::PatternRegistry registry,
QUndoStack *  undoStack,
QWidget *  parent = nullptr 
)
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).

◆ currentProvider()

PatternProvider * openswmmvis::ui::PatternEditorDialog::currentProvider ( ) const
noexcept

Currently-bound provider (or nullptr in CreateNew before submit).

Here is the caller graph for this function:

◆ deleteCurrentSilently()

void openswmmvis::ui::PatternEditorDialog::deleteCurrentSilently ( )

Delete the currently selected pattern from the registry. Bypasses the confirmation dialog (test hook + UX).

◆ duplicateCurrent()

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.

◆ factorTable()

QTableView * openswmmvis::ui::PatternEditorDialog::factorTable ( ) const
inlinenoexcept

◆ invokeNew()

void openswmmvis::ui::PatternEditorDialog::invokeNew ( )

Reveal the create-card (mirrors the "+ New" button).

◆ invokeNormalize()

void openswmmvis::ui::PatternEditorDialog::invokeNormalize ( )

Programmatically click Normalize (test hook).

◆ isCreateEnabled()

bool openswmmvis::ui::PatternEditorDialog::isCreateEnabled ( ) const

True iff Create button is enabled.

◆ isStepLinePreview()

bool openswmmvis::ui::PatternEditorDialog::isStepLinePreview ( ) const
inlinenoexcept

True iff the preview is drawn as a step line. False = smooth segments between adjacent slot values.

◆ listView()

QListView * openswmmvis::ui::PatternEditorDialog::listView ( ) const
inlinenoexcept

◆ mode()

Mode openswmmvis::ui::PatternEditorDialog::mode ( ) const
inlinenoexcept

Current mode.

◆ openForPattern()

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.

◆ patternListModel()

QStandardItemModel * openswmmvis::ui::PatternEditorDialog::patternListModel ( ) const
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.

◆ pendingName()

QString openswmmvis::ui::PatternEditorDialog::pendingName ( ) const

CreateNew-mode: name in the create-card. Empty in Edit mode.

◆ pendingType()

int openswmmvis::ui::PatternEditorDialog::pendingType ( ) const

CreateNew-mode: type currently selected in the create-card combo.

◆ pickPattern()

QString openswmmvis::ui::PatternEditorDialog::pickPattern ( openswmmvis::pattern::PatternRegistry registry,
QUndoStack *  undoStack,
const QString &  initialName,
QWidget *  parent = nullptr 
)
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.

Here is the call graph for this function:

◆ previewLineSeries()

QLineSeries * openswmmvis::ui::PatternEditorDialog::previewLineSeries ( ) const
inlinenoexcept

◆ previewMarkerSeries()

QScatterSeries * openswmmvis::ui::PatternEditorDialog::previewMarkerSeries ( ) const
inlinenoexcept

◆ renameCurrent()

bool openswmmvis::ui::PatternEditorDialog::renameCurrent ( const QString &  newName)

Rename the currently selected pattern. Returns false if no selection or the new name collides.

◆ searchEdit()

QLineEdit * openswmmvis::ui::PatternEditorDialog::searchEdit ( ) const
inlinenoexcept

◆ setPreviewMarkersVisible()

void openswmmvis::ui::PatternEditorDialog::setPreviewMarkersVisible ( bool  visible)

Toggle slot-centre markers on/off.

◆ setStepLinePreview()

void openswmmvis::ui::PatternEditorDialog::setStepLinePreview ( bool  stepLine)

Toggle the preview between step-line and smooth-line.

◆ submitCreateNew()

void openswmmvis::ui::PatternEditorDialog::submitCreateNew ( )

Programmatically click Create.

◆ tableModel()

PatternFactorTableModel * openswmmvis::ui::PatternEditorDialog::tableModel ( ) const
inlinenoexcept

The documentation for this class was generated from the following files: