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

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>

Inheritance diagram for MeshSetTriangleInfilCommand:
Collaboration diagram for MeshSetTriangleInfilCommand:

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.
 
MapCanvascanvas () const
 

Additional Inherited Members

- Protected Attributes inherited from MapCommand
MapCanvasm_canvas
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MeshSetTriangleInfilCommand()

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 
)
Parameters
layerMesh layer that owns the triangles.
trianglesTriangle indices to write.
newRowThe row every triangle in triangles receives.
oldRowsParallel to triangles: each cell's pre-edit RESOLVED row.
oldProvParallel to triangles: where that row came from. Anything but Override means the cell was inheriting and undo must erase, not rewrite.
textUndo-stack label.

Member Function Documentation

◆ id()

int MeshSetTriangleInfilCommand::id ( ) const
inlineoverride

◆ redo()

void MeshSetTriangleInfilCommand::redo ( )
override

◆ undo()

void MeshSetTriangleInfilCommand::undo ( )
override

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