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

Records a node coordinate change for undo/redo. More...

#include <mapundostack.h>

Inheritance diagram for MoveNodeCommand:
Collaboration diagram for MoveNodeCommand:

Classes

struct  LengthRec
 Per-link length snapshot used by auto-length. More...
 

Public Member Functions

 MoveNodeCommand (SWMMModelLayer *layer, int nodeIdx, double oldX, double oldY, double newX, double newY, QVector< LengthRec > lengthRecs, MapCanvas *canvas, QUndoCommand *parent=nullptr)
 
void undo () override
 
void redo () override
 
int id () const override
 
bool mergeWith (const QUndoCommand *other) 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

Records a node coordinate change for undo/redo.

Mutates engine state and the layer's geometry cache through SWMMModelLayer's edit-mutation API. Optionally recomputes conduit lengths for every link whose endpoint moved (the "auto-length" policy — see SWMMVisProjectWindow::isAutoLengthEnabled).

Consecutive commands that move the same node merge into a single undoable step so rapid drags do not bloat the stack.

Constructor & Destructor Documentation

◆ MoveNodeCommand()

MoveNodeCommand::MoveNodeCommand ( SWMMModelLayer layer,
int  nodeIdx,
double  oldX,
double  oldY,
double  newX,
double  newY,
QVector< LengthRec lengthRecs,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)

Member Function Documentation

◆ id()

int MoveNodeCommand::id ( ) const
inlineoverride

◆ mergeWith()

bool MoveNodeCommand::mergeWith ( const QUndoCommand *  other)
override

◆ redo()

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

◆ undo()

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

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