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
timeseriesseriescommands.h
Go to the documentation of this file.
1
30#ifndef OPENSWMMVIS_TIMESERIES_TIMESERIESSERIESCOMMANDS_H
31#define OPENSWMMVIS_TIMESERIES_TIMESERIESSERIESCOMMANDS_H
32
34
35#include <QString>
36#include <QUndoCommand>
37#include <QVector>
38
40
42class AddTimeseriesCommand : public QUndoCommand
43{
44public:
48 AddTimeseriesCommand(void *layerHandle,
49 QString name,
50 QVector<TimeseriesPoint> points,
51 QString unitsLabel,
52 QString description,
53 QUndoCommand *parent = nullptr);
54 void undo() override;
55 void redo() override;
56
57private:
58 void *m_layer = nullptr;
59 QString m_name;
60 QVector<TimeseriesPoint> m_points;
61 QString m_unitsLabel;
62 QString m_description;
63 bool m_preexisting = false;
64};
65
67class SetTimeseriesPointsCommand : public QUndoCommand
68{
69public:
70 SetTimeseriesPointsCommand(void *layerHandle,
71 QString name,
72 QVector<TimeseriesPoint> newPoints,
73 QString newDescription,
74 QUndoCommand *parent = nullptr);
75 void undo() override;
76 void redo() override;
77
78private:
79 void apply(const QVector<TimeseriesPoint> &pts, const QString &desc);
80
81 void *m_layer = nullptr;
82 QString m_name;
83 QVector<TimeseriesPoint> m_newPoints, m_oldPoints;
84 QString m_newDescription, m_oldDescription;
85 bool m_captured = false;
86};
87
89class DeleteTimeseriesCommand : public QUndoCommand
90{
91public:
92 DeleteTimeseriesCommand(void *layerHandle,
93 QString name,
94 QUndoCommand *parent = nullptr);
95 void undo() override;
96 void redo() override;
97
98private:
99 void *m_layer = nullptr;
100 QString m_name;
101 QVector<TimeseriesPoint> m_points;
102 QString m_unitsLabel;
103 QString m_description;
104 bool m_captured = false;
105};
106
107} // namespace openswmmvis::timeseries
108
109#endif // OPENSWMMVIS_TIMESERIES_TIMESERIESSERIESCOMMANDS_H
Create an inline series and flush it to the engine.
Definition timeseriesseriescommands.h:43
void undo() override
Definition timeseriesseriescommands.cpp:104
void redo() override
Definition timeseriesseriescommands.cpp:79
Delete a series from both the registry and the engine.
Definition timeseriesseriescommands.h:90
void redo() override
Definition timeseriesseriescommands.cpp:179
void undo() override
Definition timeseriesseriescommands.cpp:199
Replace every point (and the description) of an existing series.
Definition timeseriesseriescommands.h:68
void undo() override
Definition timeseriesseriescommands.cpp:163
void redo() override
Definition timeseriesseriescommands.cpp:146
QVector< QPointF > pts
Definition meshpatch.cpp:62
Definition timeseriesprovider.h:34
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString name
Definition sectionmodelbuilders.cpp:474
Slice BQ Phase 6.7.3.1 — MVC model for a single Tseries.