![]() |
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 one per-vertex attribute across a set of vertices. More...
#include <meshcommands.h>
Public Member Functions | |
| MeshSetVertexAttributeCommand (SWMM2DMeshLayer *layer, QByteArray key, QVector< int > vertices, QVector< mesh::MeshVertex > newAttrs, QVector< mesh::MeshVertex > oldAttrs, 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 one per-vertex attribute across a set of vertices.
Stores a snapshot of every touched vertex's editable attribute set (z / tag / coupledNode / couplingCd / couplingArea) on both sides of the edit rather than the single changed field. That is what makes undo faithful for the interdependent ones: clearing a coupling also resets Cd and Area to the engine defaults, so restoring the node id alone would silently drop the user's coefficients.
The snapshot is applied field-by-field through the layer's apply* helpers, in an order that respects their preconditions (coupledNode before Cd/Area, which are rejected on an uncoupled vertex). Fields that did not move are no-ops inside the helpers.
| MeshSetVertexAttributeCommand::MeshSetVertexAttributeCommand | ( | SWMM2DMeshLayer * | layer, |
| QByteArray | key, | ||
| QVector< int > | vertices, | ||
| QVector< mesh::MeshVertex > | newAttrs, | ||
| QVector< mesh::MeshVertex > | oldAttrs, | ||
| const QString & | text, | ||
| MapCanvas * | canvas, | ||
| QUndoCommand * | parent = nullptr |
||
| ) |
| layer | Mesh layer that owns the vertices. |
| key | Attribute key ("z", "tag", "coupledNode", "couplingCd", "couplingArea") — used for labelling only; the snapshots carry the values. |
| vertices | Vertex indices to write. |
| newAttrs | Parallel to vertices: post-edit attribute snapshot. |
| oldAttrs | Parallel to vertices: pre-edit attribute snapshot. |
|
inlineoverride |
|
override |
|
override |