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
timeseriesundocommands.h
Go to the documentation of this file.
1
18#ifndef OPENSWMMVIS_TIMESERIES_TIMESERIESUNDOCOMMANDS_H
19#define OPENSWMMVIS_TIMESERIES_TIMESERIESUNDOCOMMANDS_H
20
22
23#include <QDateTime>
24#include <QString>
25#include <QUndoCommand>
26#include <QVector>
27
29
31class SetPointValueCommand : public QUndoCommand
32{
33public:
35 int index,
36 double newValue,
37 QUndoCommand *parent = nullptr);
38 void undo() override;
39 void redo() override;
40
41private:
42 TimeseriesProvider *m_provider;
43 int m_index;
44 double m_oldValue;
45 double m_newValue;
46};
47
50class MovePointCommand : public QUndoCommand
51{
52public:
54 int index,
55 QDateTime newTime,
56 double newValue,
57 QUndoCommand *parent = nullptr);
58 void undo() override;
59 void redo() override;
60
61private:
62 TimeseriesProvider *m_provider;
63 int m_index;
64 QDateTime m_oldTime;
65 double m_oldValue;
66 QDateTime m_newTime;
67 double m_newValue;
68};
69
71class InsertPointCommand : public QUndoCommand
72{
73public:
75 QDateTime time,
76 double value,
77 QUndoCommand *parent = nullptr);
78 void undo() override;
79 void redo() override;
80
83 int insertedIndex() const noexcept { return m_lastInsertedIndex; }
84
85private:
86 TimeseriesProvider *m_provider;
87 QDateTime m_time;
88 double m_value;
89 int m_lastInsertedIndex = -1;
90};
91
94class DeletePointsCommand : public QUndoCommand
95{
96public:
98 QVector<int> indices,
99 QUndoCommand *parent = nullptr);
100 void undo() override;
101 void redo() override;
102
103private:
104 TimeseriesProvider *m_provider;
105 QVector<TimeseriesPoint> m_removed;
106};
107
111class BulkTransformCommand : public QUndoCommand
112{
113public:
115 QVector<TimeseriesPoint> newPoints,
116 QString description,
117 QUndoCommand *parent = nullptr);
118 void undo() override;
119 void redo() override;
120
121private:
122 TimeseriesProvider *m_provider;
123 QVector<TimeseriesPoint> m_oldPoints;
124 QVector<TimeseriesPoint> m_newPoints;
125};
126
130class RenameTimeseriesCommand : public QUndoCommand
131{
132public:
134 QString newName,
135 QUndoCommand *parent = nullptr);
136 void undo() override;
137 void redo() override;
138
139private:
140 TimeseriesProvider *m_provider;
141 QString m_oldName;
142 QString m_newName;
143};
144
149class ChangeSourceModeCommand : public QUndoCommand
150{
151public:
154 QUndoCommand *parent = nullptr);
155 void undo() override;
156 void redo() override;
157
158private:
159 TimeseriesProvider *m_provider;
162};
163
168class SetTimeModeCommand : public QUndoCommand
169{
170public:
173 QDateTime anchorForRelative,
174 QUndoCommand *parent = nullptr);
175 void undo() override;
176 void redo() override;
177
178private:
179 TimeseriesProvider *m_provider;
180 int m_oldCount;
181 QDateTime m_oldAnchor;
182 bool m_oldAllRelative;
184 QDateTime m_anchor;
185};
186
187} // namespace openswmmvis::timeseries
188
189#endif // OPENSWMMVIS_TIMESERIES_TIMESERIESUNDOCOMMANDS_H
Replace the entire point list (used by rotate / scale bulk transforms). The caller must pre-validate ...
Definition timeseriesundocommands.h:112
void undo() override
Definition timeseriesundocommands.cpp:152
void redo() override
Definition timeseriesundocommands.cpp:151
Flip the source mode (Inline ↔ ExternalFile ↔ GeopackageObserved). Storage migration (reading file ro...
Definition timeseriesundocommands.h:150
void undo() override
Definition timeseriesundocommands.cpp:188
void redo() override
Definition timeseriesundocommands.cpp:187
Delete a set of points. Stores (time, value) for each so undo can reinstate them.
Definition timeseriesundocommands.h:95
void redo() override
Definition timeseriesundocommands.cpp:116
void undo() override
Definition timeseriesundocommands.cpp:129
Insert one point. Stores the time so undo can locate the inserted row.
Definition timeseriesundocommands.h:72
void redo() override
Definition timeseriesundocommands.cpp:81
void undo() override
Definition timeseriesundocommands.cpp:86
int insertedIndex() const noexcept
Index of the inserted point after redo. -1 until first redo, or if redo was rejected.
Definition timeseriesundocommands.h:83
Change both time and value at an existing index. The provider refuses if the new time would break str...
Definition timeseriesundocommands.h:51
void undo() override
Definition timeseriesundocommands.cpp:62
void redo() override
Definition timeseriesundocommands.cpp:63
Rename the Tseries. Cascading reference rewrites in dependent objects (inflows, rain gages,...
Definition timeseriesundocommands.h:131
void redo() override
Definition timeseriesundocommands.cpp:169
void undo() override
Definition timeseriesundocommands.cpp:170
Change one point's value. Time unchanged → monotonicity preserved.
Definition timeseriesundocommands.h:32
void redo() override
Definition timeseriesundocommands.cpp:36
void undo() override
Definition timeseriesundocommands.cpp:35
Switch the series between Absolute (dated) and Relative (elapsed-from-simulation-start) time modes....
Definition timeseriesundocommands.h:169
void undo() override
Definition timeseriesundocommands.cpp:211
void redo() override
Definition timeseriesundocommands.cpp:210
Definition timeseriesprovider.h:43
TimeMode
How the series' times were authored in the .inp.
Definition timeseriesprovider.h:66
SourceMode
Where the data lives.
Definition timeseriesprovider.h:48
int index
Position in m_quadRegions / m_quadReports.
Definition meshgenerator.cpp:153
Definition timeseriesprovider.h:34
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Slice BQ Phase 6.7.3.1 — MVC model for a single Tseries.