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

Undoable write of one or more [2D_INFILTRATION_DEFAULTS] tag rows — the region-level peer of MeshSetTriangleInfilCommand. More...

#include <meshcommands.h>

Inheritance diagram for MeshSetInfilDefaultsCommand:
Collaboration diagram for MeshSetInfilDefaultsCommand:

Public Member Functions

 MeshSetInfilDefaultsCommand (SWMM2DMeshLayer *layer, QVector< QString > tags, QVector< mesh::InfilRow > newRows, QVector< mesh::InfilRow > oldRows, QVector< bool > oldExisted, 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 or more [2D_INFILTRATION_DEFAULTS] tag rows — the region-level peer of MeshSetTriangleInfilCommand.

Editing a default is how an assignment stays editable as regions instead of being frozen into N per-cell rows (engine D-I3): the row reaches every cell carrying the tag that has no override of its own, and none of them gain one.

The old state records, per tag, both the previous row and whether a row EXISTED — the same distinction MeshSetTriangleInfilCommand draws per cell. A tag that had no default row must go back to having none: writing the resolved numbers back would leave a row that shadows the '*' fallback, so a later edit to '*' would stop reaching the region. undo() therefore erases through SWMM2DMeshLayer::clearMeshInfilDefault for those tags and rewrites through applyMeshInfilDefault for the rest.

The layer is held as a QPointer: if it is closed, the command becomes inert rather than dangling.

Constructor & Destructor Documentation

◆ MeshSetInfilDefaultsCommand()

MeshSetInfilDefaultsCommand::MeshSetInfilDefaultsCommand ( SWMM2DMeshLayer layer,
QVector< QString >  tags,
QVector< mesh::InfilRow newRows,
QVector< mesh::InfilRow oldRows,
QVector< bool >  oldExisted,
const QString &  text,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)
Parameters
layerMesh layer that owns the mesh.
tagsRegion tags to write ("*" = the mesh-wide fallback).
newRowsParallel to tags: the row each tag receives.
oldRowsParallel to tags: each tag's pre-edit row (ignored where oldExisted is false).
oldExistedParallel to tags: false means the tag had no default row, so undo must ERASE rather than rewrite.
textUndo-stack label.

Member Function Documentation

◆ id()

int MeshSetInfilDefaultsCommand::id ( ) const
inlineoverride

◆ redo()

void MeshSetInfilDefaultsCommand::redo ( )
override

◆ undo()

void MeshSetInfilDefaultsCommand::undo ( )
override

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