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

Undoable deletion of a node, link, rain gage, or subcatchment. More...

#include <mapundostack.h>

Inheritance diagram for DeleteObjectCommand:
Collaboration diagram for DeleteObjectCommand:

Public Types

enum  TargetKind {
  DeleteNode ,
  DeleteLink ,
  DeleteGage ,
  DeleteSubcatch
}
 

Public Member Functions

 DeleteObjectCommand (SWMMModelLayer *layer, const QString &name, TargetKind kind, MapCanvas *canvas, QUndoCommand *parent=nullptr)
 
void setEngineAppliedByBatch (bool b)
 
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 deletion of a node, link, rain gage, or subcatchment.

The constructor snapshots the object's full property state (before redo() deletes it). undo() re-creates the object and restores all properties. For node deletion, cascade-deleted links are also re-created on undo.

Member Enumeration Documentation

◆ TargetKind

Enumerator
DeleteNode 
DeleteLink 
DeleteGage 
DeleteSubcatch 

Constructor & Destructor Documentation

◆ DeleteObjectCommand()

DeleteObjectCommand::DeleteObjectCommand ( SWMMModelLayer layer,
const QString &  name,
TargetKind  kind,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)

Constructor for node deletion. Snapshots the node + identifies cascade links.

Member Function Documentation

◆ id()

int DeleteObjectCommand::id ( ) const
inlineoverride

◆ redo()

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

◆ setEngineAppliedByBatch()

void DeleteObjectCommand::setEngineAppliedByBatch ( bool  b)
inline

Batch mode (perf-plan Phase A2): the owning BatchDeleteCommand's one swmm_*_delete_many call performs the deletion, so this child keeps only its snapshot + undo role and redo() becomes a no-op.

◆ undo()

void DeleteObjectCommand::undo ( )
override

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