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

Undoable deletion of a non-spatial data object (curve, time series, or transect) held in a SWMMModelLayer registry. More...

#include <mapundostack.h>

Inheritance diagram for DeleteDataObjectCommand:
Collaboration diagram for DeleteDataObjectCommand:

Public Member Functions

 DeleteDataObjectCommand (SWMMModelLayer *layer, const SWMMObjectRef &ref, 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
 

Static Public Member Functions

static bool supports (SWMMObjectRef::ObjectType type)
 

Additional Inherited Members

- Protected Attributes inherited from MapCommand
MapCanvasm_canvas
 

Detailed Description

Undoable deletion of a non-spatial data object (curve, time series, or transect) held in a SWMMModelLayer registry.

Data objects are owned by registries (CurveRegistry, TimeseriesRegistry, TransectRegistry) rather than the engine's spatial stores, so this command snapshots the provider's full state, calls registry->remove() on redo(), and re-creates + repopulates the provider on undo(). The registry is flushed to the engine (clear + re-add) after each mutation.

Only Curve, TimeSeries, and Transect are supported today — they have registry-backed CRUD plus engine table/transect delete. Patterns, pollutants, aquifers, snowpacks, LID controls, streets, inlets, land uses, hydrograph groups, and control rules need new engine delete APIs first (see workplans/GUI_DELETE_ALL_OBJECTS_PLAN_2026-07-22.md); supports() returns false for those so callers can grey the menu action.

Constructor & Destructor Documentation

◆ DeleteDataObjectCommand()

DeleteDataObjectCommand::DeleteDataObjectCommand ( SWMMModelLayer layer,
const SWMMObjectRef ref,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)

Member Function Documentation

◆ id()

int DeleteDataObjectCommand::id ( ) const
inlineoverride

◆ redo()

void DeleteDataObjectCommand::redo ( )
override

◆ supports()

bool DeleteDataObjectCommand::supports ( SWMMObjectRef::ObjectType  type)
static

True when type currently has a registry-backed delete path.

◆ undo()

void DeleteDataObjectCommand::undo ( )
override

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