|
wiRedPanda
Logic Circuit Simulator
|
Intermediate base for commands that operate on a fixed list of GraphicElements. More...
#include <Commands.h>
Protected Member Functions | |
| QList< GraphicElement * > | elements () const |
| Returns the live element pointers for this command's targets, looked up by stored ID. | |
| ElementsCommand (const QList< GraphicElement * > &elements, Scene *scene, QUndoCommand *parent=nullptr) | |
Protected Attributes | |
| QList< int > | m_ids |
| Scene * | m_scene |
Intermediate base for commands that operate on a fixed list of GraphicElements.
Stores the scene pointer and the stable element IDs captured at construction time, and exposes an elements() accessor that resolves them back to live pointers at undo/redo time. Eliminates the repeated m_ids + m_scene + findElements() boilerplate across command subclasses.
Definition at line 50 of file Commands.h.
|
explicitprotected |
Definition at line 255 of file Commands.cpp.
References elements(), m_ids, and m_scene.
Referenced by ChangePortSizeCommand::ChangePortSizeCommand(), FlipCommand::FlipCommand(), MorphCommand::MorphCommand(), MoveCommand::MoveCommand(), RotateCommand::RotateCommand(), UpdateBlobCommand::UpdateBlobCommand(), and UpdateCommand::UpdateCommand().
|
protected |
Returns the live element pointers for this command's targets, looked up by stored ID.
Definition at line 265 of file Commands.cpp.
References CommandUtils::findElements(), m_ids, and m_scene.
Referenced by ChangePortSizeCommand::ChangePortSizeCommand(), ElementsCommand(), MorphCommand::MorphCommand(), ChangePortSizeCommand::redo(), FlipCommand::redo(), MorphCommand::redo(), MoveCommand::redo(), RotateCommand::redo(), ChangePortSizeCommand::undo(), MorphCommand::undo(), MoveCommand::undo(), RotateCommand::undo(), UpdateBlobCommand::UpdateBlobCommand(), and UpdateCommand::UpdateCommand().
|
protected |
Definition at line 59 of file Commands.h.
Referenced by elements(), ElementsCommand(), MorphCommand::redo(), and MorphCommand::undo().
|
protected |
Definition at line 58 of file Commands.h.
Referenced by elements(), ElementsCommand(), ChangePortSizeCommand::redo(), FlipCommand::redo(), MorphCommand::redo(), MoveCommand::redo(), RotateCommand::redo(), UpdateBlobCommand::redo(), UpdateCommand::redo(), ChangePortSizeCommand::undo(), MorphCommand::undo(), MoveCommand::undo(), RotateCommand::undo(), UpdateBlobCommand::undo(), UpdateCommand::undo(), UpdateBlobCommand::UpdateBlobCommand(), and UpdateCommand::UpdateCommand().