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
irasterrenderer.h
Go to the documentation of this file.
1
38#ifndef OPENSWMM_RENDER_IRASTERRENDERER_H
39#define OPENSWMM_RENDER_IRASTERRENDERER_H
40
42
43#include <QColor>
44#include <QJsonObject>
45#include <QList>
46#include <QString>
47
48#include <memory>
49
50namespace OpenSWMM::Render
51{
52
66{
67public:
68 virtual ~IRasterRenderer() = default;
69
75 [[nodiscard]] virtual QString rendererId() const = 0;
76
90 [[nodiscard]] virtual QColor colorForValue(double value,
91 bool isNoData = false) const = 0;
92
101 [[nodiscard]] virtual QList<LegendSymbolItem> legendSymbolItems() const = 0;
102
108 [[nodiscard]] virtual QJsonObject toJson() const = 0;
109
115 virtual void fromJson(const QJsonObject &j) = 0;
116
121 [[nodiscard]] virtual std::unique_ptr<IRasterRenderer> clone() const = 0;
122
123protected:
124 IRasterRenderer() = default;
129};
130
131} // namespace OpenSWMM::Render
132
133#endif // OPENSWMM_RENDER_IRASTERRENDERER_H
Abstract interface — every raster layer's paint path goes here.
Definition irasterrenderer.h:66
IRasterRenderer(const IRasterRenderer &)=default
virtual QString rendererId() const =0
Stable string id ("singlebandpseudocolor", "singlebandgray", "paletted", "hillshade",...
virtual ~IRasterRenderer()=default
IRasterRenderer & operator=(IRasterRenderer &&)=default
virtual void fromJson(const QJsonObject &j)=0
Restores this renderer from a JSON object previously produced by toJson(). Implementations should tol...
IRasterRenderer(IRasterRenderer &&)=default
virtual std::unique_ptr< IRasterRenderer > clone() const =0
Deep copy. Owning layers / map presets / undo stack call this when they need a renderer snapshot deco...
virtual QList< LegendSymbolItem > legendSymbolItems() const =0
Returns one LegendSymbolItem per visible legend row. Drives the legend dock, the on-canvas legend ove...
virtual QColor colorForValue(double value, bool isNoData=false) const =0
Returns the display colour for one raw pixel value.
IRasterRenderer & operator=(const IRasterRenderer &)=default
virtual QJsonObject toJson() const =0
Serialises this renderer to a JSON object. The "id" field equals rendererId(); remaining keys are ren...
One row in a layer's legend — label + swatch symbol + optional range.
Definition gisrasterlayer.h:40