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
swmm2dresultsqsgrenderer.h File Reference
#include "map/mapextent.h"
#include "render/contourjob.h"
#include "render/meshrenderchunkindex.h"
#include "render/meshstaticgeometrybuffers.h"
#include "render/qsg2dasyncresult.h"
#include "render/qsg2ddirtystate.h"
#include "render/qsg2dlodpolicy.h"
#include <QFutureWatcher>
#include <QHash>
#include <QImage>
#include <QPointer>
#include <QQuickItem>
#include <QRectF>
#include <QSet>
#include <QString>
#include <limits>
#include <memory>
#include <vector>
Include dependency graph for swmm2dresultsqsgrenderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SWMM2DResultsQSGRenderer
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Contour
 

Detailed Description

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

VS.8 — Qt Quick Scene Graph renderer for SWMM2DResultsLayer. The GPU replacement for the QGraphicsItem QPainter passes (the "final paint-replacement slice" promised in swmm2dresultslayer.h §S5.6).

Rendering (node z-order, bottom → top): Pass 2 — filled contour bands (marching-triangles isobands or flat per-cell classification, per ContourBandStyle). This is now the depth fill; dry cells stay transparent so the SWMM2DMeshLayer terrain shows through. Pass 3 — isolines (thick-segment quads; separate node for index contours). Dash patterns are not supported on the GPU path — lines render solid. Pass 3b — isoline labels: rasterised textures placed along chained polylines every ~250 screen px, rotated to the line direction. Pass 4 — velocity-vector glyphs (per-glyph colour via VelocityVectorStyle::colorForSpeed); also convey flow direction. Pass 6 — cell-highlight overlay (translucent cyan fill + gold edges, matching the CPU CF.3 pass).

QSG-2D-1M (2026-07-05) — the renderer was re-architected for ~1M-cell meshes:

  • Dirty domains (Qsg2DDirtyState) replace the single m_contentDirty: pan is matrix-only, zoom rebuilds only across LOD-key changes, selection touches only the highlight nodes, and a time tick rebuilds only the data-dependent passes (fills / bands / isolines / vectors) while mesh edges and vertex markers persist.
  • A deterministic LOD policy (Qsg2DLodPolicy) gates dense passes: at Far zoom no wireframe, no vertex markers, no labels, no dense per-cell velocity glyphs, and contour bands fall back to the flat per-cell classification (visually identical once cells are subpixel).
  • A MeshRenderChunkIndex (keyed by the layer's geomRevision) batches visibility culling: fully-visible chunks skip per-element bbox tests.
  • Content is built for a coverage rect larger than the viewport; pans inside the coverage are pure transforms, leaving it triggers one LOD-domain rebuild.
  • The smooth depth fill uses persistent indexed geometry (MeshStaticGeometryBuffers): shared vertex positions upload once per geometry revision; time ticks rewrite colors + wet-cell indices in place. Set OPENSWMM_QSG_INDEXED_FILL=0 to fall back to the expanded per-corner path.
  • OPENSWMM_RENDER_PERF=1 logs per-sync dirty reasons and per-pass built-vertex / uploaded-byte counters (Qsg2DRenderStats).

Hosted as the "results2d" item in resources/qml/swmmlayer.qml, BELOW the 1D SWMMLayerQSGRenderer so the network draws above the flood map. MapCanvas drives it synchronously from paintEvent Layer 2b, exactly like the 1D renderer (repaint() + grabFramebuffer()).