LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
boardplanefragmentsbuilder.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_BOARDPLANEFRAGMENTSBUILDER_H
21 #define LIBREPCB_PROJECT_BOARDPLANEFRAGMENTSBUILDER_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include <clipper/clipper.hpp>
28 
29 #include <QtCore>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 namespace project {
36 
37 class BI_Plane;
38 class BI_Via;
39 class BI_FootprintPad;
40 
41 /*******************************************************************************
42  * Class BoardPlaneFragmentsBuilder
43  ******************************************************************************/
44 
49 public:
50  // Constructors / Destructor
51  BoardPlaneFragmentsBuilder() = delete;
53  BoardPlaneFragmentsBuilder(BI_Plane& plane) noexcept;
54  ~BoardPlaneFragmentsBuilder() noexcept;
55 
56  // General Methods
57  QVector<Path> buildFragments() noexcept;
58 
59  // Operator Overloadings
61  delete;
62 
63 private: // Methods
64  void addPlaneOutline();
65  void clipToBoardOutline();
66  void subtractOtherObjects();
67  void ensureMinimumWidth();
68  void flattenResult();
69  void removeOrphans();
70 
71  // Helper Methods
72  ClipperLib::Path createPadCutOut(const BI_FootprintPad& pad) const noexcept;
73  ClipperLib::Path createViaCutOut(const BI_Via& via) const noexcept;
74 
80  static PositiveLength maxArcTolerance() noexcept {
81  return PositiveLength(5000);
82  }
83 
84 private: // Data
86  ClipperLib::Paths mConnectedNetSignalAreas;
87  ClipperLib::Paths mResult;
88 };
89 
90 /*******************************************************************************
91  * End of File
92  ******************************************************************************/
93 
94 } // namespace project
95 } // namespace librepcb
96 
97 #endif // LIBREPCB_PROJECT_BOARDPLANEFRAGMENTSBUILDER_H
ClipperLib::Paths mConnectedNetSignalAreas
Definition: boardplanefragmentsbuilder.h:86
ClipperLib::Path createViaCutOut(const BI_Via &via) const noexcept
Definition: boardplanefragmentsbuilder.cpp:252
~BoardPlaneFragmentsBuilder() noexcept
Definition: boardplanefragmentsbuilder.cpp:57
BI_Plane & mPlane
Definition: boardplanefragmentsbuilder.h:85
void clipToBoardOutline()
Definition: boardplanefragmentsbuilder.cpp:92
BoardPlaneFragmentsBuilder & operator=(const BoardPlaneFragmentsBuilder &rhs)=delete
ClipperLib::Path createPadCutOut(const BI_FootprintPad &pad) const noexcept
Definition: boardplanefragmentsbuilder.cpp:239
void removeOrphans()
Definition: boardplanefragmentsbuilder.cpp:219
void flattenResult()
Definition: boardplanefragmentsbuilder.cpp:207
The BI_Plane class.
Definition: bi_plane.h:53
The BI_FootprintPad class.
Definition: bi_footprintpad.h:56
void subtractOtherObjects()
Definition: boardplanefragmentsbuilder.cpp:121
QVector< Path > buildFragments() noexcept
Definition: boardplanefragmentsbuilder.cpp:64
The BoardPlaneFragmentsBuilder class.
Definition: boardplanefragmentsbuilder.h:48
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:780
void ensureMinimumWidth()
Definition: boardplanefragmentsbuilder.cpp:201
ClipperLib::Paths mResult
Definition: boardplanefragmentsbuilder.h:87
void addPlaneOutline()
Definition: boardplanefragmentsbuilder.cpp:87
static PositiveLength maxArcTolerance() noexcept
Definition: boardplanefragmentsbuilder.h:80
The BI_Via class.
Definition: bi_via.h:49