LibreCAD
|
#include <entitybuilder.h>
Public Member Functions | |
EntityBuilder (Document_SPtr document) | |
Builder constructor. More... | |
EntityBuilder * | appendEntity (entity::CADEntity_CSPtr cadEntity) |
append entity to the stack More... | |
EntityBuilder * | appendOperation (Base_SPtr operation) |
Append operation to the stack. More... | |
virtual void | undo () const |
Undo a given operation. More... | |
virtual void | redo () const |
Redo a given operation. More... | |
void | processStack () |
Apply the operations Apply operations on the entities without updating the document, and clear the stack. 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 () |
Private Attributes | |
std::vector< Base_SPtr > | _stack |
std::vector < entity::CADEntity_CSPtr > | _workingBuffer |
std::vector < entity::CADEntity_CSPtr > | _entitiesThatWhereUpdated |
std::vector < entity::CADEntity_CSPtr > | _entitiesThatNeedsRemoval |
Friends | |
class | lc::operation::Base |
Definition at line 15 of file entitybuilder.h.
EntityBuilder::EntityBuilder | ( | Document_SPtr | document | ) |
Builder constructor.
document | to apply operations |
Definition at line 8 of file entitybuilder.cpp.
EntityBuilder * EntityBuilder::appendEntity | ( | entity::CADEntity_CSPtr | cadEntity | ) |
append entity to the stack
cadEntity |
Definition at line 12 of file entitybuilder.cpp.
EntityBuilder * EntityBuilder::appendOperation | ( | Base_SPtr | operation | ) |
Append operation to the stack.
operation |
Definition at line 17 of file entitybuilder.cpp.
|
protectedvirtual |
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 22 of file entitybuilder.cpp.
void EntityBuilder::processStack | ( | ) |
Apply the operations Apply operations on the entities without updating the document, and clear the stack.
Definition at line 71 of file entitybuilder.cpp.
|
virtual |
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 61 of file entitybuilder.cpp.
|
virtual |
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 47 of file entitybuilder.cpp.
|
friend |
Definition at line 16 of file entitybuilder.h.
|
private |
Definition at line 56 of file entitybuilder.h.
|
private |
Definition at line 55 of file entitybuilder.h.
|
private |
Definition at line 52 of file entitybuilder.h.
|
private |
Definition at line 53 of file entitybuilder.h.