LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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_EDITOR_CMDBOARDNETSEGMENTADDELEMENTS_H
21#define LIBREPCB_EDITOR_CMDBOARDNETSEGMENTADDELEMENTS_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommand.h"
27
31
32#include <QtCore>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class BI_NetLine;
40class BI_NetLineAnchor;
41class BI_NetPoint;
42class BI_NetSegment;
43class Layer;
44
45namespace editor {
46
47/*******************************************************************************
48 * Class CmdBoardNetSegmentAddElements
49 ******************************************************************************/
50
55public:
56 // Constructors / Destructor
59
60 // General Methods
61 BI_Pad* addPad(BI_Pad& pad);
62 BI_Pad* addPad(const BoardPadData& pad);
63 BI_Via* addVia(BI_Via& via);
64 BI_Via* addVia(const Via& via);
66 BI_NetPoint* addNetPoint(const Point& position);
69 const Layer& layer, const PositiveLength& width);
70
71private:
72 // Private Methods
73
75 bool performExecute() override;
76
78 void performUndo() override;
79
81 void performRedo() override;
82
83 // Private Member Variables
85 QList<BI_Pad*> mPads;
86 QList<BI_Via*> mVias;
87 QList<BI_NetPoint*> mNetPoints;
88 QList<BI_NetLine*> mNetLines;
89};
90
91/*******************************************************************************
92 * End of File
93 ******************************************************************************/
94
95} // namespace editor
96} // namespace librepcb
97
98#endif
Definition bi_netline.h:46
The BI_NetLine class.
Definition bi_netline.h:71
The BI_NetPoint class.
Definition bi_netpoint.h:46
The BI_NetSegment class.
Definition bi_netsegment.h:53
A pad in a board (either standalone or from a footprint)
Definition bi_pad.h:49
The BI_Via class.
Definition bi_via.h:44
The BoardPadData class represents a pad in a board.
Definition boardpaddata.h:43
The Layer class provides all supported geometry layers.
Definition layer.h:42
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Via class represents a via of a board.
Definition via.h:55
The CmdBoardNetSegmentAddElements class.
Definition cmdboardnetsegmentaddelements.h:54
void performRedo() override
Redo the command.
Definition cmdboardnetsegmentaddelements.cpp:112
QList< BI_NetLine * > mNetLines
Definition cmdboardnetsegmentaddelements.h:88
void performUndo() override
Undo the command.
Definition cmdboardnetsegmentaddelements.cpp:108
BI_NetLine * addNetLine(BI_NetLine &netline)
Definition cmdboardnetsegmentaddelements.cpp:84
BI_NetPoint * addNetPoint(BI_NetPoint &netpoint)
Definition cmdboardnetsegmentaddelements.cpp:73
BI_Pad * addPad(BI_Pad &pad)
Definition cmdboardnetsegmentaddelements.cpp:53
QList< BI_NetPoint * > mNetPoints
Definition cmdboardnetsegmentaddelements.h:87
BI_NetSegment & mNetSegment
Definition cmdboardnetsegmentaddelements.h:84
QList< BI_Via * > mVias
Definition cmdboardnetsegmentaddelements.h:86
~CmdBoardNetSegmentAddElements() noexcept
Definition cmdboardnetsegmentaddelements.cpp:46
bool performExecute() override
Execute the command the first time.
Definition cmdboardnetsegmentaddelements.cpp:102
BI_Via * addVia(BI_Via &via)
Definition cmdboardnetsegmentaddelements.cpp:63
QList< BI_Pad * > mPads
Definition cmdboardnetsegmentaddelements.h:85
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
Definition occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810