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
meshcommands.h
Go to the documentation of this file.
1
16#ifndef OPENSWMMVIS_MAP_MESHCOMMANDS_H
17#define OPENSWMMVIS_MAP_MESHCOMMANDS_H
18
19#include "map/mapundostack.h"
20#include "mesh/meshedgebc.h"
21#include "mesh/meshinfil.h"
22#include "mesh/meshresult.h"
23
24#include <QByteArray>
25#include <QPair>
26#include <QPointer>
27#include <QString>
28#include <QVariant>
29#include <QVector>
30
31class SWMM2DMeshLayer;
32
44{
45public:
47 QVector<int> triangles,
48 QString newTag,
49 QVector<QString> oldTags,
50 const QString &text,
52 QUndoCommand *parent = nullptr);
53
54 void undo() override;
55 void redo() override;
56 int id() const override { return 44; }
57
58private:
59 QPointer<SWMM2DMeshLayer> m_layer;
60 QVector<int> m_tris;
61 QString m_newTag;
62 QVector<QString> m_oldTags;
63};
64
66{
67public:
76 QByteArray key,
77 QVector<int> triangles,
78 QVector<double> newValues,
79 QVector<double> oldValues,
80 const QString &text,
82 QUndoCommand *parent = nullptr);
83
84 void undo() override;
85 void redo() override;
86 int id() const override { return 43; }
87
88private:
89 void apply(const QVector<double> &values);
90
91 QPointer<SWMM2DMeshLayer> m_layer;
92 QByteArray m_key;
93 QVector<int> m_tris;
94 QVector<double> m_newValues;
95 QVector<double> m_oldValues;
96};
97
114{
115public:
124 QByteArray key,
125 QVector<int> vertices,
126 QVector<mesh::MeshVertex> newAttrs,
127 QVector<mesh::MeshVertex> oldAttrs,
128 const QString &text,
130 QUndoCommand *parent = nullptr);
131
132 void undo() override;
133 void redo() override;
134 int id() const override { return 45; }
135
136private:
137 void apply(const QVector<mesh::MeshVertex> &attrs);
138
139 QPointer<SWMM2DMeshLayer> m_layer;
140 QByteArray m_key;
141 QVector<int> m_verts;
142 QVector<mesh::MeshVertex> m_newAttrs;
143 QVector<mesh::MeshVertex> m_oldAttrs;
144};
145
160{
161public:
171 QByteArray key,
172 QVector<int> edgeSlots,
173 QVector<mesh::MeshEdgeBC> newBCs,
174 QVector<mesh::MeshEdgeBC> oldBCs,
175 const QString &text,
177 QUndoCommand *parent = nullptr);
178
179 void undo() override;
180 void redo() override;
181 int id() const override { return 46; }
182
183private:
184 void apply(const QVector<mesh::MeshEdgeBC> &bcs);
185
186 QPointer<SWMM2DMeshLayer> m_layer;
187 QByteArray m_key;
188 QVector<int> m_slots;
189 QVector<mesh::MeshEdgeBC> m_newBCs;
190 QVector<mesh::MeshEdgeBC> m_oldBCs;
191};
192
218{
219public:
230 QVector<int> triangles,
231 mesh::InfilRow newRow,
232 QVector<mesh::InfilRow> oldRows,
233 QVector<mesh::InfilProvenance> oldProv,
234 const QString &text,
236 QUndoCommand *parent = nullptr);
237
238 void undo() override;
239 void redo() override;
240 int id() const override { return 49; }
241
242private:
243 QPointer<SWMM2DMeshLayer> m_layer;
244 QVector<int> m_tris;
245 mesh::InfilRow m_newRow;
246 QVector<mesh::InfilRow> m_oldRows;
247 QVector<mesh::InfilProvenance> m_oldProv;
248};
249
271{
272public:
282 QVector<QString> tags,
283 QVector<mesh::InfilRow> newRows,
284 QVector<mesh::InfilRow> oldRows,
285 QVector<bool> oldExisted,
286 const QString &text,
288 QUndoCommand *parent = nullptr);
289
290 void undo() override;
291 void redo() override;
292 int id() const override { return 50; }
293
294private:
295 QPointer<SWMM2DMeshLayer> m_layer;
296 QVector<QString> m_tags;
297 QVector<mesh::InfilRow> m_newRows;
298 QVector<mesh::InfilRow> m_oldRows;
299 QVector<bool> m_oldExisted;
300};
301
302namespace mesh {
303
314int pushCellParamEdit(SWMM2DMeshLayer *layer, const QVector<int> &triangles,
315 const QByteArray &key, double value, MapCanvas *canvas);
316
322int pushCellParamEdits(SWMM2DMeshLayer *layer, const QVector<int> &triangles,
323 const QVector<double> &values, const QByteArray &key,
324 const QString &text, MapCanvas *canvas);
325
346int pushCellInfilEdit(SWMM2DMeshLayer *layer, const QVector<int> &triangles,
347 const InfilRow &row, MapCanvas *canvas);
348
368int pushInfilDefaultsEdit(SWMM2DMeshLayer *layer,
369 const QVector<InfilDefaultRow> &rows,
370 MapCanvas *canvas);
371
377int pushCellTagEdit(SWMM2DMeshLayer *layer, const QVector<int> &triangles,
378 const QString &tag, MapCanvas *canvas);
379
395int pushVertexParamEdit(SWMM2DMeshLayer *layer, const QVector<int> &vertices,
396 const QByteArray &key, const QVariant &value,
397 MapCanvas *canvas);
398
410int pushEdgeParamEdit(SWMM2DMeshLayer *layer,
411 const QVector<QPair<int, int>> &edges,
412 const QByteArray &key, const QVariant &value,
413 MapCanvas *canvas);
414
424int pushEdgeBCEdit(SWMM2DMeshLayer *layer,
425 const QVector<QPair<int, int>> &edges,
426 const MeshEdgeBC &bc, MapCanvas *canvas);
427
428} // namespace mesh
429
430#endif // OPENSWMMVIS_MAP_MESHCOMMANDS_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
Undoable write of one per-edge attribute across a set of edge slots.
Definition meshcommands.h:160
void undo() override
Definition meshcommands.cpp:205
void redo() override
Definition meshcommands.cpp:206
int id() const override
Definition meshcommands.h:181
Undoable write of one or more [2D_INFILTRATION_DEFAULTS] tag rows — the region-level peer of MeshSetT...
Definition meshcommands.h:271
int id() const override
Definition meshcommands.h:292
void redo() override
Definition meshcommands.cpp:269
void undo() override
Definition meshcommands.cpp:276
Undoable write of one per-cell parameter across a set of triangles.
Definition meshcommands.h:66
int id() const override
Definition meshcommands.h:86
void undo() override
Definition meshcommands.cpp:101
void redo() override
Definition meshcommands.cpp:102
Undoable write of a COMPLETE per-cell infiltration row (method plus every positional parameter plus d...
Definition meshcommands.h:218
void redo() override
Definition meshcommands.cpp:226
void undo() override
Definition meshcommands.cpp:232
int id() const override
Definition meshcommands.h:240
Definition meshcommands.h:44
void undo() override
Definition meshcommands.cpp:126
int id() const override
Definition meshcommands.h:56
void redo() override
Definition meshcommands.cpp:120
Undoable write of one per-vertex attribute across a set of vertices.
Definition meshcommands.h:114
void undo() override
Definition meshcommands.cpp:167
void redo() override
Definition meshcommands.cpp:168
int id() const override
Definition meshcommands.h:134
Definition swmm2dmeshlayer.h:64
MeshEdgeBC bc
Definition inpmeshreader.cpp:41
const char * key
Definition meshcellparams.cpp:24
QString tag
r.tag or inherited from a dropped RegionMarker.
Definition meshgenerator.cpp:167
Per-cell 2D infiltration: value types, tag/override resolution and method↔parameter masks.
Definition meshcommands.h:302
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString text
Definition queryparser.cpp:35
One infiltration specification: method + positional parameters + destination.
Definition meshinfil.h:98
Definition meshedgebc.h:24