27#ifndef OPENSWMM_RENDER_RULE_H
28#define OPENSWMM_RENDER_RULE_H
79 QObject *
parent =
nullptr);
88 [[nodiscard]] QString
name()
const {
return m_name; }
91 [[nodiscard]]
bool isVisible()
const {
return m_isVisible; }
107 [[nodiscard]]
double minScale()
const {
return m_minScale; }
111 [[nodiscard]]
double maxScale()
const {
return m_maxScale; }
119 [[nodiscard]] QString
blendMode()
const {
return m_blendMode; }
137 void setRenderer(std::unique_ptr<IFeatureRenderer> r);
161 [[nodiscard]] QJsonObject
toJson()
const;
167 [[nodiscard]]
static std::unique_ptr<Rule>
fromJson(
const QJsonObject &j,
168 QObject *
parent =
nullptr);
173 [[nodiscard]] std::unique_ptr<Rule>
clone(QObject *
parent =
nullptr)
const;
181 bool m_isVisible =
true;
182 QString m_filterExpression;
183 double m_minScale = 0.0;
184 double m_maxScale = 0.0;
185 QString m_blendMode = QStringLiteral(
"Normal");
186 bool m_rebinPerFrame =
false;
187 bool m_symbolLevelsEnabled =
false;
188 std::unique_ptr<IFeatureRenderer> m_renderer;
Abstract interface — every vector layer's paint path goes here.
Definition ifeaturerenderer.h:85
One layer-scope styled aspect — name + renderer + filter + scale.
Definition rule.h:51
bool setRendererById(const QString &id)
Slice Z.3b — swap the renderer to a freshly-constructed instance of the renderer class identified by ...
Definition rule.cpp:154
double maxScale() const
Maximum map scale at which this Rule paints. 0 = unbounded.
Definition rule.h:111
double minScale() const
Minimum map scale at which this Rule paints. 0 = unbounded.
Definition rule.h:107
void setFilterExpression(const QString &expr)
Definition rule.cpp:91
QString blendMode
Definition rule.h:59
void setRebinPerFrame(bool v)
Definition rule.cpp:123
bool isVisible() const
Definition rule.h:91
QString blendMode() const
Composition / blend mode for this Rule's paint pass. "Normal" (default), "Multiply",...
Definition rule.h:119
QString filterExpression
Definition rule.h:56
void setRenderer(std::unique_ptr< IFeatureRenderer > r)
Replace the renderer. Takes ownership; the old renderer is destroyed. Emits rendererReplaced() then r...
Definition rule.cpp:139
bool symbolLevelsEnabled
Definition rule.h:73
bool isVisible
Definition rule.h:54
std::unique_ptr< Rule > clone(QObject *parent=nullptr) const
Deep copy. Owned renderer is cloned via IFeatureRenderer::clone(). The copy carries the same property...
Definition rule.cpp:237
double minScale
Definition rule.h:57
void setBlendMode(const QString &m)
Definition rule.cpp:115
void setVisible(bool v)
Definition rule.cpp:83
static std::unique_ptr< Rule > fromJson(const QJsonObject &j, QObject *parent=nullptr)
Construct a Rule from JSON. Returns nullptr if the JSON is malformed (no "renderer" object or an unkn...
Definition rule.cpp:202
IFeatureRenderer * renderer() const
The owned renderer. Never null in a default-constructed Rule — the constructor seeds it with a Single...
Definition rule.h:133
QJsonObject toJson() const
Serialise this Rule to a JSON object suitable for .swmm-rule.json and .oswp persistence.
Definition rule.cpp:178
void notifyRendererStateChanged()
Slice B.6c-fix — notify listeners that the owned renderer's internal state has changed without the po...
Definition rule.cpp:148
void setName(const QString &name)
Definition rule.cpp:75
QString filterExpression() const
Optional first-match filter expression — same DSL as RuleBasedRenderer (see ExpressionEvaluator).
Definition rule.h:103
bool symbolLevelsEnabled() const
Definition rule.h:127
void setMaxScale(double s)
Definition rule.cpp:107
void setSymbolLevelsEnabled(bool v)
Definition rule.cpp:131
QString name
Definition rule.h:53
double maxScale
Definition rule.h:58
void setMinScale(double s)
Definition rule.cpp:99
bool rebinPerFrame
Definition rule.h:66
bool rebinPerFrame() const
Definition rule.h:123
The single seam every layer paint path goes through.
double s
Scene px per model length unit.
Definition inletdrawingview.cpp:82
MaskMode m
Definition maskspec.cpp:18
Definition gisrasterlayer.h:40
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
QVector< int > parent
union-find
Definition pslgminsize.cpp:176