LibrePCB Developers Documentation
cmdfootprintedit.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_EDITOR_CMDFOOTPRINTEDIT_H
21#define LIBREPCB_EDITOR_CMDFOOTPRINTEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../cmd/cmdlistelementinsert.h"
27#include "../../cmd/cmdlistelementremove.h"
28#include "../../cmd/cmdlistelementsswap.h"
29#include "../../undocommand.h"
30
33
34#include <QtCore>
35
36/*******************************************************************************
37 * Namespace / Forward Declarations
38 ******************************************************************************/
39namespace librepcb {
40namespace editor {
41
42/*******************************************************************************
43 * Class CmdFootprintEdit
44 ******************************************************************************/
45
49class CmdFootprintEdit final : public UndoCommand {
50public:
51 // Constructors / Destructor
52 CmdFootprintEdit() = delete;
53 CmdFootprintEdit(const CmdFootprintEdit& other) = delete;
54 explicit CmdFootprintEdit(Footprint& fpt) noexcept;
55 ~CmdFootprintEdit() noexcept;
56
57 // Setters
58 void setName(const ElementName& name) noexcept;
59 void setModelPosition(const Point3D& pos) noexcept;
60 void setModelRotation(const Angle3D& rot) noexcept;
61 void setModels(const QSet<Uuid>& models) noexcept;
62
63 // Operator Overloadings
64 CmdFootprintEdit& operator=(const CmdFootprintEdit& rhs) = delete;
65
66private:
67 // Private Methods
68
70 bool performExecute() override;
71
73 void performUndo() override;
74
76 void performRedo() override;
77
78 // Private Member Variables
79
80 // Attributes from the constructor
82
83 // General Attributes
92};
93
94/*******************************************************************************
95 * Undo Commands
96 ******************************************************************************/
97
100 Footprint::Event>;
103 Footprint::Event>;
106
107/*******************************************************************************
108 * End of File
109 ******************************************************************************/
110
111} // namespace editor
112} // namespace librepcb
113
114#endif
The Footprint class represents one footprint variant of a package.
Definition: footprint.h:55
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The CmdFootprintEdit class.
Definition: cmdfootprintedit.h:49
void performRedo() override
Redo the command.
Definition: cmdfootprintedit.cpp:98
QSet< Uuid > mOldModels
Definition: cmdfootprintedit.h:90
void setName(const ElementName &name) noexcept
Definition: cmdfootprintedit.cpp:57
Point3D mNewModelPosition
Definition: cmdfootprintedit.h:87
void setModels(const QSet< Uuid > &models) noexcept
Definition: cmdfootprintedit.cpp:72
void setModelPosition(const Point3D &pos) noexcept
Definition: cmdfootprintedit.cpp:62
Footprint & mFootprint
Definition: cmdfootprintedit.h:81
Angle3D mNewModelRotation
Definition: cmdfootprintedit.h:89
Angle3D mOldModelRotation
Definition: cmdfootprintedit.h:88
void performUndo() override
Undo the command.
Definition: cmdfootprintedit.cpp:91
~CmdFootprintEdit() noexcept
Definition: cmdfootprintedit.cpp:50
CmdFootprintEdit(const CmdFootprintEdit &other)=delete
ElementName mNewName
Definition: cmdfootprintedit.h:85
void setModelRotation(const Angle3D &rot) noexcept
Definition: cmdfootprintedit.cpp:67
QSet< Uuid > mNewModels
Definition: cmdfootprintedit.h:91
ElementName mOldName
Definition: cmdfootprintedit.h:84
bool performExecute() override
Execute the command the first time.
Definition: cmdfootprintedit.cpp:81
Point3D mOldModelPosition
Definition: cmdfootprintedit.h:86
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:46
The CmdListElementRemove class.
Definition: cmdlistelementremove.h:46
The CmdListElementsSwap class.
Definition: cmdlistelementsswap.h:46
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77
std::tuple< Length, Length, Length > Point3D
Definition: length.h:989
std::tuple< Angle, Angle, Angle > Angle3D
Definition: angle.h:461
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84
Definition: footprint.h:186