20#ifndef LIBREPCB_CORE_GERBERGENERATOR_H
21#define LIBREPCB_CORE_GERBERGENERATOR_H
26#include "../fileio/filepath.h"
27#include "../types/length.h"
28#include "../types/uuid.h"
40class GerberAttributeWriter;
66 const Uuid& projUuid,
const QString& projRevision)
noexcept;
83 const std::optional<QString>& net,
84 const QString& component)
noexcept;
86 Function function,
const std::optional<QString>& net,
87 const QString& component)
noexcept;
89 const std::optional<QString>& net,
90 const QString& component)
noexcept;
92 const QString& designator,
const QString& value,
93 MountType mountType,
const QString& manufacturer,
94 const QString& mpn,
const QString& footprintName,
97 Function function,
const std::optional<QString>& net,
98 const QString& component,
const QString& pin,
99 const QString& signal)
noexcept;
103 const std::optional<QString>& net,
const QString& component,
104 const QString& pin,
const QString& signal)
noexcept;
107 Function function,
const std::optional<QString>& net,
108 const QString& component,
const QString& pin,
109 const QString& signal)
noexcept;
113 const std::optional<QString>& net,
const QString& component,
114 const QString& pin,
const QString& signal)
noexcept;
117 const std::optional<QString>& net,
const QString& component,
118 const QString& pin,
const QString& signal)
noexcept;
120 const QString& designator,
const QString& value,
121 MountType mountType,
const QString& manufacturer,
123 const QString& footprintName)
noexcept;
125 const QString& designator,
const QString& value,
126 MountType mountType,
const QString& manufacturer,
127 const QString& mpn,
const QString& footprintName,
128 const QString& pin,
const QString& signal,
129 bool isPin1)
noexcept;
141 Function apertureFunction,
const std::optional<QString>& netName,
142 const QString& componentDesignator,
const QString& pinName,
143 const QString& pinSignal,
const QString& componentValue,
144 const std::optional<MountType>& componentMountType,
145 const QString& componentManufacturer,
const QString& componentMpn,
146 const QString& componentFootprint,
147 const std::optional<Angle>& componentRotation)
noexcept;
157 const
Point& end) noexcept;
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
This class represents absolute, well-formatted paths to files or directories.
Definition filepath.h:127
A helper class to generate the aperture definitions for a Gerber file.
Definition gerberaperturelist.h:68
std::optional< GerberAttribute::ApertureFunction > Function
Definition gerberaperturelist.h:73
A Gerber X2 attribute.
Definition gerberattribute.h:43
MountType
Definition gerberattribute.h:52
BoardSide
Definition gerberattribute.h:50
Polarity
Definition gerberattribute.h:49
CopperSide
Definition gerberattribute.h:51
A helper class to generate Gerber X2 attributes.
Definition gerberattributewriter.h:45
The GerberGenerator class.
Definition gerbergenerator.h:51
void setFileFunctionCopper(int layer, CopperSide side, Polarity polarity) noexcept
Definition gerbergenerator.cpp:73
void saveToFile(const FilePath &filepath) const
Definition gerbergenerator.cpp:403
GerberAttribute::CopperSide CopperSide
Definition gerbergenerator.h:58
void switchToLinearInterpolationModeG01() noexcept
Definition gerbergenerator.cpp:473
void drawLine(const Point &start, const Point &end, const UnsignedLength &width, Function function, const std::optional< QString > &net, const QString &component) noexcept
Definition gerbergenerator.cpp:118
void printApertureList() noexcept
Definition gerbergenerator.cpp:556
const QString & toStr() const noexcept
Definition gerbergenerator.h:70
GerberApertureList::Function Function
Definition gerbergenerator.h:59
int mCurrentApertureNumber
Definition gerbergenerator.h:174
~GerberGenerator() noexcept
Definition gerbergenerator.cpp:62
void generate()
Definition gerbergenerator.cpp:395
void setCurrentAttributes(Function apertureFunction, const std::optional< QString > &netName, const QString &componentDesignator, const QString &pinName, const QString &pinSignal, const QString &componentValue, const std::optional< MountType > &componentMountType, const QString &componentManufacturer, const QString &componentMpn, const QString &componentFootprint, const std::optional< Angle > &componentRotation) noexcept
Definition gerbergenerator.cpp:414
GerberGenerator(const GerberGenerator &other)=delete
void linearInterpolateToPosition(const Point &pos) noexcept
Definition gerbergenerator.cpp:490
void interpolateBetween(const Vertex &from, const Vertex &to) noexcept
Definition gerbergenerator.cpp:504
GerberAttribute::MountType MountType
Definition gerbergenerator.h:60
void moveToPosition(const Point &pos) noexcept
Definition gerbergenerator.cpp:485
void switchToCircularCcwInterpolationModeG03() noexcept
Definition gerbergenerator.cpp:481
void setLayerPolarity(Polarity p) noexcept
Definition gerbergenerator.cpp:102
void setFileFunctionSolderMask(BoardSide side, Polarity polarity) noexcept
Definition gerbergenerator.cpp:79
void setFileFunctionComponent(int layer, BoardSide side) noexcept
Definition gerbergenerator.cpp:97
void setCurrentAperture(int number) noexcept
Definition gerbergenerator.cpp:458
void printContent() noexcept
Definition gerbergenerator.cpp:562
GerberGenerator & operator=(const GerberGenerator &rhs)=delete
void flashComponent(const Point &pos, const Angle &rot, const QString &designator, const QString &value, MountType mountType, const QString &manufacturer, const QString &mpn, const QString &footprintName) noexcept
Definition gerbergenerator.cpp:348
void flashRect(const Point &pos, const PositiveLength &w, const PositiveLength &h, const UnsignedLength &radius, const Angle &rot, Function function, const std::optional< QString > &net, const QString &component, const QString &pin, const QString &signal) noexcept
Definition gerbergenerator.cpp:258
GerberAttribute::BoardSide BoardSide
Definition gerbergenerator.h:57
QString mContent
Definition gerbergenerator.h:171
void printFooter() noexcept
Definition gerbergenerator.cpp:568
QString calcOutputMd5Checksum() const noexcept
Definition gerbergenerator.cpp:577
void setFileFunctionLegend(BoardSide side, Polarity polarity) noexcept
Definition gerbergenerator.cpp:85
void setRegionModeOn() noexcept
Definition gerbergenerator.cpp:465
void flashAtPosition(const Point &pos) noexcept
Definition gerbergenerator.cpp:522
void drawPathArea(const Path &path, Function function, const std::optional< QString > &net, const QString &component) noexcept
Definition gerbergenerator.cpp:169
void printHeader() noexcept
Definition gerbergenerator.cpp:527
void flashOctagon(const Point &pos, const PositiveLength &w, const PositiveLength &h, const UnsignedLength &radius, const Angle &rot, Function function, const std::optional< QString > &net, const QString &component, const QString &pin, const QString &signal) noexcept
Definition gerbergenerator.cpp:303
void drawPathOutline(const Path &path, const UnsignedLength &lineWidth, Function function, const std::optional< QString > &net, const QString &component) noexcept
Definition gerbergenerator.cpp:139
void setFileFunctionOutlines(bool plated) noexcept
Definition gerbergenerator.cpp:69
void setRegionModeOff() noexcept
Definition gerbergenerator.cpp:469
void flashCircle(const Point &pos, const PositiveLength &dia, Function function, const std::optional< QString > &net, const QString &component, const QString &pin, const QString &signal) noexcept
Definition gerbergenerator.cpp:236
void flashComponentPin(const Point &pos, const Angle &rot, const QString &designator, const QString &value, MountType mountType, const QString &manufacturer, const QString &mpn, const QString &footprintName, const QString &pin, const QString &signal, bool isPin1) noexcept
Definition gerbergenerator.cpp:370
void circularInterpolateToPosition(const Point &start, const Point ¢er, const Point &end) noexcept
Definition gerbergenerator.cpp:495
void setFileFunctionPaste(BoardSide side, Polarity polarity) noexcept
Definition gerbergenerator.cpp:91
void flashOutline(const Point &pos, const StraightAreaPath &path, const Angle &rot, Function function, const std::optional< QString > &net, const QString &component, const QString &pin, const QString &signal) noexcept
Definition gerbergenerator.cpp:326
QString mOutput
Definition gerbergenerator.h:170
void drawComponentOutline(const Path &path, const Angle &rot, const QString &designator, const QString &value, MountType mountType, const QString &manufacturer, const QString &mpn, const QString &footprintName, Function function) noexcept
Definition gerbergenerator.cpp:205
void flashObround(const Point &pos, const PositiveLength &w, const PositiveLength &h, const Angle &rot, Function function, const std::optional< QString > &net, const QString &component, const QString &pin, const QString &signal) noexcept
Definition gerbergenerator.cpp:281
QScopedPointer< GerberApertureList > mApertureList
Definition gerbergenerator.h:173
QVector< GerberAttribute > mFileAttributes
Definition gerbergenerator.h:167
QScopedPointer< GerberAttributeWriter > mAttributeWriter
Definition gerbergenerator.h:172
GerberAttribute::Polarity Polarity
Definition gerbergenerator.h:56
void switchToCircularCwInterpolationModeG02() noexcept
Definition gerbergenerator.cpp:477
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition path.h:57
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The Vertex class.
Definition vertex.h:43
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
type_safe::constrained_type< Path, StraightAreaPathConstraint, StraightAreaPathVerifier > StraightAreaPath
Definition path.h:274