LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdboardnetsegmentaddelements.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_CMDBOARDNETSEGMENTADDELEMENTS_H
21 #define LIBREPCB_PROJECT_CMDBOARDNETSEGMENTADDELEMENTS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../items/bi_via.h"
27 
30 
31 #include <QtCore>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 namespace project {
38 
39 class BI_NetSegment;
40 class BI_NetPoint;
41 class BI_NetLine;
42 class BI_NetLineAnchor;
43 
44 /*******************************************************************************
45  * Class CmdBoardNetSegmentAddElements
46  ******************************************************************************/
47 
52 public:
53  // Constructors / Destructor
56 
57  // General Methods
58  BI_Via* addVia(BI_Via& via);
59  BI_Via* addVia(const Point& position, BI_Via::Shape shape,
60  const PositiveLength& size,
61  const PositiveLength& drillDiameter);
63  BI_NetPoint* addNetPoint(const Point& position);
64  BI_NetLine* addNetLine(BI_NetLine& netline);
66  BI_NetLineAnchor& endPoint, GraphicsLayer& layer,
67  const PositiveLength& width);
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
83  QList<BI_Via*> mVias;
84  QList<BI_NetPoint*> mNetPoints;
85  QList<BI_NetLine*> mNetLines;
86 };
87 
88 /*******************************************************************************
89  * End of File
90  ******************************************************************************/
91 
92 } // namespace project
93 } // namespace librepcb
94 
95 #endif // LIBREPCB_PROJECT_CMDBOARDNETSEGMENTADDELEMENTS_H
bool performExecute() override
Execute the command the first time.
Definition: cmdboardnetsegmentaddelements.cpp:92
void performUndo() override
Undo the command.
Definition: cmdboardnetsegmentaddelements.cpp:98
void performRedo() override
Redo the command.
Definition: cmdboardnetsegmentaddelements.cpp:102
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition: graphicslayer.h:50
The CmdBoardNetSegmentAddElements class.
Definition: cmdboardnetsegmentaddelements.h:51
BI_NetLine * addNetLine(BI_NetLine &netline)
Definition: cmdboardnetsegmentaddelements.cpp:75
The BI_NetPoint class.
Definition: bi_netpoint.h:48
BI_NetSegment & mNetSegment
Definition: cmdboardnetsegmentaddelements.h:82
QList< BI_Via * > mVias
Definition: cmdboardnetsegmentaddelements.h:83
QList< BI_NetLine * > mNetLines
Definition: cmdboardnetsegmentaddelements.h:85
~CmdBoardNetSegmentAddElements() noexcept
Definition: cmdboardnetsegmentaddelements.cpp:46
BI_Via * addVia(BI_Via &via)
Definition: cmdboardnetsegmentaddelements.cpp:53
CmdBoardNetSegmentAddElements(BI_NetSegment &segment) noexcept
Definition: cmdboardnetsegmentaddelements.cpp:41
QList< BI_NetPoint * > mNetPoints
Definition: cmdboardnetsegmentaddelements.h:84
The BI_NetSegment class.
Definition: bi_netsegment.h:57
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
Shape
Definition: bi_via.h:56
BI_NetPoint * addNetPoint(BI_NetPoint &netpoint)
Definition: cmdboardnetsegmentaddelements.cpp:65
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:47
Definition: bi_netline.h:51
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:780
The BI_NetLine class.
Definition: bi_netline.h:74
The BI_Via class.
Definition: bi_via.h:49