dnai::commands::MoveNodeCommand Class Reference

MoveNodeCommand allow to move GenericNode in canvas. More...

#include <movenodecommand.h>

Inheritance diagram for dnai::commands::MoveNodeCommand:
Inheritance graph
Collaboration diagram for dnai::commands::MoveNodeCommand:
Collaboration graph

Public Member Functions

 MoveNodeCommand (views::GenericNode *n, const QPointF &vec, bool save=false)
 
virtual void execute () const override
 Execute the command. More...
 
virtual void executeSave () override
 Save current state of the command for the reverse unExcute() More...
 
virtual void unExcute () const override
 Reverse the execute() function. More...
 
virtual QString infos () const override
 Get display info for this command. More...
 
- Public Member Functions inherited from dnai::commands::Command
 Command (const QString &name, bool save=false)
 
virtual bool isSave () const override
 Is the command is in a save state. More...
 
const QString & name () const
 Get the command name. More...
 

Private Attributes

views::GenericNodem_n
 
QPointF m_vec
 
QPointF m_lastPos
 

Additional Inherited Members

- Protected Member Functions inherited from dnai::interfaces::ICommand
virtual ~ICommand ()=default
 
- Protected Attributes inherited from dnai::commands::Command
const QString m_name
 
const bool m_save
 

Detailed Description

MoveNodeCommand allow to move GenericNode in canvas.

Constructor & Destructor Documentation

dnai::commands::MoveNodeCommand::MoveNodeCommand ( views::GenericNode n,
const QPointF &  vec,
bool  save = false 
)

Member Function Documentation

void dnai::commands::MoveNodeCommand::execute ( ) const
overridevirtual

Execute the command.

Reimplemented from dnai::commands::Command.

void dnai::commands::MoveNodeCommand::executeSave ( )
overridevirtual

Save current state of the command for the reverse unExcute()

Reimplemented from dnai::commands::Command.

QString dnai::commands::MoveNodeCommand::infos ( ) const
overridevirtual

Get display info for this command.

Returns
QString

Reimplemented from dnai::commands::Command.

void dnai::commands::MoveNodeCommand::unExcute ( ) const
overridevirtual

Reverse the execute() function.

Reimplemented from dnai::commands::Command.

Member Data Documentation

QPointF dnai::commands::MoveNodeCommand::m_lastPos
private
views::GenericNode* dnai::commands::MoveNodeCommand::m_n
private
QPointF dnai::commands::MoveNodeCommand::m_vec
private

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