![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Renders an ordered list of candidate paths over the map. More...
#include <profilepathoverlay.h>
Public Types | |
| using | SceneToPixel = std::function< QPointF(const QPointF &)> |
| Map scene point → device pixel, supplied by the canvas. | |
Public Member Functions | |
| ProfilePathOverlay (SWMMModelLayer *model, QGraphicsItem *parent=nullptr) | |
| void | setPaths (const QVector< ProfileRouter::Path > &paths) |
| Replaces the displayed candidate paths. Rebuilds child items. | |
| void | setHighlightedPath (int index) |
Promotes path index to full opacity; dims the rest. Pass -1 to show all candidates at equal weight. | |
| void | setEndpoints (int startEngineNodeIdx, int endEngineNodeIdx) |
Marks two endpoints with pulsing halos so the user can see which start/end the candidates connect. Pass -1 to clear. | |
| void | clear () |
Removes all rendered children and detaches. Caller is responsible for delete-ing the overlay or letting the scene own it; this method is for the "search returned empty" path. | |
| int | pathCount () const |
| Returns the number of candidate paths currently displayed. | |
| QColor | colorForPath (int index) const |
Returns the categorical color assigned to path index. Useful for the picker dialog to render a matching color chip. | |
| void | paintOverlay (QPainter &p, const SceneToPixel &toPixel) const |
| Draw paths + endpoint halos in widget/pixel space. Called by MapCanvas after the QSG frame so the profile overlay sits above 1D/2D results, regardless of scene z-order. | |
Renders an ordered list of candidate paths over the map.
Each path is drawn as a translucent thick poly-line in a distinct categorical color (reuses `CategoricalPalette`). One path may be promoted to "highlighted" (full opacity, others dimmed); the start/end endpoints get pulsing halos so the user knows which endpoints the candidates connect. The overlay is *read-only* — it does not accept clicks; the `MapToolSelectProfile` continues to drive interaction. Hover synchronization with the picker dialog goes through `setHighlightedPath()`.
| using ProfilePathOverlay::SceneToPixel = std::function<QPointF(const QPointF &)> |
Map scene point → device pixel, supplied by the canvas.
|
explicit |
| void ProfilePathOverlay::clear | ( | ) |
Removes all rendered children and detaches. Caller is responsible for delete-ing the overlay or letting the scene own it; this method is for the "search returned empty" path.
| QColor ProfilePathOverlay::colorForPath | ( | int | index | ) | const |
Returns the categorical color assigned to path index. Useful for the picker dialog to render a matching color chip.
| void ProfilePathOverlay::paintOverlay | ( | QPainter & | p, |
| const SceneToPixel & | toPixel | ||
| ) | const |
Draw paths + endpoint halos in widget/pixel space. Called by MapCanvas after the QSG frame so the profile overlay sits above 1D/2D results, regardless of scene z-order.
| int ProfilePathOverlay::pathCount | ( | ) | const |
Returns the number of candidate paths currently displayed.
| void ProfilePathOverlay::setEndpoints | ( | int | startEngineNodeIdx, |
| int | endEngineNodeIdx | ||
| ) |
Marks two endpoints with pulsing halos so the user can see which start/end the candidates connect. Pass -1 to clear.
| void ProfilePathOverlay::setHighlightedPath | ( | int | index | ) |
Promotes path index to full opacity; dims the rest. Pass -1 to show all candidates at equal weight.
| void ProfilePathOverlay::setPaths | ( | const QVector< ProfileRouter::Path > & | paths | ) |
Replaces the displayed candidate paths. Rebuilds child items.