LibrePCB Developers Documentation
Loading...
Searching...
No Matches
cmdboardplaneedit.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_CMDBOARDPLANEEDIT_H
21#define LIBREPCB_EDITOR_CMDBOARDPLANEEDIT_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 Layer;
39class NetSignal;
40
41namespace editor {
42
43/*******************************************************************************
44 * Class CmdBoardPlaneEdit
45 ******************************************************************************/
46
50class CmdBoardPlaneEdit final : public UndoCommand {
51public:
52 // Constructors / Destructor
53 explicit CmdBoardPlaneEdit(BI_Plane& plane) noexcept;
54 ~CmdBoardPlaneEdit() noexcept;
55
56 // Setters
57 void translate(const Point& deltaPos, bool immediate) noexcept;
58 void snapToGrid(const PositiveLength& gridInterval, bool immediate) noexcept;
59 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
60 void mirror(const Point& center, Qt::Orientation orientation,
61 int innerLayerCount, bool immediate) noexcept;
62 void setOutline(const Path& outline, bool immediate) noexcept;
63 void setLayer(const Layer& layer, bool immediate) noexcept;
64 void setNetSignal(NetSignal* netsignal) noexcept;
65 void setMinWidth(const UnsignedLength& minWidth) noexcept;
66 void setMinClearanceToCopper(const UnsignedLength& minClearance) noexcept;
67 void setMinClearanceToBoard(const UnsignedLength& minClearance) noexcept;
68 void setMinClearanceToNpth(const UnsignedLength& minClearance) noexcept;
69 void setConnectStyle(BI_Plane::ConnectStyle style) noexcept;
70 void setThermalGap(const PositiveLength& gap) noexcept;
71 void setThermalSpokeWidth(const PositiveLength& width) noexcept;
72 void setPriority(int priority) noexcept;
73 void setKeepIslands(bool keep) noexcept;
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
120};
121
122/*******************************************************************************
123 * End of File
124 ******************************************************************************/
125
126} // namespace editor
127} // namespace librepcb
128
129#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The BI_Plane class.
Definition bi_plane.h:52
ConnectStyle
Definition bi_plane.h:68
The Layer class provides all supported geometry layers.
Definition layer.h:42
The NetSignal class.
Definition netsignal.h:50
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 CmdBoardPlaneEdit class.
Definition cmdboardplaneedit.h:50
UnsignedLength mOldMinClearanceToCopper
Definition cmdboardplaneedit.h:102
void performRedo() override
Redo the command.
Definition cmdboardplaneedit.cpp:217
PositiveLength mNewThermalGap
Definition cmdboardplaneedit.h:111
BI_Plane & mPlane
Definition cmdboardplaneedit.h:91
bool mOldLocked
Definition cmdboardplaneedit.h:118
void setLayer(const Layer &layer, bool immediate) noexcept
Definition cmdboardplaneedit.cpp:114
void translate(const Point &deltaPos, bool immediate) noexcept
Definition cmdboardplaneedit.cpp:82
UnsignedLength mOldMinWidth
Definition cmdboardplaneedit.h:100
BI_Plane::ConnectStyle mOldConnectStyle
Definition cmdboardplaneedit.h:108
int mOldPriority
Definition cmdboardplaneedit.h:114
UnsignedLength mOldMinClearanceToBoard
Definition cmdboardplaneedit.h:104
void setKeepIslands(bool keep) noexcept
Definition cmdboardplaneedit.cpp:168
void setOutline(const Path &outline, bool immediate) noexcept
Definition cmdboardplaneedit.cpp:107
UnsignedLength mNewMinWidth
Definition cmdboardplaneedit.h:101
UnsignedLength mNewMinClearanceToNpth
Definition cmdboardplaneedit.h:107
void setConnectStyle(BI_Plane::ConnectStyle style) noexcept
Definition cmdboardplaneedit.cpp:148
void performUndo() override
Undo the command.
Definition cmdboardplaneedit.cpp:201
void setMinClearanceToCopper(const UnsignedLength &minClearance) noexcept
Definition cmdboardplaneedit.cpp:130
void setMinClearanceToBoard(const UnsignedLength &minClearance) noexcept
Definition cmdboardplaneedit.cpp:136
PositiveLength mOldThermalGap
Definition cmdboardplaneedit.h:110
PositiveLength mNewThermalSpokeWidth
Definition cmdboardplaneedit.h:113
Path mOldOutline
Definition cmdboardplaneedit.h:94
bool mNewKeepIslands
Definition cmdboardplaneedit.h:117
void setThermalGap(const PositiveLength &gap) noexcept
Definition cmdboardplaneedit.cpp:153
UnsignedLength mNewMinClearanceToBoard
Definition cmdboardplaneedit.h:105
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition cmdboardplaneedit.cpp:89
BI_Plane::ConnectStyle mNewConnectStyle
Definition cmdboardplaneedit.h:109
int mNewPriority
Definition cmdboardplaneedit.h:115
const Layer * mNewLayer
Definition cmdboardplaneedit.h:97
void setNetSignal(NetSignal *netsignal) noexcept
Definition cmdboardplaneedit.cpp:120
void setMinClearanceToNpth(const UnsignedLength &minClearance) noexcept
Definition cmdboardplaneedit.cpp:142
void setPriority(int priority) noexcept
Definition cmdboardplaneedit.cpp:163
PositiveLength mOldThermalSpokeWidth
Definition cmdboardplaneedit.h:112
NetSignal * mOldNetSignal
Definition cmdboardplaneedit.h:98
Path mNewOutline
Definition cmdboardplaneedit.h:95
UnsignedLength mOldMinClearanceToNpth
Definition cmdboardplaneedit.h:106
bool performExecute() override
Execute the command the first time.
Definition cmdboardplaneedit.cpp:182
void setMinWidth(const UnsignedLength &minWidth) noexcept
Definition cmdboardplaneedit.cpp:125
void setLocked(bool locked) noexcept
Definition cmdboardplaneedit.cpp:173
void mirror(const Point &center, Qt::Orientation orientation, int innerLayerCount, bool immediate) noexcept
Definition cmdboardplaneedit.cpp:101
NetSignal * mNewNetSignal
Definition cmdboardplaneedit.h:99
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition cmdboardplaneedit.cpp:94
const Layer * mOldLayer
Definition cmdboardplaneedit.h:96
bool mNewLocked
Definition cmdboardplaneedit.h:119
bool mOldKeepIslands
Definition cmdboardplaneedit.h:116
~CmdBoardPlaneEdit() noexcept
Definition cmdboardplaneedit.cpp:71
UnsignedLength mNewMinClearanceToCopper
Definition cmdboardplaneedit.h:103
void setThermalSpokeWidth(const PositiveLength &width) noexcept
Definition cmdboardplaneedit.cpp:157
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