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

Records "place a node ON a conduit": the conduit is split at the picked point and a node of the requested SWMM type is inserted there (ADDNODE_SPLIT_REDESIGN_PLAN_2026-09-10.md step 2). More...

#include <mapundostack.h>

Inheritance diagram for InsertNodeSplitCommand:
Collaboration diagram for InsertNodeSplitCommand:

Public Member Functions

 InsertNodeSplitCommand (SWMMModelLayer *layer, QString linkName, double t, QString nodeName, QString newLinkName, int nodeType, MapCanvas *canvas, QUndoCommand *parent=nullptr)
 
void undo () override
 
void redo () override
 
int id () const override
 
QStringList warnings () const
 
bool retyped () 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

Records "place a node ON a conduit": the conduit is split at the picked point and a node of the requested SWMM type is inserted there (ADDNODE_SPLIT_REDESIGN_PLAN_2026-09-10.md step 2).

The engine's swmm_conduit_split always creates a JUNCTION, so for STORAGE / DIVIDER redo() splits, then converts the new junction with applyNodeConvert and applies the type's creation defaults (the same ObjectDefaultsApplier pass AddNodeCommand runs). A plain junction takes the split as-is — the engine's interpolated invert and conduit-derived depth are better than the defaults. Undo runs the inverse in reverse: convert back to a junction (the fuse inverse only accepts junctions), then re-fuse the conduit pair. OUTFALL is never accepted (an outfall must be terminal).

If the conversion is refused the node stays a junction and the engine's message is kept in warnings(); the split itself stands.

Constructor & Destructor Documentation

◆ InsertNodeSplitCommand()

InsertNodeSplitCommand::InsertNodeSplitCommand ( SWMMModelLayer layer,
QString  linkName,
double  t,
QString  nodeName,
QString  newLinkName,
int  nodeType,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)

Member Function Documentation

◆ id()

int InsertNodeSplitCommand::id ( ) const
inlineoverride

◆ redo()

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

◆ retyped()

bool InsertNodeSplitCommand::retyped ( ) const
inline

True when the node was actually retyped to nodeType (always true for a junction, which needs no conversion).

◆ undo()

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

◆ warnings()

QStringList InsertNodeSplitCommand::warnings ( ) const
inline

Engine warnings / the conversion error from the last redo() (e.g. a divider inserted mid-conduit has only two links until a third is drawn).

Here is the caller graph for this function:

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