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
meshhoverprobe.h
Go to the documentation of this file.
1
18#ifndef OPENSWMMVIS_MESH_MESHHOVERPROBE_H
19#define OPENSWMMVIS_MESH_MESHHOVERPROBE_H
20
21#include <QElapsedTimer>
22#include <QObject>
23#include <QPointer>
24
25class MapCanvas;
26class SWMM2DMeshLayer;
27
28namespace mesh {
29
30class MeshHoverProbe : public QObject
31{
32 Q_OBJECT
33public:
34 explicit MeshHoverProbe(QObject *parent = nullptr);
35 ~MeshHoverProbe() override;
36
37 void setCanvas(MapCanvas *canvas);
38 void setActiveMesh(SWMM2DMeshLayer *layer);
39
40 [[nodiscard]] double lastZ() const { return m_lastZ; }
41 [[nodiscard]] bool lastValid() const { return m_lastValid; }
42
43signals:
46 void elevationChanged(double z, bool finite);
47
48private slots:
49 void onCursor(double mapX, double mapY);
50
51private:
52 QPointer<MapCanvas> m_canvas;
53 QPointer<SWMM2DMeshLayer> m_mesh;
54 QElapsedTimer m_throttle;
55 double m_lastZ = 0.0;
56 bool m_lastValid = false;
57};
58
59} // namespace mesh
60
61#endif // OPENSWMMVIS_MESH_MESHHOVERPROBE_H
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Definition swmm2dmeshlayer.h:64
Definition meshhoverprobe.h:31
bool lastValid() const
Definition meshhoverprobe.h:41
~MeshHoverProbe() override
void setActiveMesh(SWMM2DMeshLayer *layer)
Definition meshhoverprobe.cpp:38
double lastZ() const
Definition meshhoverprobe.h:40
void elevationChanged(double z, bool finite)
Emitted on every (throttled) cursor update. When the cursor is outside every triangle,...
void setCanvas(MapCanvas *canvas)
Definition meshhoverprobe.cpp:24
Definition meshcommands.h:302
QVector< int > parent
union-find
Definition pslgminsize.cpp:176