LibrePCB Developers Documentation
EagleTypeConverter Class Referencefinal

Helper class to convert EAGLE types to LibrePCB types. More...

#include <eagletypeconverter.h>

+ Collaboration diagram for EagleTypeConverter:

Public Member Functions

 EagleTypeConverter ()=delete
 
 EagleTypeConverter (const EagleTypeConverter &other)=delete
 
 ~EagleTypeConverter ()=delete
 
EagleTypeConverteroperator= (const EagleTypeConverter &rhs)=delete
 

Static Public Member Functions

static ElementName convertElementName (const QString &n)
 Convert an element (e.g. symbol) name. More...
 
static QString convertElementDescription (const QString &d)
 Convert an element (e.g. symbol) description. More...
 
static ComponentSymbolVariantItemSuffix convertGateName (const QString &n)
 Convert a component gate name. More...
 
static CircuitIdentifier convertPinOrPadName (const QString &n)
 Convert a pin or pad name. More...
 
static const LayerconvertLayer (int id)
 Convert a layer ID. More...
 
static Length convertLength (double l)
 Convert a length. More...
 
static Point convertPoint (const parseagle::Point &p)
 Convert a point. More...
 
static Angle convertAngle (double a)
 Convert an angle. More...
 
static Vertex convertVertex (const parseagle::Vertex &v)
 Convert a vertex. More...
 
static Path convertVertices (const QList< parseagle::Vertex > &v, bool close)
 Convert vertices. More...
 
static std::shared_ptr< PolygonconvertWire (const parseagle::Wire &w)
 Convert a wire. More...
 
static std::shared_ptr< PolygonconvertRectangle (const parseagle::Rectangle &r, bool isGrabArea)
 Convert a rectangle. More...
 
static std::shared_ptr< PolygonconvertPolygon (const parseagle::Polygon &p, bool isGrabArea)
 Convert a polygon. More...
 
static std::shared_ptr< CircleconvertCircle (const parseagle::Circle &c, bool isGrabArea)
 Convert a circle. More...
 
static std::shared_ptr< HoleconvertHole (const parseagle::Hole &h)
 Convert a hole. More...
 
static QString convertTextValue (const QString &v)
 Convert a text value. More...
 
static std::shared_ptr< TextconvertSchematicText (const parseagle::Text &t)
 Convert a schematic/symbol text. More...
 
static std::shared_ptr< StrokeTextconvertBoardText (const parseagle::Text &t)
 Convert a board/footprint text. More...
 
static std::shared_ptr< SymbolPinconvertSymbolPin (const parseagle::Pin &p)
 Convert a symbol pin. More...
 
static std::pair< std::shared_ptr< PackagePad >, std::shared_ptr< FootprintPad > > convertThtPad (const parseagle::ThtPad &p)
 Convert a THT pad. More...
 
static std::pair< std::shared_ptr< PackagePad >, std::shared_ptr< FootprintPad > > convertSmtPad (const parseagle::SmtPad &p)
 Convert an SMT pad. More...
 

Detailed Description

Helper class to convert EAGLE types to LibrePCB types.

Constructor & Destructor Documentation

◆ EagleTypeConverter() [1/2]

EagleTypeConverter ( )
delete

◆ EagleTypeConverter() [2/2]

EagleTypeConverter ( const EagleTypeConverter other)
delete

◆ ~EagleTypeConverter()

~EagleTypeConverter ( )
delete

Member Function Documentation

◆ convertElementName()

ElementName convertElementName ( const QString &  n)
static

Convert an element (e.g. symbol) name.

Removes all invalid characters from an EAGLe element name and convert it to the corresponding LibrePCB type. If completely invalid, "Unnamed" will be returned (no error).

Parameters
nEAGLE element name (e.g. "R-0805")
Returns
LibrePCB element name
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertElementDescription()

QString convertElementDescription ( const QString &  d)
static

Convert an element (e.g. symbol) description.

Removes HTML tags and returns only the plain text.

Parameters
dEAGLE element description (might contain HTML)
Returns
LibrePCB element description (no HTML)
+ Here is the caller graph for this function:

◆ convertGateName()

ComponentSymbolVariantItemSuffix convertGateName ( const QString &  n)
static

Convert a component gate name.

Removes all invalid characters and returns the gate name as component symbol variant item suffix.

Parameters
nEAGLE gate name
Returns
LibrePCB component symbol variant item suffix
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertPinOrPadName()

CircuitIdentifier convertPinOrPadName ( const QString &  n)
static

Convert a pin or pad name.

Removes all invalid characters and returns the name as a circuit identifier.

