![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Undoable write of a COMPLETE per-cell infiltration row (method plus every positional parameter plus destination) across a set of triangles — GUI plan §3.5(3), phase GG0c. More...
#include <meshcommands.h>
Public Member Functions | |
| MeshSetTriangleInfilCommand (SWMM2DMeshLayer *layer, QVector< int > triangles, mesh::InfilRow newRow, QVector< mesh::InfilRow > oldRows, QVector< mesh::InfilProvenance > oldProv, const QString &text, MapCanvas *canvas, QUndoCommand *parent=nullptr) | |
| void | undo () override |
| void | redo () override |
| int | id () const override |
Public Member Functions inherited from MapCommand | |
| MapCommand (const QString &text, MapCanvas *canvas, QUndoCommand *parent=nullptr) | |
Constructs a map command with a human-readable text. | |
| MapCanvas * | canvas () const |
Additional Inherited Members | |
Protected Attributes inherited from MapCommand | |
| MapCanvas * | m_canvas |
Undoable write of a COMPLETE per-cell infiltration row (method plus every positional parameter plus destination) across a set of triangles — GUI plan §3.5(3), phase GG0c.
MeshSetTriangleAttributeCommand carries one key and parallel double vectors, which is right for a single-column table edit and wrong for "assign this method and its five parameters to 400 selected cells": that has to be one atomic action, and the parameters only mean anything together.
The old state records PROVENANCE, not just values. A cell that was inheriting from its region tag (or the '*' default) must go back to inheriting on undo — restoring a materialised override carrying identical numbers looks correct but silently detaches the cell from its region, so the next region-level edit no longer reaches it. undo() therefore branches on the stored mesh::InfilProvenance: Override restores the old row, Tag / Star / None erase the override through SWMM2DMeshLayer::clearMeshTriangleInfil.
The layer is held as a QPointer: if it is closed, the command becomes inert rather than dangling.
| MeshSetTriangleInfilCommand::MeshSetTriangleInfilCommand | ( | SWMM2DMeshLayer * | layer, |
| QVector< int > | triangles, | ||
| mesh::InfilRow | newRow, | ||
| QVector< mesh::InfilRow > | oldRows, | ||
| QVector< mesh::InfilProvenance > | oldProv, | ||
| const QString & | text, | ||
| MapCanvas * | canvas, | ||
| QUndoCommand * | parent = nullptr |
||
| ) |
| layer | Mesh layer that owns the triangles. |
| triangles | Triangle indices to write. |
| newRow | The row every triangle in triangles receives. |
| oldRows | Parallel to triangles: each cell's pre-edit RESOLVED row. |
| oldProv | Parallel to triangles: where that row came from. Anything but Override means the cell was inheriting and undo must erase, not rewrite. |
| text | Undo-stack label. |
|
inlineoverride |
|
override |
|
override |