LibrePCB Developers Documentation
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 setMinClearance(const UnsignedLength& minClearance) noexcept;
67 void setConnectStyle(BI_Plane::ConnectStyle style) noexcept;
68 void setThermalGap(const PositiveLength& gap) noexcept;
69 void setThermalSpokeWidth(const PositiveLength& width) noexcept;
70 void setPriority(int priority) noexcept;
71 void setKeepIslands(bool keep) noexcept;
72 void setLocked(bool locked) noexcept;
73
74private:
75 // Private Methods
76
78 bool performExecute() override;
79
81 void performUndo() override;
82
84 void performRedo() override;
85
86 // Private Member Variables
87
88 // Attributes from the constructor
90
91 // General Attributes
114};
115
116/*******************************************************************************
117 * End of File
118 ******************************************************************************/
119
120} // namespace editor
121} // namespace librepcb
122
123#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
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:40
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:58
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The CmdBoardPlaneEdit class.
Definition: cmdboardplaneedit.h:50
void performRedo() override
Redo the command.
Definition: cmdboardplaneedit.cpp:197
PositiveLength mNewThermalGap
Definition: cmdboardplaneedit.h:105
BI_Plane & mPlane
Definition: cmdboardplaneedit.h:89
bool mOldLocked
Definition: cmdboardplaneedit.h:112
void setLayer(const Layer &layer, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:110
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:78
UnsignedLength mOldMinWidth
Definition: cmdboardplaneedit.h:98
BI_Plane::ConnectStyle mOldConnectStyle
Definition: cmdboardplaneedit.h:102
int mOldPriority
Definition: cmdboardplaneedit.h:108
void setKeepIslands(bool keep) noexcept
Definition: cmdboardplaneedit.cpp:152
void setOutline(const Path &outline, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:103
UnsignedLength mNewMinWidth
Definition: cmdboardplaneedit.h:99
void setConnectStyle(BI_Plane::ConnectStyle style) noexcept
Definition: cmdboardplaneedit.cpp:132
void performUndo() override
Undo the command.
Definition: cmdboardplaneedit.cpp:183
CmdBoardPlaneEdit(BI_Plane &plane) noexcept
Definition: cmdboardplaneedit.cpp:40
PositiveLength mOldThermalGap
Definition: cmdboardplaneedit.h:104
PositiveLength mNewThermalSpokeWidth
Definition: cmdboardplaneedit.h:107
Path mOldOutline
Definition: cmdboardplaneedit.h:92
UnsignedLength mNewMinClearance
Definition: cmdboardplaneedit.h:101
bool mNewKeepIslands
Definition: cmdboardplaneedit.h:111
void setThermalGap(const PositiveLength &gap) noexcept
Definition: cmdboardplaneedit.cpp:137
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:85
BI_Plane::ConnectStyle mNewConnectStyle
Definition: cmdboardplaneedit.h:103
int mNewPriority
Definition: cmdboardplaneedit.h:109
const Layer * mNewLayer
Definition: cmdboardplaneedit.h:95
void setNetSignal(NetSignal *netsignal) noexcept
Definition: cmdboardplaneedit.cpp:116
void setPriority(int priority) noexcept
Definition: cmdboardplaneedit.cpp:147
PositiveLength mOldThermalSpokeWidth
Definition: cmdboardplaneedit.h:106
NetSignal * mOldNetSignal
Definition: cmdboardplaneedit.h:96
Path mNewOutline
Definition: cmdboardplaneedit.h:93
UnsignedLength mOldMinClearance
Definition: cmdboardplaneedit.h:100
bool performExecute() override
Execute the command the first time.
Definition: cmdboardplaneedit.cpp:166
void setMinWidth(const UnsignedLength &minWidth) noexcept
Definition: cmdboardplaneedit.cpp:121
void setLocked(bool locked) noexcept
Definition: cmdboardplaneedit.cpp:157
void mirror(const Point &center, Qt::Orientation orientation, int innerLayerCount, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:97
NetSignal * mNewNetSignal
Definition: cmdboardplaneedit.h:97
void setMinClearance(const UnsignedLength &minClearance) noexcept
Definition: cmdboardplaneedit.cpp:126
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:90
const Layer * mOldLayer
Definition: cmdboardplaneedit.h:94
bool mNewLocked
Definition: cmdboardplaneedit.h:113
bool mOldKeepIslands
Definition: cmdboardplaneedit.h:110
~CmdBoardPlaneEdit() noexcept
Definition: cmdboardplaneedit.cpp:67
void setThermalSpokeWidth(const PositiveLength &width) noexcept
Definition: cmdboardplaneedit.cpp:141
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