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
contourjob.h File Reference
#include "contour/marchingtriangles.h"
#include <array>
#include <memory>
#include <vector>
Include dependency graph for contourjob.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OpenSWMM::Render::ContourJobInput
 
struct  OpenSWMM::Render::ContourJobInput::TriPos
 
struct  OpenSWMM::Render::ContourJobOutput
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Functions

ContourJobOutput OpenSWMM::Render::computeContourJob (const ContourJobInput &in)
 

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 7 — thread-safe contour job input/output for asynchronous marching-triangles recomputation.

The results QSG renderer's per-tick marching pass reads the layer's live SceneTri buffer, which applyCurrentDepths_() mutates in place on every animation tick — a worker thread must never touch it. ContourJobInput is an immutable snapshot the GUI thread assembles instead:

  • positions: anchor-relative corner coordinates, shared (shared_ptr) across jobs and rebuilt only per geometry revision,
  • scalars: per-corner values copied per job (the only per-tick cost),
  • bandLevels / isoLevels: the class edges to march.

computeContourJob() is a pure function of that snapshot — no Qt Quick, no shared state — so it can run on any pool thread and is unit-testable headlessly (tests/unit/test_contourjob.cpp locks its output to the synchronous marching path bit-for-bit).

Staleness is handled by the caller via Qsg2DAsyncResult: results carry a generation token and stale output is dropped, never applied.