Parameters
nEAGLE pin or pad name
Returns
LibrePCB circuit identifier
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertLayer()

const Layer & convertLayer ( int  id)
static

Convert a layer ID.

Parameters
idEAGLE layer ID
Returns
LibrePCB layer
Exceptions
ExceptionIf the layer is unknown or not supported
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertLength()

Length convertLength ( double  l)
static

Convert a length.

Parameters
lEAGLE length [mm]
Returns
LibrePCB length
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertPoint()

Point convertPoint ( const parseagle::Point &  p)
static

Convert a point.

Parameters
pEAGLE point [mm]
Returns
LibrePCB point
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertAngle()

Angle convertAngle ( double  a)
static

Convert an angle.

Parameters
aEAGLE angle [°]
Returns
LibrePCB angle
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertVertex()

Vertex convertVertex ( const parseagle::Vertex &  v)
static

Convert a vertex.

Parameters
vEAGLE vertex
Returns
LibrePCB vertex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertVertices()

Path convertVertices ( const QList< parseagle::Vertex > &  v,
bool  close 
)
static

Convert vertices.

Parameters
vEAGLE vertices
closeIf true, the returned path will always be closed
Returns
LibrePCB path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertWire()

std::shared_ptr< Polygon > convertWire ( const parseagle::Wire &  w)
static

Convert a wire.

Parameters
wEAGLE wire (line segment)
Returns
LibrePCB polygon containing 1 line segment
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convertRectangle()

std::shared_ptr< Polygon > convertRectangle ( const parseagle::Rectangle &  r,
bool  isGrabArea 
)
static

Convert a rectangle.

Parameters
rEAGLE rectangle
isGrabAreaIf the returned polygon should be a grab area
Returns
LibrePCB polygon containing 4 line segments
+ Here is the call graph for this function:

◆ convertPolygon()

std::shared_ptr< Polygon > convertPolygon ( const parseagle::Polygon &  p,
bool  isGrabArea 
)
static

Convert a polygon.

Parameters
pEAGLE polygon
isGrabAreaIf the returned polygon should be a grab area
Returns
LibrePCB polygon (always closed)
+ Here is the call graph for this function:

◆ convertCircle()

std::shared_ptr< Circle > convertCircle ( const parseagle::Circle &  c,
bool  isGrabArea 
)
static

Convert a circle.

Parameters
cEAGLE circle
isGrabAreaIf the returned circle should be a grab area
Returns
LibrePCB circle
+ Here is the call graph for this function:

◆ convertHole()

std::shared_ptr< Hole > convertHole ( const parseagle::Hole &  h)
static

Convert a hole.

Parameters
hEAGLE hole
Returns
LibrePCB hole
+ Here is the call graph for this function:

◆ convertTextValue()

QString convertTextValue ( const QString &  v)
static

Convert a text value.

Parameters
vEAGLE text value (e.g. ">NAME")
Returns
LibrePCB text value (e.g. "{{NAME}}")
+ Here is the caller graph for this function:

◆ convertSchematicText()

std::shared_ptr< Text > convertSchematicText ( const parseagle::Text &  t)
static

Convert a schematic/symbol text.

Parameters
tEAGLE text
Returns
LibrePCB text
+ Here is the call graph for this function:

◆ convertBoardText()

std::shared_ptr< StrokeText > convertBoardText ( const parseagle::Text &  t)
static

Convert a board/footprint text.

Parameters
tEAGLE text
Returns
LibrePCB text
+ Here is the call graph for this function:

◆ convertSymbolPin()

std::shared_ptr< SymbolPin > convertSymbolPin ( const parseagle::Pin &  p)
static

Convert a symbol pin.

Parameters
pEAGLE pin
Returns
LibrePCB pin
+ Here is the call graph for this function:

◆ convertThtPad()

std::pair< std::shared_ptr< PackagePad >, std::shared_ptr< FootprintPad > > convertThtPad ( const parseagle::ThtPad &  p)
static

Convert a THT pad.

Parameters
pEAGLE pad
Returns
LibrePCB package pad + footprint pad
+ Here is the call graph for this function:

◆ convertSmtPad()

std::pair< std::shared_ptr< PackagePad >, std::shared_ptr< FootprintPad > > convertSmtPad ( const parseagle::SmtPad &  p)
static

Convert an SMT pad.

Parameters
pEAGLE pad
Returns
LibrePCB package pad + footprint pad
+ Here is the call graph for this function:

◆ operator=()

EagleTypeConverter& operator= ( const EagleTypeConverter rhs)
delete

The documentation for this class was generated from the following files: