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

Undoable node retype, with the burn's outfall configuration (CHANNEL_BURN_IN_PLAN_2026-09-21.md §6). More...

#include <mapundostack.h>

Inheritance diagram for ConvertNodeTypeCommand:
Collaboration diagram for ConvertNodeTypeCommand:

Public Member Functions

 ConvertNodeTypeCommand (SWMMModelLayer *layer, QString nodeName, int newNodeType, GeneratedOutfallSpec spec, MapCanvas *canvas, QUndoCommand *parent=nullptr)
 
void undo () override
 
void redo () override
 
int id () const override
 
QStringList warnings () const
 
bool converted () const
 
bool isLossy () const
 
- 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 node retype, with the burn's outfall configuration (CHANNEL_BURN_IN_PLAN_2026-09-21.md §6).

Retyping a node previously bypassed undo entirely except inside InsertNodeSplitCommand. This is the general command, modelled on it: redo() converts through SWMMModelLayer::applyNodeConvert (so the cache and the four refresh signals behave) and then applies GeneratedOutfallSpec; undo() converts back to the type the constructor snapshotted and restores invert, max depth and tag.

Warning
A conversion is lossy when the node carried type-specific data. The engine preserves the common properties and CLEARS the rest, and no API hands a storage curve or a divider's parameters back afterwards. So undo restores the TYPE and the common properties, not a storage node's curve. isLossy reports it, and the burn names such nodes in its report rather than converting them quietly. For the burn's own case — a junction becoming an outfall — there is nothing to lose and the round trip is exact.

Constructor & Destructor Documentation

◆ ConvertNodeTypeCommand()

ConvertNodeTypeCommand::ConvertNodeTypeCommand ( SWMMModelLayer layer,
QString  nodeName,
int  newNodeType,
GeneratedOutfallSpec  spec,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)
Here is the call graph for this function:

Member Function Documentation

◆ converted()

bool ConvertNodeTypeCommand::converted ( ) const
inline

True once the node is at newNodeType.

◆ id()

int ConvertNodeTypeCommand::id ( ) const
inlineoverride

◆ isLossy()

bool ConvertNodeTypeCommand::isLossy ( ) const
inline

True when the ORIGINAL type carried type-specific data undo cannot restore (anything but a junction).

Here is the caller graph for this function:

◆ redo()

void ConvertNodeTypeCommand::redo ( )
override
Here is the call graph for this function:

◆ undo()

void ConvertNodeTypeCommand::undo ( )
override
Here is the call graph for this function:

◆ warnings()

QStringList ConvertNodeTypeCommand::warnings ( ) const
inline

Engine warnings from the last redo(), plus the lossy-conversion note.

Here is the caller graph for this function:

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