![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <mesheditingtoolbar.h>
Public Types | |
| using | PickerFn = std::function< QString(const QString ¤tName)> |
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. | |
| SWMM2DMeshLayer * | activeMesh () const |
Protected Member Functions | |
| void | showEvent (QShowEvent *event) override |
| Flushes a node-list refresh that was deferred while hidden. | |
| 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)".
| 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.
| using MeshEditingToolbar::PickerFn = std::function<QString(const QString ¤tName)> |
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).
|
explicit |
|
overridedefault |
|
inline |
| 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.
| 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).
| 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.
| void MeshEditingToolbar::addToolSeparator | ( | ) |
| 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.
|
inline |
The cell-selection info label (created in the ctor; placed by SWMMVis right after the Select-2D-Cells action via addToolWidget).
| 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.
| QWidget * MeshEditingToolbar::cellTagWidget | ( | ) | const |
| QByteArray MeshEditingToolbar::currentCellParamKey | ( | ) | const |
Key of the parameter currently shown in the cell editor (mesh::CellParamSpec::key). Empty when the editor is absent.
|
signal |
Emitted when the user toggles the Edit Edge action.
|
signal |
Emitted when the user toggles the Edit Vertex action. SWMMVis hooks this to activate / deactivate MapToolMeshSelectVertex on the corresponding project window.
|
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.
| 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).
| 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.
| void MeshEditingToolbar::refreshBCNameLists | ( | ) |
| void MeshEditingToolbar::refreshNodeList | ( | ) |
| void MeshEditingToolbar::setCellEditorActions | ( | QAction * | paramAct, |
| QAction * | tagAct | ||
| ) |
|
inline |
| 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.
|
inline |
|
inline |
Lister of couplable SWMM node ids for the coupled-node dropdown.
|
inline |
|
inline |
|
inline |
|
inline |
|
overrideprotected |
Flushes a node-list refresh that was deferred while hidden.