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
maptoolmeshprofile.h
Go to the documentation of this file.
1
24#ifndef OPENSWMMVIS_MAP_TOOLS_MAPTOOLMESHPROFILE_H
25#define OPENSWMMVIS_MAP_TOOLS_MAPTOOLMESHPROFILE_H
26
27#include "map/tools/maptool.h"
28
29#include <QPoint>
30#include <QPointF>
31#include <QString>
32#include <QVector>
33
35{
36 Q_OBJECT
37public:
38 explicit MapToolMeshProfile(MapCanvas *canvas, QObject *parent = nullptr);
39 ~MapToolMeshProfile() override = default;
40
41 void activate() override;
42 void deactivate() override;
43
44 void mousePressEvent(QMouseEvent *event) override;
45 void mouseMoveEvent(QMouseEvent *event) override;
46 void mouseDoubleClickEvent(QMouseEvent *event) override;
47 void keyPressEvent(QKeyEvent *event) override;
48
49 void paint(QPainter *painter,
50 const MapExtent &canvasExtent,
51 const SpatialReferenceSystem *canvasSRS) override;
52
53signals:
56 void profilePathTraced(const QVector<QPointF> &scenePolyline);
57
59 void statusMessageChanged(const QString &message);
60
61private:
63 [[nodiscard]] QPointF pixelToScene_(int px, int py) const;
64
65 void finishTrace_();
66 void cancelTrace_();
67
68 bool m_drawing = false;
69 QVector<QPointF> m_scenePts; // committed vertices (scene coords)
70 QPoint m_cursorPixel; // live cursor (pixel coords)
71};
72
73#endif // OPENSWMMVIS_MAP_TOOLS_MAPTOOLMESHPROFILE_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 maptoolmeshprofile.h:35
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 maptoolmeshprofile.cpp:141
void keyPressEvent(QKeyEvent *event) override
Definition maptoolmeshprofile.cpp:99
void mouseMoveEvent(QMouseEvent *event) override
Definition maptoolmeshprofile.cpp:71
void activate() override
Called by the canvas when this tool becomes the active tool.
Definition maptoolmeshprofile.cpp:22
void profilePathTraced(const QVector< QPointF > &scenePolyline)
Emitted when the user finishes a ≥2-vertex trace. The polyline is in scene coords (sx = mapX,...
void statusMessageChanged(const QString &message)
Status hint piped to the main-window status bar.
~MapToolMeshProfile() override=default
void mousePressEvent(QMouseEvent *event) override
Definition maptoolmeshprofile.cpp:47
void deactivate() override
Called by the canvas when another tool replaces this one.
Definition maptoolmeshprofile.cpp:32
void mouseDoubleClickEvent(QMouseEvent *event) override
Definition maptoolmeshprofile.cpp:79
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
QString message
Definition queryparser.cpp:150