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
isublayerhost.h File Reference

Mixin interface for layers that own a list of ISublayers. More...

#include "render/isublayer.h"
#include "render/sublayerstyle.h"
#include <QHash>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QList>
#include <QString>
Include dependency graph for isublayerhost.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OpenSWMM::Render::ISublayerHost
 Mixin interface for layers that expose a list of ISublayers. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Detailed Description

Mixin interface for layers that own a list of ISublayers.

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
    Plan reference: RENDERING_OUTPUT_SUBLAYERS_PLAN.md §2 Decision 3
    (animation dispatch) and §3 (every results layer owns an ordered
    sublayer list).

    Any layer that wants to participate in the sublayer architecture
    multi-inherits ISublayerHost alongside its existing base
    (OpenSWMMVisLayer). The host is the contract the rest of the
    system relies on:

      1. The layer tree (Slice S3) calls sublayers() to render the
         third tier of the tree.
      2. The AnimationController (Slice S2 wiring, follow-up) calls
         dispatchAnimationTick(period) on every host whenever
         currentPeriodChanged fires. The host iterates its sublayer
         list and asks each sublayer whose isDynamic() returns true
         to invalidate — static sublayers' cached QSG geometry stays
         untouched (the perf-relevant cut).
      3. The legend (§J.5) collects per-sublayer LegendSymbolItems
         by walking sublayers() and concatenating their
         legendSymbolItems().

    The interface is non-QObject (no signals, no Q_OBJECT) so it can
    be multiply inherited alongside an existing QObject-derived
    layer base without diamond problems. All signal traffic flows
    through the individual ISublayer instances.

    Sublayer ownership is the host's responsibility — the interface
    does not prescribe a smart-pointer flavour; concrete hosts pick
    what fits their existing lifetime story (typically QObject
    parent-child for layers that already lean on Qt ownership).

    Cross-slice: Slice S2 (sublayer host). Adopted by SWMMResultsLayer
    and SWMM2DResultsLayer in later sub-slices; the AnimationController
    dispatch wires through it in S2 final.