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
inletundocommands.h
Go to the documentation of this file.
1
20#ifndef OPENSWMMVIS_INLET_INLETUNDOCOMMANDS_H
21#define OPENSWMMVIS_INLET_INLETUNDOCOMMANDS_H
22
23#include "inlet/inletprovider.h"
24
25#include <QPointer>
26#include <QString>
27#include <QUndoCommand>
28
29namespace openswmmvis::inlet {
30
31class InletRegistry;
32
33// ─── Design edits ───────────────────────────────────────────────────────────
34
36class SetInletTypeCommand : public QUndoCommand
37{
38public:
40 InletType newType,
41 QUndoCommand *parent = nullptr);
42 void undo() override;
43 void redo() override;
44
45private:
46 QPointer<InletProvider> m_provider;
47 InletType m_oldType;
48 InletType m_newType;
49};
50
54class SetInletParamsCommand : public QUndoCommand
55{
56public:
58 InletDesignData before,
59 InletDesignData after,
60 QUndoCommand *parent = nullptr);
61 void undo() override;
62 void redo() override;
63
64private:
65 QPointer<InletProvider> m_provider;
66 InletDesignData m_before;
67 InletDesignData m_after;
68};
69
71class SetInletCommentsCommand : public QUndoCommand
72{
73public:
75 QString newComments,
76 QUndoCommand *parent = nullptr);
77 void undo() override;
78 void redo() override;
79
80private:
81 QPointer<InletProvider> m_provider;
82 QString m_oldComments;
83 QString m_newComments;
84};
85
86// ─── Identity / lifetime ────────────────────────────────────────────────────
87
89class RenameInletCommand : public QUndoCommand
90{
91public:
93 InletProvider *provider,
94 QString newName,
95 QUndoCommand *parent = nullptr);
96 void undo() override;
97 void redo() override;
98
99private:
100 QPointer<InletRegistry> m_registry;
101 QPointer<InletProvider> m_provider;
102 QString m_oldName;
103 QString m_newName;
104};
105
107class AddInletCommand : public QUndoCommand
108{
109public:
111 QString name,
112 QUndoCommand *parent = nullptr);
113 void undo() override;
114 void redo() override;
115
118 InletProvider *provider() const;
119
120private:
121 QPointer<InletRegistry> m_registry;
122 QString m_name;
123};
124
126class DeleteInletCommand : public QUndoCommand
127{
128public:
130 InletProvider *provider,
131 QUndoCommand *parent = nullptr);
132 void undo() override;
133 void redo() override;
134
135private:
136 QPointer<InletRegistry> m_registry;
137 QString m_name;
138 QString m_comments;
139 InletDesignData m_design;
140};
141
142} // namespace openswmmvis::inlet
143
144#endif // OPENSWMMVIS_INLET_INLETUNDOCOMMANDS_H
Create a new design with default parameters.
Definition inletundocommands.h:108
void undo() override
Definition inletundocommands.cpp:132
InletProvider * provider() const
The provider created by the most recent redo (null before the first redo, or after an undo).
Definition inletundocommands.cpp:122
void redo() override
Definition inletundocommands.cpp:127
Delete a design. Undo recreates it from the stored snapshot.
Definition inletundocommands.h:127
void redo() override
Definition inletundocommands.cpp:152
void undo() override
Definition inletundocommands.cpp:158
Definition inletprovider.h:95
Definition inletregistry.h:29
Rename via the registry (uniqueness enforced by the registry).
Definition inletundocommands.h:90
void undo() override
Definition inletundocommands.cpp:105
void redo() override
Definition inletundocommands.cpp:100
Free-form description ([INLETS] comment line).
Definition inletundocommands.h:72
void undo() override
Definition inletundocommands.cpp:80
void redo() override
Definition inletundocommands.cpp:75
Whole-design snapshot write. The dialog captures the design before the property bag pushes its edit a...
Definition inletundocommands.h:55
void redo() override
Definition inletundocommands.cpp:52
void undo() override
Definition inletundocommands.cpp:57
Switch the inlet type (which groups of parameters apply).
Definition inletundocommands.h:37
void undo() override
Definition inletundocommands.cpp:33
void redo() override
Definition inletundocommands.cpp:28
MVC model for a single SWMM inlet design ([INLETS]).
Definition inletprovider.h:27
InletType
Inlet design type. Values match SWMM_InletType.
Definition inletprovider.h:30
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString name
Definition sectionmodelbuilders.cpp:474
Every parameter of one inlet design, mirroring SWMM_InletDesign. Snapshot type for the undo commands ...
Definition inletprovider.h:70