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
MeshEditingToolbar Class Reference

#include <mesheditingtoolbar.h>

Inheritance diagram for MeshEditingToolbar:
Collaboration diagram for MeshEditingToolbar:

Public Types

using PickerFn = std::function< QString(const QString &currentName)>
 Install a callback that opens a timeseries picker dialog and returns the picked name (empty = user cancelled). Per feedback_data_object_pickers, the implementation must dispatch through TimeseriesEditorDialog::pickTimeseries. SWMMVis sets this; the toolbar stays decoupled from the registries. Same shape for the curve picker (RatingCurve).
 
using ListerFn = std::function< QStringList()>
 Install lister callbacks that return the available timeseries / curve names for the project. The TS/curve BC pages populate their QComboBox from these so the user can pick an existing object without opening the CRUD dialog. Empty list → combobox shows only "(none)".
 
using NodeLocatorFn = std::function< QVector< QPair< QString, QPointF > >()>
 Locator of SWMM node ids + map coordinates ([COORDINATES], same CRS as the mesh vertices) for the Auto-couple action.
 

Signals

void editVertexToggled (bool active)
 Emitted when the user toggles the Edit Vertex action. SWMMVis hooks this to activate / deactivate MapToolMeshSelectVertex on the corresponding project window.
 
void editEdgeToggled (bool active)
 Emitted when the user toggles the Edit Edge action.
 
void hoverElevationChanged (double z, bool finite)
 Mirrors the mesh hover-Z probe outward (finite false = cursor off-mesh). SWMMVis feeds this into the status-bar coordinate readout so the elevation survives the toolbar's tab-scoped visibility.
 

Public Member Functions

 MeshEditingToolbar (const QString &title, QWidget *parent=nullptr)
 
 ~MeshEditingToolbar () override
 
void rebindCanvas (MapCanvas *canvas)
 Bind the toolbar to a new project canvas. Disconnects from the previous canvas's signals, populates the mesh combo from the new canvas's SWMM2DMeshLayer instances, and re-establishes the active-mesh probe / selection subscriptions. Pass nullptr when no project is active (clears + disables).
 
void rebindSelectionManager (SelectionManager *sel)
 Bind the toolbar to a project's SelectionManager so the spinbox / edge-info label update when selection changes (e.g. from a future Property Browser tab or an Attribute Table click). Pass nullptr to detach.
 
void setStageTimeseriesPicker (PickerFn fn)
 
void setFlowTimeseriesPicker (PickerFn fn)
 
void setRatingCurvePicker (PickerFn fn)
 
void setTimeseriesLister (ListerFn fn)
 
void setCurveLister (ListerFn fn)
 
void setNodeLister (ListerFn fn)
 Lister of couplable SWMM node ids for the coupled-node dropdown.
 
void setNodeLocator (NodeLocatorFn fn)
 
void refreshBCNameLists ()
 
void refreshNodeList ()
 
void addToolAction (QAction *action)
 Add a trailing tool action (e.g. Pick 2D Cells / Trace Profile) to the left of the expanding spacer so it stays visible. Use this instead of QToolBar::addAction, which appends after the spacer and pushes the action off the right edge into the overflow chevron.
 
void addToolSeparator ()
 
void addProfileAction (QAction *action)
 Add the mesh profile-plot action to its standalone "Profile" ribbon group (iteration 4 — kept apart from the cell-selection cluster whose width changes contextually).
 
QAction * addToolWidget (QWidget *widget)
 Add a trailing widget (e.g. the cell-selection info label) to the left of the expanding spacer, mirroring addToolAction. Returns the QAction handle for the embedded widget.
 
QLabel * cellInfoLabel () const
 The cell-selection info label (created in the ctor; placed by SWMMVis right after the Select-2D-Cells action via addToolWidget).
 
