LibrePCB Developers Documentation
Loading...
Searching...
No Matches
cmdboardpadedit.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_CMDBOARDPADEDIT_H
21#define LIBREPCB_EDITOR_CMDBOARDPADEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommand.h"
27
30
31#include <QtCore>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class NetSignal;
39
40namespace editor {
41
42/*******************************************************************************
43 * Class CmdBoardPadEdit
44 ******************************************************************************/
45
49class CmdBoardPadEdit final : public UndoCommand {
50public:
51 // Constructors / Destructor
52 explicit CmdBoardPadEdit(BI_Pad& pad) noexcept;
53 ~CmdBoardPadEdit() noexcept;
54
55 // Setters
57 const PadHoleList& holes, bool immediate);
58 void setFunction(Pad::Function function, bool immediate) noexcept;
59 void setShape(Pad::Shape shape, bool immediate) noexcept;
60 void setWidth(const PositiveLength& width, bool immediate) noexcept;
61 void setHeight(const PositiveLength& height, bool immediate) noexcept;
62 void setRadius(const UnsignedLimitedRatio& radius, bool immediate) noexcept;
63 void setCustomShapeOutline(const Path& outline) noexcept;
64 void setStopMaskConfig(const MaskConfig& config, bool immediate) noexcept;
65 void setSolderPasteConfig(const MaskConfig& config) noexcept;
66 void setCopperClearance(const UnsignedLength& clearance,
67 bool immediate) noexcept;
68 void setPosition(const Point& pos, bool immediate) noexcept;
69 void translate(const Point& deltaPos, bool immediate) noexcept;
70 void snapToGrid(const PositiveLength& gridInterval, bool immediate) noexcept;
71 void setRotation(const Angle& angle, bool immediate) noexcept;
72 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
73 void mirror(const Point& center, Qt::Orientation orientation, bool immediate);
74 void setLocked(bool locked) noexcept;
75
76private:
77 // Private Methods
78
80 bool performExecute() override;
81
83 void performUndo() override;
84
86 void performRedo() override;
87
88 // Private Member Variables
89
90 // Attributes from the constructor
92
93 // General Attributes
96};
97
98/*******************************************************************************
99 * End of File
100 ******************************************************************************/
101
102} // namespace editor
103} // namespace librepcb
104
105#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
A pad in a board (either standalone or from a footprint)
Definition bi_pad.h:49
The BoardPadData class represents a pad in a board.
Definition boardpaddata.h:43
The MaskConfig class defines how to add automatic stop mask or solder paste.
Definition maskconfig.h:45
ComponentSide
Definition pad.h:64
Function
Definition pad.h:69
Shape
Definition pad.h:58
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition path.h:59
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The CmdBoardPadEdit class.
Definition cmdboardpadedit.h:49
void performRedo() override
Redo the command.
Definition cmdboardpadedit.cpp:223
void setWidth(const PositiveLength &width, bool immediate) noexcept
Definition cmdboardpadedit.cpp:84
void setHeight(const PositiveLength &height, bool immediate) noexcept
Definition cmdboardpadedit.cpp:91
void setPosition(const Point &pos, bool immediate) noexcept
Definition cmdboardpadedit.cpp:129
void setComponentSideAndHoles(Pad::ComponentSide side, const PadHoleList &holes, bool immediate)
Definition cmdboardpadedit.cpp:62
void translate(const Point &deltaPos, bool immediate) noexcept
Definition cmdboardpadedit.cpp:135
BoardPadData mOldProperties
Definition cmdboardpadedit.h:94
void performUndo() override
Undo the command.
Definition cmdboardpadedit.cpp:205
void setRadius(const UnsignedLimitedRatio &radius, bool immediate) noexcept
Definition cmdboardpadedit.cpp:98
void setFunction(Pad::Function function, bool immediate) noexcept
Definition cmdboardpadedit.cpp:71
void setShape(Pad::Shape shape, bool immediate) noexcept
Definition cmdboardpadedit.cpp:78
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition cmdboardpadedit.cpp:142
BoardPadData mNewProperties
Definition cmdboardpadedit.h:95
void setSolderPasteConfig(const MaskConfig &config) noexcept
Definition cmdboardpadedit.cpp:117
void setStopMaskConfig(const MaskConfig &config, bool immediate) noexcept
Definition cmdboardpadedit.cpp:110
void mirror(const Point &center, Qt::Orientation orientation, bool immediate)
Definition cmdboardpadedit.cpp:166
void setCustomShapeOutline(const Path &outline) noexcept
Definition cmdboardpadedit.cpp:105
~CmdBoardPadEdit() noexcept
Definition cmdboardpadedit.cpp:48
bool performExecute() override
Execute the command the first time.
Definition cmdboardpadedit.cpp:194
void setLocked(bool locked) noexcept
Definition cmdboardpadedit.cpp:185
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition cmdboardpadedit.cpp:154
BI_Pad & mPad
Definition cmdboardpadedit.h:91
void setCopperClearance(const UnsignedLength &clearance, bool immediate) noexcept
Definition cmdboardpadedit.cpp:122
void setRotation(const Angle &angle, bool immediate) noexcept
Definition cmdboardpadedit.cpp:148
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:810
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
type_safe::constrained_type< Ratio, UnsignedLimitedRatioConstraint, UnsignedLimitedRatioVerifier > UnsignedLimitedRatio
Definition ratio.h:376