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
temporalspec.h
Go to the documentation of this file.
1
29#ifndef OPENSWMM_RENDER_TEMPORALSPEC_H
30#define OPENSWMM_RENDER_TEMPORALSPEC_H
31
32#include <QDateTime>
33#include <QJsonObject>
34#include <QString>
35
36namespace OpenSWMM::Render
37{
38
43enum class TemporalMode : int {
44 Single = 0,
45 Range = 1,
46 Cumulative = 2,
47};
48
49[[nodiscard]] QString temporalModeToString(TemporalMode m);
50[[nodiscard]] TemporalMode temporalModeFromString(const QString &s);
51
57{
61 bool enabled = false;
62
66 QString timeField;
67
70
73 qreal frameRateFps = 12.0;
74
76 bool loop = false;
77
80 bool pingPong = false;
81
84 QDateTime startTime;
85 QDateTime endTime;
86
89 qreal rangeWindowSec = 0.0;
90
93 [[nodiscard]] QJsonObject toJson() const;
94 static TemporalSpec fromJson(const QJsonObject &j);
95
97 [[nodiscard]] bool operator==(const TemporalSpec &other) const;
98 [[nodiscard]] bool operator!=(const TemporalSpec &other) const
99 { return !(*this == other); }
100};
101
102} // namespace OpenSWMM::Render
103
104#endif // OPENSWMM_RENDER_TEMPORALSPEC_H
double s
Scene px per model length unit.
Definition inletdrawingview.cpp:82
MaskMode m
Definition maskspec.cpp:18
Definition gisrasterlayer.h:40
TemporalMode
How the time axis is consumed at paint time.
Definition temporalspec.h:43
TemporalMode temporalModeFromString(const QString &s)
Definition temporalspec.cpp:43
QString temporalModeToString(TemporalMode m)
Definition temporalspec.cpp:36
Per-layer temporal-animation configuration.
Definition temporalspec.h:57
qreal frameRateFps
Playback frame rate in frames per second. Clamped to [0.1, 60.0] at write time to prevent pathologica...
Definition temporalspec.h:73
bool loop
Loop on reaching the end of the playback range.
Definition temporalspec.h:76
QJsonObject toJson() const
JSON round-trip. Empty fields are omitted to keep persistence diffs minimal.
Definition temporalspec.cpp:50
bool operator==(const TemporalSpec &other) const
Equality — for change detection in the tab UI.
Definition temporalspec.cpp:98
QDateTime startTime
Playback range — start and end times. Invalid (default- constructed) means "use the layer's full exte...
Definition temporalspec.h:84
bool enabled
Whether temporal driving is enabled on this layer. When false, the layer paints at a static reference...
Definition temporalspec.h:61
bool pingPong
Ping-pong (reverse on reaching ends) instead of jumping back to start. Implies loop=true when set.
Definition temporalspec.h:80
QDateTime endTime
Definition temporalspec.h:85
QString timeField
Datetime-typed attribute name for vector layers. For result layers the time axis is implicit (output ...
Definition temporalspec.h:66
TemporalMode mode
Playback mode.
Definition temporalspec.h:69
bool operator!=(const TemporalSpec &other) const
Definition temporalspec.h:98
static TemporalSpec fromJson(const QJsonObject &j)
Definition temporalspec.cpp:74
qreal rangeWindowSec
Range-mode window length in seconds (used only when mode == Range). Default 0 means a one-sample wind...
Definition temporalspec.h:89