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
maptoolpan.h
Go to the documentation of this file.
1
9#ifndef MAPTOOLPAN_H
10#define MAPTOOLPAN_H
11
12#include "map/tools/maptool.h"
13#include "map/mapextent.h"
14
15#include <QPoint>
16
25{
26 Q_OBJECT
27
28public:
29
30 explicit OpenSWMMVisMapToolPan(MapCanvas *canvas, QObject *parent = nullptr);
31
32 [[nodiscard]] QCursor cursor() const override;
33
34 void activate() override;
35 void deactivate() override;
36
37 void mousePressEvent(QMouseEvent *event) override;
38 void mouseMoveEvent(QMouseEvent *event) override;
39 void mouseReleaseEvent(QMouseEvent *event) override;
40
41private:
42 bool m_panning = false;
43 QPoint m_lastPixel;
44 MapExtent m_panStartExtent;
45};
46
47#endif // MAPTOOLPAN_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
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
Tool that pans the map canvas by click-dragging.
Definition maptoolpan.h:25
void deactivate() override
Called by the canvas when another tool replaces this one.
Definition maptoolpan.cpp:30
void mousePressEvent(QMouseEvent *event) override
Definition maptoolpan.cpp:36
void activate() override
Called by the canvas when this tool becomes the active tool.
Definition maptoolpan.cpp:24
void mouseMoveEvent(QMouseEvent *event) override
Definition maptoolpan.cpp:52
QCursor cursor() const override
Returns the mouse cursor to display while this tool is active.
Definition maptoolpan.cpp:19
void mouseReleaseEvent(QMouseEvent *event) override
Definition maptoolpan.cpp:66
Axis-aligned bounding box in a map coordinate system, used by MapCanvas and all layer types to define...
Abstract base class for all interactive tools attached to a MapCanvas.
QVector< int > parent
union-find
Definition pslgminsize.cpp:176