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
30
31#include <QtCore>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class BI_NetLine;
39class BI_NetLineAnchor;
40class BI_NetPoint;
41class BI_NetSegment;
42class Layer;
43
44namespace editor {
45
46/*******************************************************************************
47 * Class CmdBoardNetSegmentAddElements
48 ******************************************************************************/
49
54public:
55 // Constructors / Destructor
58
59 // General Methods
60 BI_Via* addVia(BI_Via& via);
61 BI_Via* addVia(const Via& via);
63 BI_NetPoint* addNetPoint(const Point& position);
66 BI_NetLineAnchor& endPoint, const Layer& layer,
67 const PositiveLength& width);
68
69private:
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 editor
93} // namespace librepcb
94
95#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:52
The BI_Via class.
Definition bi_via.h:44
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:52
The CmdBoardNetSegmentAddElements class.
Definition cmdboardnetsegmentaddelements.h:53
void performRedo() override
Redo the command.
Definition cmdboardnetsegmentaddelements.cpp:102
QList< BI_NetLine * > mNetLines
Definition cmdboardnetsegmentaddelements.h:85
void performUndo() override
Undo the command.
Definition cmdboardnetsegmentaddelements.cpp:98
BI_NetLine * addNetLine(BI_NetLine &netline)
Definition cmdboardnetsegmentaddelements.cpp:74
BI_NetPoint * addNetPoint(BI_NetPoint &netpoint)
Definition cmdboardnetsegmentaddelements.cpp:63
QList< BI_NetPoint * > mNetPoints
Definition cmdboardnetsegmentaddelements.h:84
BI_NetSegment & mNetSegment
Definition cmdboardnetsegmentaddelements.h:82
QList< BI_Via * > mVias
Definition cmdboardnetsegmentaddelements.h:83
~CmdBoardNetSegmentAddElements() noexcept
Definition cmdboardnetsegmentaddelements.cpp:46
bool performExecute() override
Execute the command the first time.
Definition cmdboardnetsegmentaddelements.cpp:92
BI_Via * addVia(BI_Via &via)
Definition cmdboardnetsegmentaddelements.cpp:53
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810