KiCad PCB EDA Suite
|
#include <dxf_import_plugin.h>
Public Member Functions | |
DXF_IMPORT_PLUGIN () | |
~DXF_IMPORT_PLUGIN () | |
const wxString | GetName () const override |
Return the plugin name. | |
const std::vector< std::string > | GetFileExtensions () const override |
Return a vector of the file extensions handled by this plugin. | |
bool | Load (const wxString &aFileName) override |
Load file for import. | |
bool | LoadFromMemory (const wxMemoryBuffer &aMemBuffer) override |
Set memory buffer with content for import. | |
bool | Import () override |
Actually imports the file. | |
double | GetImageWidth () const override |
Return image width from original imported file. | |
double | GetImageHeight () const override |
Return image height from original imported file. | |
BOX2D | GetImageBBox () const override |
Return image bounding box from original imported file. | |
void | updateImageLimits (const VECTOR2D &aPoint) |
virtual void | SetImporter (GRAPHICS_IMPORTER *aImporter) override |
Set the receiver of the imported shapes. | |
void | ImportAsFootprintGraphic (bool aImportAsFootprintGraphic) |
Allow the import DXF items converted to board graphic items or footprint graphic items. | |
void | SetUnit (DXF_IMPORT_UNITS aUnit) |
Set the default units when importing DXFs. | |
void | SetDefaultLineWidthMM (double aWidth) |
Set the default line width when importing dxf items like lines to Pcbnew. | |
void | SetLineWidthMM (double aWidth) override |
void | SetOffset (double aOffsetX, double aOffsetY) |
Set the coordinate offset between the imported dxf items and Pcbnew. | |
void | SetBrdLayer (int aBrdLayer) |
Set the layer number to import dxf items. | |
bool | ImportDxfFile (const wxString &aFile) |
Implementation of the method used for communicate with this filter. | |
bool | ImportDxfFile (const wxMemoryBuffer &aMemBuffer) |
Implementation of the method used for communicate with this filter. | |
const wxString & | GetMessages () const override |
void | ReportMsg (const wxString &aMessage) override |
wxString | GetWildcards () const |
Return a list of wildcards that contains the file extensions handled by this plugin, separated with a semi-colon. | |
Protected Attributes | |
GRAPHICS_IMPORTER * | m_importer |
< Importer used to create objects representing the imported shapes. | |
Private Member Functions | |
double | mapX (double aDxfCoordX) |
double | mapY (double aDxfCoordY) |
double | mapDim (double aDxfValue) |
double | lineWeightToWidth (int lw, DXF_IMPORT_LAYER *aLayer) |
double | getCurrentUnitScale () |
MATRIX3x3D | getArbitraryAxis (DL_Extrusion *aData) |
VECTOR3D | wcsToOcs (const MATRIX3x3D &arbitraryAxis, VECTOR3D point) |
Converts a given world coordinate point to object coordinate using the given arbitrary axis vectors. | |
VECTOR3D | ocsToWcs (const MATRIX3x3D &arbitraryAxis, VECTOR3D point) |
Converts a given object coordinate point to world coordinate using the given arbitrary axis vectors. | |
DXF_IMPORT_LAYER * | getImportLayer (const std::string &aLayerName) |
Return the import layer data. | |
DXF_IMPORT_BLOCK * | getImportBlock (const std::string &aBlockName) |
Return the import layer block. | |
DXF_IMPORT_STYLE * | getImportStyle (const std::string &aStyleName) |
Return the import style. | |
void | insertLine (const VECTOR2D &aSegStart, const VECTOR2D &aSegEnd, double aWidth) |
void | insertArc (const VECTOR2D &aSegStart, const VECTOR2D &aSegEnd, double aBulge, double aWidth) |
void | insertSpline (double aWidth) |
virtual void | setVariableString (const std::string &key, const std::string &value, int code) override |
Called for every string variable in the DXF file (e.g. | |
virtual void | setVariableInt (const std::string &key, int value, int code) override |
Called for every int variable in the DXF file (e.g. | |
virtual void | setVariableDouble (const std::string &key, double value, int code) override |
Called for every double variable in the DXF file (e.g. | |
virtual void | addLayer (const DL_LayerData &aData) override |
virtual void | addLine (const DL_LineData &aData) override |
virtual void | addLinetype (const DL_LinetypeData &data) override |
virtual void | addBlock (const DL_BlockData &) override |
Called for each BLOCK in the DXF file. | |
virtual void | endBlock () override |
virtual void | addTextStyle (const DL_StyleData &aData) override |
virtual void | addPoint (const DL_PointData &aData) override |
virtual void | addCircle (const DL_CircleData &aData) override |
virtual void | addArc (const DL_ArcData &aData) override |
void | addEllipse (const DL_EllipseData &aData) override |
virtual void | addText (const DL_TextData &aData) override |
virtual void | addPolyline (const DL_PolylineData &aData) override |
virtual void | addInsert (const DL_InsertData &aData) override |
virtual void | addVertex (const DL_VertexData &aData) override |
Called for every polyline vertex. | |
virtual void | addMTextChunk (const std::string &text) override |
virtual void | addMText (const DL_MTextData &aData) override |
virtual void | endEntity () override |
virtual void | addSpline (const DL_SplineData &aData) override |
Called for every spline. | |
virtual void | addControlPoint (const DL_ControlPointData &aData) override |
Called for every spline control point. | |
virtual void | addFitPoint (const DL_FitPointData &aData) override |
Called for every spline fit point. | |
virtual void | addKnot (const DL_KnotData &aData) override |
Called for every spline knot value. | |
virtual void | addXLine (const DL_XLineData &) override |
virtual void | addRay (const DL_RayData &) override |
virtual void | addArcAlignedText (const DL_ArcAlignedTextData &) override |
virtual void | addDimAlign (const DL_DimensionData &, const DL_DimAlignedData &) override |
virtual void | addDimLinear (const DL_DimensionData &, const DL_DimLinearData &) override |
virtual void | addDimRadial (const DL_DimensionData &, const DL_DimRadialData &) override |
virtual void | addDimDiametric (const DL_DimensionData &, const DL_DimDiametricData &) override |
virtual void | addDimAngular (const DL_DimensionData &, const DL_DimAngular2LData &) override |
virtual void | addDimAngular3P (const DL_DimensionData &, const DL_DimAngular3PData &) override |
virtual void | addDimOrdinate (const DL_DimensionData &, const DL_DimOrdinateData &) override |
virtual void | addLeader (const DL_LeaderData &) override |
virtual void | addLeaderVertex (const DL_LeaderVertexData &) override |
virtual void | addHatch (const DL_HatchData &) override |
virtual void | addHatchLoop (const DL_HatchLoopData &) override |
virtual void | addHatchEdge (const DL_HatchEdgeData &) override |
virtual void | addTrace (const DL_TraceData &) override |
virtual void | add3dFace (const DL_3dFaceData &) override |
virtual void | addSolid (const DL_SolidData &) override |
virtual void | addImage (const DL_ImageData &) override |
virtual void | linkImage (const DL_ImageDefData &) override |
virtual void | addAttribute (const DL_AttributeData &) override |
virtual void | addXRecord (const std::string &) override |
virtual void | addXRecordString (int, const std::string &) override |
virtual void | addXRecordReal (int, double) override |
virtual void | addXRecordInt (int, int) override |
virtual void | addXRecordBool (int, bool) override |
virtual void | addXDataApp (const std::string &) override |
virtual void | addXDataString (int, const std::string &) override |
virtual void | addXDataReal (int, double) override |
virtual void | addXDataInt (int, int) override |
void | writeLine () |
void | writeMtext () |
Static Private Member Functions | |
static wxString | toDxfString (const wxString &aStr) |
Convert a native Unicode string into a DXF encoded string. | |
static wxString | toNativeString (const wxString &aData) |
Convert a DXF encoded string into a native Unicode string. | |
Private Attributes | |
double | m_xOffset |
double | m_yOffset |
double | m_defaultThickness |
int | m_brdLayer |
int | m_version |
std::string | m_codePage |
bool | m_importAsFPShapes |
wxString | m_messages |
DXF2BRD_ENTITY_DATA | m_curr_entity |
std::string | m_mtextContent |
double | m_minX |
double | m_maxX |
double | m_minY |
double | m_maxY |
DXF_IMPORT_UNITS | m_currentUnit |
int | m_importCoordinatePrecision |
int | m_importAnglePrecision |
GRAPHICS_IMPORTER_BUFFER | m_internalImporter |
std::vector< std::unique_ptr< DXF_IMPORT_LAYER > > | m_layers |
std::vector< std::unique_ptr< DXF_IMPORT_BLOCK > > | m_blocks |
std::vector< std::unique_ptr< DXF_IMPORT_STYLE > > | m_styles |
DXF_IMPORT_BLOCK * | m_currentBlock |
Definition at line 213 of file dxf_import_plugin.h.
DXF_IMPORT_PLUGIN::DXF_IMPORT_PLUGIN | ( | ) |
Definition at line 92 of file dxf_import_plugin.cpp.
References Dwgs_User, DXF_IMPORT_LINEWEIGHT_BY_LW_DEFAULT, m_brdLayer, m_currentBlock, m_currentUnit, m_defaultThickness, m_importAnglePrecision, m_importAsFPShapes, m_importCoordinatePrecision, m_layers, m_maxX, m_maxY, m_minX, m_minY, m_version, m_xOffset, and m_yOffset.
DXF_IMPORT_PLUGIN::~DXF_IMPORT_PLUGIN | ( | ) |
Definition at line 115 of file dxf_import_plugin.cpp.
|
inlineoverrideprivatevirtual |
Definition at line 518 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
overrideprivatevirtual |
Definition at line 575 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddArc(), ANGLE_0, ANGLE_180, ANGLE_360, DEGREES_T, getArbitraryAxis(), getImportLayer(), MATRIX3x3< T >::GetScale(), lineWeightToWidth(), DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, mapDim(), mapX(), mapY(), ocsToWcs(), RotatePoint(), updateImageLimits(), VECTOR2< T >::x, VECTOR3< T >::x, VECTOR2< T >::y, and VECTOR3< T >::y.
Referenced by addEllipse().
|
inlineoverrideprivatevirtual |
Definition at line 467 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 535 of file dxf_import_plugin.h.
|
overrideprivatevirtual |
Called for each BLOCK in the DXF file.
These are re-usable elements that may be placed into the model space. The elements are dereferenced to the model, so we just need to skip the re-parsing for the block elements.
Definition at line 505 of file dxf_import_plugin.cpp.
References m_blocks, m_currentBlock, and name.
|
overrideprivatevirtual |
Definition at line 555 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddCircle(), getArbitraryAxis(), getImportLayer(), lineWeightToWidth(), DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, mapDim(), mapX(), mapY(), ocsToWcs(), updateImageLimits(), VECTOR3< T >::x, and VECTOR3< T >::y.
Referenced by addEllipse().
|
overrideprivatevirtual |
Called for every spline control point.
Definition at line 276 of file dxf_import_plugin.cpp.
References m_curr_entity, and DXF2BRD_ENTITY_DATA::m_SplineControlPointList.
|
inlineoverrideprivatevirtual |
Definition at line 472 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 488 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 492 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 484 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 476 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 496 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 480 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
overrideprivate |
Definition at line 620 of file dxf_import_plugin.cpp.
References addArc(), addCircle(), GRAPHICS_IMPORTER_BUFFER::AddSpline(), ANGLE_360, EDA_ANGLE::AsDegrees(), VECTOR2< T >::EuclideanNorm(), getArbitraryAxis(), getImportLayer(), lineWeightToWidth(), DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, mapX(), mapY(), ocsToWcs(), RADIANS_T, TransformEllipseToBeziers(), updateImageLimits(), VECTOR3< T >::x, and VECTOR3< T >::y.
|
overrideprivatevirtual |
Called for every spline fit point.
Definition at line 283 of file dxf_import_plugin.cpp.
References m_curr_entity, and DXF2BRD_ENTITY_DATA::m_SplineFitPointList.
|
inlineoverrideprivatevirtual |
Definition at line 506 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 511 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 510 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 528 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
overrideprivatevirtual |
Definition at line 523 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddShape(), DEG2RAD(), getArbitraryAxis(), getImportBlock(), GRAPHICS_IMPORTER_BUFFER::GetShapes(), DXF_IMPORT_BLOCK::m_baseX, DXF_IMPORT_BLOCK::m_baseY, DXF_IMPORT_BLOCK::m_buffer, m_internalImporter, mapX(), mapY(), ocsToWcs(), scale, MATRIX3x3< T >::SetRotation(), VECTOR3< T >::x, and VECTOR3< T >::y.
|
overrideprivatevirtual |
Called for every spline knot value.
Definition at line 291 of file dxf_import_plugin.cpp.
References m_curr_entity, and DXF2BRD_ENTITY_DATA::m_SplineKnotsList.
|
overrideprivatevirtual |
Definition at line 298 of file dxf_import_plugin.cpp.
References DXF_IMPORT_LINEWEIGHT_BY_LAYER, DXF_IMPORT_LINEWEIGHT_BY_LW_DEFAULT, m_layers, and name.
|
inlineoverrideprivatevirtual |
Definition at line 500 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 504 of file dxf_import_plugin.h.
|
overrideprivatevirtual |
Definition at line 400 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddLine(), getImportLayer(), lineWeightToWidth(), DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, mapX(), mapY(), and updateImageLimits().
|
overrideprivatevirtual |
Definition at line 313 of file dxf_import_plugin.cpp.
References From_UTF8(), and name.
|
overrideprivatevirtual |
Definition at line 853 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddText(), getArbitraryAxis(), getImportStyle(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, m_mtextContent, DXF_IMPORT_STYLE::m_widthFactor, mapDim(), mapX(), mapY(), ocsToWcs(), text, toNativeString(), updateImageLimits(), VECTOR2< T >::x, VECTOR3< T >::x, VECTOR2< T >::y, and VECTOR3< T >::y.
|
overrideprivatevirtual |
Definition at line 843 of file dxf_import_plugin.cpp.
References m_mtextContent, and text.
|
overrideprivatevirtual |
Definition at line 1357 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddCircle(), getArbitraryAxis(), DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, mapDim(), mapX(), mapY(), ocsToWcs(), SCALE_FACTOR, updateImageLimits(), VECTOR3< T >::x, and VECTOR3< T >::y.
|
overrideprivatevirtual |
Definition at line 417 of file dxf_import_plugin.cpp.
References DXF2BRD_ENTITY_DATA::Clear(), m_curr_entity, DXF2BRD_ENTITY_DATA::m_EntityFlag, DXF2BRD_ENTITY_DATA::m_EntityParseStatus, and DXF2BRD_ENTITY_DATA::m_EntityType.
|
inlineoverrideprivatevirtual |
Definition at line 462 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 523 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
overrideprivatevirtual |
Called for every spline.
Definition at line 258 of file dxf_import_plugin.cpp.
References DXF2BRD_ENTITY_DATA::Clear(), m_curr_entity, DXF2BRD_ENTITY_DATA::m_EntityFlag, DXF2BRD_ENTITY_DATA::m_EntityParseStatus, DXF2BRD_ENTITY_DATA::m_EntityType, DXF2BRD_ENTITY_DATA::m_SplineControlCount, DXF2BRD_ENTITY_DATA::m_SplineDegree, DXF2BRD_ENTITY_DATA::m_SplineFitCount, DXF2BRD_ENTITY_DATA::m_SplineKnotsCount, DXF2BRD_ENTITY_DATA::m_SplineTangentEndX, DXF2BRD_ENTITY_DATA::m_SplineTangentEndY, DXF2BRD_ENTITY_DATA::m_SplineTangentStartX, and DXF2BRD_ENTITY_DATA::m_SplineTangentStartY.
|
overrideprivatevirtual |
Definition at line 690 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddText(), getArbitraryAxis(), getImportStyle(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_TOP, DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, DXF_IMPORT_STYLE::m_widthFactor, mapDim(), mapX(), mapY(), ocsToWcs(), text, toNativeString(), updateImageLimits(), VECTOR2< T >::x, VECTOR3< T >::x, VECTOR2< T >::y, and VECTOR3< T >::y.
|
overrideprivatevirtual |
Definition at line 1346 of file dxf_import_plugin.cpp.
|
inlineoverrideprivatevirtual |
Definition at line 513 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
overrideprivatevirtual |
Called for every polyline vertex.
Definition at line 432 of file dxf_import_plugin.cpp.
References std::abs(), getArbitraryAxis(), getImportLayer(), insertArc(), insertLine(), lineWeightToWidth(), DXF2BRD_ENTITY_DATA::m_BulgeVertex, m_curr_entity, DXF2BRD_ENTITY_DATA::m_EntityParseStatus, DXF2BRD_ENTITY_DATA::m_LastCoordinate, DXF2BRD_ENTITY_DATA::m_PolylineStart, mapX(), mapY(), MIN_BULGE, ocsToWcs(), VECTOR2< T >::x, VECTOR3< T >::x, VECTOR2< T >::y, and VECTOR3< T >::y.
|
inlineoverrideprivatevirtual |
Definition at line 541 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 544 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 543 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 542 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 458 of file dxf_import_plugin.h.
References _, and ReportMsg().
|
inlineoverrideprivatevirtual |
Definition at line 536 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 540 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 539 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 538 of file dxf_import_plugin.h.
|
inlineoverrideprivatevirtual |
Definition at line 537 of file dxf_import_plugin.h.
|
overrideprivatevirtual |
Definition at line 518 of file dxf_import_plugin.cpp.
References m_currentBlock.
|
overrideprivatevirtual |
Definition at line 474 of file dxf_import_plugin.cpp.
References std::abs(), DXF2BRD_ENTITY_DATA::Clear(), getImportLayer(), insertArc(), insertLine(), insertSpline(), lineWeightToWidth(), DXF2BRD_ENTITY_DATA::m_BulgeVertex, m_curr_entity, DXF2BRD_ENTITY_DATA::m_EntityFlag, DXF2BRD_ENTITY_DATA::m_EntityType, DXF2BRD_ENTITY_DATA::m_LastCoordinate, DXF2BRD_ENTITY_DATA::m_PolylineStart, and MIN_BULGE.
|
private |
Definition at line 1588 of file dxf_import_plugin.cpp.
References VECTOR3< T >::Cross(), VECTOR3< T >::Normalize(), VECTOR3< T >::x, and VECTOR3< T >::y.
Referenced by addArc(), addCircle(), addEllipse(), addInsert(), addMText(), addPoint(), addText(), and addVertex().
|
private |
Definition at line 998 of file dxf_import_plugin.cpp.
References m_currentUnit, and scale.
|
inlineoverridevirtual |
Return a vector of the file extensions handled by this plugin.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 224 of file dxf_import_plugin.h.
|
overridevirtual |
Return image bounding box from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 181 of file dxf_import_plugin.cpp.
References m_maxX, m_maxY, m_minX, m_minY, BOX2< Vec >::SetEnd(), and BOX2< Vec >::SetOrigin().
|
overridevirtual |
Return image height from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 175 of file dxf_import_plugin.cpp.
|
overridevirtual |
Return image width from original imported file.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 169 of file dxf_import_plugin.cpp.
|
private |
Return the import layer block.
aBlockName | is the raw string from dxflib. |
Definition at line 358 of file dxf_import_plugin.cpp.
References m_blocks.
Referenced by addInsert().
|
private |
Return the import layer data.
aLayerName | is the raw string from dxflib getLayer(). |
Definition at line 337 of file dxf_import_plugin.cpp.
References m_layers.
Referenced by addArc(), addCircle(), addEllipse(), addLine(), addVertex(), and endEntity().
|
private |
Return the import style.
aStyleName | is the raw string from dxflib. |
Definition at line 379 of file dxf_import_plugin.cpp.
References m_styles.
Referenced by addMText(), and addText().
|
inlineoverridevirtual |
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 319 of file dxf_import_plugin.h.
References m_messages.
|
inlineoverridevirtual |
Return the plugin name.
This string will be used as the description in the file dialog.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 219 of file dxf_import_plugin.h.
|
inlineinherited |
Return a list of wildcards that contains the file extensions handled by this plugin, separated with a semi-colon.
Definition at line 65 of file graphics_import_plugin.h.
References formatWildcardExt(), and GRAPHICS_IMPORT_PLUGIN::GetFileExtensions().
|
overridevirtual |
Actually imports the file.
It is necessary to have loaded the file beforehand.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 160 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::ImportTo(), GRAPHICS_IMPORT_PLUGIN::m_importer, and m_internalImporter.
|
inline |
Allow the import DXF items converted to board graphic items or footprint graphic items.
aImportAsFootprintGraphic | use true to import in a footprint or false to import on a board. |
Definition at line 248 of file dxf_import_plugin.h.
References m_importAsFPShapes.
bool DXF_IMPORT_PLUGIN::ImportDxfFile | ( | const wxMemoryBuffer & | aMemBuffer | ) |
Implementation of the method used for communicate with this filter.
aMemBuffer | is the memory bufferr. |
Definition at line 236 of file dxf_import_plugin.cpp.
bool DXF_IMPORT_PLUGIN::ImportDxfFile | ( | const wxString & | aFile | ) |
Implementation of the method used for communicate with this filter.
aFile | is the full filename. |
Definition at line 218 of file dxf_import_plugin.cpp.
Referenced by Load(), and LoadFromMemory().
|
private |
Definition at line 1396 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddArc(), DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, M_PI_2, RADIANS_T, SCALE_FACTOR, updateImageLimits(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by addVertex(), and endEntity().
|
private |
Definition at line 1381 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER_BUFFER::AddLine(), DXF_IMPORT_BLOCK::m_buffer, m_currentBlock, m_internalImporter, SCALE_FACTOR, updateImageLimits(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by addVertex(), and endEntity().
|
private |
Definition at line 1477 of file dxf_import_plugin.cpp.
References _, GRAPHICS_IMPORTER_BUFFER::AddLine(), GRAPHICS_IMPORTER_BUFFER::AddSpline(), DXF_IMPORT_BLOCK::m_buffer, m_curr_entity, m_currentBlock, m_internalImporter, DXF2BRD_ENTITY_DATA::m_SplineControlPointList, DXF2BRD_ENTITY_DATA::m_SplineDegree, DXF2BRD_ENTITY_DATA::m_SplineFitPointList, DXF2BRD_ENTITY_DATA::m_SplineKnotsList, mapX(), mapY(), ReportMsg(), and updateImageLimits().
Referenced by endEntity().
|
private |
Definition at line 322 of file dxf_import_plugin.cpp.
References DXF_IMPORT_LINEWEIGHT_BY_LAYER, m_defaultThickness, DXF_IMPORT_LAYER::m_lineWeight, and SCALE_FACTOR.
Referenced by addArc(), addCircle(), addEllipse(), addLine(), addVertex(), and endEntity().
|
inlineoverrideprivatevirtual |
Definition at line 532 of file dxf_import_plugin.h.
|
overridevirtual |
Load file for import.
It is necessary to have the GRAPHICS_IMPORTER object set before.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 120 of file dxf_import_plugin.cpp.
References _, GRAPHICS_IMPORTER_BUFFER::ClearShapes(), ImportDxfFile(), m_blocks, m_internalImporter, m_layers, m_styles, and ReportMsg().
|
overridevirtual |
Set memory buffer with content for import.
It is necessary to have the GRAPHICS_IMPORTER object set before.
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 140 of file dxf_import_plugin.cpp.
References _, GRAPHICS_IMPORTER_BUFFER::ClearShapes(), ImportDxfFile(), m_blocks, m_internalImporter, m_layers, m_styles, and ReportMsg().
|
private |
Definition at line 212 of file dxf_import_plugin.cpp.
References getCurrentUnitScale(), and SCALE_FACTOR.
Referenced by addArc(), addCircle(), addMText(), addPoint(), and addText().
|
private |
Definition at line 200 of file dxf_import_plugin.cpp.
References getCurrentUnitScale(), m_xOffset, and SCALE_FACTOR.
Referenced by addArc(), addCircle(), addEllipse(), addInsert(), addLine(), addMText(), addPoint(), addText(), addVertex(), and insertSpline().
|
private |
Definition at line 206 of file dxf_import_plugin.cpp.
References getCurrentUnitScale(), m_yOffset, and SCALE_FACTOR.
Referenced by addArc(), addCircle(), addEllipse(), addInsert(), addLine(), addMText(), addPoint(), addText(), addVertex(), and insertSpline().
|
private |
Converts a given object coordinate point to world coordinate using the given arbitrary axis vectors.
Definition at line 1614 of file dxf_import_plugin.cpp.
References wcsToOcs().
Referenced by addArc(), addCircle(), addEllipse(), addInsert(), addMText(), addPoint(), addText(), and addVertex().
|
overridevirtual |
Implements GRAPHICS_IMPORT_PLUGIN.
Definition at line 250 of file dxf_import_plugin.cpp.
References m_messages.
Referenced by add3dFace(), addArcAlignedText(), addDimAlign(), addDimAngular(), addDimAngular3P(), addDimDiametric(), addDimLinear(), addDimOrdinate(), addDimRadial(), addHatch(), addImage(), addLeader(), addRay(), addSolid(), addTrace(), addXLine(), insertSpline(), Load(), and LoadFromMemory().
|
inline |
Set the layer number to import dxf items.
The layer should be a technical layer, not a copper layer.
Definition at line 300 of file dxf_import_plugin.h.
References m_brdLayer.
|
inline |
Set the default line width when importing dxf items like lines to Pcbnew.
DXF files have no line width explicit parameter, it will be most of time the line width of imported lines. f
aWidth | is the line width in mm. |
Definition at line 273 of file dxf_import_plugin.h.
References m_defaultThickness.
Referenced by SetImporter(), and SetLineWidthMM().
|
overridevirtual |
Set the receiver of the imported shapes.
Reimplemented from GRAPHICS_IMPORT_PLUGIN.
Definition at line 191 of file dxf_import_plugin.cpp.
References GRAPHICS_IMPORTER::GetLineWidthMM(), GRAPHICS_IMPORT_PLUGIN::m_importer, SetDefaultLineWidthMM(), and GRAPHICS_IMPORT_PLUGIN::SetImporter().
|
inlineoverridevirtual |
Reimplemented from GRAPHICS_IMPORT_PLUGIN.
Definition at line 278 of file dxf_import_plugin.h.
References SetDefaultLineWidthMM().
|
inline |
Set the coordinate offset between the imported dxf items and Pcbnew.
DXF files have the Y axis from bottom to top aOffsetX = 0, and aOffsetY = - vertical page size to import a full page.
aOffsetX | is the X offset in mm. |
aOffsetY | is the Y offset in mm. |
Definition at line 289 of file dxf_import_plugin.h.
|
inline |
Set the default units when importing DXFs.
DXFs can lack units by design which requires the importing software to make the decision.
aUnits | is the default unit of the DXF to assume. |
Definition at line 260 of file dxf_import_plugin.h.
References m_currentUnit.
|
inlineoverrideprivatevirtual |
Called for every double variable in the DXF file (e.g.
"$DIMEXO").
Definition at line 399 of file dxf_import_plugin.h.
|
overrideprivatevirtual |
Called for every int variable in the DXF file (e.g.
"$ACADMAINTVER").
Definition at line 1036 of file dxf_import_plugin.cpp.
References m_codePage, m_currentUnit, m_importAnglePrecision, and m_importCoordinatePrecision.
|
overrideprivatevirtual |
Called for every string variable in the DXF file (e.g.
"$ACADVER").
Definition at line 1096 of file dxf_import_plugin.cpp.
|
staticprivate |
Convert a native Unicode string into a DXF encoded string.
DXF encoding includes the following special sequences:
Definition at line 1103 of file dxf_import_plugin.cpp.
References res.
|
staticprivate |
Convert a DXF encoded string into a native Unicode string.
Definition at line 1157 of file dxf_import_plugin.cpp.
References res.
Referenced by addMText(), and addText().
void DXF_IMPORT_PLUGIN::updateImageLimits | ( | const VECTOR2D & | aPoint | ) |
Definition at line 1578 of file dxf_import_plugin.cpp.
References m_maxX, m_maxY, m_minX, m_minY, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by addArc(), addCircle(), addEllipse(), addLine(), addMText(), addPoint(), addText(), insertArc(), insertLine(), and insertSpline().
|
private |
Converts a given world coordinate point to object coordinate using the given arbitrary axis vectors.
Definition at line 1608 of file dxf_import_plugin.cpp.
Referenced by ocsToWcs().
|
private |
|
private |
|
private |
Definition at line 590 of file dxf_import_plugin.h.
Referenced by addBlock(), getImportBlock(), Load(), and LoadFromMemory().
|
private |
Definition at line 568 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), and SetBrdLayer().
|
private |
Definition at line 570 of file dxf_import_plugin.h.
Referenced by setVariableInt().
|
private |
Definition at line 575 of file dxf_import_plugin.h.
Referenced by addControlPoint(), addFitPoint(), addKnot(), addPolyline(), addSpline(), addVertex(), endEntity(), and insertSpline().
|
private |
Definition at line 592 of file dxf_import_plugin.h.
Referenced by addArc(), addBlock(), addCircle(), addEllipse(), addLine(), addMText(), addPoint(), addText(), DXF_IMPORT_PLUGIN(), endBlock(), insertArc(), insertLine(), and insertSpline().
|
private |
Definition at line 582 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), getCurrentUnitScale(), SetUnit(), and setVariableInt().
|
private |
Definition at line 567 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), lineWeightToWidth(), and SetDefaultLineWidthMM().
|
private |
Definition at line 584 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), and setVariableInt().
|
private |
Definition at line 571 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), and ImportAsFootprintGraphic().
|
private |
Definition at line 583 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), and setVariableInt().
|
protectedinherited |
< Importer used to create objects representing the imported shapes.
Definition at line 138 of file graphics_import_plugin.h.
Referenced by Import(), SVG_IMPORT_PLUGIN::Import(), SVG_IMPORT_PLUGIN::Load(), SVG_IMPORT_PLUGIN::LoadFromMemory(), GRAPHICS_IMPORT_PLUGIN::SetImporter(), and SetImporter().
|
private |
Definition at line 586 of file dxf_import_plugin.h.
Referenced by addArc(), addCircle(), addEllipse(), addInsert(), addLine(), addMText(), addPoint(), addText(), Import(), insertArc(), insertLine(), insertSpline(), Load(), and LoadFromMemory().
|
private |
Definition at line 589 of file dxf_import_plugin.h.
Referenced by addLayer(), DXF_IMPORT_PLUGIN(), getImportLayer(), Load(), and LoadFromMemory().
|
private |
Definition at line 579 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), GetImageBBox(), GetImageWidth(), and updateImageLimits().
|
private |
Definition at line 580 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), GetImageBBox(), GetImageHeight(), and updateImageLimits().
|
private |
Definition at line 573 of file dxf_import_plugin.h.
Referenced by GetMessages(), and ReportMsg().
|
private |
Definition at line 579 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), GetImageBBox(), GetImageWidth(), and updateImageLimits().
|
private |
Definition at line 580 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), GetImageBBox(), GetImageHeight(), and updateImageLimits().
|
private |
Definition at line 577 of file dxf_import_plugin.h.
Referenced by addMText(), and addMTextChunk().
|
private |
Definition at line 591 of file dxf_import_plugin.h.
Referenced by addTextStyle(), getImportStyle(), Load(), and LoadFromMemory().
|
private |
Definition at line 569 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN().
|
private |
Definition at line 565 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), mapX(), and SetOffset().
|
private |
Definition at line 566 of file dxf_import_plugin.h.
Referenced by DXF_IMPORT_PLUGIN(), mapY(), and SetOffset().