QElectroTech  0.8-dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PastePartsCommand Class Reference

The PastePartsCommand class Undo command for paste element primitive in an element editor. More...

#include <pastepartscommand.h>

Inheritance diagram for PastePartsCommand:
Inheritance graph
Collaboration diagram for PastePartsCommand:
Collaboration graph

Public Member Functions

 PastePartsCommand (ElementView *view, const ElementContent &content_to_paste, QUndoCommand *parent=nullptr)
 PastePartsCommand::PastePartsCommand. More...
 
 ~PastePartsCommand () override
 PastePartsCommand::~PastePartsCommand. More...
 
void undo () override
 PastePartsCommand::undo. More...
 
void redo () override
 PastePartsCommand::redo. More...
 
virtual void setOffset (int old_offset_paste_count, const QPointF &old_start_top_left_corner, int new_offset_paste_count, const QPointF &new_start_top_left_corner)
 PastePartsCommand::setOffset Describe the offset to use with this undo command. More...
 
- Public Member Functions inherited from ElementEditionCommand
 ElementEditionCommand (ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr)
 ElementEditionCommand::ElementEditionCommand Constructs an ElementEditionCommand, thus embedding the provided scene and view. More...
 
 ElementEditionCommand (const QString &, ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr)
 ElementEditionCommand::ElementEditionCommand Constructs an ElementEditionCommand, thus embedding the provided scene and view. More...
 
 ~ElementEditionCommand () override
 
ElementSceneelementScene () const
 
void setElementScene (ElementScene *)
 
ElementViewelementView () const
 
void setElementView (ElementView *)
 

Private Member Functions

 PastePartsCommand (const PastePartsCommand &)
 

Private Attributes

ElementContent m_pasted_content
 
int m_old_offset_paste_count
 
int m_new_offset_paste_count
 
QPointF m_old_start_top_left_corner
 
QPointF m_new_start_top_left_corner
 
bool m_uses_offset = false
 
bool m_first_redo = true
 

Additional Inherited Members

- Protected Attributes inherited from ElementEditionCommand
ElementScenem_scene
 Element editor/view/scene the command should take place on. More...
 
ElementViewm_view
 

Detailed Description

The PastePartsCommand class Undo command for paste element primitive in an element editor.

Constructor & Destructor Documentation

◆ PastePartsCommand() [1/2]

PastePartsCommand::PastePartsCommand ( ElementView view,
const ElementContent content_to_paste,
QUndoCommand *  parent = nullptr 
)

PastePartsCommand::PastePartsCommand.

Parameters
view: view where this command work
content_to_paste: content to paste
parent: parent undo command
Note
all terminal stored in content_to_paste get a new uuid in the constructor of this class to avoid have several terminal of an element with the same uuid.
Here is the call graph for this function:

◆ ~PastePartsCommand()

PastePartsCommand::~PastePartsCommand ( )
override

PastePartsCommand::~PastePartsCommand.

Here is the call graph for this function:

◆ PastePartsCommand() [2/2]

PastePartsCommand::PastePartsCommand ( const PastePartsCommand )
private

Member Function Documentation

◆ redo()

void PastePartsCommand::redo ( )
override

PastePartsCommand::redo.

Here is the call graph for this function:

◆ setOffset()

void PastePartsCommand::setOffset ( int  old_offset_paste_count,
const QPointF &  old_start_top_left_corner,
int  new_offset_paste_count,
const QPointF &  new_start_top_left_corner 
)
virtual

PastePartsCommand::setOffset Describe the offset to use with this undo command.

Parameters
old_offset_paste_count
old_start_top_left_corner
new_offset_paste_count
new_start_top_left_corner

◆ undo()

void PastePartsCommand::undo ( )
override

PastePartsCommand::undo.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_first_redo

bool PastePartsCommand::m_first_redo = true
private

◆ m_new_offset_paste_count

int PastePartsCommand::m_new_offset_paste_count
private

◆ m_new_start_top_left_corner

QPointF PastePartsCommand::m_new_start_top_left_corner
private

◆ m_old_offset_paste_count

int PastePartsCommand::m_old_offset_paste_count
private

◆ m_old_start_top_left_corner

QPointF PastePartsCommand::m_old_start_top_left_corner
private

◆ m_pasted_content

ElementContent PastePartsCommand::m_pasted_content
private

◆ m_uses_offset

bool PastePartsCommand::m_uses_offset = false
private

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