LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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"
30
31#include <polyclipping/clipper.hpp>
32
33#include <QtCore>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39
40/*******************************************************************************
41 * Class BoardClipperPathGenerator
42 ******************************************************************************/
43
48public:
50
51 // Constructors / Destructor
53 const PositiveLength& maxArcTolerance) noexcept;
55
56 // Getters
57 const ClipperLib::Paths& getPaths() const noexcept { return mPaths; }
58 void takePathsTo(ClipperLib::Paths& out) noexcept;
59
60 // General Methods
61 void addCopper(const Data& data, const Layer& layer,
62 const QSet<std::optional<Uuid>>& netsignals,
63 bool ignorePlanes = false);
64 void addStopMaskOpenings(const Data& data, const Layer& layer,
65 const Length& offset = Length(0));
66 void addVia(const Data::Via& via, const Length& offset = Length(0));
67 void addTrace(const Data::Trace& trace, const Length& offset = Length(0));
68 void addPlane(const QVector<Path>& fragments);
69 void addPolygon(const Path& path, const UnsignedLength& lineWidth,
70 bool filled, const Length& offset = Length(0));
71 void addCircle(const Data::Circle& circle, const Transform& transform,
72 const Length& offset = Length(0));
73 void addStrokeText(const Data::StrokeText& strokeText,
74 const Length& offset = Length(0));
75 void addHole(const PositiveLength& diameter, const NonEmptyPath& path,
76 const Transform& transform = Transform(),
77 const Length& offset = Length(0));
78 void addPad(const Data::Pad& pad, const Layer& layer,
79 const Length& offset = Length(0));
80
81private: // Data
83 ClipperLib::Paths mPaths;
84};
85
86/*******************************************************************************
87 * End of File
88 ******************************************************************************/
89
90} // namespace librepcb
91
92#endif
Helper to create Clipper paths for librepcb::BoardDesignRuleCheck.
Definition boardclipperpathgenerator.h:47
void addHole(const PositiveLength &diameter, const NonEmptyPath &path, const Transform &transform=Transform(), const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:346
void addStopMaskOpenings(const Data &data, const Layer &layer, const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:160
const ClipperLib::Paths & getPaths() const noexcept
Definition boardclipperpathgenerator.h:57
void addStrokeText(const Data::StrokeText &strokeText, const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:332
void addTrace(const Data::Trace &trace, const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:263
void addCopper(const Data &data, const Layer &layer, const QSet< std::optional< Uuid > > &netsignals, bool ignorePlanes=false)
Definition boardclipperpathgenerator.cpp:70
PositiveLength mMaxArcTolerance
Definition boardclipperpathgenerator.h:82
void addPolygon(const Path &path, const UnsignedLength &lineWidth, bool filled, const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:283
void addPad(const Data::Pad &pad, const Layer &layer, const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:358
BoardDesignRuleCheckData Data
Definition boardclipperpathgenerator.h:49
ClipperLib::Paths mPaths
Definition boardclipperpathgenerator.h:83
void addPlane(const QVector< Path > &fragments)
Definition boardclipperpathgenerator.cpp:275
~BoardClipperPathGenerator() noexcept
Definition boardclipperpathgenerator.cpp:54
void addVia(const Data::Via &via, const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:251
void addCircle(const Data::Circle &circle, const Transform &transform, const Length &offset=Length(0))
Definition boardclipperpathgenerator.cpp:307
void takePathsTo(ClipperLib::Paths &out) noexcept
Definition boardclipperpathgenerator.cpp:61
The Layer class provides all supported geometry layers.
Definition layer.h:42
The Length class is used to represent a length (for example 12.75 millimeters)
Definition length.h:82
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition path.h:57
Helper class to perform coordinate transformation with various types.
Definition transform.h:59
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
type_safe::constrained_type< Path, NonEmptyPathConstraint, NonEmptyPathVerifier > NonEmptyPath
Definition path.h:231
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
Input data structure for librepcb::BoardDesignRuleCheck.
Definition boarddesignrulecheckdata.h:48