LibrePCB Developers Documentation
|
Read DXF files into LibrePCB data structures. More...
#include <dxfreader.h>
Classes | |
struct | Circle |
Public Member Functions | |
DxfReader () noexcept | |
Default constructor. More... | |
DxfReader (const DxfReader &other)=delete | |
virtual | ~DxfReader () noexcept |
Destructor. More... | |
void | setScaleFactor (qreal scaleFactor) noexcept |
Set a custom scale factor. More... | |
const QList< Point > & | getPoints () const noexcept |
Get all imported points. More... | |
const QList< Circle > & | getCircles () const noexcept |
Get all imported circles. More... | |
const QList< Path > & | getPolygons () const noexcept |
Get all imported lines, arcs and polylines (converted to polygons) More... | |
void | parse (const FilePath &dxfFile) |
Parse a DXF file. More... | |
DxfReader & | operator= (const DxfReader &rhs)=delete |
Private Attributes | |
qreal | mScaleFactor |
QList< Point > | mPoints |
QList< Circle > | mCircles |
QList< Path > | mPolygons |
Friends | |
class | DxfReaderImpl |
Read DXF files into LibrePCB data structures.
Basically this is a wrapper around the third-party library "dxflib" to read DXF files and return the DXF objects as LibrePCB data structures. See documentation of dxflib about the exact capabilities of the reader itself.
Our wrapper currently supports the following data structures:
Note that this class tries to read and apply the length unit defined in the DXF file. However, a DXF file is not required to specify the unit. If it is missing, the unit millimeters is assumed.
|
noexcept |
Default constructor.
|
virtualnoexcept |
Destructor.
|
inlinenoexcept |
Set a custom scale factor.
All imported objects will be scaled with this factor (default is 1.0).
scaleFactor | Scale factor. |
|
inlinenoexcept |
Get all imported points.
|
inlinenoexcept |
Get all imported circles.
|
inlinenoexcept |
Get all imported lines, arcs and polylines (converted to polygons)
void parse | ( | const FilePath & | dxfFile | ) |
Parse a DXF file.
dxfFile | File path to the DXF to import. |
Exception | if anything went wrong (e.g. file does not exist). |
|
friend |
The actual implementation is in the *.cpp file and should have access to this class members.
|
private |
|
private |
|
private |
|
private |