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

Undoable bulk attribute write on one node / link / rain gage, routed through the object's property adapter so every engine setter convention (enum handling, read-modify-write tuples, loss-coeff triples, …) is reused instead of re-implemented. More...

#include <importcommands.h>

Inheritance diagram for SetAdapterPropertiesCommand:
Collaboration diagram for SetAdapterPropertiesCommand:

Public Member Functions

 SetAdapterPropertiesCommand (SWMMModelLayer *layer, quint8 kind, QString name, QVariantMap newValues, QVariantMap oldValues, 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 QObject * createAdapter (SWMMModelLayer *layer, quint8 kind, const QString &name)
 

Additional Inherited Members

- Protected Attributes inherited from MapCommand
MapCanvasm_canvas
 

Detailed Description

Undoable bulk attribute write on one node / link / rain gage, routed through the object's property adapter so every engine setter convention (enum handling, read-modify-write tuples, loss-coeff triples, …) is reused instead of re-implemented.

Keys of newValues / oldValues are adapter Q_PROPERTY names. oldValues must contain the pre-change value of every key in newValues (captured by the executor before pushing). redo() writes newValues, undo() writes oldValues. The adapter is built fresh on every redo()/undo() so the command never holds a stale engine index.

Constructor & Destructor Documentation

◆ SetAdapterPropertiesCommand()

SetAdapterPropertiesCommand::SetAdapterPropertiesCommand ( SWMMModelLayer layer,
quint8  kind,
QString  name,
QVariantMap  newValues,
QVariantMap  oldValues,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)

Member Function Documentation

◆ createAdapter()

QObject * SetAdapterPropertiesCommand::createAdapter ( SWMMModelLayer layer,
quint8  kind,
const QString &  name 
)
static

Build the kind-appropriate concrete adapter for name on layer (junction/outfall/storage/divider subclass for nodes, per-link-type subclass for links, rain-gage adapter for gages). Returns nullptr when the object no longer exists. Caller owns the returned object. Exposed statically so the executor can use the same factory to snapshot old values.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ id()

int SetAdapterPropertiesCommand::id ( ) const
inlineoverride

◆ redo()

void SetAdapterPropertiesCommand::redo ( )
override

◆ undo()

void SetAdapterPropertiesCommand::undo ( )
override

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