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
diagramspec.h
Go to the documentation of this file.
1
26#ifndef OPENSWMM_RENDER_DIAGRAMSPEC_H
27#define OPENSWMM_RENDER_DIAGRAMSPEC_H
28
29#include <QColor>
30#include <QJsonObject>
31#include <QPointF>
32#include <QSizeF>
33#include <QString>
34#include <QStringList>
35#include <QVector>
36
37namespace OpenSWMM::Render
38{
39
44enum class DiagramType : int {
45 Pie = 0,
46 Bar = 1,
47 TimeSeries = 2,
48 Histogram = 3,
49};
50
51[[nodiscard]] QString diagramTypeToString(DiagramType t);
52[[nodiscard]] DiagramType diagramTypeFromString(const QString &s);
53
59{
61 bool enabled = false;
62
65
69 QStringList attributes;
70
74
76 QSizeF sizePx = QSizeF(40.0, 40.0);
77
79 QPointF offsetPx = QPointF(0.0, 0.0);
80
83 QVector<QColor> palette;
84
87 qreal rangeMin = 0.0;
88 qreal rangeMax = 0.0;
89
90 [[nodiscard]] QJsonObject toJson() const;
91 static DiagramSpec fromJson(const QJsonObject &j);
92
93 [[nodiscard]] bool operator==(const DiagramSpec &other) const;
94 [[nodiscard]] bool operator!=(const DiagramSpec &other) const
95 { return !(*this == other); }
96};
97
98} // namespace OpenSWMM::Render
99
100#endif // OPENSWMM_RENDER_DIAGRAMSPEC_H
DiagramType t
Definition diagramspec.cpp:20
double s
Scene px per model length unit.
Definition inletdrawingview.cpp:82
Definition gisrasterlayer.h:40
QString diagramTypeToString(DiagramType t)
Definition diagramspec.cpp:30
DiagramType
Chart kind painted per feature.
Definition diagramspec.h:44
DiagramType diagramTypeFromString(const QString &s)
Definition diagramspec.cpp:37
Per-layer diagram configuration.
Definition diagramspec.h:59
DiagramType type
Chart kind.
Definition diagramspec.h:64
bool enabled
Master switch. When false, no chart is painted.
Definition diagramspec.h:61
bool operator==(const DiagramSpec &other) const
Definition diagramspec.cpp:104
QString seriesExpression
For TimeSeries: an expression that evaluates per feature to a vector of doubles. Empty for static cha...
Definition diagramspec.h:73
QStringList attributes
For static charts (Pie / Bar / Histogram): which attribute names drive the bars / wedges....
Definition diagramspec.h:69
QSizeF sizePx
Chart bounding-box size in pixels.
Definition diagramspec.h:76
qreal rangeMax
Definition diagramspec.h:88
static DiagramSpec fromJson(const QJsonObject &j)
Definition diagramspec.cpp:79
QPointF offsetPx
Offset from the feature's anchor point in pixels.
Definition diagramspec.h:79
qreal rangeMin
Value range for bars / histogram (min, max). Both zero = auto-fit to the data.
Definition diagramspec.h:87
bool operator!=(const DiagramSpec &other) const
Definition diagramspec.h:94
QJsonObject toJson() const
Definition diagramspec.cpp:44
QVector< QColor > palette
Color palette for wedges / bars. Empty → use the layer's categorical palette default.
Definition diagramspec.h:83