LibreCAD
|
#include <blockops.h>
Public Member Functions | |
ReplaceBlock (const Document_SPtr &document, const Block_CSPtr &oldBlock, const Block_CSPtr &newBlock) | |
virtual void | undo () const override |
Undo a given operation. More... | |
virtual void | redo () const override |
Redo a given operation. More... | |
![]() | |
DocumentOperation (Document_SPtr document, const std::string &description) | |
Document_SPtr | document () const |
virtual void | execute () |
execute this operation More... | |
virtual | ~DocumentOperation () |
![]() | |
Undoable (const std::string &text) | |
Name of this operartion. More... | |
virtual | ~Undoable () |
virtual std::string | text () |
Name of the operation. More... | |
Protected Member Functions | |
virtual void | processInternal () override |
Private Attributes | |
Block_CSPtr | _oldBlock |
Block_CSPtr | _newBlock |
Definition at line 37 of file blockops.h.
ReplaceBlock::ReplaceBlock | ( | const Document_SPtr & | document, |
const Block_CSPtr & | oldBlock, | ||
const Block_CSPtr & | newBlock | ||
) |
Definition at line 44 of file blockops.cpp.
|
overrideprotectedvirtual |
This function gets called when an operation starts and when the document is locked for you so you can do your work
Implements lc::operation::DocumentOperation.
Definition at line 61 of file blockops.cpp.
|
overridevirtual |
Redo a given operation.
This can get called if we want to redo a operation. Redo is usually called after an undo operation. If in the undo operation entities where removed, it needs to get added again. it doesn't have to do any re.calculation but just remember what entities have been added or removed.
Implements lc::operation::Undoable.
Definition at line 56 of file blockops.cpp.
|
overridevirtual |
Undo a given operation.
For any operation that means for example when it added entities to the document it now needs to remove all created entities on the document. When the operation added a layer or block, it will call functions to remove that block
Implements lc::operation::Undoable.
Definition at line 51 of file blockops.cpp.
|
private |
Definition at line 49 of file blockops.h.
|
private |
Definition at line 48 of file blockops.h.