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
maptoolprofilemarker.h
Go to the documentation of this file.
1
21#ifndef OPENSWMMVIS_MAP_TOOLS_MAPTOOLPROFILEMARKER_H
22#define OPENSWMMVIS_MAP_TOOLS_MAPTOOLPROFILEMARKER_H
23
24#include "map/tools/maptool.h"
25
27
29{
30 Q_OBJECT
31public:
32 explicit MapToolProfileMarker(MapCanvas *canvas, QObject *parent = nullptr);
33
35 void setOverlay(MeshProfileOverlay *overlay);
36
37 [[nodiscard]] QCursor cursor() const override;
38
39 void deactivate() override;
40 void mousePressEvent(QMouseEvent *event) override;
41 void mouseMoveEvent(QMouseEvent *event) override;
42 void mouseReleaseEvent(QMouseEvent *event) override;
43 void paint(QPainter *painter,
44 const MapExtent &canvasExtent,
45 const SpatialReferenceSystem *canvasSRS) override;
46
47signals:
50 void markerChainageChanged(double chainage);
51
52private:
53 [[nodiscard]] QPointF pixelToScene_(int px, int py) const;
54 void endDrag_();
55
56 // Raw pointer: the owning MeshProfilePlotDialog clears it (setOverlay(nullptr))
57 // before deleting the overlay, so it never dangles. MeshProfileOverlay is a
58 // plain (non-QObject) class, so QPointer isn't applicable.
59 MeshProfileOverlay *m_overlay = nullptr;
60 bool m_dragging = false;
61 double m_chainage = 0.0;
62};
63
64#endif // OPENSWMMVIS_MAP_TOOLS_MAPTOOLPROFILEMARKER_H
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
An axis-aligned bounding box in the coordinate space of a given CRS.
Definition mapextent.h:26
Definition maptoolprofilemarker.h:29
void deactivate() override
Called by the canvas when another tool replaces this one.
Definition maptoolprofilemarker.cpp:36
void markerChainageChanged(double chainage)
Emitted while the marker is dragged. chainage is scene-unit distance along the path.
void mouseMoveEvent(QMouseEvent *event) override
Definition maptoolprofilemarker.cpp:73
QCursor cursor() const override
Returns the mouse cursor to display while this tool is active.
Definition maptoolprofilemarker.cpp:31
void mouseReleaseEvent(QMouseEvent *event) override
Definition maptoolprofilemarker.cpp:83
void mousePressEvent(QMouseEvent *event) override
Definition maptoolprofilemarker.cpp:49
void paint(QPainter *painter, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
Called by the canvas in drawForeground() so the tool can draw transient overlay graphics (rubber-band...
Definition maptoolprofilemarker.cpp:99
void setOverlay(MeshProfileOverlay *overlay)
Bind the overlay this tool drags. Pass null to detach.
Definition maptoolprofilemarker.cpp:24
Definition meshprofileoverlay.h:31
Abstract base class for interactive map tools used in the MapCanvas.
Definition maptool.h:43
MapCanvas * canvas() const
Returns the MapCanvas this tool is attached to.
Definition maptool.cpp:29
Represents a coordinate reference system backed by a GDAL OGRSpatialReference.
Definition spatialreferencesystem.h:28
Abstract base class for all interactive tools attached to a MapCanvas.
QVector< int > parent
union-find
Definition pslgminsize.cpp:176