Dxf import fix (patch from Cirilo Bernardo, with a minor change)
This commit is contained in:
parent
9ef5627880
commit
5a6665ec08
|
@ -52,7 +52,6 @@ DXF2BRD_CONVERTER::DXF2BRD_CONVERTER() : DRW_Interface()
|
||||||
m_xOffset = 0.0; // X coord offset for conversion (in mm)
|
m_xOffset = 0.0; // X coord offset for conversion (in mm)
|
||||||
m_yOffset = 0.0; // Y coord offset for conversion (in mm)
|
m_yOffset = 0.0; // Y coord offset for conversion (in mm)
|
||||||
m_Dfx2mm = 1.0; // The scale factor to convert DXF units to mm
|
m_Dfx2mm = 1.0; // The scale factor to convert DXF units to mm
|
||||||
m_dxf = NULL;
|
|
||||||
m_brd = NULL;
|
m_brd = NULL;
|
||||||
m_version = 0;
|
m_version = 0;
|
||||||
m_defaultThickness = 0.1;
|
m_defaultThickness = 0.1;
|
||||||
|
@ -84,28 +83,16 @@ int DXF2BRD_CONVERTER::mapDim( double aDxfValue )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of the method used for communicate
|
|
||||||
* with this filter.
|
|
||||||
*
|
|
||||||
* @param aFile = the full filename.
|
|
||||||
* @param aLayersList = where to store the list of layer names
|
|
||||||
*/
|
|
||||||
bool DXF2BRD_CONVERTER::ImportDxfFile( const wxString& aFile, BOARD* aBoard )
|
bool DXF2BRD_CONVERTER::ImportDxfFile( const wxString& aFile, BOARD* aBoard )
|
||||||
{
|
{
|
||||||
m_brd = aBoard;
|
m_brd = aBoard;
|
||||||
|
|
||||||
m_dxf = new dxfRW( aFile.ToUTF8() );
|
dxfRW* dxf = new dxfRW( aFile.ToUTF8() );
|
||||||
bool success = m_dxf->read( this, true );
|
bool success = dxf->read( this, true );
|
||||||
|
|
||||||
if( success==false )
|
delete dxf;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete m_dxf;
|
return success;
|
||||||
m_dxf = NULL;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add aItem the the board
|
// Add aItem the the board
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "drw_interface.h"
|
#include "drw_interface.h"
|
||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
|
|
||||||
class dxfRW;
|
|
||||||
class BOARD;
|
class BOARD;
|
||||||
class BOARD_ITEM;
|
class BOARD_ITEM;
|
||||||
|
|
||||||
|
@ -54,7 +53,6 @@ private:
|
||||||
int m_brdLayer; // The board layer to place imported dfx items
|
int m_brdLayer; // The board layer to place imported dfx items
|
||||||
int m_version; // the dxf version, not used here
|
int m_version; // the dxf version, not used here
|
||||||
std::string m_codePage; // The code page, not used here
|
std::string m_codePage; // The code page, not used here
|
||||||
dxfRW* m_dxf; // the dxf reader
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DXF2BRD_CONVERTER();
|
DXF2BRD_CONVERTER();
|
||||||
|
@ -80,6 +78,13 @@ public:
|
||||||
*/
|
*/
|
||||||
void SetBrdLayer( int aBrdLayer ) { m_brdLayer = aBrdLayer; }
|
void SetBrdLayer( int aBrdLayer ) { m_brdLayer = aBrdLayer; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of the method used for communicate
|
||||||
|
* with this filter.
|
||||||
|
*
|
||||||
|
* @param aFile = the full filename.
|
||||||
|
* @param aBoard = where to store the graphical items and text
|
||||||
|
*/
|
||||||
bool ImportDxfFile( const wxString& aFile, BOARD * aBoard );
|
bool ImportDxfFile( const wxString& aFile, BOARD * aBoard );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue