20#ifndef LIBREPCB_EAGLEIMPORT_EAGLETYPECONVERTER_H
21#define LIBREPCB_EAGLEIMPORT_EAGLETYPECONVERTER_H
44#include <parseagle/common/enums.h>
83namespace eagleimport {
108 std::optional<std::pair<Point, PositiveLength>>
circle;
115 std::shared_ptr<SymbolPin>
pin;
173 const QString& deviceName);
328 template <
typename T>
392 const QList<parseagle::Wire>& wires,
bool isGrabAreaIfClosed,
433 static std::shared_ptr<Hole>
convertHole(
const parseagle::Hole& h);
470 const parseagle::Text& t);
480 const parseagle::Attribute& t);
512 const parseagle::Text& t);
522 const parseagle::Attribute& t);
543 static std::pair<std::shared_ptr<PackagePad>, std::shared_ptr<FootprintPad>>
554 static std::pair<std::shared_ptr<PackagePad>, std::shared_ptr<FootprintPad>>
630 const QString& fallback =
"unknown") noexcept;
The Alignment class.
Definition alignment.h:115
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The BoundedUnsignedRatio class represents a ratio limited to a range specified by min/max values.
Definition boundedunsignedratio.h:46
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 LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition lengthunit.h:60
Generic logger class to pass messages between objects.
Definition messagelogger.h:43
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 Vertex class.
Definition vertex.h:43
Helper class to convert EAGLE types to LibrePCB types.
Definition eagletypeconverter.h:92
static std::shared_ptr< Circle > tryConvertToBoardCircle(const Geometry &g)
Try to convert an intermediate geometry to a board circle.
Definition eagletypeconverter.cpp:983
static UnsignedLength convertLineWidth(double w, int layerId)
Convert a line width for a given layer.
Definition eagletypeconverter.cpp:375
static void convertGrid(const parseagle::Grid &g, PositiveLength &interval, LengthUnit &unit)
Convert grid settings.
Definition eagletypeconverter.cpp:444
EagleTypeConverter()=delete
static void tryConvertAttributes(const QList< parseagle::Attribute > &in, AttributeList &out, MessageLogger &log)
Try converting a list of attributes.
Definition eagletypeconverter.cpp:151
EagleTypeConverter(const EagleTypeConverter &other)=delete
static Geometry convertPolygon(const parseagle::Polygon &p, bool isGrabArea)
Convert a polygon.
Definition eagletypeconverter.cpp:548
static T convertParamTo(const parseagle::Param &p)
Convert a parameter value to a LibrePCB type.
static QString convertInversionSyntax(const QString &s) noexcept
Convert the inversion syntax of a text.
Definition eagletypeconverter.cpp:118
static std::shared_ptr< Text > tryConvertSchematicAttribute(const parseagle::Attribute &t)
Try to convert a schematic/symbol attribute text.
Definition eagletypeconverter.cpp:643
static ElementName convertDeviceName(const QString &deviceSetName, const QString &deviceName)
Convert a device name.
Definition eagletypeconverter.cpp:82
static std::shared_ptr< Text > tryConvertSchematicText(const parseagle::Text &t)
Try to convert a schematic/symbol text.
Definition eagletypeconverter.cpp:623
static std::pair< std::shared_ptr< PackagePad >, std::shared_ptr< FootprintPad > > convertThtPad(const parseagle::ThtPad &p, const BoundedUnsignedRatio &autoAnnularWidth)
Convert a THT pad.
Definition eagletypeconverter.cpp:805
static ComponentSymbolVariantItemSuffix convertGateName(const QString &n)
Convert a component gate name.
Definition eagletypeconverter.cpp:101
static const Layer * tryConvertBoardLayer(int id) noexcept
Try to convert a layer ID to a board layer.
Definition eagletypeconverter.cpp:215
static Vertex convertVertex(const parseagle::Vertex &v)
Convert a vertex.
Definition eagletypeconverter.cpp:464
~EagleTypeConverter()=delete
static Geometry convertFrame(const parseagle::Frame &f)
Convert a frame.
Definition eagletypeconverter.cpp:586
static Geometry convertRectangle(const parseagle::Rectangle &r, bool isGrabArea)
Convert a rectangle.
Definition eagletypeconverter.cpp:531
static Angle convertAngle(double a)
Convert an angle.
Definition eagletypeconverter.cpp:440
static ComponentPrefix convertComponentPrefix(const QString &p)
Convert a component prefix.
Definition eagletypeconverter.cpp:96
static QHash< const Layer *, const Layer * > convertLayerSetup(const QString &s)
Convert a layer setup string.
Definition eagletypeconverter.cpp:317
static std::shared_ptr< StrokeText > tryConvertBoardText(const parseagle::Text &t)
Try to cnvert a board/footprint text.
Definition eagletypeconverter.cpp:707
static Pin convertSymbolPin(const parseagle::Pin &p)
Convert a symbol pin.
Definition eagletypeconverter.cpp:757
static Point convertPoint(const parseagle::Point &p)
Convert a point.
Definition eagletypeconverter.cpp:436
static PositiveLength convertSchematicTextSize(double s)
Convert the size (height) of a schematic text.
Definition eagletypeconverter.cpp:619
static CircuitIdentifier convertPinOrPadName(const QString &n)
Convert a pin or pad name.
Definition eagletypeconverter.cpp:107
static std::shared_ptr< Attribute > tryConvertAttribute(const parseagle::Attribute &a, MessageLogger &log)
Try converting an attribute.
Definition eagletypeconverter.cpp:139
static std::pair< std::shared_ptr< PackagePad >, std::shared_ptr< FootprintPad > > convertSmtPad(const parseagle::SmtPad &p)
Convert an SMT pad.
Definition eagletypeconverter.cpp:876
static std::shared_ptr< Circle > tryConvertToSchematicCircle(const Geometry &g)
Try to convert an intermediate geometry to a schematic circle.
Definition eagletypeconverter.cpp:913
static Path convertVertices(const QList< parseagle::Vertex > &v, bool close)
Convert vertices.
Definition eagletypeconverter.cpp:468
static QList< Geometry > convertAndJoinWires(const QList< parseagle::Wire > &wires, bool isGrabAreaIfClosed, MessageLogger &log)
Try to join and convert multiple wires to polygons.
Definition eagletypeconverter.cpp:480
static Length convertLength(double l)
Convert a length.
Definition eagletypeconverter.cpp:371
static Alignment convertAlignment(parseagle::Alignment a)
Convert an alignment.
Definition eagletypeconverter.cpp:346
static BoundedUnsignedRatio getDefaultAutoThtAnnularWidth() noexcept
Get the default annular width of THT pads with 'auto' size.
Definition eagletypeconverter.cpp:1124
static QString getLayerName(int id, const QString &fallback="unknown") noexcept
Get the EAGLE layer name for a given layer ID.
Definition eagletypeconverter.cpp:1004
static UnsignedLength convertBoardTextStrokeWidth(int layerId, double size, int ratio)
Convert the stroke width of a board text.
Definition eagletypeconverter.cpp:683
static Geometry convertCircle(const parseagle::Circle &c, bool isGrabArea)
Convert a circle.
Definition eagletypeconverter.cpp:560
static ElementName convertComponentName(QString n)
Convert a component name.
Definition eagletypeconverter.cpp:75
static QString convertTextValue(const QString &v)
Convert a text value.
Definition eagletypeconverter.cpp:605
static std::shared_ptr< Polygon > tryConvertToSchematicPolygon(const Geometry &g)
Try to convert an intermediate geometry to a schematic polygon.
Definition eagletypeconverter.cpp:925
static std::shared_ptr< StrokeText > tryConvertBoardAttribute(const parseagle::Attribute &t)
Try to convert a board/footprint attribute text.
Definition eagletypeconverter.cpp:732
static std::shared_ptr< Polygon > tryConvertToBoardPolygon(const Geometry &g)
Try to convert an intermediate geometry to a board polygon.
Definition eagletypeconverter.cpp:995
static QVector< std::shared_ptr< Zone > > tryConvertToBoardZones(const Geometry &g)
Try to convert an intermediate geometry to board keepout zones.
Definition eagletypeconverter.cpp:947
static const Layer * tryConvertSchematicLayer(int id) noexcept
Try to convert a layer ID to a schematic layer.
Definition eagletypeconverter.cpp:184
static std::shared_ptr< Hole > convertHole(const parseagle::Hole &h)
Convert a hole.
Definition eagletypeconverter.cpp:576
static ElementName convertElementName(const QString &n)
Convert an element (e.g. symbol) name.
Definition eagletypeconverter.cpp:61
static QString convertElementDescription(const QString &d)
Convert an element (e.g. symbol) description.
Definition eagletypeconverter.cpp:69
static PositiveLength convertBoardTextSize(int layerId, double size)
Convert the size (height) of a board text.
Definition eagletypeconverter.cpp:663
static QVector< Path > convertBoardZoneOutline(const Path &outline, const Length &lineWidth)
Convert the outline of a board zone.
Definition eagletypeconverter.cpp:934
static void tryExtractMpnAndManufacturer(AttributeList &attributes, SimpleString &mpn, SimpleString &manufacturer) noexcept
Try extracting MPN and manufacturer from a list of attributes.
Definition eagletypeconverter.cpp:163
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
type_safe::constrained_type< QString, CircuitIdentifierConstraint, CircuitIdentifierVerifier > CircuitIdentifier
Definition circuitidentifier.h:95
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
type_safe::constrained_type< QString, ComponentPrefixConstraint, ComponentPrefixVerifier > ComponentPrefix
Definition componentprefix.h:84
type_safe::constrained_type< QString, SimpleStringConstraint, SimpleStringVerifier > SimpleString
Definition simplestring.h:79
type_safe::constrained_type< QString, ComponentSymbolVariantItemSuffixConstraint, ComponentSymbolVariantItemSuffixVerifier > ComponentSymbolVariantItemSuffix
Definition componentsymbolvariantitemsuffix.h:88
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84
Definition eaglelibraryconverter.h:38
Intermediate geometry type used for converting polygon-like EAGLE elements.
Definition eagletypeconverter.h:102
UnsignedLength lineWidth
Definition eagletypeconverter.h:104
bool grabArea
Definition eagletypeconverter.h:106
int layerId
Definition eagletypeconverter.h:103
std::optional< std::pair< Point, PositiveLength > > circle
Definition eagletypeconverter.h:108
bool filled
Definition eagletypeconverter.h:105
Path path
Definition eagletypeconverter.h:107
LibrePCB data structure to represent an EAGLE symbol pin.
Definition eagletypeconverter.h:114
std::shared_ptr< Circle > circle
Definition eagletypeconverter.h:116
std::shared_ptr< Polygon > polygon
Definition eagletypeconverter.h:117
std::shared_ptr< SymbolPin > pin
Definition eagletypeconverter.h:115