2009-11-20 14:55:20 +00:00
|
|
|
/******************/
|
|
|
|
/**** Plot DXF ****/
|
|
|
|
/******************/
|
2009-06-30 19:27:39 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "common.h"
|
|
|
|
#include "plot_common.h"
|
|
|
|
#include "confirm.h"
|
|
|
|
#include "pcbnew.h"
|
|
|
|
#include "pcbplot.h"
|
|
|
|
#include "trigo.h"
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
2010-01-01 13:30:39 +00:00
|
|
|
bool WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer,
|
2009-11-20 14:55:20 +00:00
|
|
|
GRTraceMode trace_mode )
|
2009-06-30 19:27:39 +00:00
|
|
|
{
|
|
|
|
Ki_PageDescr* currentsheet = GetScreen()->m_CurrentSheetDesc;
|
|
|
|
|
|
|
|
FILE* output_file = wxFopen( FullFileName, wxT( "wt" ) );
|
|
|
|
if( output_file == NULL )
|
|
|
|
{
|
2010-01-01 13:30:39 +00:00
|
|
|
return false;
|
2009-06-30 19:27:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SetLocaleTo_C_standard();
|
|
|
|
|
2009-08-29 10:20:48 +00:00
|
|
|
DXF_PLOTTER* plotter = new DXF_PLOTTER();
|
2009-06-30 19:27:39 +00:00
|
|
|
plotter->set_paper_size( currentsheet );
|
2009-11-20 14:55:20 +00:00
|
|
|
plotter->set_viewport( wxPoint( 0, 0 ), 1, 0 );
|
2009-06-30 19:27:39 +00:00
|
|
|
plotter->set_creator( wxT( "PCBNEW-DXF" ) );
|
|
|
|
plotter->set_filename( FullFileName );
|
|
|
|
plotter->start_plot( output_file );
|
|
|
|
|
2010-12-11 18:40:39 +00:00
|
|
|
if( g_PcbPlotOptions.m_PlotFrameRef )
|
2009-06-30 19:27:39 +00:00
|
|
|
PlotWorkSheet( plotter, GetScreen() );
|
|
|
|
|
|
|
|
Plot_Layer( plotter, Layer, trace_mode );
|
|
|
|
plotter->end_plot();
|
|
|
|
delete plotter;
|
|
|
|
SetLocaleTo_Default();
|
2010-01-01 13:30:39 +00:00
|
|
|
|
|
|
|
return true;
|
2009-06-30 19:27:39 +00:00
|
|
|
}
|