LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdschematicnetlabeladd.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_CMDSCHEMATICNETLABELADD_H
21 #define LIBREPCB_PROJECT_CMDSCHEMATICNETLABELADD_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 NetSignal;
38 class Schematic;
39 class SI_NetLabel;
40 class SI_NetSegment;
41 
42 /*******************************************************************************
43  * Class CmdSchematicNetLabelAdd
44  ******************************************************************************/
45 
49 class CmdSchematicNetLabelAdd final : public UndoCommand {
50 public:
51  // Constructors / Destructor
52  CmdSchematicNetLabelAdd(SI_NetSegment& segment, const Point& position,
53  const Angle& rotation) noexcept;
54  ~CmdSchematicNetLabelAdd() noexcept;
55 
56  // Getters
57  SI_NetLabel* getNetLabel() const noexcept { return mNetLabel; }
58 
59 private:
60  // Private Methods
61 
63  bool performExecute() override;
64 
66  void performUndo() override;
67 
69  void performRedo() override;
70 
71  // Private Member Variables
72 
77 };
78 
79 /*******************************************************************************
80  * End of File
81  ******************************************************************************/
82 
83 } // namespace project
84 } // namespace librepcb
85 
86 #endif // LIBREPCB_PROJECT_CMDSCHEMATICNETLABELADD_H
void performRedo() override
Redo the command.
Definition: cmdschematicnetlabeladd.cpp:70
SI_NetLabel * getNetLabel() const noexcept
Definition: cmdschematicnetlabeladd.h:57
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
Angle mRotation
Definition: cmdschematicnetlabeladd.h:75
SI_NetLabel * mNetLabel
Definition: cmdschematicnetlabeladd.h:76
The SI_NetSegment class.
Definition: si_netsegment.h:55
SI_NetSegment & mNetSegment
Definition: cmdschematicnetlabeladd.h:73
CmdSchematicNetLabelAdd(SI_NetSegment &segment, const Point &position, const Angle &rotation) noexcept
Definition: cmdschematicnetlabeladd.cpp:41
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
void performUndo() override
Undo the command.
Definition: cmdschematicnetlabeladd.cpp:66
The CmdSchematicNetLabelAdd class.
Definition: cmdschematicnetlabeladd.h:49
~CmdSchematicNetLabelAdd() noexcept
Definition: cmdschematicnetlabeladd.cpp:51
The SI_NetLabel class.
Definition: si_netlabel.h:51
bool performExecute() override
Execute the command the first time.
Definition: cmdschematicnetlabeladd.cpp:58
Point mPosition
Definition: cmdschematicnetlabeladd.h:74