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
meshstaticgeometrybuffers.h File Reference
#include <QPointF>
#include <QVector>
#include <QtGlobal>
#include <algorithm>
#include <cstddef>
#include <utility>
#include <vector>
Include dependency graph for meshstaticgeometrybuffers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OpenSWMM::Render::MeshStaticGeometryBuffers
 
struct  OpenSWMM::Render::MeshStaticGeometryBuffers::Vec2
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

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

QSG-2D-1M Phase 5 — persistent static geometry buffers for the 2D mesh / results QSG renderers.

The historical QSG path re-expanded every triangle into three ColoredPoint2D vertices on every content rebuild (pan-back, zoom, time tick, style edit) — ~84 MB of CPU-side vertex assembly per rebuild on a 1M-cell mesh. This builder assembles, ONCE per geometry revision:

  • a shared, anchor-relative float position array (one entry per mesh vertex — shared corners are stored once),
  • a static triangle index array (3 × quint32 per cell; cells with out-of-range vertex ids are dropped),
  • optionally a deduplicated undirected edge endpoint array (2 × quint32 per unique edge).

Positions are anchor-relative so they stay small in float precision and are invariant under pan/zoom (the renderer's root transform carries the view). Dynamic state (colors / scalars / selection overlays) lives in separate per-pass arrays owned by the renderers — style, data, and selection changes never touch these buffers.

ensureBuilt() is revision-keyed: calling it again with the same revision is a no-op (returns false), which is the contract that makes pan/zoom and data ticks free of static rebuilds. Locked by tests/unit/test_meshstaticgeometrybuffers.cpp.

Header-only, Qt-Core-only.