|
SILICON
|
#include <undoCommands.hpp>
Classes | |
| struct | Snapshot |
Public Types | |
| enum class | Operation { Add , Remove } |
Public Member Functions | |
| WireTopologyCommand (DiagramScene *scene, const std::vector< GraphicalWireSegment * > &segments, Operation operation, bool skipInitialRedo=true, QUndoCommand *parent=nullptr) | |
| Captures segments for undoing or redoing wire addition or removal. | |
| void | undo () override |
| Reverses the captured wire addition or removal. | |
| void | redo () override |
| Reapplies the operation, optionally skipping the first invocation. | |
Private Member Functions | |
| void | apply (bool restore) |
| Restores captured segments or removes them from their original document. | |
Private Attributes | |
| DiagramScene * | scene |
| std::string | documentPath |
| std::vector< Snapshot > | snapshots |
| Operation | operation |
| bool | skipInitialRedo |
Definition at line 44 of file undoCommands.hpp.
|
strong |
| Enumerator | |
|---|---|
| Add | |
| Remove | |
Definition at line 46 of file undoCommands.hpp.
| WireTopologyCommand | ( | DiagramScene * | scene, |
| const std::vector< GraphicalWireSegment * > & | segments, | ||
| Operation | operation, | ||
| bool | skipInitialRedo = true, | ||
| QUndoCommand * | parent = nullptr ) |
Captures segments for undoing or redoing wire addition or removal.
| scene | Scene containing the segments. |
| segments | Segments whose geometry, identifiers, and buses are captured. |
| operation | Whether the original action adds or removes segments. |
| skipInitialRedo | Whether the action was already applied before pushing the command. |
| parent | Optional parent undo command. |
Definition at line 80 of file undoCommands.cpp.
|
private |
Restores captured segments or removes them from their original document.
| restore | True restores the snapshots; false removes their scene items. |
Definition at line 97 of file undoCommands.cpp.
|
override |
Reapplies the operation, optionally skipping the first invocation.
Definition at line 145 of file undoCommands.cpp.
|
override |
Reverses the captured wire addition or removal.
Definition at line 140 of file undoCommands.cpp.
|
private |
Definition at line 78 of file undoCommands.hpp.
|
private |
Definition at line 80 of file undoCommands.hpp.
|
private |
Definition at line 77 of file undoCommands.hpp.
|
private |
Definition at line 81 of file undoCommands.hpp.
|
private |
Definition at line 79 of file undoCommands.hpp.