LibrePCB Developers Documentation
Loading...
Searching...
No Matches
boardspecctraexport.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_BOARDSPECCTRAEXPORT_H
21#define LIBREPCB_CORE_BOARDSPECCTRAEXPORT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../types/point.h"
27
28#include <QtCore>
29
30#include <map>
31#include <memory>
32#include <vector>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class BI_Device;
40class BI_NetSegment;
41class BI_Pad;
42class BI_Via;
43class Board;
44class Hole;
45class Layer;
46class Path;
47class Point;
48class SExpression;
49
50/*******************************************************************************
51 * Class BoardSpecctraExport
52 ******************************************************************************/
53
57class BoardSpecctraExport final : public QObject {
58 Q_OBJECT
59
60public:
61 // Constructors / Destructor
64 explicit BoardSpecctraExport(const Board& board) noexcept;
65 ~BoardSpecctraExport() noexcept;
66
67 // General Methods
68 QByteArray generate() const;
69
70 // Operator Overloadings
71 BoardSpecctraExport& operator=(const BoardSpecctraExport& rhs) = delete;
72
73private:
74 std::unique_ptr<SExpression> genParser() const;
75 std::unique_ptr<SExpression> genResolution() const;
76 std::unique_ptr<SExpression> genStructure(
77 std::vector<std::unique_ptr<SExpression>>& viaPadStacks) const;
78 std::unique_ptr<SExpression> genStructureRule() const;
79 std::unique_ptr<SExpression> genPlacement() const;
80 std::unique_ptr<SExpression> genLibrary(
81 std::vector<std::unique_ptr<SExpression>>& fptPadStacks,
82 std::vector<std::unique_ptr<SExpression>>& viaPadStacks) const;
83 std::unique_ptr<SExpression> genLibraryImage(
84 std::vector<std::unique_ptr<SExpression>>& fptPadStacks) const;
85 std::unique_ptr<SExpression> genLibraryImage(
86 const BI_Device& dev,
87 std::vector<std::unique_ptr<SExpression>>& fptPadStacks) const;
88 std::unique_ptr<SExpression> genLibraryPadStack(const BI_Pad& pad) const;
89 std::unique_ptr<SExpression> genNetwork() const;
90 std::unique_ptr<SExpression> genWiring() const;
91 std::unique_ptr<SExpression> genWiringPadStack(const BI_Via& via) const;
92 QString getWiringPadStackId(const BI_Via& via) const;
93
94 template <typename THole>
95 std::unique_ptr<SExpression> toKeepout(const QString& id,
96 const THole& hole) const;
97 std::unique_ptr<SExpression> toKeepout(
98 const QString& id, const Path& path,
99 const QSet<const Layer*>& layers) const;
100 std::unique_ptr<SExpression> toPolygon(const QString& layer,
101 const UnsignedLength& width,
102 const Path& path,
103 bool multiline) const;
104 std::unique_ptr<SExpression> toPath(const QString& layer,
105 const UnsignedLength& width,
106 const Path& path, bool multiline) const;
107 std::unique_ptr<SExpression> toCircle(const QString& layer,
108 const PositiveLength& diameter,
109 const Point& pos = Point()) const;
110 std::unique_ptr<SExpression> toToken(const Length& length) const;
111 static QString getNetName(const BI_NetSegment& ns) noexcept;
112 static std::size_t addToPadStacks(
113 std::vector<std::unique_ptr<SExpression>>& padStacks,
114 std::unique_ptr<SExpression> padStack);
115
119 static PositiveLength maxArcTolerance() noexcept {
120 return PositiveLength(5000);
121 }
122
123 // Private Member Variables
124 const Board& mBoard;
125};
126
127/*******************************************************************************
128 * End of File
129 ******************************************************************************/
130
131} // namespace librepcb
132
133#endif
The BI_Device class.
Definition bi_device.h:57
The BI_NetSegment class.
Definition bi_netsegment.h:53
A pad in a board (either standalone or from a footprint)
Definition bi_pad.h:49
The BI_Via class.
Definition bi_via.h:44
The Board class represents a PCB of a project and is always part of a circuit.
Definition board.h:74
Specctra DSN Export.
Definition boardspecctraexport.h:57
std::unique_ptr< SExpression > genPlacement() const
Definition boardspecctraexport.cpp:266
BoardSpecctraExport(const BoardSpecctraExport &other)=delete
std::unique_ptr< SExpression > genWiring() const
Definition boardspecctraexport.cpp:597
const Board & mBoard
Definition boardspecctraexport.h:124
std::unique_ptr< SExpression > genNetwork() const
Definition boardspecctraexport.cpp:535
std::unique_ptr< SExpression > genStructureRule() const
Definition boardspecctraexport.cpp:241
std::unique_ptr< SExpression > toPolygon(const QString &layer, const UnsignedLength &width, const Path &path, bool multiline) const
Definition boardspecctraexport.cpp:743
std::unique_ptr< SExpression > toKeepout(const QString &id, const THole &hole) const
Definition boardspecctraexport.cpp:690
std::unique_ptr< SExpression > genParser() const
Definition boardspecctraexport.cpp:135
std::unique_ptr< SExpression > toCircle(const QString &layer, const PositiveLength &diameter, const Point &pos=Point()) const
Definition boardspecctraexport.cpp:767
static std::size_t addToPadStacks(std::vector< std::unique_ptr< SExpression > > &padStacks, std::unique_ptr< SExpression > padStack)
Definition boardspecctraexport.cpp:794
QByteArray generate() const
Definition boardspecctraexport.cpp:75
static PositiveLength maxArcTolerance() noexcept
Definition boardspecctraexport.h:119
std::unique_ptr< SExpression > genWiringPadStack(const BI_Via &via) const
Definition boardspecctraexport.cpp:628
std::unique_ptr< SExpression > toToken(const Length &length) const
Definition boardspecctraexport.cpp:780
std::unique_ptr< SExpression > genStructure(std::vector< std::unique_ptr< SExpression > > &viaPadStacks) const
Definition boardspecctraexport.cpp:156
std::unique_ptr< SExpression > genLibraryPadStack(const BI_Pad &pad) const
Definition boardspecctraexport.cpp:431
std::unique_ptr< SExpression > toPath(const QString &layer, const UnsignedLength &width, const Path &path, bool multiline) const
Definition boardspecctraexport.cpp:751
~BoardSpecctraExport() noexcept
Definition boardspecctraexport.cpp:68
std::unique_ptr< SExpression > genResolution() const
Definition boardspecctraexport.cpp:149
static QString getNetName(const BI_NetSegment &ns) noexcept
Definition boardspecctraexport.cpp:785
std::unique_ptr< SExpression > genLibrary(std::vector< std::unique_ptr< SExpression > > &fptPadStacks, std::vector< std::unique_ptr< SExpression > > &viaPadStacks) const
Definition boardspecctraexport.cpp:305
QString getWiringPadStackId(const BI_Via &via) const
Definition boardspecctraexport.cpp:649
std::unique_ptr< SExpression > genLibraryImage(std::vector< std::unique_ptr< SExpression > > &fptPadStacks) const
Definition boardspecctraexport.cpp:332
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:59
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The SExpression class.
Definition sexpression.h:69
Definition occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
Definition uuid.h:186