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

Renders an ordered list of candidate paths over the map. More...

#include <profilepathoverlay.h>

Inheritance diagram for ProfilePathOverlay:
Collaboration diagram for ProfilePathOverlay:

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.
 

Detailed Description

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()`.

Member Typedef Documentation

◆ SceneToPixel

using ProfilePathOverlay::SceneToPixel = std::function<QPointF(const QPointF &)>

Map scene point → device pixel, supplied by the canvas.

Constructor & Destructor Documentation

◆ ProfilePathOverlay()

ProfilePathOverlay::ProfilePathOverlay ( SWMMModelLayer model,
QGraphicsItem *  parent = nullptr 
)
explicit

Member Function Documentation

◆ clear()

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.

◆ colorForPath()

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.

Here is the call graph for this function:

◆ paintOverlay()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pathCount()

int ProfilePathOverlay::pathCount ( ) const

Returns the number of candidate paths currently displayed.

◆ setEndpoints()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHighlightedPath()

void ProfilePathOverlay::setHighlightedPath ( int  index)

Promotes path index to full opacity; dims the rest. Pass -1 to show all candidates at equal weight.

◆ setPaths()

void ProfilePathOverlay::setPaths ( const QVector< ProfileRouter::Path > &  paths)

Replaces the displayed candidate paths. Rebuilds child items.

Here is the caller graph for this function:

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