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
importcommands.h
Go to the documentation of this file.
1
19#ifndef OPENSWMMVIS_MAP_IMPORTCOMMANDS_H
20#define OPENSWMMVIS_MAP_IMPORTCOMMANDS_H
21
22#include "map/mapundostack.h"
23
24#include <QPointF>
25#include <QString>
26#include <QVariantMap>
27#include <QVector>
28
43{
44public:
46 quint8 kind, // SWMMModelLayer::kKindNode/Link/Gage
47 QString name,
48 QVariantMap newValues,
49 QVariantMap oldValues,
51 QUndoCommand *parent = nullptr);
52
53 void undo() override;
54 void redo() override;
55 int id() const override { return 41; }
56
63 [[nodiscard]] static QObject *createAdapter(SWMMModelLayer *layer,
64 quint8 kind,
65 const QString &name);
66
67private:
68 void apply(const QVariantMap &values);
69
70 SWMMModelLayer *m_layer = nullptr;
71 quint8 m_kind = 0;
72 QString m_name;
73 QVariantMap m_newValues;
74 QVariantMap m_oldValues;
75};
76
82{
83public:
85 QString linkName,
86 QVector<QPointF> oldInterior,
87 QVector<QPointF> newInterior,
89 QUndoCommand *parent = nullptr);
90
91 void undo() override;
92 void redo() override;
93 int id() const override { return 42; }
94
95private:
96 void apply(const QVector<QPointF> &interior);
97
98 SWMMModelLayer *m_layer = nullptr;
99 QString m_name;
100 QVector<QPointF> m_oldInterior;
101 QVector<QPointF> m_newInterior;
102};
103
104#endif // OPENSWMMVIS_MAP_IMPORTCOMMANDS_H
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Abstract base for all undoable commands that affect the MapCanvas.
Definition mapundostack.h:172
MapCanvas * canvas() const
Definition mapundostack.cpp:85
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
Undoable bulk attribute write on one node / link / rain gage, routed through the object's property ad...
Definition importcommands.h:43
void undo() override
Definition importcommands.cpp:103
static QObject * createAdapter(SWMMModelLayer *layer, quint8 kind, const QString &name)
Definition importcommands.cpp:37
int id() const override
Definition importcommands.h:55
void redo() override
Definition importcommands.cpp:102
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
TokenKind kind
Definition queryparser.cpp:34
QString name
Definition sectionmodelbuilders.cpp:474