36#ifndef OPENSWMM_RENDER_IFEATURERENDERER_H
37#define OPENSWMM_RENDER_IFEATURERENDERER_H
103 const QVariantMap &attrs)
const = 0;
117 [[nodiscard]]
virtual QJsonObject
toJson()
const = 0;
130 [[nodiscard]]
virtual std::unique_ptr<IFeatureRenderer>
clone()
const = 0;
Abstract interface — every vector layer's paint path goes here.
Definition ifeaturerenderer.h:85
IFeatureRenderer(IFeatureRenderer &&)=default
virtual QList< LegendSymbolItem > legendSymbolItems() const =0
Returns one LegendSymbolItem per visible legend row. Drives the legend dock, the on-canvas legend ove...
IFeatureRenderer()=default
virtual qreal sizeForClass(const QString &) const
Read the current marker / line size for classKey. Returns a negative value when the renderer has no e...
Definition ifeaturerenderer.h:166
virtual QJsonObject toJson() const =0
Serialises this renderer to a JSON object. The "id" field equals rendererId(); remaining keys are ren...
virtual bool supportsClassEdit(ClassEditKind) const
True if this renderer can mutate kind on a per-class basis. Defaults to false so opt-in is explicit.
Definition ifeaturerenderer.h:149
virtual QColor colorForClass(const QString &) const
Read the current colour for classKey. Returns an invalid QColor when the renderer has no explicit val...
Definition ifeaturerenderer.h:158
virtual QString rendererId() const =0
Stable string id ("single", "graduated", "categorized", "rule"). Used as the discriminator in JSON ro...
virtual void setWidthForClass(const QString &, qreal)
Override the line width for classKey. No-op when supportsClassEdit(Width) is false.
Definition ifeaturerenderer.h:179
virtual void setSymbolForClass(const QString &, const SymbolStyle &)
Wholesale-replace the SymbolStyle for classKey. No-op when supportsClassEdit(Symbol) is false.
Definition ifeaturerenderer.h:183
IFeatureRenderer & operator=(IFeatureRenderer &&)=default
virtual void setColorForClass(const QString &, const QColor &)
Override the colour for the class identified by classKey. Has no effect when supportsClassEdit(Color)...
Definition ifeaturerenderer.h:171
virtual SymbolStyle symbolFor(const FeatureRef &f, const QVariantMap &attrs) const =0
Returns the SymbolStyle to paint for one feature.
virtual void setSizeForClass(const QString &, qreal)
Override the marker size for classKey (points / squares / triangles…). No-op when supportsClassEdit(S...
Definition ifeaturerenderer.h:175
IFeatureRenderer(const IFeatureRenderer &)=default
virtual ~IFeatureRenderer()=default
virtual void clearClassEditOverrides()
Drop every per-class override applied via the setters above. The renderer falls back to its ramp / ca...
Definition ifeaturerenderer.h:189
virtual std::unique_ptr< IFeatureRenderer > clone() const =0
Deep copy. Owning layers / map presets / undo stack call this when they need a renderer snapshot deco...
IFeatureRenderer & operator=(const IFeatureRenderer &)=default
virtual void fromJson(const QJsonObject &j)=0
Restores this renderer from a JSON object previously produced by toJson(). Implementations should tol...
Stable identifier passed to IFeatureRenderer::symbolFor().
One row in a layer's legend — label + swatch symbol + optional range.
Definition gisrasterlayer.h:40
ClassEditKind
Categories of per-class mutation that a renderer may support.
Definition ifeaturerenderer.h:64
Identifies one feature in one layer for the renderer pipeline.
Definition featureref.h:35
Stack of SymbolLayer paint passes (bottom-up) plus an overall opacity.
Definition symbolstyle.h:39
A stack of SymbolLayer paint passes plus a layer-level opacity.