LibrePCB Developers Documentation
boardnetsegmentsplitter.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_EDITOR_BOARDNETSEGMENTSPLITTER_H
21 #define LIBREPCB_PROJECT_EDITOR_BOARDNETSEGMENTSPLITTER_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
29 
30 #include <QtCore>
31 #include <QtWidgets>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 
38 class GraphicsLayer;
39 
40 namespace project {
41 namespace editor {
42 
43 /*******************************************************************************
44  * Class BoardNetSegmentSplitter
45  ******************************************************************************/
46 
51 public:
52  // Types
53  struct Segment {
57  };
58 
59  // Constructors / Destructor
60  BoardNetSegmentSplitter() noexcept;
61  BoardNetSegmentSplitter(const BoardNetSegmentSplitter& other) = delete;
62  ~BoardNetSegmentSplitter() noexcept;
63 
64  // General Methods
66  const Point& pos) noexcept;
67  void addJunction(const Junction& junction) noexcept;
68  void addVia(const Via& via, bool replaceByJunctions) noexcept;
69  void addTrace(const Trace& trace) noexcept;
70  QList<Segment> split() noexcept;
71 
72  // Operator Overloadings
73  BoardNetSegmentSplitter& operator=(const BoardNetSegmentSplitter& rhs) =
74  delete;
75 
76 private: // Methods
78  const GraphicsLayerName& layer) noexcept;
79  void findConnectedLinesAndPoints(const TraceAnchor& anchor,
80  ViaList& availableVias,
81  TraceList& availableTraces, Segment& segment)
82 
83  noexcept;
84 
85 private: // Data
89 
91  QHash<QPair<TraceAnchor, GraphicsLayerName>, TraceAnchor> mReplacedAnchors;
92 };
93 
94 /*******************************************************************************
95  * End of File
96  ******************************************************************************/
97 
98 } // namespace editor
99 } // namespace project
100 } // namespace librepcb
101 
102 #endif
void findConnectedLinesAndPoints(const TraceAnchor &anchor, ViaList &availableVias, TraceList &availableTraces, Segment &segment) noexcept
Definition: boardnetsegmentsplitter.cpp:125
TraceList mTraces
Definition: boardnetsegmentsplitter.h:88
The Via class represents a via of a board.
Definition: via.h:50
QHash< TraceAnchor, Point > mAnchorsToReplace
Definition: boardnetsegmentsplitter.h:90
The Junction class represents the connection point between netlines or traces.
Definition: junction.h:50
Definition: airwiresbuilder.cpp:32
TraceList traces
Definition: boardnetsegmentsplitter.h:56
The TraceAnchor class.
Definition: trace.h:47
type_safe::constrained_type< QString, GraphicsLayerNameConstraint, GraphicsLayerNameVerifier > GraphicsLayerName
Definition: graphicslayername.h:78
QList< Segment > split() noexcept
Definition: boardnetsegmentsplitter.cpp:78
void addJunction(const Junction &junction) noexcept
Definition: boardnetsegmentsplitter.cpp:57
BoardNetSegmentSplitter() noexcept
Definition: boardnetsegmentsplitter.cpp:41
QHash< QPair< TraceAnchor, GraphicsLayerName >, TraceAnchor > mReplacedAnchors
Definition: boardnetsegmentsplitter.h:91
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
ViaList mVias
Definition: boardnetsegmentsplitter.h:87
The BoardNetSegmentSplitter class.
Definition: boardnetsegmentsplitter.h:50
The Trace class represents a trace within a board.
Definition: trace.h:108
TraceAnchor replaceAnchor(const TraceAnchor &anchor, const GraphicsLayerName &layer) noexcept
Definition: boardnetsegmentsplitter.cpp:107
void addVia(const Via &via, bool replaceByJunctions) noexcept
Definition: boardnetsegmentsplitter.cpp:61
Definition: boardnetsegmentsplitter.h:53
void replaceFootprintPadByJunctions(const TraceAnchor &anchor, const Point &pos) noexcept
Definition: boardnetsegmentsplitter.cpp:52
JunctionList junctions
Definition: boardnetsegmentsplitter.h:54
JunctionList mJunctions
Definition: boardnetsegmentsplitter.h:86
void addTrace(const Trace &trace) noexcept
Definition: boardnetsegmentsplitter.cpp:70
ViaList vias
Definition: boardnetsegmentsplitter.h:55