wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
RotateCommand Class Reference

Undo command that rotates a list of elements by a fixed angle. More...

#include <Commands.h>

Inheritance diagram for RotateCommand:
[legend]

Public Member Functions

void redo () override
 Applies the rotation.
 RotateCommand (const QList< GraphicElement * > &items, const int angle, Scene *scene, QUndoCommand *parent=nullptr)
 Constructs the command.
void undo () override
 Reverses the rotation.

Additional Inherited Members

Protected Member Functions inherited from ElementsCommand
QList< GraphicElement * > elements () const
 Returns the live element pointers for this command's targets, looked up by stored ID.
 ElementsCommand (const QList< GraphicElement * > &elements, Scene *scene, QUndoCommand *parent=nullptr)
Protected Attributes inherited from ElementsCommand
QList< int > m_ids
Scenem_scene

Detailed Description

Undo command that rotates a list of elements by a fixed angle.

Definition at line 128 of file Commands.h.

Constructor & Destructor Documentation

◆ RotateCommand()

RotateCommand::RotateCommand ( const QList< GraphicElement * > & items,
const int angle,
Scene * scene,
QUndoCommand * parent = nullptr )
explicit

Constructs the command.

Parameters
itemsElements to rotate.
angleClockwise rotation in degrees (e.g. 90 or -90).
sceneTarget scene.
parentOptional parent undo command.

Definition at line 330 of file Commands.cpp.

References ElementsCommand::ElementsCommand().

Member Function Documentation

◆ redo()

void RotateCommand::redo ( )
override

Applies the rotation.

Definition at line 359 of file Commands.cpp.

References ElementsCommand::elements(), and ElementsCommand::m_scene.

◆ undo()

void RotateCommand::undo ( )
override

Reverses the rotation.

Definition at line 344 of file Commands.cpp.

References ElementsCommand::elements(), and ElementsCommand::m_scene.


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