LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdboardnetpointedit.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_CMDBOARDNETPOINTEDIT_H
21 #define LIBREPCB_PROJECT_CMDBOARDNETPOINTEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
28 
29 #include <QtCore>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 namespace project {
36 
37 class BI_NetPoint;
38 
39 /*******************************************************************************
40  * Class CmdBoardNetPointEdit
41  ******************************************************************************/
42 
46 class CmdBoardNetPointEdit final : public UndoCommand {
47 public:
48  // Constructors / Destructor
49  explicit CmdBoardNetPointEdit(BI_NetPoint& point) noexcept;
50  ~CmdBoardNetPointEdit() noexcept;
51 
52  // Setters
53  void setPosition(const Point& pos, bool immediate) noexcept;
54  void translate(const Point& deltaPos, bool immediate) noexcept;
55  void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
56 
57 private:
58  // Private Methods
59 
61  bool performExecute() override;
62 
64  void performUndo() override;
65 
67  void performRedo() override;
68 
69  // Private Member Variables
70 
71  // Attributes from the constructor
73 
74  // General Attributes
77 };
78 
79 /*******************************************************************************
80  * End of File
81  ******************************************************************************/
82 
83 } // namespace project
84 } // namespace librepcb
85 
86 #endif // LIBREPCB_PROJECT_CMDBOARDNETPOINTEDIT_H
The CmdBoardNetPointEdit class.
Definition: cmdboardnetpointedit.h:46
The BI_NetPoint class.
Definition: bi_netpoint.h:48
void performRedo() override
Redo the command.
Definition: cmdboardnetpointedit.cpp:91
void performUndo() override
Undo the command.
Definition: cmdboardnetpointedit.cpp:87
void setPosition(const Point &pos, bool immediate) noexcept
Definition: cmdboardnetpointedit.cpp:56
Point mOldPos
Definition: cmdboardnetpointedit.h:75
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
~CmdBoardNetPointEdit() noexcept
Definition: cmdboardnetpointedit.cpp:46
bool performExecute() override
Execute the command the first time.
Definition: cmdboardnetpointedit.cpp:81
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
Point mNewPos
Definition: cmdboardnetpointedit.h:76
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition: cmdboardnetpointedit.cpp:70
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmdboardnetpointedit.cpp:63
CmdBoardNetPointEdit(BI_NetPoint &point) noexcept
Definition: cmdboardnetpointedit.cpp:39
BI_NetPoint & mNetPoint
Definition: cmdboardnetpointedit.h:72