kicad/pcbnew/plotdxf.cpp

45 lines
1.0 KiB
C++
Raw Normal View History

/**
* @file plotdxf.cpp
* @brief Plot DXF.
*/
2009-06-30 19:27:39 +00:00
#include <fctsys.h>
#include <common.h>
#include <plot_common.h>
#include <confirm.h>
#include <trigo.h>
#include <wxBasePcbFrame.h>
#include <pcbnew.h>
#include <protos.h>
#include <pcbplot.h>
2009-06-30 19:27:39 +00:00
bool PCB_BASE_FRAME::ExportToDxfFile( const wxString& aFullFileName, int aLayer,
EDA_DRAW_MODE_T aTraceMode )
2009-06-30 19:27:39 +00:00
{
LOCALE_IO toggle;
2009-06-30 19:27:39 +00:00
FILE* output_file = wxFopen( aFullFileName, wxT( "wt" ) );
2009-06-30 19:27:39 +00:00
if( output_file == NULL )
{
return false;
2009-06-30 19:27:39 +00:00
}
DXF_PLOTTER* plotter = new DXF_PLOTTER();
plotter->SetPageSettings( GetPageSettings() );
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( aFullFileName );
2009-06-30 19:27:39 +00:00
plotter->start_plot( output_file );
if( g_PcbPlotOptions.m_PlotFrameRef )
2009-06-30 19:27:39 +00:00
PlotWorkSheet( plotter, GetScreen() );
Plot_Layer( plotter, aLayer, aTraceMode );
2009-06-30 19:27:39 +00:00
plotter->end_plot();
delete plotter;
return true;
2009-06-30 19:27:39 +00:00
}