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

Slice US.1 (UNIFIED_STYLING_AND_UI_CONSISTENCY_PLAN.md S1) — the shared classification value type embedded in style bags. More...

#include "render/attributesource.h"
#include "render/colorramp.h"
#include "render/intervalbinner.h"
#include "render/legendsymbolitem.h"
#include <QColor>
#include <QHash>
#include <QJsonObject>
#include <QList>
#include <QMetaType>
#include <QPair>
#include <QString>
#include <QVector>
Include dependency graph for classificationscheme.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OpenSWMM::Render::ClassificationScheme
 Shared classification model: mode + binner + ramp + range + per-class overrides, with a revision stamp for render caches. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Detailed Description

Slice US.1 (UNIFIED_STYLING_AND_UI_CONSISTENCY_PLAN.md S1) — the shared classification value type embedded in style bags.

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

A ClassificationScheme answers one question for every classified visual (1D graduated symbols, 2D depth fill, contour bands, isolines, mesh elevation fill): "given a data range and an optional sample of values, what are the class edges and what colour does each class get?"

It composes the existing primitives rather than replacing them:

  • IntervalBinner — break computation (EqualInterval, Quantile, Manual, NaturalBreaks, StdDev, Log, Exp)
  • RasterColorRamp — named built-in / two-colour gradient source
  • RangeMode — animation range behaviour (P2 spine)

levelEdges() is the canonical replacement for the Contour::evenlySpacedLevels* helpers at the QSG renderer call sites: it returns N+1 ascending edges INCLUSIVE of both range endpoints (N bands need N+1 edges; isoline passes draw the interior edges via interiorLevels()).

revision() is a content-change stamp for QSG cache keys: every mutating setter restamps from a process-global counter, so two schemes with different content virtually never share a revision, while copies of an unchanged scheme do (cache stays warm).

Value type (no QObject) — style bags store it by value and emit their own styleChanged() when it is replaced.