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

Slice BI Phase 8.13.7-α / 8.13.43-α — typed-struct carve-out of the BI.2 string-expression data-defined override mechanism. More...

#include <QJsonObject>
#include <QString>
Include dependency graph for datadefined.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OpenSWMM::Render::DataDefinedScalar
 Maps one numeric attribute to a scalar output range. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Enumerations

enum class  OpenSWMM::Render::DDCurve : int {
  OpenSWMM::Render::Linear = 0 ,
  OpenSWMM::Render::Sqrt = 1 ,
  OpenSWMM::Render::Log = 2
}
 Interpolation shape for DataDefinedScalar. More...
 

Detailed Description

Slice BI Phase 8.13.7-α / 8.13.43-α — typed-struct carve-out of the BI.2 string-expression data-defined override mechanism.

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

DataDefinedScalar maps one numeric feature attribute (e.g. maxDepth, geom1, area) onto a scalar output range (typically a symbol size or line width in pixels). It carries:

  • attribute the SWMM attribute key to read
  • valueMin / Max the attribute-value range to map from
  • outMin / Max the output range (e.g. 2..14 px)
  • curve interpolation shape (Linear / Sqrt / Log)

evaluate(value) clamps to [valueMin, valueMax], applies the curve, and linearly maps to [outMin, outMax]. NaN / non-finite inputs return outMin defensively.

Storage convention: each SymbolLayer::props may carry an optional "sizeData" (markers) or "widthData" (lines) payload holding a DataDefinedScalar JSON. Renderers that honour data-defined output read the struct, evaluate it against the feature's attribute map, and write the resolved number into props["size"] / props["width"] before returning the SymbolStyle from symbolFor. Painters that already read those keys then see the per-feature override transparently — no painter changes needed for static rendering.

Cross-slice: GUI_IMPLEMENTATION_PLAN.md §L.BI Phase 8.13.7-α

  • Phase 8.13.43-α + §L.BI BI-MK.1 size/width controls.