19#ifndef OPENSWMM_RENDER_SUBLAYERS_FLOWARROWSUBLAYER_H
20#define OPENSWMM_RENDER_SUBLAYERS_FLOWARROWSUBLAYER_H
68 [[nodiscard]]
double headSizePx()
const {
return m_headSizePx; }
69 [[nodiscard]]
double shaftWidthPx()
const {
return m_shaftWidthPx; }
70 [[nodiscard]] QColor
color()
const {
return m_color; }
71 [[nodiscard]] QColor
outlineColor()
const {
return m_outlineColor; }
76 [[nodiscard]]
double speedMinMps()
const {
return m_speedMinMps; }
77 [[nodiscard]]
double speedMaxMps()
const {
return m_speedMaxMps; }
96 [[nodiscard]] QJsonObject
toJson()
const override;
97 void fromJson(
const QJsonObject &j)
override;
100 double m_arrowLengthPx = 20.0;
101 double m_arrowSpacingPx = 36.0;
102 double m_headSizePx = 6.0;
103 double m_shaftWidthPx = 1.6;
104 QColor m_color = QColor(20, 20, 20, 230);
105 QColor m_outlineColor = QColor(255, 255, 255, 200);
106 double m_dryDepthCutoff = 0.01;
107 bool m_placeAtCellCenters =
false;
109 bool m_colorByMagnitude =
false;
110 QString m_colorRampName = QStringLiteral(
"viridis");
111 double m_speedMinMps = 0.0;
112 double m_speedMaxMps = 2.0;
122 QString
id()
const override {
return m_id; }
123 QString
displayName()
const override {
return tr(
"Flow direction arrows"); }
127 qreal
opacity()
const override {
return m_opacity; }
141 bool m_visible =
false;
142 qreal m_opacity = 1.0;
Definition flowarrowsublayer.h:34
void setColor(const QColor &v)
Definition flowarrowsublayer.h:83
void setArrowLengthPx(double v)
Definition flowarrowsublayer.cpp:18
void setShaftWidthPx(double v)
Definition flowarrowsublayer.cpp:42
double speedMaxMps
Definition flowarrowsublayer.h:48
QString colorRampName
Definition flowarrowsublayer.h:46
double headSizePx
Definition flowarrowsublayer.h:38
void fromJson(const QJsonObject &j) override
Restore the style from JSON.
Definition flowarrowsublayer.cpp:87
double dryDepthCutoff() const
Definition flowarrowsublayer.h:72
double arrowSpacingPx
Definition flowarrowsublayer.h:37
QColor color() const
Definition flowarrowsublayer.h:70
QJsonObject toJson() const override
Serialize the style to JSON.
Definition flowarrowsublayer.cpp:69
double arrowSpacingPx() const
Definition flowarrowsublayer.h:67
double speedMaxMps() const
Definition flowarrowsublayer.h:77
void setArrowSpacingPx(double v)
Definition flowarrowsublayer.cpp:26
void setHeadSizePx(double v)
Definition flowarrowsublayer.cpp:34
bool placeAtCellCenters
Definition flowarrowsublayer.h:43
QColor color
Definition flowarrowsublayer.h:40
void setColorByMagnitude(bool v)
Definition flowarrowsublayer.h:87
QColor outlineColor() const
Definition flowarrowsublayer.h:71
void setSpeedMinMps(double v)
Definition flowarrowsublayer.h:89
double speedMinMps() const
Definition flowarrowsublayer.h:76
void setColorRampName(const QString &v)
Definition flowarrowsublayer.h:88
double arrowLengthPx() const
Definition flowarrowsublayer.h:66
double headSizePx() const
Definition flowarrowsublayer.h:68
void setOutlineColor(const QColor &v)
Definition flowarrowsublayer.h:84
bool colorByMagnitude() const
Definition flowarrowsublayer.h:74
double shaftWidthPx
Definition flowarrowsublayer.h:39
bool placeAtCellCenters() const
Definition flowarrowsublayer.h:73
double shaftWidthPx() const
Definition flowarrowsublayer.h:69
QString colorRampName() const
Definition flowarrowsublayer.h:75
double speedMinMps
Definition flowarrowsublayer.h:47
void setPlaceAtCellCenters(bool v)
Definition flowarrowsublayer.h:86
bool colorByMagnitude
Definition flowarrowsublayer.h:45
void setDryDepthCutoff(double v)
Definition flowarrowsublayer.cpp:50
QColor outlineColor
Definition flowarrowsublayer.h:41
double dryDepthCutoff
Definition flowarrowsublayer.h:42
void setSpeedMaxMps(double v)
Definition flowarrowsublayer.h:90
QColor colorForSpeed(double speedMps) const
Definition flowarrowsublayer.cpp:58
double arrowLengthPx
Definition flowarrowsublayer.h:36
Definition flowarrowsublayer.h:116
bool isDynamic() const override
Whether this sublayer's output depends on the current animation period.
Definition flowarrowsublayer.h:130
QList< LegendSymbolItem > legendSymbolItems() const override
Returns the legend rows this sublayer contributes.
Definition flowarrowsublayer.cpp:137
QString displayName() const override
Definition flowarrowsublayer.h:123
Kind kind() const override
Definition flowarrowsublayer.h:121
bool isVisible() const override
Definition flowarrowsublayer.h:125
FlowArrowStyle * flowArrowStyle() const
Definition flowarrowsublayer.h:137
qreal opacity() const override
Definition flowarrowsublayer.h:127
SublayerStyle * style() override
Returns the property-bag QObject that owns this sublayer's style knobs.
Definition flowarrowsublayer.h:132
QString id() const override
Definition flowarrowsublayer.h:122
void setOpacity(qreal o) override
Definition flowarrowsublayer.cpp:129
void setVisible(bool v) override
Definition flowarrowsublayer.cpp:122
QSGNode * buildOrUpdateNode(QSGNode *existing, const SublayerContext &) override
Build (or update) the QSG node tree for this sublayer.
Definition flowarrowsublayer.cpp:152
One toggleable visual aspect of a results / model layer.
Definition isublayer.h:87
Kind
Coarse taxonomy of sublayer paint behaviours.
Definition isublayer.h:100
@ ArrowKind
Definition isublayer.h:104
Base class for per-sublayer style property bags.
Definition sublayerstyle.h:56
void styleChanged()
Emitted when any property changes.
void setDirty()
Definition sublayerstyle.h:97
RasterColorRamp — gradient mapping from a normalised value in [0,1] to a display QColor.
Toggleable visual aspect of an output layer.
Definition gisrasterlayer.h:40
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Per-frame parameters handed to ISublayer::buildOrUpdateNode().
Definition isublayer.h:73
QObject base class for per-sublayer style property bags.