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
swmm2dmeshqsgrenderer.h File Reference
#include "contour/marchingtriangles.h"
#include "map/mapextent.h"
#include "render/colorramp.h"
#include "render/qsg2ddirtystate.h"
#include "render/qsg2dlodpolicy.h"
#include <QByteArray>
#include <QHash>
#include <QPointer>
#include <QQuickItem>
#include <QRectF>
#include <QSet>
#include <QString>
#include <limits>
#include <vector>
Include dependency graph for swmm2dmeshqsgrenderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SWMM2DMeshQSGRenderer
 

Detailed Description

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026

Qt Quick Scene Graph renderer for SWMM2DMeshLayer. Replaces the per-triangle QPainter path in MeshGraphicsItem::paint() with a single GPU draw call, eliminating O(N) QPainter state changes.

Rendering: Pass 1 — filled triangles: QSGGeometry::ColoredPoint2D + QSGVertexColorMaterial. Per-vertex colors encode elevation colour ramp × hillshade, computed once per geometry/zoom change and reused on pan. Pass 2 — edges: two QSGGeometryNode (thin/wide), thick-segment quads (DrawTriangles) so line widths are consistent across RHI backends (Metal/Vulkan/D3D11).

QSG-2D-1M (2026-07-05) — 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, and a selection change rebuilds only the §V overlay nodes.
  • A deterministic LOD policy (Qsg2DLodPolicy) gates dense passes: at Far zoom the fill switches to the layer's coarse overview (m_overviewTris — the same aggregate the CPU painter uses), and the wireframe / vertex markers / contour labels are suppressed.
  • Content is culled to a coverage rect larger than the viewport; pans inside it stay matrix-only, leaving it triggers one LOD rebuild.
  • OPENSWMM_RENDER_PERF=1 logs per-sync dirty reasons and per-pass built-vertex / uploaded-byte counters (Qsg2DRenderStats).