LibrePCB Developers Documentation
Loading...
Searching...
No Matches
schematicselectionquery.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_SCHEMATICSELECTIONQUERY_H
21#define LIBREPCB_EDITOR_SCHEMATICSELECTIONQUERY_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <QtCore>
27
28/*******************************************************************************
29 * Namespace / Forward Declarations
30 ******************************************************************************/
31namespace librepcb {
32
33class SI_BusJunction;
34class SI_BusLabel;
35class SI_BusLine;
36class SI_BusSegment;
37class SI_Image;
38class SI_NetLabel;
39class SI_NetLine;
40class SI_NetPoint;
41class SI_NetSegment;
42class SI_Polygon;
43class SI_Symbol;
44class SI_SymbolPin;
45class SI_Text;
46class Uuid;
47
48namespace editor {
49
50class SchematicGraphicsScene;
51
52/*******************************************************************************
53 * Class SchematicSelectionQuery
54 ******************************************************************************/
55
59class SchematicSelectionQuery final : public QObject {
60 Q_OBJECT
61
62public:
63 // Types
65 QSet<SI_BusJunction*> junctions;
66 QSet<SI_BusLine*> lines;
67 QSet<SI_BusLabel*> labels;
68 };
70 QSet<SI_NetPoint*> netpoints;
71 QSet<SI_NetLine*> netlines;
72 QSet<SI_NetLabel*> netlabels;
73 };
74
75 // Constructors / Destructor
79 QObject* parent = nullptr);
80 ~SchematicSelectionQuery() noexcept;
81
82 // Getters
83 const QSet<SI_Symbol*>& getSymbols() const noexcept { return mResultSymbols; }
84 const QSet<SI_BusJunction*>& getBusJunctions() const noexcept {
86 }
87 const QSet<SI_BusLine*>& getBusLines() const noexcept {
88 return mResultBusLines;
89 }
90 const QSet<SI_BusLabel*>& getBusLabels() const noexcept {
91 return mResultBusLabels;
92 }
93 const QSet<SI_NetPoint*>& getNetPoints() const noexcept {
94 return mResultNetPoints;
95 }
96 const QSet<SI_NetLine*>& getNetLines() const noexcept {
97 return mResultNetLines;
98 }
99 const QSet<SI_NetLabel*>& getNetLabels() const noexcept {
100 return mResultNetLabels;
101 }
102 const QSet<SI_Polygon*>& getPolygons() const noexcept {
103 return mResultPolygons;
104 }
105 const QSet<SI_Text*>& getTexts() const noexcept { return mResultTexts; }
106 const QSet<SI_Image*>& getImages() const noexcept { return mResultImages; }
107
117 QHash<SI_BusSegment*, BusSegmentItems> getBusSegmentItems() const noexcept;
118
128 QHash<SI_NetSegment*, NetSegmentItems> getNetSegmentItems() const noexcept;
129 int getResultCount() const noexcept;
130 bool isResultEmpty() const noexcept { return (getResultCount() == 0); }
131
132 // General Methods
133 void addSelectedSymbols() noexcept;
134 void addSelectedBusJunctions() noexcept;
135 void addSelectedBusLines() noexcept;
136 void addSelectedBusLabels() noexcept;
137 void addSelectedNetPoints() noexcept;
138 void addSelectedNetLines() noexcept;
139 void addSelectedNetLabels() noexcept;
140 void addSelectedPolygons() noexcept;
141 void addSelectedSchematicTexts() noexcept;
142 void addSelectedSymbolTexts() noexcept;
143 void addSelectedImages() noexcept;
153 void addJunctionsOfBusLines(bool onlyIfAllLinesSelected = false) noexcept;
163 void addNetPointsOfNetLines(bool onlyIfAllNetLinesSelected = false) noexcept;
164 void addNetLinesOfSymbolPins() noexcept;
165
166 // Operator Overloadings
168 delete;
169
170private: // Data
172
173 // query result
184};
185
186/*******************************************************************************
187 * End of File
188 ******************************************************************************/
189
190} // namespace editor
191} // namespace librepcb
192
193#endif
The SI_BusJunction class.
Definition si_busjunction.h:45
The SI_BusLabel class.
Definition si_buslabel.h:48
The SI_BusLine class.
Definition si_busline.h:47
The SI_Image class represents an image in a schematic.
Definition si_image.h:45
The SI_NetLabel class.
Definition si_netlabel.h:48
The SI_NetLine class.
Definition si_netline.h:64
The SI_NetPoint class.
Definition si_netpoint.h:44
The SI_NetSegment class.
Definition si_netsegment.h:55
The SI_Polygon class represents a polygon in a schematic.
Definition si_polygon.h:47
The SI_Symbol class.
Definition si_symbol.h:54
The SI_Text class represents a text label in a schematic.
Definition si_text.h:48
The SchematicGraphicsScene class.
Definition schematicgraphicsscene.h:76
The SchematicSelectionQuery class.
Definition schematicselectionquery.h:59
const QSet< SI_BusLabel * > & getBusLabels() const noexcept
Definition schematicselectionquery.h:90
void addSelectedImages() noexcept
Definition schematicselectionquery.cpp:207
const QSet< SI_NetPoint * > & getNetPoints() const noexcept
Definition schematicselectionquery.h:93
SchematicGraphicsScene & mScene
Definition schematicselectionquery.h:171
QSet< SI_Polygon * > mResultPolygons
Definition schematicselectionquery.h:181
QSet< SI_Symbol * > mResultSymbols
Definition schematicselectionquery.h:174
const QSet< SI_Symbol * > & getSymbols() const noexcept
Definition schematicselectionquery.h:83
void addSelectedNetPoints() noexcept
Definition schematicselectionquery.cpp:153
QSet< SI_BusLine * > mResultBusLines
Definition schematicselectionquery.h:176
void addSelectedBusLines() noexcept
Definition schematicselectionquery.cpp:135
void addNetPointsOfNetLines(bool onlyIfAllNetLinesSelected=false) noexcept
Add net points of the selected net lines.
Definition schematicselectionquery.cpp:234
void addSelectedNetLabels() noexcept
Definition schematicselectionquery.cpp:171
QHash< SI_NetSegment *, NetSegmentItems > getNetSegmentItems() const noexcept
Get net points, net lines and net labels grouped by net segment.
Definition schematicselectionquery.cpp:91
QSet< SI_Text * > mResultTexts
Definition schematicselectionquery.h:182
void addNetLinesOfSymbolPins() noexcept
Definition schematicselectionquery.cpp:252
bool isResultEmpty() const noexcept
Definition schematicselectionquery.h:130
QSet< SI_NetLabel * > mResultNetLabels
Definition schematicselectionquery.h:180
const QSet< SI_NetLabel * > & getNetLabels() const noexcept
Definition schematicselectionquery.h:99
QHash< SI_BusSegment *, BusSegmentItems > getBusSegmentItems() const noexcept
Get bus junctions, lines and labels grouped by bus segment.
Definition schematicselectionquery.cpp:76
void addSelectedPolygons() noexcept
Definition schematicselectionquery.cpp:180
void addSelectedSchematicTexts() noexcept
Definition schematicselectionquery.cpp:189
void addJunctionsOfBusLines(bool onlyIfAllLinesSelected=false) noexcept
Add junctions of the selected bus lines.
Definition schematicselectionquery.cpp:216
const QSet< SI_BusLine * > & getBusLines() const noexcept
Definition schematicselectionquery.h:87
~SchematicSelectionQuery() noexcept
Definition schematicselectionquery.cpp:68
void addSelectedNetLines() noexcept
Definition schematicselectionquery.cpp:162
const QSet< SI_Polygon * > & getPolygons() const noexcept
Definition schematicselectionquery.h:102
QSet< SI_BusJunction * > mResultBusJunctions
Definition schematicselectionquery.h:175
const QSet< SI_Text * > & getTexts() const noexcept
Definition schematicselectionquery.h:105
void addSelectedSymbolTexts() noexcept
Definition schematicselectionquery.cpp:198
QSet< SI_Image * > mResultImages
Definition schematicselectionquery.h:183
SchematicSelectionQuery(const SchematicSelectionQuery &other)=delete
const QSet< SI_BusJunction * > & getBusJunctions() const noexcept
Definition schematicselectionquery.h:84
const QSet< SI_NetLine * > & getNetLines() const noexcept
Definition schematicselectionquery.h:96
QSet< SI_NetLine * > mResultNetLines
Definition schematicselectionquery.h:179
void addSelectedBusLabels() noexcept
Definition schematicselectionquery.cpp:144
int getResultCount() const noexcept
Definition schematicselectionquery.cpp:105
QSet< SI_NetPoint * > mResultNetPoints
Definition schematicselectionquery.h:178
void addSelectedBusJunctions() noexcept
Definition schematicselectionquery.cpp:126
void addSelectedSymbols() noexcept
Definition schematicselectionquery.cpp:117
const QSet< SI_Image * > & getImages() const noexcept
Definition schematicselectionquery.h:106
QSet< SI_BusLabel * > mResultBusLabels
Definition schematicselectionquery.h:177
Definition occmodel.cpp:77
Definition schematicselectionquery.h:64
QSet< SI_BusLabel * > labels
Definition schematicselectionquery.h:67
QSet< SI_BusJunction * > junctions
Definition schematicselectionquery.h:65
QSet< SI_BusLine * > lines
Definition schematicselectionquery.h:66
Definition schematicselectionquery.h:69
QSet< SI_NetLabel * > netlabels
Definition schematicselectionquery.h:72
QSet< SI_NetPoint * > netpoints
Definition schematicselectionquery.h:70
QSet< SI_NetLine * > netlines
Definition schematicselectionquery.h:71