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
selectionbeaconoverlay.h File Reference

Locator for the current selection: a flash on change, then a persistent beacon for as long as the selection stands. More...

#include <QColor>
#include <QElapsedTimer>
#include <QObject>
#include <QPointF>
#include <QTimer>
#include <QVector>
#include <functional>
Include dependency graph for selectionbeaconoverlay.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SelectionBeaconOverlay
 

Namespaces

namespace  SelectionBeacon
 

Variables

constexpr int SelectionBeacon::kBeaconRadiusPx = 14
 steady ring radius
 
constexpr int SelectionBeacon::kFlashMaxRadiusPx = 46
 ring radius at end of flash
 
constexpr int SelectionBeacon::kFlashDurationMs = 800
 
constexpr int SelectionBeacon::kFlashFrameMs = 33
 ~30 fps while flashing
 
constexpr int SelectionBeacon::kMaxBeacons = 250
 beyond this, aggregate
 

Detailed Description

Locator for the current selection: a flash on change, then a persistent beacon for as long as the selection stands.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

A selected conduit two pixels long is invisible at model-wide zoom — the selection halo scales with the geometry, so "what did I just select, and where is it?" has no answer until you zoom. This overlay answers it in SCREEN space: the ring is a fixed pixel size at every zoom, so it stays legible no matter how small the feature itself has become.

Two phases:

  • flash — an expanding, fading ring for ~800 ms after the selection changes, to pull the eye;
  • beacon — a steady ring that remains until the selection changes again.

Zoom-dependent aggregation: when the whole selection collapses to less than a beacon's width on screen (i.e. zoomed out), ONE ring is drawn at its centre rather than N rings stacked on the same pixel. Zoomed in far enough to tell the features apart, each gets its own.

Off-screen selections draw nothing by design — "Zoom to Selection" (Ctrl+Shift+J) already serves that case.

Painted from MapCanvas' overlay stage, above the composited QSG frame, so a 2D mesh can never hide it.