LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lc::operation::ReplaceLinePattern Class Reference

#include <linepatternops.h>

Inheritance diagram for lc::operation::ReplaceLinePattern:
Collaboration diagram for lc::operation::ReplaceLinePattern:

Public Member Functions

 ReplaceLinePattern (Document_SPtr document, const DxfLinePattern_CSPtr oldLinePattern, const DxfLinePattern_CSPtr newLinePattern)
 
virtual void undo () const
 Undo a given operation. More...
 
virtual void redo () const
 Redo a given operation. More...
 
- Public Member Functions inherited from lc::operation::DocumentOperation
 DocumentOperation (Document_SPtr document, const std::string &description)
 
Document_SPtr document () const
 
virtual void execute ()
 execute this operation More...
 
virtual ~DocumentOperation ()
 
- Public Member Functions inherited from lc::operation::Undoable
 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

DxfLinePattern_CSPtr _oldLinePattern
 
DxfLinePattern_CSPtr _newLinePattern
 

Detailed Description

Replace DxfLinePattern in document

Definition at line 55 of file linepatternops.h.

Constructor & Destructor Documentation

ReplaceLinePattern::ReplaceLinePattern ( Document_SPtr  document,
const DxfLinePattern_CSPtr  oldLinePattern,
const DxfLinePattern_CSPtr  newLinePattern 
)

ReplaceLinePattern

Definition at line 59 of file linepatternops.cpp.

61  :
62  DocumentOperation(document, "ReplaceLinePattern"),
63  _oldLinePattern(oldLinePattern),
64  _newLinePattern(newLinePattern) {
65 }
DxfLinePattern_CSPtr _oldLinePattern
DocumentOperation(Document_SPtr document, const std::string &description)
DxfLinePattern_CSPtr _newLinePattern

Member Function Documentation

void ReplaceLinePattern::processInternal ( )
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 67 of file linepatternops.cpp.

67  {
68  document()->removeDocumentMetaType(_oldLinePattern);
69  document()->addDocumentMetaType(_newLinePattern);
70 }
DxfLinePattern_CSPtr _oldLinePattern
DxfLinePattern_CSPtr _newLinePattern
void ReplaceLinePattern::redo ( ) const
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 75 of file linepatternops.cpp.

75  {
76 }
void ReplaceLinePattern::undo ( ) const
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 72 of file linepatternops.cpp.

72  {
73 }

Member Data Documentation

DxfLinePattern_CSPtr lc::operation::ReplaceLinePattern::_newLinePattern
private

Definition at line 70 of file linepatternops.h.

DxfLinePattern_CSPtr lc::operation::ReplaceLinePattern::_oldLinePattern
private

Definition at line 69 of file linepatternops.h.


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