LibrePCB Developers Documentation
Loading...
Searching...
No Matches
cmdremoveselectedschematicitems.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_CMDREMOVESELECTEDSCHEMATICITEMS_H
21#define LIBREPCB_EDITOR_CMDREMOVESELECTEDSCHEMATICITEMS_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommandgroup.h"
27
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37class ComponentSignalInstance;
38class NetSignal;
39class SI_BusJunction;
40class SI_BusLabel;
41class SI_BusLine;
42class SI_BusSegment;
43class SI_NetLabel;
44class SI_NetLine;
45class SI_NetPoint;
46class SI_NetSegment;
47class SI_Symbol;
48
49namespace editor {
50
51class SchematicGraphicsScene;
52
53/*******************************************************************************
54 * Class CmdRemoveSelectedSchematicItems
55 ******************************************************************************/
56
65
66public:
67 // Constructors / Destructor
69 SchematicGraphicsScene& scene) noexcept;
71
72 // Output
73 const QSet<SI_NetSegment*>& getModifiedNetSegments() const noexcept {
75 }
76 const QSet<SI_BusSegment*>& getModifiedBusSegments() const noexcept {
78 }
79
80private:
81 // Private Methods
82
84 bool performExecute() override;
85
86 void removeNetSegmentItems(SI_NetSegment& netsegment,
87 const QSet<SI_NetPoint*>& netpointsToRemove,
88 const QSet<SI_NetLine*>& netlinesToRemove,
89 const QSet<SI_NetLabel*>& netlabelsToRemove,
90 const QSet<SI_BusJunction*>& busJunctionsToReplace,
91 QVector<Segment>& remainingNetSegments);
93 SI_BusSegment& busSegment, const QSet<SI_BusJunction*>& junctionsToRemove,
94 const QSet<SI_BusLine*>& linesToRemove,
95 const QSet<SI_BusLabel*>& labelsToRemove,
96 QHash<NetLineAnchor, NetLineAnchor>& replacedBusJunctions);
98 const QVector<Segment>& remainingNetSegments,
99 const QHash<NetLineAnchor, NetLineAnchor>& replacedBusJunctions);
100 void removeSymbol(SI_Symbol& symbol);
102
103 // Attributes from the constructor
105
106 // Output
107 QSet<SI_NetSegment*> mModifiedNetSegments;
108 QSet<SI_BusSegment*> mModifiedBusSegments;
109};
110
111/*******************************************************************************
112 * End of File
113 ******************************************************************************/
114
115} // namespace editor
116} // namespace librepcb
117
118#endif
The ComponentSignalInstance class.
Definition componentsignalinstance.h:49
The NetSignal class.
Definition netsignal.h:50
The SI_BusSegment class.
Definition si_bussegment.h:52
The SI_NetSegment class.
Definition si_netsegment.h:55
The SI_Symbol class.
Definition si_symbol.h:54
The CmdRemoveSelectedSchematicItems class.
Definition cmdremoveselectedschematicitems.h:60
void disconnectComponentSignalInstance(ComponentSignalInstance &signal)
Definition cmdremoveselectedschematicitems.cpp:483
SchematicGraphicsScene & mScene
Definition cmdremoveselectedschematicitems.h:104
~CmdRemoveSelectedSchematicItems() noexcept
Definition cmdremoveselectedschematicitems.cpp:94
void removeBusSegmentItems(SI_BusSegment &busSegment, const QSet< SI_BusJunction * > &junctionsToRemove, const QSet< SI_BusLine * > &linesToRemove, const QSet< SI_BusLabel * > &labelsToRemove, QHash< NetLineAnchor, NetLineAnchor > &replacedBusJunctions)
Definition cmdremoveselectedschematicitems.cpp:266
void addRemainingNetSegmentItems(const QVector< Segment > &remainingNetSegments, const QHash< NetLineAnchor, NetLineAnchor > &replacedBusJunctions)
Definition cmdremoveselectedschematicitems.cpp:359
void removeNetSegmentItems(SI_NetSegment &netsegment, const QSet< SI_NetPoint * > &netpointsToRemove, const QSet< SI_NetLine * > &netlinesToRemove, const QSet< SI_NetLabel * > &netlabelsToRemove, const QSet< SI_BusJunction * > &busJunctionsToReplace, QVector< Segment > &remainingNetSegments)
Definition cmdremoveselectedschematicitems.cpp:204
QSet< SI_BusSegment * > mModifiedBusSegments
Definition cmdremoveselectedschematicitems.h:108
const QSet< SI_NetSegment * > & getModifiedNetSegments() const noexcept
Definition cmdremoveselectedschematicitems.h:73
const QSet< SI_BusSegment * > & getModifiedBusSegments() const noexcept
Definition cmdremoveselectedschematicitems.h:76
bool performExecute() override
Execute the command the first time.
Definition cmdremoveselectedschematicitems.cpp:101
QSet< SI_NetSegment * > mModifiedNetSegments
Definition cmdremoveselectedschematicitems.h:107
void removeSymbol(SI_Symbol &symbol)
Definition cmdremoveselectedschematicitems.cpp:459
The SchematicGraphicsScene class.
Definition schematicgraphicsscene.h:76
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition undocommandgroup.h:44
Definition occmodel.cpp:77
Definition schematicnetsegmentsplitter.h:48
Definition cmdremoveselectedschematicitems.h:61
SchematicNetSegmentSplitter::Segment elements
Definition cmdremoveselectedschematicitems.h:63
NetSignal * net
Definition cmdremoveselectedschematicitems.h:62