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
qsg2ddirtystate.h File Reference
#include <QtGlobal>
Include dependency graph for qsg2ddirtystate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OpenSWMM::Render::Qsg2DDirtyState
 

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 2 — dirty-domain separation for the 2D mesh / results QSG renderers.

The renderers historically folded every invalidation into a single m_contentDirty flag, so a selection change or a zoom rebuilt every pass. Qsg2DDirtyState splits invalidation into orthogonal domains:

Geometry — mesh topology or scene coordinates changed Style — colour ramp / opacity / widths / marker or contour settings Data — result values changed (time-step advance) Selection — highlighted cells / edges / vertices changed Lod — the level-of-detail content key changed, or the view left the coverage region the content was built for Transform — extent changed but content itself needs no rebuild

Usage contract (single-threaded — Qt GUI thread):

  1. Signal handlers / setters call the note*() methods. Ambiguous invalidations (the layer's catch-all repaintRequested) call noteExternalChanged().
  2. Once per sync, the renderer calls resolve() with snapshot diffs it computed itself (geometry revision, selection sets, time index) and with the LOD/coverage verdicts from Qsg2DLodPolicy. resolve() classifies any pending external change into the narrowest true domain (falling back to Style when nothing observable moved), returns the combined bitset, and clears the pending state.

Expected classifications (locked by tests/unit/test_qsg2d_dirtystate.cpp):

pan after a clean frame -> Transform zoom within the same LOD bucket -> Transform zoom across an LOD threshold -> Transform | Lod highlighted set changed -> Selection time-step changed -> Data geometry revision changed -> Geometry style edit (nothing else moved) -> Style

Pure Qt-Core header — no Qt Quick dependency, unit-testable headlessly.