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
snapengine.h
Go to the documentation of this file.
1
8#ifndef SNAPENGINE_H
9#define SNAPENGINE_H
10
11#include <QColor>
12#include <QString>
13
15class SWMMModelLayer;
16class QPainter;
17
34{
35public:
37
38 struct Result {
39 bool snapped = false;
40 double x = 0.0;
41 double y = 0.0;
43 QString elementName;
44 };
45
56 [[nodiscard]] static Result snap(const OpenSWMMVisMapTool *tool,
57 SWMMModelLayer *layer,
58 double mapX, double mapY);
59
65 static void paintSnapRing(QPainter *painter,
66 const OpenSWMMVisMapTool *tool,
67 const Result &result,
68 const QColor &color = QColor(255, 165, 0));
69};
70
71#endif // SNAPENGINE_H
Abstract base class for interactive map tools used in the MapCanvas.
Definition maptool.h:43
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
Stateless helper that finds the nearest snap point for a given cursor position, respecting the applic...
Definition snapengine.h:34
static Result snap(const OpenSWMMVisMapTool *tool, SWMMModelLayer *layer, double mapX, double mapY)
Find the nearest snap point within the configured tolerance.
Definition snapengine.cpp:29
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.
Definition snapengine.cpp:116
Kind
Definition snapengine.h:36
Definition snapengine.h:38
double x
Definition snapengine.h:40
QString elementName
Definition snapengine.h:43
Kind kind
Definition snapengine.h:42
double y
Definition snapengine.h:41
bool snapped
Definition snapengine.h:39