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

Raster renderer driven by the shared ClassificationScheme — continuous (stretched) or classified single-band colouring. More...

#include "render/classificationscheme.h"
#include "render/irasterrenderer.h"
#include "render/scalarramplut.h"
#include <QColor>
#include <QPair>
#include <QRgb>
#include <QVector>
#include <algorithm>
#include <array>
Include dependency graph for graduatedrasterrenderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OpenSWMM::Render::GraduatedRasterRenderer
 ClassificationScheme-driven single-band raster colouring. More...
 

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Detailed Description

Raster renderer driven by the shared ClassificationScheme — continuous (stretched) or classified single-band colouring.

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

The raster analogue of GraduatedRenderer on the feature side and the model behind the raster Symbology tab's "Singleband pseudocolor" renderer. Everything the shared ClassificationEditor edits (Continuous/Classified mode, ramp + invert, method, class count, manual breaks, custom range, per-class colour / label overrides, label format) lives in the embedded ClassificationScheme; this class adds what a raster needs on top:

  • dataMin / dataMax — the band statistics the scheme classifies over (the scheme's custom range wins when enabled — see effectiveRange())
  • edges — the class edges last derived from the scheme + a value sample. Persisted, so a Quantile / Jenks classification reloads from .oswp without re-sampling the raster
  • clipOutOfRange — values outside the effective range render transparent instead of clamping to the end colours (QGIS "clip out of range values")

Hot path: colorForValue() is pure arithmetic over state baked by rebake() — a 256-entry LUT for Continuous mode (ScalarRampLut contract) and one QRgb per class for Classified mode. Every mutator rebakes eagerly, so the clone() handed to a tile worker is immutable: no lazy caches, no locking, and no ClassificationScheme call per pixel (the scheme's colour lookups build a RasterColorRamp on every call).