20#ifndef LIBREPCB_EDITOR_CMDDEVICEINSTANCEEDIT_H
21#define LIBREPCB_EDITOR_CMDDEVICEINSTANCEEDIT_H
26#include "../../undocommand.h"
31#include <optional/tl/optional.hpp>
43class CmdDeviceInstanceEditAll;
63 void rotate(
const Angle& angle,
const Point& center,
bool immediate)
noexcept;
65 void mirror(
const Point& center, Qt::Orientation orientation,
bool immediate);
67 void setModel(
const tl::optional<Uuid>& uuid)
noexcept;
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The BI_Device class.
Definition: bi_device.h:57
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The CmdDeviceInstanceEditAll class.
Definition: cmddeviceinstanceeditall.h:51
The CmdDeviceInstanceEdit class.
Definition: cmddeviceinstanceedit.h:52
void performRedo() override
Redo the command.
Definition: cmddeviceinstanceedit.cpp:161
bool mOldLocked
Definition: cmddeviceinstanceedit.h:93
void setPosition(const Point &pos, bool immediate) noexcept
Definition: cmddeviceinstanceedit.cpp:71
BI_Device & mDevice
Definition: cmddeviceinstanceedit.h:84
tl::optional< Uuid > mNewModelUuid
Definition: cmddeviceinstanceedit.h:96
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmddeviceinstanceedit.cpp:78
void setLocked(bool locked)
Definition: cmddeviceinstanceedit.cpp:122
CmdDeviceInstanceEdit(BI_Device &dev) noexcept
Definition: cmddeviceinstanceedit.cpp:40
Point mOldPos
Definition: cmddeviceinstanceedit.h:87
tl::optional< Uuid > mOldModelUuid
Definition: cmddeviceinstanceedit.h:95
void setMirrored(bool mirrored, bool immediate)
Definition: cmddeviceinstanceedit.cpp:103
bool mOldMirrored
Definition: cmddeviceinstanceedit.h:91
Angle mNewRotation
Definition: cmddeviceinstanceedit.h:90
void setModel(const tl::optional< Uuid > &uuid) noexcept
Definition: cmddeviceinstanceedit.cpp:127
void performUndo() override
Undo the command.
Definition: cmddeviceinstanceedit.cpp:147
bool mNewMirrored
Definition: cmddeviceinstanceedit.h:92
Point mNewPos
Definition: cmddeviceinstanceedit.h:88
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition: cmddeviceinstanceedit.cpp:85
void mirror(const Point ¢er, Qt::Orientation orientation, bool immediate)
Definition: cmddeviceinstanceedit.cpp:111
bool performExecute() override
Execute the command the first time.
Definition: cmddeviceinstanceedit.cpp:136
void rotate(const Angle &angle, const Point ¢er, bool immediate) noexcept
Definition: cmddeviceinstanceedit.cpp:97
Angle mOldRotation
Definition: cmddeviceinstanceedit.h:89
~CmdDeviceInstanceEdit() noexcept
Definition: cmddeviceinstanceedit.cpp:55
bool mNewLocked
Definition: cmddeviceinstanceedit.h:94
void setRotation(const Angle &angle, bool immediate) noexcept
Definition: cmddeviceinstanceedit.cpp:90
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812