QWidget * cellParamEditorWidget () const
 Per-cell editor widgets. The first is a parameter page — a combo naming the attribute to prescribe (Manning's n, initial depth, …, from mesh::cellParamSpecs) beside the value editor; the second is the descriptive tag field.
 
QWidget * cellTagWidget () const
 
void setCellEditorActions (QAction *paramAct, QAction *tagAct)
 
void addCellAction (QAction *action)
 Place a cell-scoped action (currently "Assign Infiltration to Selection…") in the 2D-cell cluster, beside the param / tag editors.
 
QByteArray currentCellParamKey () const
 Key of the parameter currently shown in the cell editor (mesh::CellParamSpec::key). Empty when the editor is absent.
 
void setDepthUnitLabel (const QString &label)
 Project depth unit ("ft" / "m") shown on length-valued cell parameters. Set by SWMMVis on each project-window switch.
 
SWMM2DMeshLayeractiveMesh () const
 

Protected Member Functions

void showEvent (QShowEvent *event) override
 Flushes a node-list refresh that was deferred while hidden.
 

Member Typedef Documentation

◆ ListerFn

using MeshEditingToolbar::ListerFn = std::function<QStringList()>

Install lister callbacks that return the available timeseries / curve names for the project. The TS/curve BC pages populate their QComboBox from these so the user can pick an existing object without opening the CRUD dialog. Empty list → combobox shows only "(none)".

◆ NodeLocatorFn

using MeshEditingToolbar::NodeLocatorFn = std::function<QVector<QPair<QString, QPointF> >()>

Locator of SWMM node ids + map coordinates ([COORDINATES], same CRS as the mesh vertices) for the Auto-couple action.

◆ PickerFn

using MeshEditingToolbar::PickerFn = std::function<QString(const QString &currentName)>

Install a callback that opens a timeseries picker dialog and returns the picked name (empty = user cancelled). Per feedback_data_object_pickers, the implementation must dispatch through TimeseriesEditorDialog::pickTimeseries. SWMMVis sets this; the toolbar stays decoupled from the registries. Same shape for the curve picker (RatingCurve).

Constructor & Destructor Documentation

◆ MeshEditingToolbar()

MeshEditingToolbar::MeshEditingToolbar ( const QString &  title,
QWidget *  parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~MeshEditingToolbar()

MeshEditingToolbar::~MeshEditingToolbar ( )
overridedefault

Member Function Documentation

◆ activeMesh()

SWMM2DMeshLayer * MeshEditingToolbar::activeMesh ( ) const
inline

◆ addCellAction()

void MeshEditingToolbar::addCellAction ( QAction *  action)

Place a cell-scoped action (currently "Assign Infiltration to Selection…") in the 2D-cell cluster, beside the param / tag editors.

Enabled only while at least one cell is selected — the dialog it opens reads the selection, so offering it with nothing selected is offering a dead end. Disabled rather than hidden (unlike the editor widgets) because the same QAction is mirrored into the Model ▸ Mesh menu.

◆ addProfileAction()

void MeshEditingToolbar::addProfileAction ( QAction *  action)

Add the mesh profile-plot action to its standalone "Profile" ribbon group (iteration 4 — kept apart from the cell-selection cluster whose width changes contextually).

◆ addToolAction()

void MeshEditingToolbar::addToolAction ( QAction *  action)

Add a trailing tool action (e.g. Pick 2D Cells / Trace Profile) to the left of the expanding spacer so it stays visible. Use this instead of QToolBar::addAction, which appends after the spacer and pushes the action off the right edge into the overflow chevron.

◆ addToolSeparator()

void MeshEditingToolbar::addToolSeparator ( )

◆ addToolWidget()

QAction * MeshEditingToolbar::addToolWidget ( QWidget *  widget)

Add a trailing widget (e.g. the cell-selection info label) to the left of the expanding spacer, mirroring addToolAction. Returns the QAction handle for the embedded widget.

◆ cellInfoLabel()

QLabel * MeshEditingToolbar::cellInfoLabel ( ) const
inline

The cell-selection info label (created in the ctor; placed by SWMMVis right after the Select-2D-Cells action via addToolWidget).

◆ cellParamEditorWidget()

QWidget * MeshEditingToolbar::cellParamEditorWidget ( ) const

Per-cell editor widgets. The first is a parameter page — a combo naming the attribute to prescribe (Manning's n, initial depth, …, from mesh::cellParamSpecs) beside the value editor; the second is the descriptive tag field.

Created in the ctor but NOT placed — SWMMVis positions them right after the cell info label so they sit in the 2D-cell group, then hands the embedding QActions back via setCellEditorActions() so the toolbar can hide them when no cell is selected.

◆ cellTagWidget()

QWidget * MeshEditingToolbar::cellTagWidget ( ) const

◆ currentCellParamKey()

QByteArray MeshEditingToolbar::currentCellParamKey ( ) const

Key of the parameter currently shown in the cell editor (mesh::CellParamSpec::key). Empty when the editor is absent.

◆ editEdgeToggled

void MeshEditingToolbar::editEdgeToggled ( bool  active)
signal

Emitted when the user toggles the Edit Edge action.

Here is the caller graph for this function:

◆ editVertexToggled

void MeshEditingToolbar::editVertexToggled ( bool  active)
signal

Emitted when the user toggles the Edit Vertex action. SWMMVis hooks this to activate / deactivate MapToolMeshSelectVertex on the corresponding project window.

Here is the caller graph for this function:

◆ hoverElevationChanged

void MeshEditingToolbar::hoverElevationChanged ( double  z,
bool  finite 
)
signal

Mirrors the mesh hover-Z probe outward (finite false = cursor off-mesh). SWMMVis feeds this into the status-bar coordinate readout so the elevation survives the toolbar's tab-scoped visibility.

◆ rebindCanvas()

void MeshEditingToolbar::rebindCanvas ( MapCanvas canvas)

Bind the toolbar to a new project canvas. Disconnects from the previous canvas's signals, populates the mesh combo from the new canvas's SWMM2DMeshLayer instances, and re-establishes the active-mesh probe / selection subscriptions. Pass nullptr when no project is active (clears + disables).

Here is the call graph for this function:

◆ rebindSelectionManager()

void MeshEditingToolbar::rebindSelectionManager ( SelectionManager sel)

Bind the toolbar to a project's SelectionManager so the spinbox / edge-info label update when selection changes (e.g. from a future Property Browser tab or an Attribute Table click). Pass nullptr to detach.

Here is the call graph for this function:

◆ refreshBCNameLists()

void MeshEditingToolbar::refreshBCNameLists ( )
Here is the caller graph for this function:

◆ refreshNodeList()

void MeshEditingToolbar::refreshNodeList ( )
Here is the caller graph for this function:

◆ setCellEditorActions()

void MeshEditingToolbar::setCellEditorActions ( QAction *  paramAct,
QAction *  tagAct 
)

◆ setCurveLister()

void MeshEditingToolbar::setCurveLister ( ListerFn  fn)
inline

◆ setDepthUnitLabel()

void MeshEditingToolbar::setDepthUnitLabel ( const QString &  label)

Project depth unit ("ft" / "m") shown on length-valued cell parameters. Set by SWMMVis on each project-window switch.

◆ setFlowTimeseriesPicker()

void MeshEditingToolbar::setFlowTimeseriesPicker ( PickerFn  fn)
inline

◆ setNodeLister()

void MeshEditingToolbar::setNodeLister ( ListerFn  fn)
inline

Lister of couplable SWMM node ids for the coupled-node dropdown.

◆ setNodeLocator()

void MeshEditingToolbar::setNodeLocator ( NodeLocatorFn  fn)
inline

◆ setRatingCurvePicker()

void MeshEditingToolbar::setRatingCurvePicker ( PickerFn  fn)
inline

◆ setStageTimeseriesPicker()

void MeshEditingToolbar::setStageTimeseriesPicker ( PickerFn  fn)
inline

◆ setTimeseriesLister()

void MeshEditingToolbar::setTimeseriesLister ( ListerFn  fn)
inline

◆ showEvent()

void MeshEditingToolbar::showEvent ( QShowEvent *  event)
overrideprotected

Flushes a node-list refresh that was deferred while hidden.

Here is the call graph for this function:

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