LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
boardclipperpathgenerator.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_BOARDCLIPPERPATHGENERATOR_H
21 #define LIBREPCB_PROJECT_BOARDCLIPPERPATHGENERATOR_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 
36 class GraphicsLayer;
37 
38 namespace project {
39 
40 class Board;
41 class NetSignal;
42 
43 /*******************************************************************************
44  * Class BoardClipperPathGenerator
45  ******************************************************************************/
46 
52 public:
53  // Constructors / Destructor
55  Board& board, const PositiveLength& maxArcTolerance) noexcept;
56  ~BoardClipperPathGenerator() noexcept;
57 
58  // Getters
59  const ClipperLib::Paths& getPaths() const noexcept { return mPaths; }
60 
61  // General Methods
62  void addBoardOutline();
63  void addHoles(const Length& offset);
64  void addCopper(const QString& layerName, const NetSignal* netsignal);
65 
66 private: // Data
69  ClipperLib::Paths mPaths;
70 };
71 
72 /*******************************************************************************
73  * End of File
74  ******************************************************************************/
75 
76 } // namespace project
77 } // namespace librepcb
78 
79 #endif // LIBREPCB_PROJECT_BOARDCLIPPERPATHGENERATOR_H
The BoardClipperPathGenerator class creates a Clipper path from a librepcb::project::Board.
Definition: boardclipperpathgenerator.h:51
PositiveLength mMaxArcTolerance
Definition: boardclipperpathgenerator.h:68
void addBoardOutline()
Definition: boardclipperpathgenerator.cpp:65
ClipperLib::Paths mPaths
Definition: boardclipperpathgenerator.h:69
void addHoles(const Length &offset)
Definition: boardclipperpathgenerator.cpp:92
Board & mBoard
Definition: boardclipperpathgenerator.h:67
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:780
~BoardClipperPathGenerator() noexcept
Definition: boardclipperpathgenerator.cpp:58
The NetSignal class.
Definition: netsignal.h:56
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:83
void addCopper(const QString &layerName, const NetSignal *netsignal)
Definition: boardclipperpathgenerator.cpp:123
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:82
const ClipperLib::Paths & getPaths() const noexcept
Definition: boardclipperpathgenerator.h:59
BoardClipperPathGenerator(Board &board, const PositiveLength &maxArcTolerance) noexcept
Definition: boardclipperpathgenerator.cpp:53