17#ifndef OPENSWMM_RENDER_SINGLESYMBOLRENDERER_H
18#define OPENSWMM_RENDER_SINGLESYMBOLRENDERER_H
46 [[nodiscard]]
const QString &
legendLabel()
const {
return m_legendLabel; }
61 [[nodiscard]] QString
rendererId()
const override {
return QStringLiteral(
"single"); }
63 const QVariantMap &attrs)
const override;
65 [[nodiscard]] QJsonObject
toJson()
const override;
66 void fromJson(
const QJsonObject &j)
override;
67 [[nodiscard]] std::unique_ptr<IFeatureRenderer>
clone()
const override;
73 [[nodiscard]] QColor
colorForClass(
const QString &classKey)
const override;
74 [[nodiscard]] qreal
sizeForClass(
const QString &classKey)
const override;
75 void setColorForClass(
const QString &classKey,
const QColor &color)
override;
82 QString m_legendLabel;
Abstract interface — every vector layer's paint path goes here.
Definition ifeaturerenderer.h:85
One SymbolStyle for the whole layer.
Definition singlesymbolrenderer.h:31
QList< LegendSymbolItem > legendSymbolItems() const override
Returns one LegendSymbolItem per visible legend row. Drives the legend dock, the on-canvas legend ove...
Definition singlesymbolrenderer.cpp:49
void setSymbol(SymbolStyle s)
Definition singlesymbolrenderer.cpp:20
qreal sizeForClass(const QString &classKey) const override
Read the current marker / line size for classKey. Returns a negative value when the renderer has no e...
Definition singlesymbolrenderer.cpp:113
void setLegendLabel(QString label)
Definition singlesymbolrenderer.h:47
std::unique_ptr< IFeatureRenderer > clone() const override
Deep copy. Owning layers / map presets / undo stack call this when they need a renderer snapshot deco...
Definition singlesymbolrenderer.cpp:81
const QString & legendLabel() const
Label drawn next to the swatch in the legend (default "").
Definition singlesymbolrenderer.h:46
void setSizeData(DataDefinedScalar d)
Definition singlesymbolrenderer.h:58
SymbolStyle symbolFor(const FeatureRef &f, const QVariantMap &attrs) const override
Returns the SymbolStyle to paint for one feature.
Definition singlesymbolrenderer.cpp:25
~SingleSymbolRenderer() override=default
QString rendererId() const override
Stable string id ("single", "graduated", "categorized", "rule"). Used as the discriminator in JSON ro...
Definition singlesymbolrenderer.h:61
void setWidthForClass(const QString &classKey, qreal width) override
Override the line width for classKey. No-op when supportsClassEdit(Width) is false.
Definition singlesymbolrenderer.cpp:140
void fromJson(const QJsonObject &j) override
Restores this renderer from a JSON object previously produced by toJson(). Implementations should tol...
Definition singlesymbolrenderer.cpp:71
QColor colorForClass(const QString &classKey) const override
Read the current colour for classKey. Returns an invalid QColor when the renderer has no explicit val...
Definition singlesymbolrenderer.cpp:105
bool supportsClassEdit(ClassEditKind) const override
True if this renderer can mutate kind on a per-class basis. Defaults to false so opt-in is explicit.
Definition singlesymbolrenderer.h:72
const DataDefinedScalar & sizeData() const
Slice BI Phase 8.13.43-α — data-defined size/width override. When set, symbolFor evaluates the overri...
Definition singlesymbolrenderer.h:57
void setSizeForClass(const QString &classKey, qreal size) override
Override the marker size for classKey (points / squares / triangles…). No-op when supportsClassEdit(S...
Definition singlesymbolrenderer.cpp:134
const SymbolStyle & symbol() const
The single style applied to every feature.
Definition singlesymbolrenderer.h:40
QJsonObject toJson() const override
Serialises this renderer to a JSON object. The "id" field equals rendererId(); remaining keys are ren...
Definition singlesymbolrenderer.cpp:59
SingleSymbolRenderer()=default
void setColorForClass(const QString &classKey, const QColor &color) override
Override the colour for the class identified by classKey. Has no effect when supportsClassEdit(Color)...
Definition singlesymbolrenderer.cpp:128
void setSymbolForClass(const QString &classKey, const SymbolStyle &style) override
Wholesale-replace the SymbolStyle for classKey. No-op when supportsClassEdit(Symbol) is false.
Definition singlesymbolrenderer.cpp:146
Slice BI Phase 8.13.7-α / 8.13.43-α — typed-struct carve-out of the BI.2 string-expression data-defin...
const char * label
Human label for the filter entry.
Definition gdaldrivers.cpp:22
The single seam every layer paint path goes through.
double s
Scene px per model length unit.
Definition inletdrawingview.cpp:82
Definition gisrasterlayer.h:40
ClassEditKind
Categories of per-class mutation that a renderer may support.
Definition ifeaturerenderer.h:64
Maps one numeric attribute to a scalar output range.
Definition datadefined.h:57
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