![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Stateless helper that finds the nearest snap point for a given cursor position, respecting the application's snapping preferences. More...
#include <snapengine.h>
Classes | |
| struct | Result |
Public Types | |
| enum class | Kind { None , Node , Gage , LinkVertex , SubcatchVertex } |
Static Public Member Functions | |
| static Result | snap (const OpenSWMMVisMapTool *tool, SWMMModelLayer *layer, double mapX, double mapY) |
| Find the nearest snap point within the configured tolerance. | |
| static void | paintSnapRing (QPainter *painter, const OpenSWMMVisMapTool *tool, const Result &result, const QColor &color=QColor(255, 165, 0)) |
| Paint a snap indicator ring on the overlay channel. | |
Stateless helper that finds the nearest snap point for a given cursor position, respecting the application's snapping preferences.
Call snap() on every mouseMoveEvent and store the result. Use the stored result in mousePressEvent to commit the snapped coordinate, and in paint() to draw the orange snap indicator ring.
Snap candidates (in priority order):
|
strong |
|
static |
Paint a snap indicator ring on the overlay channel.
Does nothing when result.snapped is false.
|
static |
Find the nearest snap point within the configured tolerance.
| tool | The calling tool — used only for pixel→map conversion. |
| layer | The active SWMM model layer to query. |
| mapX | Cursor X in map (layer-CRS) coordinates. |
| mapY | Cursor Y in map (layer-CRS) coordinates. |
Result if a candidate is found within tolerance, or Result{false, mapX, mapY} otherwise.