LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_PROJECT_CMDBOARDPLANEEDIT_H
21 #define LIBREPCB_PROJECT_CMDBOARDPLANEEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../items/bi_plane.h"
27 
30 
31 #include <QtCore>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 namespace project {
38 
39 class NetSignal;
40 
41 /*******************************************************************************
42  * Class CmdBoardPlaneEdit
43  ******************************************************************************/
44 
48 class CmdBoardPlaneEdit final : public UndoCommand {
49 public:
50  // Constructors / Destructor
51  CmdBoardPlaneEdit(BI_Plane& plane, bool rebuildOnChanges) noexcept;
52  ~CmdBoardPlaneEdit() noexcept;
53 
54  // Setters
55  void translate(const Point& deltaPos, bool immediate) noexcept;
56  void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
57  void mirror(const Point& center, Qt::Orientation orientation,
58  bool immediate) noexcept;
59  void setOutline(const Path& outline, bool immediate) noexcept;
60  void setLayerName(const GraphicsLayerName& layerName,
61  bool immediate) noexcept;
62  void setNetSignal(NetSignal& netsignal) noexcept;
63  void setMinWidth(const UnsignedLength& minWidth) noexcept;
64  void setMinClearance(const UnsignedLength& minClearance) noexcept;
65  void setConnectStyle(BI_Plane::ConnectStyle style) noexcept;
66  void setPriority(int priority) noexcept;
67  void setKeepOrphans(bool keepOrphans) noexcept;
68 
69 private:
70  // Private Methods
71 
73  bool performExecute() override;
74 
76  void performUndo() override;
77 
79  void performRedo() override;
80 
81  // Private Member Variables
82 
83  // Attributes from the constructor
86 
87  // General Attributes
104 };
105 
106 /*******************************************************************************
107  * End of File
108  ******************************************************************************/
109 
110 } // namespace project
111 } // namespace librepcb
112 
113 #endif // LIBREPCB_PROJECT_CMDBOARDPLANEEDIT_H
void setConnectStyle(BI_Plane::ConnectStyle style) noexcept
Definition: cmdboardplaneedit.cpp:127
bool performExecute() override
Execute the command the first time.
Definition: cmdboardplaneedit.cpp:146
BI_Plane & mPlane
Definition: cmdboardplaneedit.h:84
void setMinWidth(const UnsignedLength &minWidth) noexcept
Definition: cmdboardplaneedit.cpp:116
void setMinClearance(const UnsignedLength &minClearance) noexcept
Definition: cmdboardplaneedit.cpp:121
BI_Plane::ConnectStyle mNewConnectStyle
Definition: cmdboardplaneedit.h:99
Path mNewOutline
Definition: cmdboardplaneedit.h:89
void setNetSignal(NetSignal &netsignal) noexcept
Definition: cmdboardplaneedit.cpp:111
GraphicsLayerName mNewLayerName
Definition: cmdboardplaneedit.h:91
bool mOldKeepOrphans
Definition: cmdboardplaneedit.h:102
type_safe::constrained_type< QString, GraphicsLayerNameConstraint, GraphicsLayerNameVerifier > GraphicsLayerName
Definition: graphicslayername.h:78
BI_Plane::ConnectStyle mOldConnectStyle
Definition: cmdboardplaneedit.h:98
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:82
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
Path mOldOutline
Definition: cmdboardplaneedit.h:88
The CmdBoardPlaneEdit class.
Definition: cmdboardplaneedit.h:48
NetSignal * mOldNetSignal
Definition: cmdboardplaneedit.h:92
int mOldPriority
Definition: cmdboardplaneedit.h:100
The BI_Plane class.
Definition: bi_plane.h:53
void mirror(const Point &center, Qt::Orientation orientation, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:89
void setLayerName(const GraphicsLayerName &layerName, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:104
void performRedo() override
Redo the command.
Definition: cmdboardplaneedit.cpp:174
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
CmdBoardPlaneEdit(BI_Plane &plane, bool rebuildOnChanges) noexcept
Definition: cmdboardplaneedit.cpp:41
~CmdBoardPlaneEdit() noexcept
Definition: cmdboardplaneedit.cpp:64
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:75
void setKeepOrphans(bool keepOrphans) noexcept
Definition: cmdboardplaneedit.cpp:137
void setPriority(int priority) noexcept
Definition: cmdboardplaneedit.cpp:132
UnsignedLength mNewMinClearance
Definition: cmdboardplaneedit.h:97
bool mDoRebuildOnChanges
Definition: cmdboardplaneedit.h:85
void setOutline(const Path &outline, bool immediate) noexcept
Definition: cmdboardplaneedit.cpp:97
The Path class represents a list of vertices connected by straight lines or circular arc segments...
Definition: path.h:53
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
NetSignal * mNewNetSignal
Definition: cmdboardplaneedit.h:93
bool mNewKeepOrphans
Definition: cmdboardplaneedit.h:103
UnsignedLength mOldMinClearance
Definition: cmdboardplaneedit.h:96
UnsignedLength mNewMinWidth
Definition: cmdboardplaneedit.h:95
The NetSignal class.
Definition: netsignal.h:56
void performUndo() override
Undo the command.
Definition: cmdboardplaneedit.cpp:160
UnsignedLength mOldMinWidth
Definition: cmdboardplaneedit.h:94
GraphicsLayerName mOldLayerName
Definition: cmdboardplaneedit.h:90
int mNewPriority
Definition: cmdboardplaneedit.h:101
ConnectStyle
Definition: bi_plane.h:58
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:659