![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <profileplotwidget.h>
Classes | |
| struct | LayerToggles |
| Label / terrain / orientation switches and per-output user preferences (currentHglLine, currentHglFill, maxHglBand, etc.). More... | |
| struct | SeriesBinding |
| One elevation-axis curve to render: a (results-layer × output kind) pair with resolved style and pre-computed data. More... | |
| struct | Surface2DSample |
One station of the 2D inundation overlay: the active 2D results layer's water surface sampled where the path crosses the mesh. chainage is REAL path chainage (converted to virtual x when painting, like terrain samples). bed is the mesh bed elevation at the station; wse is bed + interpolated depth, or NaN when the station is dry / off-mesh / has no data (a gap). More... | |
Public Types | |
| enum class | Mode { Identify = 0 , Pan , ZoomIn , ZoomOut } |
| enum class | AxisEdge { None = 0 , XMinimum , XMaximum , YMinimum , YMaximum } |
Signals | |
| void | visibleXRangeChanged (double vxMin, double vxMax) |
| Emitted whenever the visible x-range (virtual chainage) changes — fit, zoom, pan, wheel, axis-edge edit, or a new path/series recomputing the extent. Emitted at most once per change (values are compared against the last emission). Consumed by the attribute-tracks pane to stay column-aligned. | |
| void | nodeRightClicked (int pathNodeIdx, const QPoint &globalPos) |
| Emitted on right-click over a node glyph; consumed by Stage 6 to pop an edit-in-place context menu. | |
| void | linkRightClicked (int pathLinkIdx, const QPoint &globalPos) |
| Emitted on right-click over a link glyph. | |
| void | backgroundRightClicked (const QPoint &globalPos) |
| Emitted on right-click that hits neither a node nor a link. Hosts use this to show a context menu whose element-specific items (e.g. "Zoom to on map") are disabled but other items (e.g. "Properties…") remain available. | |
| void | nodeClicked (int pathNodeIdx) |
| Emitted on left-click over a node glyph. Consumed by ProfilePlotDialog to drive the main-map selection. | |
| void | linkClicked (int pathLinkIdx) |
| Emitted on left-click over a conduit / non-conduit glyph. | |
| void | nodeDoubleClicked (int pathNodeIdx) |
| Emitted on left double-click over a node glyph. Hosts use this to zoom the main map to the element. | |
| void | linkDoubleClicked (int pathLinkIdx) |
| Emitted on left double-click over a link glyph. | |
| void | backgroundClicked () |
| Emitted on left-click in Identify mode when the click misses every node and link glyph. Hosts use this to clear the selection so blank-area clicks act as a deselect. | |
Public Member Functions | |
| ProfilePlotWidget (QWidget *parent=nullptr) | |
| void | setPath (const ProfileBuilder::PathStatic &path) |
| Sets the static path + chainage to render. Triggers a repaint. | |
| void | setSeries (const QVector< SeriesBinding > &series) |
| Replaces all rendered series at once. Order matters only for z-order between equal-kind series (e.g. when overlaying HGL from two models, the later series paints on top). | |
| const QVector< SeriesBinding > & | series () const |
| void | setCurrentPeriod (int seriesIdx, int period) |
Selects the time-step shown by current-time series (HGL / EGL / WaterSurface). seriesIdx is the source-of-truth for the animation cursor; other current-time series advance in lock- step. Pass -1 for period to hide the animation lines. | |
| void | setCurrentDateTime (const QDateTime &dt) |
| Sets the wall-clock datetime corresponding to the current period. Used by the on-plot timestamp overlay. Passing an invalid QDateTime hides the overlay. | |
| void | setCurrentPeriod (int period) |
Convenience overload: applies period to the primary (series index 0). Per-source time-mapping is the dialog's responsibility — the widget doesn't translate dates. | |
| void | setLayerToggles (const LayerToggles &toggles) |
| LayerToggles | layerToggles () const |
| void | setSurface2DSamples (const QVector< Surface2DSample > &samples) |
Replaces the 2D inundation overlay stations (static geometry + the current frame's WSE). Pass an empty vector to clear. The host re-sends the vector with fresh wse values on every animation tick; ProfilePlotOptions::show2DInundation gates drawing. Widens the y-extent to the wettest station. | |
| const QVector< Surface2DSample > & | surface2DSamples () const |
| void | setOptions (ProfilePlotOptions *options) |
Binds a ProfilePlotOptions object — the widget's theming (per-type fills/outlines, soil colours, line widths, legend position/font/opacity) is read from it. Pass nullptr to fall back to the hardcoded defaults. The widget connects to changed() and repaints automatically. | |
| ProfilePlotOptions * | options () const |
| void | setAxisLabels (const QString &xLabel, const QString &yLabel) |
| Sets axis labels for the plot frame. Defaults to "Chainage" / "Elevation" if not set. | |
| int | nodeIndexAt (const QPoint &widgetPos) const |
Hit-test: returns the path-node index whose manhole glyph is nearest widgetPos within a reasonable tolerance, or -1. Virtual junctions count — their dashed rectangle shares the manhole footprint. Used by Stage 6's edit-in-place context menu. | |
| int | linkIndexAt (const QPoint &widgetPos) const |
Hit-test: returns the path-link index whose conduit / glyph passes through widgetPos within a reasonable tolerance, or -1. | |
| void | setMode (Mode m) |
| Mode | mode () const |
| AxisEdge | axisEdgeAt (const QPoint &widgetPos) const |
| bool | setAxisEdgeValue (AxisEdge edge, double value) |
| QRectF | visibleDataRange () const |
| void | setVisibleXRange (double vxMin, double vxMax) |
| const QVector< double > & | virtualChainageTable () const |
| double | virtualToRealChainage (double vx) const |
| void | zoomBy (double factor) |
| void | fitToExtent () |
| void | setSelectedElementNames (const QStringList &names) |
| Marks a set of element names (nodes or links) as selected so the matching glyphs render with a highlight outline. Names not on the path are silently ignored. Pass an empty list to clear all highlights. | |
Static Public Member Functions | |
| static int | chartLeftMarginPx () |
| static int | chartRightMarginPx () |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) override |
| void | resizeEvent (QResizeEvent *event) override |
| void | mousePressEvent (QMouseEvent *event) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| void | mouseDoubleClickEvent (QMouseEvent *event) override |
| void | wheelEvent (QWheelEvent *event) override |
|
strong |
|
strong |
|
explicit |
| ProfilePlotWidget::AxisEdge ProfilePlotWidget::axisEdgeAt | ( | const QPoint & | widgetPos | ) | const |
|
signal |
Emitted on left-click in Identify mode when the click misses every node and link glyph. Hosts use this to clear the selection so blank-area clicks act as a deselect.
|
signal |
Emitted on right-click that hits neither a node nor a link. Hosts use this to show a context menu whose element-specific items (e.g. "Zoom to on map") are disabled but other items (e.g. "Properties…") remain available.
|
static |
The fixed horizontal gutters of the plot area, in pixels. The tracks pane adopts the same values so data columns line up.
|
static |
| void ProfilePlotWidget::fitToExtent | ( | ) |
Reset the view rect to the auto-computed data extent (Fit).
| ProfilePlotWidget::LayerToggles ProfilePlotWidget::layerToggles | ( | ) | const |
|
signal |
Emitted on left-click over a conduit / non-conduit glyph.
|
signal |
Emitted on left double-click over a link glyph.
| int ProfilePlotWidget::linkIndexAt | ( | const QPoint & | widgetPos | ) | const |
Hit-test: returns the path-link index whose conduit / glyph passes through widgetPos within a reasonable tolerance, or -1.
|
signal |
Emitted on right-click over a link glyph.
|
inline |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
signal |
Emitted on left-click over a node glyph. Consumed by ProfilePlotDialog to drive the main-map selection.
|
signal |
Emitted on left double-click over a node glyph. Hosts use this to zoom the main map to the element.
| int ProfilePlotWidget::nodeIndexAt | ( | const QPoint & | widgetPos | ) | const |
Hit-test: returns the path-node index whose manhole glyph is nearest widgetPos within a reasonable tolerance, or -1. Virtual junctions count — their dashed rectangle shares the manhole footprint. Used by Stage 6's edit-in-place context menu.
|
signal |
Emitted on right-click over a node glyph; consumed by Stage 6 to pop an edit-in-place context menu.
|
inline |
|
overrideprotected |
|
overrideprotected |
|
inline |
| void ProfilePlotWidget::setAxisLabels | ( | const QString & | xLabel, |
| const QString & | yLabel | ||
| ) |
Sets axis labels for the plot frame. Defaults to "Chainage" / "Elevation" if not set.
| void ProfilePlotWidget::setCurrentDateTime | ( | const QDateTime & | dt | ) |
Sets the wall-clock datetime corresponding to the current period. Used by the on-plot timestamp overlay. Passing an invalid QDateTime hides the overlay.
| void ProfilePlotWidget::setCurrentPeriod | ( | int | period | ) |
Convenience overload: applies period to the primary (series index 0). Per-source time-mapping is the dialog's responsibility — the widget doesn't translate dates.
| void ProfilePlotWidget::setCurrentPeriod | ( | int | seriesIdx, |
| int | period | ||
| ) |
Selects the time-step shown by current-time series (HGL / EGL / WaterSurface). seriesIdx is the source-of-truth for the animation cursor; other current-time series advance in lock- step. Pass -1 for period to hide the animation lines.
| void ProfilePlotWidget::setLayerToggles | ( | const LayerToggles & | toggles | ) |
| void ProfilePlotWidget::setMode | ( | Mode | m | ) |
| void ProfilePlotWidget::setOptions | ( | ProfilePlotOptions * | options | ) |
Binds a ProfilePlotOptions object — the widget's theming (per-type fills/outlines, soil colours, line widths, legend position/font/opacity) is read from it. Pass nullptr to fall back to the hardcoded defaults. The widget connects to changed() and repaints automatically.
| void ProfilePlotWidget::setPath | ( | const ProfileBuilder::PathStatic & | path | ) |
Sets the static path + chainage to render. Triggers a repaint.
| void ProfilePlotWidget::setSelectedElementNames | ( | const QStringList & | names | ) |
Marks a set of element names (nodes or links) as selected so the matching glyphs render with a highlight outline. Names not on the path are silently ignored. Pass an empty list to clear all highlights.
| void ProfilePlotWidget::setSeries | ( | const QVector< SeriesBinding > & | series | ) |
Replaces all rendered series at once. Order matters only for z-order between equal-kind series (e.g. when overlaying HGL from two models, the later series paints on top).
| void ProfilePlotWidget::setSurface2DSamples | ( | const QVector< Surface2DSample > & | samples | ) |
Replaces the 2D inundation overlay stations (static geometry + the current frame's WSE). Pass an empty vector to clear. The host re-sends the vector with fresh wse values on every animation tick; ProfilePlotOptions::show2DInundation gates drawing. Widens the y-extent to the wettest station.
Sets the visible x-range (virtual chainage). Y is untouched. Used by the synced attribute-tracks pane to push its own pan/zoom back up. Emits visibleXRangeChanged() (once) when the range actually moves.
|
inline |
|
inline |
Maps a virtual x back to real chainage — public so the tracks pane can label its shared x-axis with real stations, exactly like this widget's own bottom ticks.
| QRectF ProfilePlotWidget::visibleDataRange | ( | ) | const |
Emitted whenever the visible x-range (virtual chainage) changes — fit, zoom, pan, wheel, axis-edge edit, or a new path/series recomputing the extent. Emitted at most once per change (values are compared against the last emission). Consumed by the attribute-tracks pane to stay column-aligned.
|
overrideprotected |
| void ProfilePlotWidget::zoomBy | ( | double | factor | ) |
Zoom the view rect by factor around its centre. < 1 zooms in.