LibrePCB Developers Documentation
cmdfootprintpadedit.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_CMDFOOTPRINTPADEDIT_H
21#define LIBREPCB_EDITOR_CMDFOOTPRINTPADEDIT_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
32
33#include <QtCore>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39namespace editor {
40
41/*******************************************************************************
42 * Class CmdFootprintPadEdit
43 ******************************************************************************/
44
48class CmdFootprintPadEdit final : public UndoCommand {
49public:
50 // Constructors / Destructor
53 explicit CmdFootprintPadEdit(FootprintPad& pad) noexcept;
54 ~CmdFootprintPadEdit() noexcept;
55
56 // Setters
57 void setPackagePadUuid(const tl::optional<Uuid>& pad,
58 bool immediate) noexcept;
59 void setComponentSide(FootprintPad::ComponentSide side,
60 bool immediate) noexcept;
61 void setFunction(FootprintPad::Function function, bool immediate) noexcept;
62 void setShape(FootprintPad::Shape shape, bool immediate) noexcept;
63 void setWidth(const PositiveLength& width, bool immediate) noexcept;
64 void setHeight(const PositiveLength& height, bool immediate) noexcept;
65 void setRadius(const UnsignedLimitedRatio& radius, bool immediate) noexcept;
66 void setCustomShapeOutline(const Path& outline) noexcept;
67 void setStopMaskConfig(const MaskConfig& config, bool immediate) noexcept;
68 void setSolderPasteConfig(const MaskConfig& config) noexcept;
69 void setCopperClearance(const UnsignedLength& clearance) noexcept;
70 void setPosition(const Point& pos, bool immediate) noexcept;
71 void translate(const Point& deltaPos, bool immediate) noexcept;
72 void snapToGrid(const PositiveLength& gridInterval, bool immediate) noexcept;
73 void setRotation(const Angle& angle, bool immediate) noexcept;
74 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
75 void mirrorGeometry(Qt::Orientation orientation, const Point& center,
76 bool immediate) noexcept;
77 void mirrorLayer(bool immediate) noexcept;
78 void setHoles(const PadHoleList& holes, bool immediate) noexcept;
79
80 // Operator Overloadings
81 CmdFootprintPadEdit& operator=(const CmdFootprintPadEdit& rhs) = delete;
82
83private:
84 // Private Methods
85
87 bool performExecute() override;
88
90 void performUndo() override;
91
93 void performRedo() override;
94
95 // Private Member Variables
96
97 // Attributes from the constructor
99
100 // General Attributes
103};
104
105/*******************************************************************************
106 * Undo Commands
107 ******************************************************************************/
108
111 FootprintPad::Event>;
114 FootprintPad::Event>;
117 FootprintPad::Event>;
118
119/*******************************************************************************
120 * End of File
121 ******************************************************************************/
122
123} // namespace editor
124} // namespace librepcb
125
126#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The FootprintPad class represents a pad of a footprint.
Definition: footprintpad.h:55
The MaskConfig class defines how to add automatic stop mask or solder paste.
Definition: maskconfig.h:45
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition: path.h:58
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The CmdFootprintPadEdit class.
Definition: cmdfootprintpadedit.h:48
void performRedo() override
Redo the command.
Definition: cmdfootprintpadedit.cpp:225
FootprintPad mNewProperties
Definition: cmdfootprintpadedit.h:102
void setWidth(const PositiveLength &width, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:86
void setHeight(const PositiveLength &height, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:93
void setPosition(const Point &pos, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:131
~CmdFootprintPadEdit() noexcept
Definition: cmdfootprintpadedit.cpp:44
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:138
void performUndo() override
Undo the command.
Definition: cmdfootprintpadedit.cpp:221
void setRadius(const UnsignedLimitedRatio &radius, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:100
void setPackagePadUuid(const tl::optional< Uuid > &pad, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:58
void mirrorGeometry(Qt::Orientation orientation, const Point &center, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:170
void setShape(FootprintPad::Shape shape, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:79
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:145
FootprintPad mOldProperties
Definition: cmdfootprintpadedit.h:101
CmdFootprintPadEdit(const CmdFootprintPadEdit &other)=delete
void setSolderPasteConfig(const MaskConfig &config) noexcept
Definition: cmdfootprintpadedit.cpp:119
void mirrorLayer(bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:190
void setStopMaskConfig(const MaskConfig &config, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:112
void setFunction(FootprintPad::Function function, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:72
void setCustomShapeOutline(const Path &outline) noexcept
Definition: cmdfootprintpadedit.cpp:107
FootprintPad & mPad
Definition: cmdfootprintpadedit.h:98
bool performExecute() override
Execute the command the first time.
Definition: cmdfootprintpadedit.cpp:214
void setComponentSide(FootprintPad::ComponentSide side, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:65
void setHoles(const PadHoleList &holes, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:201
void setCopperClearance(const UnsignedLength &clearance) noexcept
Definition: cmdfootprintpadedit.cpp:125
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:158
void setRotation(const Angle &angle, bool immediate) noexcept
Definition: cmdfootprintpadedit.cpp:151
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
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696
type_safe::constrained_type< Ratio, UnsignedLimitedRatioConstraint, UnsignedLimitedRatioVerifier > UnsignedLimitedRatio
Definition: ratio.h:378
Definition: uuid.h:183
Definition: footprintpad.h:242