LibrePCB Developers Documentation
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_CORE_BOARDCLIPPERPATHGENERATOR_H
21#define LIBREPCB_CORE_BOARDCLIPPERPATHGENERATOR_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../../geometry/path.h"
27#include "../../../types/length.h"
28#include "../../../utils/transform.h"
29
30#include <polyclipping/clipper.hpp>
31
32#include <QtCore>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class BI_FootprintPad;
40class BI_NetLine;
41class BI_Plane;
42class BI_StrokeText;
43class BI_Via;
44class Board;
45class Circle;
46class Hole;
47class Layer;
48class NetSignal;
49
50/*******************************************************************************
51 * Class BoardClipperPathGenerator
52 ******************************************************************************/
53
59public:
60 // Constructors / Destructor
62 Board& board, const PositiveLength& maxArcTolerance) noexcept;
64
65 // Getters
66 const ClipperLib::Paths& getPaths() const noexcept { return mPaths; }
67 void takePathsTo(ClipperLib::Paths& out) noexcept;
68
69 // General Methods
70 void addCopper(const Layer& layer, const QSet<const NetSignal*>& netsignals,
71 bool ignorePlanes = false);
72 void addStopMaskOpenings(const Layer& layer,
73 const Length& offset = Length(0));
74 void addVia(const BI_Via& via, const Length& offset = Length(0));
75 void addNetLine(const BI_NetLine& netLine, const Length& offset = Length(0));
76 void addPlane(const BI_Plane& plane);
77 void addPolygon(const Path& path, const UnsignedLength& lineWidth,
78 bool filled, const Length& offset = Length(0));
79 void addCircle(const Circle& circle, const Transform& transform,
80 const Length& offset = Length(0));
81 void addStrokeText(const BI_StrokeText& strokeText,
82 const Length& offset = Length(0));
83 void addHole(const PositiveLength& diameter, const NonEmptyPath& path,
84 const Transform& transform = Transform(),
85 const Length& offset = Length(0));
86 void addPad(const BI_FootprintPad& pad, const Layer& layer,
87 const Length& offset = Length(0));
88
89private: // Data
92 ClipperLib::Paths mPaths;
93};
94
95/*******************************************************************************
96 * End of File
97 ******************************************************************************/
98
99} // namespace librepcb
100
101#endif
The BI_FootprintPad class.
Definition: bi_footprintpad.h:48
The BI_NetLine class.
Definition: bi_netline.h:71
The BI_Plane class.
Definition: bi_plane.h:52
The BI_StrokeText class.
Definition: bi_stroketext.h:49
The BI_Via class.
Definition: bi_via.h:44
The BoardClipperPathGenerator class creates a Clipper path from a librepcb::Board.
Definition: boardclipperpathgenerator.h:58
void addHole(const PositiveLength &diameter, const NonEmptyPath &path, const Transform &transform=Transform(), const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:346
BoardClipperPathGenerator(Board &board, const PositiveLength &maxArcTolerance) noexcept
Definition: boardclipperpathgenerator.cpp:49
const ClipperLib::Paths & getPaths() const noexcept
Definition: boardclipperpathgenerator.h:66
void addCopper(const Layer &layer, const QSet< const NetSignal * > &netsignals, bool ignorePlanes=false)
Definition: boardclipperpathgenerator.cpp:70
void addStrokeText(const BI_StrokeText &strokeText, const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:333
PositiveLength mMaxArcTolerance
Definition: boardclipperpathgenerator.h:91
void addPolygon(const Path &path, const UnsignedLength &lineWidth, bool filled, const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:284
void addPlane(const BI_Plane &plane)
Definition: boardclipperpathgenerator.cpp:276
void addVia(const BI_Via &via, const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:259
Board & mBoard
Definition: boardclipperpathgenerator.h:90
ClipperLib::Paths mPaths
Definition: boardclipperpathgenerator.h:92
void addNetLine(const BI_NetLine &netLine, const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:268
~BoardClipperPathGenerator() noexcept
Definition: boardclipperpathgenerator.cpp:54
void addPad(const BI_FootprintPad &pad, const Layer &layer, const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:358
void addCircle(const Circle &circle, const Transform &transform, const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:308
void takePathsTo(ClipperLib::Paths &out) noexcept
Definition: boardclipperpathgenerator.cpp:61
void addStopMaskOpenings(const Layer &layer, const Length &offset=Length(0))
Definition: boardclipperpathgenerator.cpp:165
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:73
The Circle class.
Definition: circle.h:46
The Layer class provides all supported geometry layers.
Definition: layer.h:40
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:83
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition: path.h:58
Helper class to perform coordinate transformation with various types.
Definition: transform.h:59
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
type_safe::constrained_type< Path, NonEmptyPathConstraint, NonEmptyPathVerifier > NonEmptyPath
Definition: path.h:221
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696