Commit 5a6665ec authored by Cirilo Bernardo's avatar Cirilo Bernardo Committed by jean-pierre charras

Dxf import fix (patch from Cirilo Bernardo, with a minor change)

parent 9ef56278
...@@ -52,7 +52,6 @@ DXF2BRD_CONVERTER::DXF2BRD_CONVERTER() : DRW_Interface() ...@@ -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 ) ...@@ -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 @@ ...@@ -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: ...@@ -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: ...@@ -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 );
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment