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
mapcanvas.h
Go to the documentation of this file.
1
8#ifndef MAPCANVAS_H
9#define MAPCANVAS_H
10
11#include "map/mapextent.h"
12#include "map/mapundostack.h"
14
15#include <QHash>
16#include <QImage>
17#include <QList>
18#include <QPointer>
19#include <QRectF>
20#include <QStringList>
21#include <QTimer>
22#include <QTransform>
23#include <QVector>
24#include <QWidget>
25#include <optional>
26
32class MapUndoStack;
33class MapRenderJob;
37class QGestureEvent;
38
62class MapCanvas : public QWidget
63{
64 Q_OBJECT
65
66 Q_PROPERTY(MapExtent extent READ extent WRITE setExtent NOTIFY extentChanged)
67 Q_PROPERTY(double scale READ scale NOTIFY scaleChanged)
68 Q_PROPERTY(bool showScaleBar READ showScaleBar WRITE setShowScaleBar
72 Q_PROPERTY(int maxUndoCount READ maxUndoCount WRITE setMaxUndoCount
77
78public:
79
80 explicit MapCanvas(QWidget *parent = nullptr);
81 ~MapCanvas() override;
82
83 // ----- Scene access --------------------------------------------------
84
85 [[nodiscard]] OpenSWMMVisScene *mapScene() const;
86
87 // ----- Overlay view access -------------------------------------------
88
89 [[nodiscard]] OpenSWMMVisGraphicsView *overlayView() const;
90
91 // ----- CRS -----------------------------------------------------------
92
93 [[nodiscard]] SpatialReferenceSystem *canvasSRS() const;
94
95 void setCanvasSRS(SpatialReferenceSystem *srs, bool ownsSRS = false);
96
97 bool setCanvasSRSByCode(const QString &authName, int code);
98
99 // ----- Extent / view -------------------------------------------------
100
101 [[nodiscard]] MapExtent extent() const;
102
103 void setExtent(const MapExtent &extent, bool pushUndo = true);
104
105 void zoomToFullExtent();
106 void zoomIn(double factor = 2.0);
107 void zoomOut(double factor = 2.0);
108 void pan(double dx, double dy);
109
110 [[nodiscard]] double scale() const;
111
118 [[nodiscard]] double scaleDenominator() const;
119
127 void setScaleDenominator(double denom);
128
129 // ----- Interactive navigation (used by map tools) --------------------
130
133 void translateViewBy(int dx, int dy);
134
137 void zoomAroundCursor(double factor, const QPoint &viewportPos);
138
141 void syncExtentFromView();
142
143 // ----- Layer management ----------------------------------------------
144
145 [[nodiscard]] const QList<OpenSWMMVisLayer *> &layers() const;
146
147 void addLayer(OpenSWMMVisLayer *layer, bool pushUndo = true);
148 void insertLayer(int position, OpenSWMMVisLayer *layer, bool pushUndo = true);
149 OpenSWMMVisLayer *takeLayer(int index, bool pushUndo = true);
150 void moveLayer(int fromIndex, int toIndex, bool pushUndo = true);
151
158 void reorderLayers(const QList<OpenSWMMVisLayer *> &newOrder,
159 bool pushUndo = true);
160
161 [[nodiscard]] int layerCount() const;
162 [[nodiscard]] OpenSWMMVisLayer *layerAt(int index) const;
163 [[nodiscard]] MapExtent fullExtent() const;
164
165 // ----- Layer-group (category) order — Slice LTR-2026-09-19 ------------
166 //
167 // The layer tree shows the stack bucketed into category groups
168 // (openswmmvis::ui::CategoryId). Invariant kept by this class: the
169 // stack is always GROUPED — every category's layers are contiguous,
170 // groups appear in layerGroupOrder() sequence (index 0 = top of tree =
171 // highest canvas index = drawn last). addLayer() therefore inserts a
172 // new layer at the top of its own group, not at the top of the stack,
173 // so tree order and paint order never disagree.
174
178 [[nodiscard]] QVector<int> layerGroupOrder() const;
182 void setLayerGroupOrder(const QVector<int> &order);
183
186 [[nodiscard]] static QString layerOrderKey(const OpenSWMMVisLayer *layer);
192 void setPendingLayerOrder(const QStringList &keysBottomToTop);
193 [[nodiscard]] QStringList pendingLayerOrder() const;
198 [[nodiscard]] int groupedInsertPosition(const OpenSWMMVisLayer *layer) const;
199
204 bool moveSublayer(OpenSWMMVisLayer *host, int from, int to, bool pushUndo = true);
205
209 [[nodiscard]] MapExtent extentInCanvasCRS(const OpenSWMMVisLayer *layer,
210 const MapExtent &nativeExtent) const;
211
213 [[nodiscard]] MapExtent layerExtentInCanvasCRS(const OpenSWMMVisLayer *layer) const;
214
215 // ----- Active tool ---------------------------------------------------
216
217 [[nodiscard]] OpenSWMMVisMapTool *activeTool() const;
219
220 // ----- Mesh-profile overlay ------------------------------------------
221
230
234 { return m_meshProfileOverlay; }
235
240
246 { return m_selectionBeacon; }
247
248public slots:
257 void flashSelection();
258
261
262public:
263
264 // ----- Undo ----------------------------------------------------------
265
266 [[nodiscard]] MapUndoStack *undoStack() const;
267 [[nodiscard]] int maxUndoCount() const;
268 void setMaxUndoCount(int count);
269
270 // ----- Decorations ---------------------------------------------------
271
272 [[nodiscard]] bool showScaleBar() const;
273 void setShowScaleBar(bool show);
274
275 [[nodiscard]] bool showCoordinates() const;
276 void setShowCoordinates(bool show);
277
283 void setTerrainElevation(const std::optional<double> &z);
284
286 void setTerrainUnit(const QString &unit);
287
290 [[nodiscard]] std::optional<double> terrainZ() const { return m_terrainZ; }
291
293 [[nodiscard]] QString terrainUnit() const { return m_terrainUnit; }
294
295 [[nodiscard]] QColor backgroundColor() const;
296 void setBackgroundColor(const QColor &color);
297
298 [[nodiscard]] ScaleBarSettings *scaleBarSettings() const;
299
300 // ----- Coordinate conversion -----------------------------------------
301
302 void toMapCoords(int px, int py, double &mapX, double &mapY) const;
303 void toPixelCoords(double mapX, double mapY, int &px, int &py) const;
304
305 // ----- Refresh -------------------------------------------------------
306
315 Raster = 0x1,
316 Scene = 0x2,
317 Overlay = 0x4,
318 Extent = 0x8,
319 };
320 Q_DECLARE_FLAGS(DirtyChannels, DirtyChannel)
321
322
330 void invalidate(DirtyChannels channels,
331 const QString &reason = QString());
332
339 void suspendRefresh();
340 void resumeRefresh();
341
342 // ----- Legacy refresh API (kept for call-site backward compat) -------
343
344 void refresh();
345 void refreshLayerItems();
346
347 // ----- Pan state (suppresses tile reloads during drag) ----------------
348
349 void beginPan();
350 void endPan();
351 [[nodiscard]] bool isPanning() const;
352
353 // Used by ChangeCRSCommand::undo/redo to apply a CRS without pushing to the undo stack.
354 void applyCRSInternal(SpatialReferenceSystem *srs, bool ownsSRS);
355
356signals:
358 void scaleChanged(double scale);
366 void cursorPositionChanged(double mapX, double mapY);
367 void showScaleBarChanged(bool show);
368 void showCoordinatesChanged(bool show);
370 void backgroundColorChanged(const QColor &color);
371
372protected:
373 void paintEvent(QPaintEvent *event) override;
374 void resizeEvent(QResizeEvent *event) override;
375 void showEvent(QShowEvent *event) override;
376 void hideEvent(QHideEvent *event) override;
377
378 void mousePressEvent(QMouseEvent *event) override;
379 void mouseMoveEvent(QMouseEvent *event) override;
380 void mouseReleaseEvent(QMouseEvent *event) override;
381 void mouseDoubleClickEvent(QMouseEvent *event) override;
382 void wheelEvent(QWheelEvent *event) override;
383 void keyPressEvent(QKeyEvent *event) override;
384 void keyReleaseEvent(QKeyEvent *event) override;
385
392 bool event(QEvent *event) override;
393
396 void gestureEvent(QGestureEvent *event);
397
398private slots:
399 void onLayerRepaintRequested();
400 void onRenderJobFinished(QImage result);
401 void fireRasterChannel();
402 void fireSceneChannel();
403 void onDragRenderTick();
404 void syncScaleBarFromPreferences();
405 void syncQsgRenderKindsFromPreferences();
406
407private:
408
409 // Extent / overlay management
410 void renderSceneBuffer();
411 void applyExtentToOverlay();
412 void ensureOverlaySceneRectCovers(const QRectF &needed);
413 [[nodiscard]] QRectF overlayVisibleSceneRect() const;
414 [[nodiscard]] MapExtent arCorrectedExtent(const MapExtent &ext) const;
415 void updateLayerZValues();
416
417 // Render job management
418 void startRenderJob();
419 void cancelRenderJob();
420
421 // Decorations (painted in widget coordinates)
422 void renderScaleBar(QPainter &painter) const;
423 void renderCoordinates(QPainter &painter, double mapX, double mapY) const;
424 void renderTerrainLabel(QPainter &painter) const;
425
426 // Returns ground distance (metres) represented by one horizontal screen pixel
427 // at the centre of the current view. CRS-aware: uses the cosine-latitude
428 // formula for geographic CRS and linearUnitsToMetres() for projected CRS.
429 [[nodiscard]] double metresPerPixel() const;
430
431 // ----- Scene & overlay ------------------------------------------------
432 OpenSWMMVisScene *m_scene = nullptr;
433 OpenSWMMVisGraphicsView *m_overlayView = nullptr;
434
435 // ----- CRS & extent ---------------------------------------------------
436 SpatialReferenceSystem *m_canvasSRS = nullptr;
437 bool m_ownsSRS = false;
438 MapExtent m_extent;
439 QList<OpenSWMMVisLayer *> m_layers;
440 QVector<int> m_layerGroupOrder; // see layerGroupOrder()
441 QStringList m_pendingLayerOrder; // see setPendingLayerOrder()
442
443 // ----- Active tool & undo ---------------------------------------------
444 OpenSWMMVisMapTool *m_activeTool = nullptr;
445 MapUndoStack *m_undoStack = nullptr;
446
447 // ----- Mesh-profile overlay (painted above the QSG frame) -------------
448 // Not owned: MeshProfilePlotDialog creates it and clears this pointer
449 // (setMeshProfileOverlay(nullptr)) before deleting it.
450 MeshProfileOverlay *m_meshProfileOverlay = nullptr;
451
452 // Not owned: MapToolSelectProfile creates it and clears this pointer
453 // (setProfilePathOverlay(nullptr)) before deleting it.
454 ProfilePathOverlay *m_profilePathOverlay = nullptr;
455
456 // Selection locator. Canvas-owned (unlike the profile overlays, which a
457 // dialog/tool binds and unbinds) because selection is always present.
458 SelectionBeaconOverlay *m_selectionBeacon = nullptr;
461 [[nodiscard]] QVector<QPointF> resolveSelectionAnchors() const;
463 void wireSelectionBeaconTo(OpenSWMMVisLayer *layer);
466 void appendMeshSelectionAnchors(class SWMM2DMeshLayer *ml,
467 QVector<QPointF> &anchors) const;
468 QSet<QObject *> m_beaconWiredLayers;
469
470 // ----- Decorations ----------------------------------------------------
471 bool m_showScaleBar = true;
472 bool m_showCoords = false;
473 std::optional<double> m_terrainZ; // set by TerrainToolbar sampling
474 QString m_terrainUnit; // "ft" or "m" from UnitSystem
475 QColor m_bgColor = Qt::white;
476 ScaleBarSettings *m_scaleBarSettings = nullptr;
477
478 // ----- Refresh timer --------------------------------------------------
479 QTimer *m_refreshTimer = nullptr;
480
481 // ----- Phase 0.9 — per-channel dirty / debounce -----------------------
483 QTimer *m_rasterTimer = nullptr;
484 QTimer *m_sceneTimer = nullptr;
486 DirtyChannels m_pendingChannels = NoChannel;
488 int m_suspendDepth = 0;
490 QString m_pendingReason;
491
492 // ----- QGIS-style render buffers --------------------------------------
493 QImage m_mapBuffer;
494 MapExtent m_mapBufferExtent;
498 MapExtent m_pendingRenderExtent;
501 QImage m_frameBuffer;
502 MapRenderJob *m_renderJob = nullptr;
503
504 // QGIS-style cache for the vector QGraphicsScene (2D mesh, GIS vectors,
505 // annotations), used only during an active pan/zoom gesture: the scene is
506 // rasterised live when idle (so selection / profile / hover stay
507 // immediate) and that same buffer is blitted with a stale-buffer transform
508 // during pan/zoom, instead of re-running QGraphicsScene::render() — which
509 // paints the full mesh — on every gesture frame.
510 QImage m_sceneBuffer;
511 MapExtent m_sceneBufferExtent;
512 // P2 — true ⇒ m_sceneBuffer must be re-rendered before the next
513 // non-gesture blit. Set by QGraphicsScene::changed, scene-affecting
514 // refreshes, and non-raster repaintRequested; cleared by
515 // renderSceneBuffer(). Lets tile arrivals and decoration repaints skip
516 // the full scene rasterisation.
517 bool m_sceneDirty = true;
518
519 // ----- Pan / zoom state -----------------------------------------------
520 bool m_isPanning = false;
521 bool m_isZooming = false;
522 MapExtent m_panStartExtent;
523 // P3 — repeating ~200 ms timer active only while m_isPanning: warms the
524 // raster tile caches at the current drag extent and starts a render job,
525 // so blank margins fill DURING the drag instead of only after mouse-up.
526 QTimer *m_dragRenderTimer = nullptr;
527 double m_lastMouseMapX = 0.0;
528 double m_lastMouseMapY = 0.0;
529 int m_lastMousePxX = 0;
530 int m_lastMousePxY = 0;
531
532 // ----- Middle-mouse global pan ----------------------------------------
533 bool m_middlePanActive = false;
534 QPoint m_middlePanStart;
535
536 // ----- Phase B.RHI — QQuickWidget host for the QSG renderers ----------
537 // A transparent child widget overlaying the canvas, hosting (VS.8 +
538 // Mesh Tiled LOD P1.1) a root Item with three stacked renderers:
539 // SWMM2DMeshQSGRenderer (terrain mesh: elevation fill / wireframe /
540 // contours) at the BOTTOM, SWMM2DResultsQSGRenderer (flood map: Gouraud
541 // depth fill / bands / isolines / arrows) above it, and
542 // SWMMLayerQSGRenderer (SWMM network: nodes/links/subcatchments) on top.
543 // The QPainter SWMM2DMeshGraphicsItem path remains the mesh fallback
544 // (preference Rendering/QsgMeshEnabled, env OPENSWMM_QSG_MESH=0).
545 // Native Metal on macOS, Vulkan on Linux, D3D11 on Windows.
546 // See docs/RENDERING_5M_PLAN.md (Phase B.RHI).
547 class QQuickWidget *m_qsgWidget = nullptr;
548 class SWMMLayerQSGRenderer *m_qsgRenderer = nullptr;
549 class SWMM2DResultsQSGRenderer *m_qsg2DRenderer = nullptr;
550 class SWMM2DMeshQSGRenderer *m_qsgMeshRenderer = nullptr;
551
552 // Cached QSG framebuffer (re-grabbed only when something the QSG
553 // renderer cares about actually changed — extent, layer, widget
554 // size, or a layer's repaintRequested signal). Without this cache,
555 // every basemap repaint event paid the cost of a synchronous
556 // repaint() + grabFramebuffer() on the QSG widget, which dominates
557 // paintEvent on large models.
558 QImage m_qsgFrameCache;
559 bool m_qsgFrameDirty = true;
560 MapExtent m_qsgCachedExtent;
561 class SWMMModelLayer *m_qsgCachedLayer = nullptr;
562 class SWMM2DResultsLayer *m_qsgCached2DLayer = nullptr;
563 class SWMM2DMeshLayer *m_qsgCachedMeshLayer = nullptr;
564 QSize m_qsgCachedSize;
565
566 // Sum of the three QSG renderers' contentRevision() counters as of the
567 // last successful grab. The renderers bump their counter the moment an
568 // external change marks them dirty, so comparing against this catches a
569 // change that landed after the canvas already consumed (and cleared)
570 // m_qsgFrameDirty — otherwise that grab would have captured a frame the
571 // renderer had not yet rebuilt, and nothing would ever regrab it.
572 quint64 m_qsgCachedContentRev = 0;
573
575 [[nodiscard]] quint64 qsgContentRevision() const;
576
577 // VS.8 — true while the canvas force-enabled the 1D QSG kinds because a
578 // 2D results layer is QSG-owned (the network must composite above the
579 // flood map inside the same QSG frame). Restored from Preferences when
580 // the 2D layer goes away.
581 bool m_qsg1DForced = false;
582};
583
584Q_DECLARE_OPERATORS_FOR_FLAGS(MapCanvas::DirtyChannels)
585
586#endif // MAPCANVAS_H
Unit unit
Definition aquifereditordialog.cpp:57
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
void setShowCoordinates(bool show)
Definition mapcanvas.cpp:1317
void layerOrderChanged()
void resumeRefresh()
Definition mapcanvas.cpp:1493
void pan(double dx, double dy)
Definition mapcanvas.cpp:449
void showCoordinatesChanged(bool show)
void endPan()
Definition mapcanvas.cpp:2632
void showEvent(QShowEvent *event) override
Definition mapcanvas.cpp:2530
void zoomAroundCursor(double factor, const QPoint &viewportPos)
Zoom the view by factor anchored at viewportPos, then sync m_extent and schedule a tile refresh.
Definition mapcanvas.cpp:2760
void setProfilePathOverlay(ProfilePathOverlay *overlay)
Bind the 1D profile-path candidate/accepted overlay. Painted above the QSG result frame so profile pa...
Definition mapcanvas.cpp:1212
int layerCount() const
Definition mapcanvas.cpp:777
void setMaxUndoCount(int count)
Definition mapcanvas.cpp:1228
void backgroundColorChanged(const QColor &color)
void addLayer(OpenSWMMVisLayer *layer, bool pushUndo=true)
Definition mapcanvas.cpp:537
void extentChanged(const MapExtent &extent)
void refresh()
Definition mapcanvas.cpp:1622
void zoomIn(double factor=2.0)
Definition mapcanvas.cpp:439
int maxUndoCount
Definition mapcanvas.h:73
MapExtent extentInCanvasCRS(const OpenSWMMVisLayer *layer, const MapExtent &nativeExtent) const
Reproject nativeExtent from layer's CRS into canvas CRS by transforming its four corners....
Definition mapcanvas.cpp:963
void toPixelCoords(double mapX, double mapY, int &px, int &py) const
Definition mapcanvas.cpp:1379
MapExtent fullExtent() const
Definition mapcanvas.cpp:999
void scaleChanged(double scale)
void clearSelectionBeacon()
Drops a standing beacon (a new selection has superseded it).
Definition mapcanvas.cpp:1141
void zoomToFullExtent()
Definition mapcanvas.cpp:426
OpenSWMMVisLayer * takeLayer(int index, bool pushUndo=true)
Definition mapcanvas.cpp:651
void setMeshProfileOverlay(MeshProfileOverlay *overlay)
Bind the 2D-mesh profile overlay (line + position marker) drawn ON TOP of every map layer — including...
Definition mapcanvas.cpp:1061
OpenSWMMVisScene * mapScene() const
Definition mapcanvas.cpp:321
void moveLayer(int fromIndex, int toIndex, bool pushUndo=true)
Definition mapcanvas.cpp:705
void setLayerGroupOrder(const QVector< int > &order)
Definition mapcanvas.cpp:794
void keyReleaseEvent(QKeyEvent *event) override
Definition mapcanvas.cpp:2404
QColor backgroundColor
Definition mapcanvas.h:75
void refreshLayerItems()
Definition mapcanvas.cpp:1628
OpenSWMMVisLayer * layerAt(int index) const
Definition mapcanvas.cpp:925
void showScaleBarChanged(bool show)
void setScaleDenominator(double denom)
Zoom the view to exactly the given 1:N scale, preserving the current centre point and canvas aspect r...
Definition mapcanvas.cpp:487
bool moveSublayer(OpenSWMMVisLayer *host, int from, int to, bool pushUndo=true)
Definition mapcanvas.cpp:902
void wheelEvent(QWheelEvent *event) override
Definition mapcanvas.cpp:2364
void cursorPositionChanged(double mapX, double mapY)
void flashSelection()
Flash + beacon the CURRENT selection.
Definition mapcanvas.cpp:1147
const QList< OpenSWMMVisLayer * > & layers() const
Definition mapcanvas.cpp:535
MeshProfileOverlay * meshProfileOverlay() const
The currently bound profile overlay, or null. Lets a closing profile dialog detach only when the bind...
Definition mapcanvas.h:233
bool setCanvasSRSByCode(const QString &authName, int code)
Definition mapcanvas.cpp:390
MapUndoStack * undoStack() const
Definition mapcanvas.cpp:1224
void setBackgroundColor(const QColor &color)
Definition mapcanvas.cpp:1343
void layerRemoved(OpenSWMMVisLayer *layer)
void layerAdded(OpenSWMMVisLayer *layer)
void invalidate(DirtyChannels channels, const QString &reason=QString())
Single entry point for dirtying one or more rendering channels.
Definition mapcanvas.cpp:1423
void mouseMoveEvent(QMouseEvent *event) override
Definition mapcanvas.cpp:2320
void setTerrainUnit(const QString &unit)
Definition mapcanvas.cpp:1334
void translateViewBy(int dx, int dy)
Smooth-pan the view by (dx, dy) screen pixels without updating m_extent or triggering tile reloads....
Definition mapcanvas.cpp:2723
void resizeEvent(QResizeEvent *event) override
Definition mapcanvas.cpp:2559
void applyCRSInternal(SpatialReferenceSystem *srs, bool ownsSRS)
Definition mapcanvas.cpp:330
void setPendingLayerOrder(const QStringList &keysBottomToTop)
Definition mapcanvas.cpp:816
MapExtent extent
Definition mapcanvas.h:66
void maxUndoCountChanged(int count)
double scaleDenominator() const
Current scale as a 1:N denominator, DPI-aware and CRS-aware.
Definition mapcanvas.cpp:459
MapExtent layerExtentInCanvasCRS(const OpenSWMMVisLayer *layer) const
Convenience overload: reprojects the full extent of layer.
Definition mapcanvas.cpp:993
ScaleBarSettings * scaleBarSettings
Definition mapcanvas.h:76
DirtyChannel
Independent redraw channels — see Phase 0.9 in the GUI implementation plan. Each channel has a separa...
Definition mapcanvas.h:313
@ Scene
QGraphicsScene vector items (50 ms debounce)
Definition mapcanvas.h:316
@ Extent
Extent committed (immediate; usually implies Raster|Scene)
Definition mapcanvas.h:318
@ NoChannel
Definition mapcanvas.h:314
@ Overlay
Decorations / selection highlights (immediate)
Definition mapcanvas.h:317
@ Raster
WMS/WMTS/GIS-raster composite (150 ms debounce)
Definition mapcanvas.h:315
QVector< int > layerGroupOrder() const
Definition mapcanvas.cpp:783
void canvasSRSChanged(SpatialReferenceSystem *srs)
void activeToolChanged(OpenSWMMVisMapTool *tool)
void insertLayer(int position, OpenSWMMVisLayer *layer, bool pushUndo=true)
Definition mapcanvas.cpp:547
void reorderLayers(const QList< OpenSWMMVisLayer * > &newOrder, bool pushUndo=true)
Atomically reorder the entire layer stack to match newOrder.
Definition mapcanvas.cpp:744
double scale
Definition mapcanvas.h:67
int groupedInsertPosition(const OpenSWMMVisLayer *layer) const
Definition mapcanvas.cpp:844
void zoomOut(double factor=2.0)
Definition mapcanvas.cpp:444
void keyPressEvent(QKeyEvent *event) override
Definition mapcanvas.cpp:2380
void toMapCoords(int px, int py, double &mapX, double &mapY) const
Definition mapcanvas.cpp:1364
void setShowScaleBar(bool show)
Definition mapcanvas.cpp:1240
void setExtent(const MapExtent &extent, bool pushUndo=true)
Definition mapcanvas.cpp:406
QStringList pendingLayerOrder() const
Definition mapcanvas.cpp:839
SelectionBeaconOverlay * selectionBeacon() const
Locator for the current selection — flashes on change, then leaves a fixed-size beacon so a selected ...
Definition mapcanvas.h:245
void mouseReleaseEvent(QMouseEvent *event) override
Definition mapcanvas.cpp:2344
std::optional< double > terrainZ() const
Definition mapcanvas.h:290
void sublayerOrderChanged(OpenSWMMVisLayer *host)
void mousePressEvent(QMouseEvent *event) override
Definition mapcanvas.cpp:2304
bool showScaleBar
Definition mapcanvas.h:69
bool showCoordinates
Definition mapcanvas.h:71
QString terrainUnit() const
Definition mapcanvas.h:293
void setActiveTool(OpenSWMMVisMapTool *tool)
Definition mapcanvas.cpp:1038
void paintEvent(QPaintEvent *event) override
Definition mapcanvas.cpp:1770
void beginPan()
Definition mapcanvas.cpp:2614
SpatialReferenceSystem * canvasSRS() const
Definition mapcanvas.cpp:328
OpenSWMMVisMapTool * activeTool() const
Definition mapcanvas.cpp:1036
void hideEvent(QHideEvent *event) override
Definition mapcanvas.cpp:2554
bool event(QEvent *event) override
Definition mapcanvas.cpp:2471
static QString layerOrderKey(const OpenSWMMVisLayer *layer)
Definition mapcanvas.cpp:808
void setCanvasSRS(SpatialReferenceSystem *srs, bool ownsSRS=false)
Definition mapcanvas.cpp:368
void suspendRefresh()
Bracket a batch of invalidate() calls so they fire once. Reference-counted — nested pairs are safe....
Definition mapcanvas.cpp:1485
void syncExtentFromView()
Recompute m_extent from the current overlay view transform. Call after translateViewBy() or direct tr...
Definition mapcanvas.cpp:2700
OpenSWMMVisGraphicsView * overlayView() const
Definition mapcanvas.cpp:322
bool isPanning() const
Definition mapcanvas.cpp:2668
void mouseDoubleClickEvent(QMouseEvent *event) override
Definition mapcanvas.cpp:2358
void setTerrainElevation(const std::optional< double > &z)
Sets the terrain elevation to display alongside X/Y in the coordinate overlay. Pass an empty optional...
Definition mapcanvas.cpp:1327
void gestureEvent(QGestureEvent *event)
Definition mapcanvas.cpp:2512
An axis-aligned bounding box in the coordinate space of a given CRS.
Definition mapextent.h:26
Renders raster layers into an off-screen QImage on a worker thread.
Definition maprenderjob.h:43
An undo/redo stack for map operations with a configurable maximum depth.
Definition mapundostack.h:117
Definition meshprofileoverlay.h:31
Transparent QGraphicsView overlay for interactive vector content in the MapCanvas.
Definition openswmmvisgraphicsview.h:37
Abstract base class for all layers displayed in the MapCanvas.
Definition openswmmvislayer.h:116
Abstract base class for interactive map tools used in the MapCanvas.
Definition maptool.h:43
Central QGraphicsScene subclass that holds all map-layer graphics items.
Definition openswmmvisscene.h:32
Renders an ordered list of candidate paths over the map.
Definition profilepathoverlay.h:48
Definition swmm2dmeshlayer.h:64
Definition swmm2dmeshqsgrenderer.h:58
Definition swmm2dresultslayer.h:550
Definition swmm2dresultsqsgrenderer.h:89
Definition swmmlayerqsgrenderer.h:42
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
Holds all configurable appearance properties for the map scale bar.
Definition scalebarsettings.h:26
Definition selectionbeaconoverlay.h:57
Represents a coordinate reference system backed by a GDAL OGRSpatialReference.
Definition spatialreferencesystem.h:28
int code
Definition heatconfigdialog.cpp:40
Axis-aligned bounding box in a map coordinate system, used by MapCanvas and all layer types to define...
std::vector< float > dx
Definition mesh2dresultsexport.cpp:611
std::vector< float > dy
Green–Gauss only, parallel to cell
Definition mesh2dresultsexport.cpp:611
int index
Position in m_quadRegions / m_quadReports.
Definition meshgenerator.cpp:153
int count
Definition numberformat.cpp:101
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
int position
Definition queryparser.cpp:149
Configurable appearance settings for the map scale bar.