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

Slice BI-MK.1 Phase 8.13.40 — per-kind renderer dispatch. More...

#include "render/ifeaturerenderer.h"
#include <QHash>
#include <QString>
#include <functional>
#include <memory>
#include <unordered_map>
#include <vector>
Include dependency graph for multikindrenderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OpenSWMM::Render::detail::QStringHash
 std-style hash for QString so unordered_map can key on it without round-tripping through std::string. Delegates to Qt's qHash. More...
 
class  OpenSWMM::Render::MultiKindRenderer
 Per-kind IFeatureRenderer dispatch for multi-kind layers. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 
namespace  OpenSWMM::Render::detail
 

Detailed Description

Slice BI-MK.1 Phase 8.13.40 — per-kind renderer dispatch.

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
    MultiKindRenderer is the `IFeatureRenderer` adapter that lets a
    multi-kind layer (`SWMMModelLayer` with 11 object categories,
    `SWMMResultsLayer` with 3 attribute scopes) carry one inner
    renderer per kind. It dispatches `symbolFor()` based on the
    feature's `FeatureRef::categoryHint` string, falling back to a
    shared default when no per-kind renderer is registered.

    Design choice: kind keys are STRINGS (matching FeatureRef's
    categoryHint contract) rather than ordinals. This keeps the
    renderer ignorant of SWMM-specific enums — the layer is free to
    use any naming scheme; the renderer just dispatches on the
    string. `.oswp` round-trip uses the same strings as JSON keys.

    Legend aggregation: walks every kind's renderer's
    `legendSymbolItems()`, prepending the kind label as a category
    header so the legend dock can group visually.

    Cross-slice: GUI_IMPLEMENTATION_PLAN.md §J.10 (`MultiKindRenderer`
    adapter) + §N.14 (per-kind UI). Phase 8.13.40 closes the prereq
    that BI-MK.1.41 (SymbologyDialog left pane) builds on.