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
MeshSetEdgeAttributeCommand Class Reference

Undoable write of one per-edge attribute across a set of edge slots. More...

#include <meshcommands.h>

Inheritance diagram for MeshSetEdgeAttributeCommand:
Collaboration diagram for MeshSetEdgeAttributeCommand:

Public Member Functions

 MeshSetEdgeAttributeCommand (SWMM2DMeshLayer *layer, QByteArray key, QVector< int > edgeSlots, QVector< mesh::MeshEdgeBC > newBCs, QVector< mesh::MeshEdgeBC > oldBCs, 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.
 
MapCanvascanvas () const
 

Additional Inherited Members

- Protected Attributes inherited from MapCommand
MapCanvasm_canvas
 

Detailed Description

Undoable write of one per-edge attribute across a set of edge slots.

Slots are stored flat (mesh::edgeSlot(cell, edgeLocal)) and both sides of the edit hold the WHOLE MeshEdgeBC, not just the changed field: the BC fields are interdependent through type (a stage value is meaningless once the type flips to Wall), so a partial restore would leave the slot in a state the user never saw.

Conveyance dispatches to applyMeshEdgeConveyance rather than applyMeshEdgeBC in BOTH directions, so the engine's interior-edge symmetry invariant (both halves carry the same value) survives undo.

Constructor & Destructor Documentation

◆ MeshSetEdgeAttributeCommand()

MeshSetEdgeAttributeCommand::MeshSetEdgeAttributeCommand ( SWMM2DMeshLayer layer,
QByteArray  key,
QVector< int >  edgeSlots,
QVector< mesh::MeshEdgeBC newBCs,
QVector< mesh::MeshEdgeBC oldBCs,
const QString &  text,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)
Parameters
layerMesh layer that owns the edges.
keyAttribute key ("conveyance", "bcType", "head", "slope", "flow", "tseries", "curve", "group", or "bc" for a whole boundary-condition write). "conveyance" selects the mirroring write path; every other key writes the slot.
edgeSlotsFlat edge slots (mesh::edgeSlot(cell, edgeLocal)).
newBCsParallel to edgeSlots: post-edit slot value.
oldBCsParallel to edgeSlots: pre-edit slot value.

Member Function Documentation

◆ id()

int MeshSetEdgeAttributeCommand::id ( ) const
inlineoverride

◆ redo()

void MeshSetEdgeAttributeCommand::redo ( )
override

◆ undo()

void MeshSetEdgeAttributeCommand::undo ( )
override

The documentation for this class was generated from the following files: