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
meshprofileplotoptions.h
Go to the documentation of this file.
1
14#ifndef MESH_PROFILE_PLOT_OPTIONS_H
15#define MESH_PROFILE_PLOT_OPTIONS_H
16
17#include "plot/numberformat.h"
18
19#include <QBrush>
20#include <QColor>
21#include <QFont>
22#include <QObject>
23#include <QPen>
24#include <QPointF>
25#include <QString>
26
27class MeshProfilePlotOptions : public QObject
28{
29 Q_OBJECT
30
31public:
33 Q_ENUM(LegendPosition)
34
35
38 Q_ENUM(LabelFormatMode)
39
40
56 Q_ENUM(AxisNumberFormat)
57
60 Q_ENUM(TimeLabelPosition)
61
62 // ── Visibility toggles ──────────────────────────────────────────────
63 Q_PROPERTY(bool showDepthFill READ showDepthFill WRITE setShowDepthFill NOTIFY changed)
64 Q_PROPERTY(bool showWseLine READ showWseLine WRITE setShowWseLine NOTIFY changed)
68
69 // ── Terrain / water styling ─────────────────────────────────────────
70 Q_PROPERTY(QBrush soilFill READ soilFill WRITE setSoilFill NOTIFY changed)
71 Q_PROPERTY(QPen groundLinePen READ groundLinePen WRITE setGroundLinePen NOTIFY changed)
72 Q_PROPERTY(QBrush depthFillBrush READ depthFillBrush WRITE setDepthFillBrush NOTIFY changed)
73 Q_PROPERTY(QPen wseLinePen READ wseLinePen WRITE setWseLinePen NOTIFY changed)
74 Q_PROPERTY(QPen maxEnvelopePen READ maxEnvelopePen WRITE setMaxEnvelopePen NOTIFY changed)
75 Q_PROPERTY(QBrush maxEnvelopeBrush READ maxEnvelopeBrush WRITE setMaxEnvelopeBrush NOTIFY changed)
77
78 // ── Axis number format ──────────────────────────────────────────────
79 // X axis = chainage/distance; Y axis = elevation. Seeded from the global
80 // Preferences default; edits here override per-plot.
83 Q_PROPERTY(QString xLabelFormat
84 READ xLabelFormat WRITE setXLabelFormat NOTIFY changed)
87 Q_PROPERTY(QString yLabelFormat
88 READ yLabelFormat WRITE setYLabelFormat NOTIFY changed)
89
90 // ── Legend ──────────────────────────────────────────────────────────
91 Q_PROPERTY(bool legendVisible READ legendVisible WRITE setLegendVisible NOTIFY changed)
94 Q_PROPERTY(QFont legendFont READ legendFont WRITE setLegendFont NOTIFY changed)
95 Q_PROPERTY(double legendOpacity READ legendOpacity WRITE setLegendOpacity NOTIFY changed)
96 Q_PROPERTY(QPointF legendOffset READ legendOffset WRITE setLegendOffset NOTIFY changed)
97
98 // ── Timestamp overlay ───────────────────────────────────────────────
99 Q_PROPERTY(bool showTimeLabel READ showTimeLabel WRITE setShowTimeLabel NOTIFY changed)
102 Q_PROPERTY(QColor timeLabelColor READ timeLabelColor WRITE setTimeLabelColor NOTIFY changed)
103 Q_PROPERTY(QFont timeLabelFont READ timeLabelFont WRITE setTimeLabelFont NOTIFY changed)
104 Q_PROPERTY(QString timeLabelFormat READ timeLabelFormat WRITE setTimeLabelFormat NOTIFY changed)
105 Q_PROPERTY(QPointF timeLabelOffset READ timeLabelOffset WRITE setTimeLabelOffset NOTIFY changed)
106
107public:
108 explicit MeshProfilePlotOptions(QObject *parent = nullptr);
109
111 Q_INVOKABLE QString displayLabelFor(const QString &propertyName) const;
112
113 // ── Getters ─────────────────────────────────────────────────────────
114 bool showDepthFill() const { return m_showDepthFill; }
115 bool showWseLine() const { return m_showWseLine; }
116 bool showMaxEnvelopeFill() const { return m_showMaxEnvelopeFill; }
117 bool showMaxEnvelopeLine() const { return m_showMaxEnvelopeLine; }
118 bool showCellBoundaries() const { return m_showCellBoundaries; }
119 QColor cellBoundaryColor() const { return m_cellBoundaryColor; }
120 QBrush soilFill() const { return m_soilFill; }
121 QPen groundLinePen() const { return m_groundLinePen; }
122 QBrush depthFillBrush() const { return m_depthFillBrush; }
123 QPen wseLinePen() const { return m_wseLinePen; }
124 QPen maxEnvelopePen() const { return m_maxEnvelopePen; }
125 QBrush maxEnvelopeBrush() const { return m_maxEnvelopeBrush; }
130
131 LabelFormatMode xLabelFormatMode() const { return m_xLabelMode; }
132 int xLabelPrecision() const { return m_xLabelPrecision; }
133 QString xLabelFormat() const { return m_xLabelFormatStr; }
134 LabelFormatMode yLabelFormatMode() const { return m_yLabelMode; }
135 int yLabelPrecision() const { return m_yLabelPrecision; }
136 QString yLabelFormat() const { return m_yLabelFormatStr; }
139 { return { static_cast<openswmmvis::plot::NumberFormatMode>(m_xLabelMode), m_xLabelPrecision, m_xLabelFormatStr }; }
141 { return { static_cast<openswmmvis::plot::NumberFormatMode>(m_yLabelMode), m_yLabelPrecision, m_yLabelFormatStr }; }
142 bool legendVisible() const { return m_legendVisible; }
143 LegendPosition legendPosition() const { return m_legendPosition; }
144 QFont legendFont() const { return m_legendFont; }
145 double legendOpacity() const { return m_legendOpacity; }
146 QPointF legendOffset() const { return m_legendOffset; }
147 bool showTimeLabel() const { return m_showTimeLabel; }
148 TimeLabelPosition timeLabelPosition() const { return m_timeLabelPosition; }
149 QColor timeLabelColor() const { return m_timeLabelColor; }
150 QFont timeLabelFont() const { return m_timeLabelFont; }
151 QString timeLabelFormat() const { return m_timeLabelFormat; }
152 QPointF timeLabelOffset() const { return m_timeLabelOffset; }
153
154public slots:
155 void setShowDepthFill(bool v);
156 void setShowWseLine(bool v);
157 void setShowMaxEnvelopeFill(bool v);
158 void setShowMaxEnvelopeLine(bool v);
159 void setShowCellBoundaries(bool v);
160 void setCellBoundaryColor(const QColor &c);
161 void setSoilFill(const QBrush &b);
162 void setGroundLinePen(const QPen &p);
163 void setDepthFillBrush(const QBrush &b);
164 void setWseLinePen(const QPen &p);
165 void setMaxEnvelopePen(const QPen &p);
166 void setMaxEnvelopeBrush(const QBrush &b);
170 void setXLabelPrecision(int count);
171 void setXLabelFormat(const QString &spec);
173 void setYLabelPrecision(int count);
174 void setYLabelFormat(const QString &spec);
175 void setLegendVisible(bool v);
177 void setLegendFont(const QFont &f);
178 void setLegendOpacity(double a);
179 void setLegendOffset(const QPointF &p);
180 void setShowTimeLabel(bool v);
182 void setTimeLabelColor(const QColor &c);
183 void setTimeLabelFont(const QFont &f);
184 void setTimeLabelFormat(const QString &fmt);
185 void setTimeLabelOffset(const QPointF &p);
186
187signals:
188 void changed();
189
190private:
191 bool m_showDepthFill = true;
192 bool m_showWseLine = true;
193 bool m_showMaxEnvelopeFill = true;
194 bool m_showMaxEnvelopeLine = true;
195 bool m_showCellBoundaries = true;
196
197 // Terrain earth tone (matches the 1D profile soil fill) + crisp ground
198 // line; animated depth in a translucent water blue; max envelope a
199 // dashed line over a faint band.
200 QBrush m_soilFill {QColor(0xC6, 0xA9, 0x7A, 160)};
201 QPen m_groundLinePen = QPen(QColor(0x6B, 0x52, 0x2E), 1.6, Qt::SolidLine);
202 QBrush m_depthFillBrush {QColor(0x55, 0xA8, 0xE6, 120)};
203 QPen m_wseLinePen = QPen(QColor(0x1F, 0x6F, 0xB7), 2.0, Qt::SolidLine);
204 QPen m_maxEnvelopePen = QPen(QColor(0x1F, 0x6F, 0xB7), 1.4, Qt::DashLine);
205 QBrush m_maxEnvelopeBrush {QColor(0x55, 0xA8, 0xE6, 60)};
206
207 // Diagnostic dots where the traced line crosses a mesh-cell edge — a warm
208 // accent that reads against the blue water and brown ground.
209 QColor m_cellBoundaryColor {0xD9, 0x53, 0x1E};
210
211 // Axis number format — seeded from the global Preferences default in the
212 // constructor.
213 LabelFormatMode m_xLabelMode = Decimals;
214 int m_xLabelPrecision = 0;
215 QString m_xLabelFormatStr; // optional printf override; empty = use mode+precision
216 LabelFormatMode m_yLabelMode = Decimals;
217 int m_yLabelPrecision = 2;
218 QString m_yLabelFormatStr; // optional printf override; empty = use mode+precision
219
220 bool m_legendVisible = true;
221 LegendPosition m_legendPosition = TopRight;
222 QFont m_legendFont;
223 double m_legendOpacity = 0.86;
224 QPointF m_legendOffset {0.0, 0.0};
225
226 bool m_showTimeLabel = true;
227 TimeLabelPosition m_timeLabelPosition = TimeTopLeft;
228 QColor m_timeLabelColor {0x10, 0x10, 0x10};
229 QFont m_timeLabelFont;
230 QString m_timeLabelFormat = QStringLiteral("dd-MMM-yyyy HH:mm:ss");
231 QPointF m_timeLabelOffset {0.0, 0.0};
232};
233
234#endif // MESH_PROFILE_PLOT_OPTIONS_H
Definition meshprofileplotoptions.h:28
double legendOpacity() const
Definition meshprofileplotoptions.h:145
openswmmvis::plot::NumberFormat xFormat() const
Current X/Y axis label format as the shared value type.
Definition meshprofileplotoptions.h:138
QFont timeLabelFont() const
Definition meshprofileplotoptions.h:150
AxisNumberFormat
Definition meshprofileplotoptions.h:45
@ SigFigs4
Definition meshprofileplotoptions.h:53
@ SigFigs3
Definition meshprofileplotoptions.h:52
@ Integer
Definition meshprofileplotoptions.h:46
@ Decimals1
Definition meshprofileplotoptions.h:47
@ Decimals6
Definition meshprofileplotoptions.h:51
@ Decimals4
Definition meshprofileplotoptions.h:50
@ Decimals2
Definition meshprofileplotoptions.h:48
@ Decimals3
Definition meshprofileplotoptions.h:49
@ SigFigs6
Definition meshprofileplotoptions.h:54
void setLegendPosition(LegendPosition p)
Definition meshprofileplotoptions.cpp:124
QColor cellBoundaryColor
Definition meshprofileplotoptions.h:76
void setWseLinePen(const QPen &p)
Definition meshprofileplotoptions.cpp:78
void setTimeLabelFormat(const QString &fmt)
Definition meshprofileplotoptions.cpp:136
QFont legendFont() const
Definition meshprofileplotoptions.h:144
LabelFormatMode xLabelFormatMode() const
Definition meshprofileplotoptions.h:131
bool showCellBoundaries() const
Definition meshprofileplotoptions.h:118
QBrush depthFillBrush
Definition meshprofileplotoptions.h:72
void setYAxisNumberFormat(AxisNumberFormat f)
Definition meshprofileplotoptions.cpp:103
bool showCellBoundaries
Definition meshprofileplotoptions.h:67
QString yLabelFormat() const
Definition meshprofileplotoptions.h:136
QPen maxEnvelopePen
Definition meshprofileplotoptions.h:74
bool showMaxEnvelopeLine
Definition meshprofileplotoptions.h:66
TimeLabelPosition
Definition meshprofileplotoptions.h:58
@ TimeTopRight
Definition meshprofileplotoptions.h:58
@ TimeTopLeft
Definition meshprofileplotoptions.h:58
@ TimeBottomLeft
Definition meshprofileplotoptions.h:59
@ TimeBottomRight
Definition meshprofileplotoptions.h:59
bool showMaxEnvelopeFill() const
Definition meshprofileplotoptions.h:116
bool showTimeLabel
Definition meshprofileplotoptions.h:99
bool legendVisible
Definition meshprofileplotoptions.h:91
QBrush maxEnvelopeBrush() const
Definition meshprofileplotoptions.h:125
void setMaxEnvelopeBrush(const QBrush &b)
Definition meshprofileplotoptions.cpp:80
void setShowMaxEnvelopeLine(bool v)
Definition meshprofileplotoptions.cpp:71
void setLegendOpacity(double a)
Definition meshprofileplotoptions.cpp:126
void setLegendVisible(bool v)
Definition meshprofileplotoptions.cpp:123
void setXLabelPrecision(int count)
Definition meshprofileplotoptions.cpp:111
QBrush soilFill() const
Definition meshprofileplotoptions.h:120
LegendPosition legendPosition() const
Definition meshprofileplotoptions.h:143
void setMaxEnvelopePen(const QPen &p)
Definition meshprofileplotoptions.cpp:79
void setTimeLabelFont(const QFont &f)
Definition meshprofileplotoptions.cpp:135
MeshProfilePlotOptions::TimeLabelPosition timeLabelPosition
Definition meshprofileplotoptions.h:101
void setCellBoundaryColor(const QColor &c)
Definition meshprofileplotoptions.cpp:73
openswmmvis::plot::NumberFormat yFormat() const
Definition meshprofileplotoptions.h:140
QPen groundLinePen() const
Definition meshprofileplotoptions.h:121
QPointF legendOffset() const
Definition meshprofileplotoptions.h:146
void setXLabelFormat(const QString &spec)
Definition meshprofileplotoptions.cpp:115
QBrush depthFillBrush() const
Definition meshprofileplotoptions.h:122
QPointF timeLabelOffset
Definition meshprofileplotoptions.h:105
void setShowMaxEnvelopeFill(bool v)
Definition meshprofileplotoptions.cpp:70
QPointF timeLabelOffset() const
Definition meshprofileplotoptions.h:152
void setTimeLabelOffset(const QPointF &p)
Definition meshprofileplotoptions.cpp:137
bool showTimeLabel() const
Definition meshprofileplotoptions.h:147
void setShowWseLine(bool v)
Definition meshprofileplotoptions.cpp:69
QString xLabelFormat() const
Definition meshprofileplotoptions.h:133
bool showWseLine() const
Definition meshprofileplotoptions.h:115
void setGroundLinePen(const QPen &p)
Definition meshprofileplotoptions.cpp:76
void setYLabelFormat(const QString &spec)
Definition meshprofileplotoptions.cpp:121
QColor timeLabelColor() const
Definition meshprofileplotoptions.h:149
QBrush soilFill
Definition meshprofileplotoptions.h:70
MeshProfilePlotOptions::AxisNumberFormat xAxisNumberFormat
Definition meshprofileplotoptions.h:82
void setLegendFont(const QFont &f)
Definition meshprofileplotoptions.cpp:125
void setShowTimeLabel(bool v)
Definition meshprofileplotoptions.cpp:132
LegendPosition
Definition meshprofileplotoptions.h:32
@ TopRight
Definition meshprofileplotoptions.h:32
@ TopLeft
Definition meshprofileplotoptions.h:32
@ BottomLeft
Definition meshprofileplotoptions.h:32
@ BottomRight
Definition meshprofileplotoptions.h:32
QPen groundLinePen
Definition meshprofileplotoptions.h:71
QBrush maxEnvelopeBrush
Definition meshprofileplotoptions.h:75
QPen maxEnvelopePen() const
Definition meshprofileplotoptions.h:124
bool legendVisible() const
Definition meshprofileplotoptions.h:142
TimeLabelPosition timeLabelPosition() const
Definition meshprofileplotoptions.h:148
void setXAxisNumberFormat(AxisNumberFormat f)
Definition meshprofileplotoptions.cpp:94
double legendOpacity
Definition meshprofileplotoptions.h:95
LabelFormatMode
Axis label number mode; values mirror openswmmvis::plot::NumberFormatMode (0=Decimals,...
Definition meshprofileplotoptions.h:37
@ Decimals
Definition meshprofileplotoptions.h:37
@ SignificantFigures
Definition meshprofileplotoptions.h:37
void setTimeLabelColor(const QColor &c)
Definition meshprofileplotoptions.cpp:134
LabelFormatMode yLabelFormatMode() const
Definition meshprofileplotoptions.h:134
void setDepthFillBrush(const QBrush &b)
Definition meshprofileplotoptions.cpp:77
void setLegendOffset(const QPointF &p)
Definition meshprofileplotoptions.cpp:130
QPen wseLinePen() const
Definition meshprofileplotoptions.h:123
QString timeLabelFormat
Definition meshprofileplotoptions.h:104
void setXLabelFormatMode(LabelFormatMode m)
Definition meshprofileplotoptions.cpp:110
QPointF legendOffset
Definition meshprofileplotoptions.h:96
void setSoilFill(const QBrush &b)
Definition meshprofileplotoptions.cpp:75
void setYLabelPrecision(int count)
Definition meshprofileplotoptions.cpp:117
void setShowCellBoundaries(bool v)
Definition meshprofileplotoptions.cpp:72
bool showMaxEnvelopeLine() const
Definition meshprofileplotoptions.h:117
QColor cellBoundaryColor() const
Definition meshprofileplotoptions.h:119
QPen wseLinePen
Definition meshprofileplotoptions.h:73
bool showMaxEnvelopeFill
Definition meshprofileplotoptions.h:65
bool showWseLine
Definition meshprofileplotoptions.h:64
void setTimeLabelPosition(TimeLabelPosition p)
Definition meshprofileplotoptions.cpp:133
int yLabelPrecision() const
Definition meshprofileplotoptions.h:135
bool showDepthFill
Definition meshprofileplotoptions.h:63
MeshProfilePlotOptions::AxisNumberFormat yAxisNumberFormat
Definition meshprofileplotoptions.h:86
QFont legendFont
Definition meshprofileplotoptions.h:94
Q_INVOKABLE QString displayLabelFor(const QString &propertyName) const
Human-readable label for the QPropertyModel row header.
Definition meshprofileplotoptions.cpp:34
MeshProfilePlotOptions::LegendPosition legendPosition
Definition meshprofileplotoptions.h:93
QString xLabelFormat
Definition meshprofileplotoptions.h:84
int xLabelPrecision() const
Definition meshprofileplotoptions.h:132
QString yLabelFormat
Definition meshprofileplotoptions.h:88
void setYLabelFormatMode(LabelFormatMode m)
Definition meshprofileplotoptions.cpp:116
QColor timeLabelColor
Definition meshprofileplotoptions.h:102
void setShowDepthFill(bool v)
Definition meshprofileplotoptions.cpp:68
QString timeLabelFormat() const
Definition meshprofileplotoptions.h:151
QFont timeLabelFont
Definition meshprofileplotoptions.h:103
ArrowPlacement p
Definition linesymbollayer.cpp:27
MaskMode m
Definition maskspec.cpp:18
int b
local residual indices, a < b
Definition meshquadmatch.cpp:46
int a
Definition meshquadmatch.cpp:46
NumberFormatMode
Interpretation of NumberFormat::count.
Definition numberformat.h:32
int count
Definition numberformat.cpp:101
Single source of truth for how chart plots render numeric values.
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
A mode + count describing how to render a double.
Definition numberformat.h:41