LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdboardnetsegmentremoveelements.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_CMDBOARDNETSEGMENTREMOVEELEMENTS_H
21 #define LIBREPCB_PROJECT_CMDBOARDNETSEGMENTREMOVEELEMENTS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
27 
28 #include <QtCore>
29 
30 /*******************************************************************************
31  * Namespace / Forward Declarations
32  ******************************************************************************/
33 namespace librepcb {
34 namespace project {
35 
36 class BI_NetSegment;
37 class BI_Via;
38 class BI_NetPoint;
39 class BI_NetLine;
40 
41 /*******************************************************************************
42  * Class CmdBoardNetSegmentRemoveElements
43  ******************************************************************************/
44 
49 public:
50  // Constructors / Destructor
53 
54  // General Methods
55  void removeVia(BI_Via& via);
56  void removeNetPoint(BI_NetPoint& netpoint);
57  void removeNetLine(BI_NetLine& netline);
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
73  QList<BI_Via*> mVias;
74  QList<BI_NetPoint*> mNetPoints;
75  QList<BI_NetLine*> mNetLines;
76 };
77 
78 /*******************************************************************************
79  * End of File
80  ******************************************************************************/
81 
82 } // namespace project
83 } // namespace librepcb
84 
85 #endif // LIBREPCB_PROJECT_CMDBOARDNETSEGMENTREMOVEELEMENTS_H
bool performExecute() override
Execute the command the first time.
Definition: cmdboardnetsegmentremoveelements.cpp:70
void removeNetLine(BI_NetLine &netline)
Definition: cmdboardnetsegmentremoveelements.cpp:62
The BI_NetPoint class.
Definition: bi_netpoint.h:48
CmdBoardNetSegmentRemoveElements(BI_NetSegment &segment) noexcept
Definition: cmdboardnetsegmentremoveelements.cpp:42
The CmdBoardNetSegmentRemoveElements class.
Definition: cmdboardnetsegmentremoveelements.h:48
void removeVia(BI_Via &via)
Definition: cmdboardnetsegmentremoveelements.cpp:54
~CmdBoardNetSegmentRemoveElements() noexcept
Definition: cmdboardnetsegmentremoveelements.cpp:47
QList< BI_NetPoint * > mNetPoints
Definition: cmdboardnetsegmentremoveelements.h:74
The BI_NetSegment class.
Definition: bi_netsegment.h:59
QList< BI_Via * > mVias
Definition: cmdboardnetsegmentremoveelements.h:73
BI_NetSegment & mNetSegment
Definition: cmdboardnetsegmentremoveelements.h:72
QList< BI_NetLine * > mNetLines
Definition: cmdboardnetsegmentremoveelements.h:75
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:52
void removeNetPoint(BI_NetPoint &netpoint)
Definition: cmdboardnetsegmentremoveelements.cpp:58
void performRedo() override
Redo the command.
Definition: cmdboardnetsegmentremoveelements.cpp:80
void performUndo() override
Undo the command.
Definition: cmdboardnetsegmentremoveelements.cpp:76
The BI_NetLine class.
Definition: bi_netline.h:74
The BI_Via class.
Definition: bi_via.h:49