LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 setTags(const QSet<Tag>& tags) noexcept;
60 void setModelPosition(const Point3D& pos) noexcept;
61 void setModelRotation(const Angle3D& rot) noexcept;
62 void setModels(const QSet<Uuid>& models) noexcept;
63
64 // Operator Overloadings
65 CmdFootprintEdit& operator=(const CmdFootprintEdit& rhs) = delete;
66
67private:
68 // Private Methods
69
71 bool performExecute() override;
72
74 void performUndo() override;
75
77 void performRedo() override;
78
79 // Private Member Variables
80
81 // Attributes from the constructor
83
84 // General Attributes
95};
96
97/*******************************************************************************
98 * Undo Commands
99 ******************************************************************************/
100
103 Footprint::Event>;
106 Footprint::Event>;
109
110/*******************************************************************************
111 * End of File
112 ******************************************************************************/
113
114} // namespace editor
115} // namespace librepcb
116
117#endif
The Footprint class represents one footprint variant of a package.
Definition footprint.h:56
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The CmdFootprintEdit class.
Definition cmdfootprintedit.h:49
void performRedo() override
Redo the command.
Definition cmdfootprintedit.cpp:107
QSet< Uuid > mOldModels
Definition cmdfootprintedit.h:93
void setName(const ElementName &name) noexcept
Definition cmdfootprintedit.cpp:59
Point3D mNewModelPosition
Definition cmdfootprintedit.h:90
void setModels(const QSet< Uuid > &models) noexcept
Definition cmdfootprintedit.cpp:79
void setModelPosition(const Point3D &pos) noexcept
Definition cmdfootprintedit.cpp:69
Footprint & mFootprint
Definition cmdfootprintedit.h:82
QSet< Tag > mOldTags
Definition cmdfootprintedit.h:87
Angle3D mNewModelRotation
Definition cmdfootprintedit.h:92
Angle3D mOldModelRotation
Definition cmdfootprintedit.h:91
void performUndo() override
Undo the command.
Definition cmdfootprintedit.cpp:99
~CmdFootprintEdit() noexcept
Definition cmdfootprintedit.cpp:52
CmdFootprintEdit(const CmdFootprintEdit &other)=delete
ElementName mNewName
Definition cmdfootprintedit.h:86
void setTags(const QSet< Tag > &tags) noexcept
Definition cmdfootprintedit.cpp:64
void setModelRotation(const Angle3D &rot) noexcept
Definition cmdfootprintedit.cpp:74
QSet< Tag > mNewTags
Definition cmdfootprintedit.h:88
QSet< Uuid > mNewModels
Definition cmdfootprintedit.h:94
ElementName mOldName
Definition cmdfootprintedit.h:85
bool performExecute() override
Execute the command the first time.
Definition cmdfootprintedit.cpp:88
Point3D mOldModelPosition
Definition cmdfootprintedit.h:89
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
CmdListElementsSwap< Footprint, FootprintListNameProvider, Footprint::Event > CmdFootprintsSwap
Definition cmdfootprintedit.h:108
CmdListElementInsert< Footprint, FootprintListNameProvider, Footprint::Event > CmdFootprintInsert
Definition cmdfootprintedit.h:103
CmdListElementRemove< Footprint, FootprintListNameProvider, Footprint::Event > CmdFootprintRemove
Definition cmdfootprintedit.h:106
Definition occmodel.cpp:77
type_safe::constrained_type< QString, TagConstraint, TagVerifier > Tag
Definition tag.h:82
std::tuple< Length, Length, Length > Point3D
Definition length.h:987
std::tuple< Angle, Angle, Angle > Angle3D
Definition angle.h:458
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84
Definition footprint.h:193