Commit c3fde304 authored by charras's avatar charras

code cleaning. Pcbnew: Minor enhancements in Plot dialog

parent 0a58e630
...@@ -13,6 +13,7 @@ set(COMMON_SRCS ...@@ -13,6 +13,7 @@ set(COMMON_SRCS
bezier_curves.cpp bezier_curves.cpp
block_commande.cpp block_commande.cpp
class_marker_base.cpp class_marker_base.cpp
class_plotter.cpp
class_undoredo_container.cpp class_undoredo_container.cpp
common.cpp common.cpp
common_plot_functions.cpp common_plot_functions.cpp
......
This diff is collapsed.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "kicad_string.h" #include "kicad_string.h"
/***********************************************************************************/ /***********************************************************************************/
void DXF_Plotter::set_viewport( wxPoint offset, void DXF_PLOTTER::set_viewport( wxPoint offset,
double aScale, int orient ) double aScale, int orient )
/***********************************************************************************/ /***********************************************************************************/
...@@ -30,7 +30,7 @@ void DXF_Plotter::set_viewport( wxPoint offset, ...@@ -30,7 +30,7 @@ void DXF_Plotter::set_viewport( wxPoint offset,
/*****************************************************************/ /*****************************************************************/
void DXF_Plotter::start_plot( FILE* fout ) void DXF_PLOTTER::start_plot( FILE* fout )
/*****************************************************************/ /*****************************************************************/
{ {
wxASSERT( !output_file ); wxASSERT( !output_file );
...@@ -54,7 +54,7 @@ void DXF_Plotter::start_plot( FILE* fout ) ...@@ -54,7 +54,7 @@ void DXF_Plotter::start_plot( FILE* fout )
/**********************************/ /**********************************/
void DXF_Plotter::end_plot() void DXF_PLOTTER::end_plot()
/**********************************/ /**********************************/
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -66,7 +66,7 @@ void DXF_Plotter::end_plot() ...@@ -66,7 +66,7 @@ void DXF_Plotter::end_plot()
/******************************/ /******************************/
void DXF_Plotter::set_color( int color ) void DXF_PLOTTER::set_color( int color )
/******************************/ /******************************/
/* /*
...@@ -84,7 +84,7 @@ void DXF_Plotter::set_color( int color ) ...@@ -84,7 +84,7 @@ void DXF_Plotter::set_color( int color )
/************************************************************/ /************************************************************/
void DXF_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) void DXF_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
/************************************************************/ /************************************************************/
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -97,7 +97,7 @@ void DXF_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) ...@@ -97,7 +97,7 @@ void DXF_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
/************************************************************/ /************************************************************/
void DXF_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width ) void DXF_PLOTTER::circle( wxPoint centre, int diameter, FILL_T fill, int width )
/************************************************************/ /************************************************************/
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -114,7 +114,7 @@ void DXF_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width ) ...@@ -114,7 +114,7 @@ void DXF_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width )
/*****************************************************/ /*****************************************************/
void DXF_Plotter::poly( int nb, int* coord, FILL_T fill, int width ) void DXF_PLOTTER::poly( int nb, int* coord, FILL_T fill, int width )
/*****************************************************/ /*****************************************************/
/* Trace un polygone (ferme si rempli) en format DXF /* Trace un polygone (ferme si rempli) en format DXF
...@@ -143,7 +143,7 @@ void DXF_Plotter::poly( int nb, int* coord, FILL_T fill, int width ) ...@@ -143,7 +143,7 @@ void DXF_Plotter::poly( int nb, int* coord, FILL_T fill, int width )
/**********************************************/ /**********************************************/
void DXF_Plotter::pen_to( wxPoint pos, char plume ) void DXF_PLOTTER::pen_to( wxPoint pos, char plume )
/**********************************************/ /**********************************************/
/* /*
...@@ -172,14 +172,14 @@ void DXF_Plotter::pen_to( wxPoint pos, char plume ) ...@@ -172,14 +172,14 @@ void DXF_Plotter::pen_to( wxPoint pos, char plume )
} }
void DXF_Plotter::set_dash( bool dashed ) void DXF_PLOTTER::set_dash( bool dashed )
{ {
/* NOP for now */ /* NOP for now */
wxASSERT( output_file ); wxASSERT( output_file );
} }
void DXF_Plotter::thick_segment( wxPoint start, wxPoint end, int width, void DXF_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,
GRTraceMode tracemode ) GRTraceMode tracemode )
/** Function Plot a filled segment (track) /** Function Plot a filled segment (track)
...@@ -202,7 +202,7 @@ void DXF_Plotter::thick_segment( wxPoint start, wxPoint end, int width, ...@@ -202,7 +202,7 @@ void DXF_Plotter::thick_segment( wxPoint start, wxPoint end, int width,
/********************************************************************/ /********************************************************************/
void DXF_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
FILL_T fill, int width ) FILL_T fill, int width )
/********************************************************************/ /********************************************************************/
...@@ -230,7 +230,7 @@ void DXF_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, ...@@ -230,7 +230,7 @@ void DXF_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
/***********************************************************************************/ /***********************************************************************************/
void DXF_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/************************************************************************************/ /************************************************************************************/
/* Trace 1 pastille PAD_OVAL en position pos_X,Y , de dim size.x, size.y */ /* Trace 1 pastille PAD_OVAL en position pos_X,Y , de dim size.x, size.y */
...@@ -250,7 +250,7 @@ void DXF_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -250,7 +250,7 @@ void DXF_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient,
/*******************************************************************************/ /*******************************************************************************/
void DXF_Plotter::flash_pad_circle( wxPoint pos, int diametre, void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/*******************************************************************************/ /*******************************************************************************/
/* Trace 1 pastille RONDE (via,pad rond) en position pos */ /* Trace 1 pastille RONDE (via,pad rond) en position pos */
...@@ -261,7 +261,7 @@ void DXF_Plotter::flash_pad_circle( wxPoint pos, int diametre, ...@@ -261,7 +261,7 @@ void DXF_Plotter::flash_pad_circle( wxPoint pos, int diametre,
/**************************************************************************/ /**************************************************************************/
void DXF_Plotter::flash_pad_rect( wxPoint pos, wxSize padsize, void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
int orient, GRTraceMode trace_mode ) int orient, GRTraceMode trace_mode )
/**************************************************************************/ /**************************************************************************/
...@@ -325,7 +325,7 @@ void DXF_Plotter::flash_pad_rect( wxPoint pos, wxSize padsize, ...@@ -325,7 +325,7 @@ void DXF_Plotter::flash_pad_rect( wxPoint pos, wxSize padsize,
/*******************************************************************/ /*******************************************************************/
void DXF_Plotter::flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta, void DXF_PLOTTER::flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta,
int orient, GRTraceMode trace_mode ) int orient, GRTraceMode trace_mode )
/*******************************************************************/ /*******************************************************************/
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/***************************************************************************/ /***************************************************************************/
void Gerber_Plotter::set_viewport( wxPoint offset, void GERBER_PLOTTER::set_viewport( wxPoint offset,
double aScale, int orient ) double aScale, int orient )
/***************************************************************************/ /***************************************************************************/
...@@ -36,7 +36,7 @@ void Gerber_Plotter::set_viewport( wxPoint offset, ...@@ -36,7 +36,7 @@ void Gerber_Plotter::set_viewport( wxPoint offset,
/******************************************************************/ /******************************************************************/
void Gerber_Plotter::start_plot( FILE* aFile ) void GERBER_PLOTTER::start_plot( FILE* aFile )
/*****************************************************************/ /*****************************************************************/
/** Function start_plot /** Function start_plot
...@@ -70,7 +70,7 @@ void Gerber_Plotter::start_plot( FILE* aFile ) ...@@ -70,7 +70,7 @@ void Gerber_Plotter::start_plot( FILE* aFile )
/******************************************************************/ /******************************************************************/
void Gerber_Plotter::end_plot() void GERBER_PLOTTER::end_plot()
/*****************************************************************/ /*****************************************************************/
{ {
char line[1024]; char line[1024];
...@@ -102,7 +102,7 @@ void Gerber_Plotter::end_plot() ...@@ -102,7 +102,7 @@ void Gerber_Plotter::end_plot()
/*************************************************************************************/ /*************************************************************************************/
void Gerber_Plotter::set_default_line_width( int width ) void GERBER_PLOTTER::set_default_line_width( int width )
/*************************************************************************************/ /*************************************************************************************/
/* Set the default line width (in 1/1000 inch) for the current plotting /* Set the default line width (in 1/1000 inch) for the current plotting
...@@ -114,7 +114,7 @@ void Gerber_Plotter::set_default_line_width( int width ) ...@@ -114,7 +114,7 @@ void Gerber_Plotter::set_default_line_width( int width )
/***************************************/ /***************************************/
void Gerber_Plotter::set_current_line_width( int width ) void GERBER_PLOTTER::set_current_line_width( int width )
/***************************************/ /***************************************/
/* Set the Current line width (in 1/1000 inch) for the next plot /* Set the Current line width (in 1/1000 inch) for the next plot
...@@ -127,20 +127,20 @@ void Gerber_Plotter::set_current_line_width( int width ) ...@@ -127,20 +127,20 @@ void Gerber_Plotter::set_current_line_width( int width )
else else
pen_width = default_pen_width; pen_width = default_pen_width;
select_aperture( wxSize( pen_width, pen_width ), Aperture::Plotting ); select_aperture( wxSize( pen_width, pen_width ), APERTURE::Plotting );
current_pen_width = pen_width; current_pen_width = pen_width;
} }
/******************************************************/ /******************************************************/
vector<Aperture>::iterator Gerber_Plotter::get_aperture( const wxSize& size, std::vector<APERTURE>::iterator GERBER_PLOTTER::get_aperture( const wxSize& size,
Aperture::Aperture_Type type ) APERTURE::Aperture_Type type )
/******************************************************/ /******************************************************/
{ {
int last_D_code = 9; int last_D_code = 9;
// Search an existing aperture // Search an existing aperture
vector<Aperture>::iterator tool = apertures.begin(); std::vector<APERTURE>::iterator tool = apertures.begin();
while( tool != apertures.end() ) while( tool != apertures.end() )
{ {
last_D_code = tool->D_code; last_D_code = tool->D_code;
...@@ -151,7 +151,7 @@ vector<Aperture>::iterator Gerber_Plotter::get_aperture( const wxSize& ...@@ -151,7 +151,7 @@ vector<Aperture>::iterator Gerber_Plotter::get_aperture( const wxSize&
} }
// Allocate a new aperture // Allocate a new aperture
Aperture new_tool; APERTURE new_tool;
new_tool.size = size; new_tool.size = size;
new_tool.type = type; new_tool.type = type;
new_tool.D_code = last_D_code + 1; new_tool.D_code = last_D_code + 1;
...@@ -161,7 +161,7 @@ vector<Aperture>::iterator Gerber_Plotter::get_aperture( const wxSize& ...@@ -161,7 +161,7 @@ vector<Aperture>::iterator Gerber_Plotter::get_aperture( const wxSize&
/******************************************************/ /******************************************************/
void Gerber_Plotter::select_aperture( const wxSize& size, Aperture::Aperture_Type type ) void GERBER_PLOTTER::select_aperture( const wxSize& size, APERTURE::Aperture_Type type )
/******************************************************/ /******************************************************/
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -177,7 +177,7 @@ void Gerber_Plotter::select_aperture( const wxSize& size, Aperture::Aperture_Typ ...@@ -177,7 +177,7 @@ void Gerber_Plotter::select_aperture( const wxSize& size, Aperture::Aperture_Typ
/******************************************************/ /******************************************************/
void Gerber_Plotter::write_aperture_list() void GERBER_PLOTTER::write_aperture_list()
/******************************************************/ /******************************************************/
/* Genere la liste courante des D_CODES /* Genere la liste courante des D_CODES
...@@ -189,7 +189,7 @@ void Gerber_Plotter::write_aperture_list() ...@@ -189,7 +189,7 @@ void Gerber_Plotter::write_aperture_list()
char cbuf[1024]; char cbuf[1024];
/* Init : */ /* Init : */
for( vector<Aperture>::iterator tool = apertures.begin(); for( std::vector<APERTURE>::iterator tool = apertures.begin();
tool != apertures.end(); tool++ ) tool != apertures.end(); tool++ )
{ {
const float fscale = 0.0001f * plot_scale; // For 3.4 format const float fscale = 0.0001f * plot_scale; // For 3.4 format
...@@ -199,20 +199,20 @@ void Gerber_Plotter::write_aperture_list() ...@@ -199,20 +199,20 @@ void Gerber_Plotter::write_aperture_list()
switch( tool->type ) switch( tool->type )
{ {
case Aperture::Circle: case APERTURE::Circle:
sprintf( text, "C,%f*%%\n", tool->size.x * fscale ); sprintf( text, "C,%f*%%\n", tool->size.x * fscale );
break; break;
case Aperture::Rect: case APERTURE::Rect:
sprintf( text, "R,%fX%f*%%\n", tool->size.x * fscale, sprintf( text, "R,%fX%f*%%\n", tool->size.x * fscale,
tool->size.y * fscale ); tool->size.y * fscale );
break; break;
case Aperture::Plotting: case APERTURE::Plotting:
sprintf( text, "C,%f*%%\n", tool->size.x * fscale ); sprintf( text, "C,%f*%%\n", tool->size.x * fscale );
break; break;
case Aperture::Oval: case APERTURE::Oval:
sprintf( text, "O,%fX%f*%%\n", tool->size.x * fscale, sprintf( text, "O,%fX%f*%%\n", tool->size.x * fscale,
tool->size.y * fscale ); tool->size.y * fscale );
break; break;
...@@ -224,7 +224,7 @@ void Gerber_Plotter::write_aperture_list() ...@@ -224,7 +224,7 @@ void Gerber_Plotter::write_aperture_list()
/**********************************************/ /**********************************************/
void Gerber_Plotter::pen_to( wxPoint aPos, char plume ) void GERBER_PLOTTER::pen_to( wxPoint aPos, char plume )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
user_to_device_coordinates( aPos ); user_to_device_coordinates( aPos );
...@@ -247,7 +247,7 @@ void Gerber_Plotter::pen_to( wxPoint aPos, char plume ) ...@@ -247,7 +247,7 @@ void Gerber_Plotter::pen_to( wxPoint aPos, char plume )
/**************************************************************************/ /**************************************************************************/
void Gerber_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) void GERBER_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
/**************************************************************************/ /**************************************************************************/
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -264,7 +264,7 @@ void Gerber_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) ...@@ -264,7 +264,7 @@ void Gerber_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
/*************************************************************************************/ /*************************************************************************************/
void Gerber_Plotter::circle( wxPoint aCentre, int aDiameter, FILL_T fill, int aWidth ) void GERBER_PLOTTER::circle( wxPoint aCentre, int aDiameter, FILL_T fill, int aWidth )
/*************************************************************************************/ /*************************************************************************************/
/** Function circle /** Function circle
...@@ -296,7 +296,7 @@ void Gerber_Plotter::circle( wxPoint aCentre, int aDiameter, FILL_T fill, int aW ...@@ -296,7 +296,7 @@ void Gerber_Plotter::circle( wxPoint aCentre, int aDiameter, FILL_T fill, int aW
/***************************************************************/ /***************************************************************/
void Gerber_Plotter::poly( int aCornersCount, int* aCoord, FILL_T aFill, int aWidth ) void GERBER_PLOTTER::poly( int aCornersCount, int* aCoord, FILL_T aFill, int aWidth )
/***************************************************************/ /***************************************************************/
/** Function PlotFilledPolygon_GERBER /** Function PlotFilledPolygon_GERBER
...@@ -338,7 +338,7 @@ void Gerber_Plotter::poly( int aCornersCount, int* aCoord, FILL_T aFill, int aWi ...@@ -338,7 +338,7 @@ void Gerber_Plotter::poly( int aCornersCount, int* aCoord, FILL_T aFill, int aWi
/* Function flash_pad_circle /* Function flash_pad_circle
* Plot a circular pad or via at the user position pos * Plot a circular pad or via at the user position pos
*/ */
void Gerber_Plotter::flash_pad_circle( wxPoint pos, int diametre, void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
{ {
wxASSERT( output_file ); wxASSERT( output_file );
...@@ -354,14 +354,14 @@ void Gerber_Plotter::flash_pad_circle( wxPoint pos, int diametre, ...@@ -354,14 +354,14 @@ void Gerber_Plotter::flash_pad_circle( wxPoint pos, int diametre,
case FILLED: case FILLED:
user_to_device_coordinates( pos ); user_to_device_coordinates( pos );
select_aperture( size, Aperture::Circle ); select_aperture( size, APERTURE::Circle );
fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y ); fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y );
break; break;
} }
} }
void Gerber_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/* Trace 1 pastille PAD_OVAL en position pos_X,Y: /* Trace 1 pastille PAD_OVAL en position pos_X,Y:
...@@ -381,7 +381,7 @@ void Gerber_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -381,7 +381,7 @@ void Gerber_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient,
if( orient == 900 || orient == 2700 ) /* orient tournee de 90 deg */ if( orient == 900 || orient == 2700 ) /* orient tournee de 90 deg */
EXCHG( size.x, size.y ); EXCHG( size.x, size.y );
user_to_device_coordinates( pos ); user_to_device_coordinates( pos );
select_aperture( size, Aperture::Oval ); select_aperture( size, APERTURE::Oval );
fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y ); fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y );
} }
else /* Forme tracee comme un segment */ else /* Forme tracee comme un segment */
...@@ -414,7 +414,7 @@ void Gerber_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -414,7 +414,7 @@ void Gerber_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient,
} }
void Gerber_Plotter::flash_pad_rect( wxPoint pos, wxSize size, void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
int orient, GRTraceMode trace_mode ) int orient, GRTraceMode trace_mode )
/* Plot 1 rectangular pad /* Plot 1 rectangular pad
...@@ -449,7 +449,7 @@ void Gerber_Plotter::flash_pad_rect( wxPoint pos, wxSize size, ...@@ -449,7 +449,7 @@ void Gerber_Plotter::flash_pad_rect( wxPoint pos, wxSize size,
case FILLED: case FILLED:
user_to_device_coordinates( pos ); user_to_device_coordinates( pos );
select_aperture( size, Aperture::Rect ); select_aperture( size, APERTURE::Rect );
fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y ); fprintf( output_file, "X%5.5dY%5.5dD03*\n", pos.x, pos.y );
break; break;
} }
...@@ -463,7 +463,7 @@ void Gerber_Plotter::flash_pad_rect( wxPoint pos, wxSize size, ...@@ -463,7 +463,7 @@ void Gerber_Plotter::flash_pad_rect( wxPoint pos, wxSize size,
} }
void Gerber_Plotter::flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta, void GERBER_PLOTTER::flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta,
int orient, GRTraceMode trace_mode ) int orient, GRTraceMode trace_mode )
/* Trace 1 pad trapezoidal donne par : /* Trace 1 pad trapezoidal donne par :
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
const double SCALE_HPGL = 0.102041; const double SCALE_HPGL = 0.102041;
/***********************************************************************************/ /***********************************************************************************/
void HPGL_Plotter::set_viewport( wxPoint offset, void HPGL_PLOTTER::set_viewport( wxPoint offset, double aScale, int orient )
double aScale, int orient )
/***********************************************************************************/ /***********************************************************************************/
/* Set the plot offset for the current plotting /* Set the plot offset for the current plotting
...@@ -31,7 +30,7 @@ void HPGL_Plotter::set_viewport( wxPoint offset, ...@@ -31,7 +30,7 @@ void HPGL_Plotter::set_viewport( wxPoint offset,
} }
/*****************************************************************/ /*****************************************************************/
void HPGL_Plotter::start_plot( FILE *fout ) void HPGL_PLOTTER::start_plot( FILE *fout )
/*****************************************************************/ /*****************************************************************/
{ {
wxASSERT(!output_file); wxASSERT(!output_file);
...@@ -40,7 +39,7 @@ void HPGL_Plotter::start_plot( FILE *fout ) ...@@ -40,7 +39,7 @@ void HPGL_Plotter::start_plot( FILE *fout )
} }
/**********************************/ /**********************************/
void HPGL_Plotter::end_plot() void HPGL_PLOTTER::end_plot()
/**********************************/ /**********************************/
{ {
wxASSERT(output_file); wxASSERT(output_file);
...@@ -50,7 +49,7 @@ void HPGL_Plotter::end_plot() ...@@ -50,7 +49,7 @@ void HPGL_Plotter::end_plot()
} }
/************************************************************/ /************************************************************/
void HPGL_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) void HPGL_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
/************************************************************/ /************************************************************/
{ {
wxASSERT(output_file); wxASSERT(output_file);
...@@ -61,7 +60,7 @@ void HPGL_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) ...@@ -61,7 +60,7 @@ void HPGL_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
} }
/************************************************************/ /************************************************************/
void HPGL_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width ) void HPGL_PLOTTER::circle( wxPoint centre, int diameter, FILL_T fill, int width )
/************************************************************/ /************************************************************/
{ {
wxASSERT(output_file); wxASSERT(output_file);
...@@ -76,7 +75,7 @@ void HPGL_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width ...@@ -76,7 +75,7 @@ void HPGL_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width
} }
/*****************************************************/ /*****************************************************/
void HPGL_Plotter::poly( int nb, int* coord, FILL_T fill, int width ) void HPGL_PLOTTER::poly( int nb, int* coord, FILL_T fill, int width )
/*****************************************************/ /*****************************************************/
/* Trace un polygone (ferme si rempli) en format HPGL /* Trace un polygone (ferme si rempli) en format HPGL
...@@ -104,7 +103,7 @@ void HPGL_Plotter::poly( int nb, int* coord, FILL_T fill, int width ) ...@@ -104,7 +103,7 @@ void HPGL_Plotter::poly( int nb, int* coord, FILL_T fill, int width )
} }
/***************************/ /***************************/
void HPGL_Plotter::pen_control( int plume ) void HPGL_PLOTTER::pen_control( int plume )
/***************************/ /***************************/
/* leve (plume = 'U') ou baisse (plume = 'D') la plume /* leve (plume = 'U') ou baisse (plume = 'D') la plume
...@@ -136,7 +135,7 @@ void HPGL_Plotter::pen_control( int plume ) ...@@ -136,7 +135,7 @@ void HPGL_Plotter::pen_control( int plume )
} }
/**********************************************/ /**********************************************/
void HPGL_Plotter::pen_to( wxPoint pos, char plume ) void HPGL_PLOTTER::pen_to( wxPoint pos, char plume )
/**********************************************/ /**********************************************/
/* /*
...@@ -160,7 +159,7 @@ void HPGL_Plotter::pen_to( wxPoint pos, char plume ) ...@@ -160,7 +159,7 @@ void HPGL_Plotter::pen_to( wxPoint pos, char plume )
pen_lastpos = pos; pen_lastpos = pos;
} }
void HPGL_Plotter::set_dash( bool dashed ) void HPGL_PLOTTER::set_dash( bool dashed )
{ {
wxASSERT(output_file); wxASSERT(output_file);
if (dashed) if (dashed)
...@@ -169,7 +168,7 @@ void HPGL_Plotter::set_dash( bool dashed ) ...@@ -169,7 +168,7 @@ void HPGL_Plotter::set_dash( bool dashed )
fputs("LI;\n", stderr); fputs("LI;\n", stderr);
} }
void HPGL_Plotter::thick_segment( wxPoint start, wxPoint end, int width, void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,
GRTraceMode tracemode) GRTraceMode tracemode)
/** Function Plot a filled segment (track) /** Function Plot a filled segment (track)
* @param start = starting point * @param start = starting point
...@@ -192,7 +191,7 @@ void HPGL_Plotter::thick_segment( wxPoint start, wxPoint end, int width, ...@@ -192,7 +191,7 @@ void HPGL_Plotter::thick_segment( wxPoint start, wxPoint end, int width,
} }
/********************************************************************/ /********************************************************************/
void HPGL_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, void HPGL_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
FILL_T fill, int width ) FILL_T fill, int width )
/********************************************************************/ /********************************************************************/
...@@ -232,7 +231,7 @@ void HPGL_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, ...@@ -232,7 +231,7 @@ void HPGL_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
} }
/***********************************************************************************/ /***********************************************************************************/
void HPGL_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/************************************************************************************/ /************************************************************************************/
/* Trace 1 pastille PAD_OVAL en position pos_X,Y , de dim size.x, size.y */ /* Trace 1 pastille PAD_OVAL en position pos_X,Y , de dim size.x, size.y */
...@@ -268,7 +267,7 @@ void HPGL_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -268,7 +267,7 @@ void HPGL_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient,
} }
/*******************************************************************************/ /*******************************************************************************/
void HPGL_Plotter::flash_pad_circle(wxPoint pos, int diametre, void HPGL_PLOTTER::flash_pad_circle(wxPoint pos, int diametre,
GRTraceMode trace_mode) GRTraceMode trace_mode)
/*******************************************************************************/ /*******************************************************************************/
/* Trace 1 pastille RONDE (via,pad rond) en position pos */ /* Trace 1 pastille RONDE (via,pad rond) en position pos */
...@@ -311,7 +310,7 @@ void HPGL_Plotter::flash_pad_circle(wxPoint pos, int diametre, ...@@ -311,7 +310,7 @@ void HPGL_Plotter::flash_pad_circle(wxPoint pos, int diametre,
} }
/**************************************************************************/ /**************************************************************************/
void HPGL_Plotter::flash_pad_rect(wxPoint pos, wxSize padsize, void HPGL_PLOTTER::flash_pad_rect(wxPoint pos, wxSize padsize,
int orient, GRTraceMode trace_mode) int orient, GRTraceMode trace_mode)
/**************************************************************************/ /**************************************************************************/
/* /*
...@@ -412,7 +411,7 @@ void HPGL_Plotter::flash_pad_rect(wxPoint pos, wxSize padsize, ...@@ -412,7 +411,7 @@ void HPGL_Plotter::flash_pad_rect(wxPoint pos, wxSize padsize,
} }
/*******************************************************************/ /*******************************************************************/
void HPGL_Plotter::flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta, void HPGL_PLOTTER::flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta,
int orient, GRTraceMode trace_mode ) int orient, GRTraceMode trace_mode )
/*******************************************************************/ /*******************************************************************/
/* /*
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "kicad_string.h" #include "kicad_string.h"
/*************************************************************************************/ /*************************************************************************************/
void PS_Plotter::set_viewport( wxPoint offset, void PS_PLOTTER::set_viewport( wxPoint offset,
double aScale, int orient ) double aScale, int orient )
/*************************************************************************************/ /*************************************************************************************/
...@@ -27,7 +27,7 @@ void PS_Plotter::set_viewport( wxPoint offset, ...@@ -27,7 +27,7 @@ void PS_Plotter::set_viewport( wxPoint offset,
} }
/*************************************************************************************/ /*************************************************************************************/
void PS_Plotter::set_default_line_width( int width ) void PS_PLOTTER::set_default_line_width( int width )
/*************************************************************************************/ /*************************************************************************************/
/* Set the default line width (in 1/1000 inch) for the current plotting /* Set the default line width (in 1/1000 inch) for the current plotting
...@@ -38,7 +38,7 @@ void PS_Plotter::set_default_line_width( int width ) ...@@ -38,7 +38,7 @@ void PS_Plotter::set_default_line_width( int width )
} }
/***************************************/ /***************************************/
void PS_Plotter::set_current_line_width( int width ) void PS_PLOTTER::set_current_line_width( int width )
/***************************************/ /***************************************/
/* Set the Current line width (in 1/1000 inch) for the next plot /* Set the Current line width (in 1/1000 inch) for the next plot
...@@ -61,7 +61,7 @@ void PS_Plotter::set_current_line_width( int width ) ...@@ -61,7 +61,7 @@ void PS_Plotter::set_current_line_width( int width )
/******************************/ /******************************/
void PS_Plotter::set_color( int color ) void PS_PLOTTER::set_color( int color )
/******************************/ /******************************/
/* Print the postscript set color command: /* Print the postscript set color command:
...@@ -114,7 +114,7 @@ void PS_Plotter::set_color( int color ) ...@@ -114,7 +114,7 @@ void PS_Plotter::set_color( int color )
} }
} }
void PS_Plotter::set_dash( bool dashed ) void PS_PLOTTER::set_dash( bool dashed )
{ {
wxASSERT(output_file); wxASSERT(output_file);
if (dashed) if (dashed)
...@@ -124,7 +124,7 @@ void PS_Plotter::set_dash( bool dashed ) ...@@ -124,7 +124,7 @@ void PS_Plotter::set_dash( bool dashed )
} }
/***************************************************************/ /***************************************************************/
void PS_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) void PS_PLOTTER::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
/***************************************************************/ /***************************************************************/
{ {
user_to_device_coordinates( p1 ); user_to_device_coordinates( p1 );
...@@ -136,7 +136,7 @@ void PS_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width ) ...@@ -136,7 +136,7 @@ void PS_Plotter::rect( wxPoint p1, wxPoint p2, FILL_T fill, int width )
} }
/******************************************************/ /******************************************************/
void PS_Plotter::circle( wxPoint pos, int diametre, FILL_T fill, int width ) void PS_PLOTTER::circle( wxPoint pos, int diametre, FILL_T fill, int width )
/******************************************************/ /******************************************************/
{ {
wxASSERT(output_file); wxASSERT(output_file);
...@@ -152,7 +152,7 @@ void PS_Plotter::circle( wxPoint pos, int diametre, FILL_T fill, int width ) ...@@ -152,7 +152,7 @@ void PS_Plotter::circle( wxPoint pos, int diametre, FILL_T fill, int width )
/**************************************************************************************/ /**************************************************************************************/
void PS_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, void PS_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
FILL_T fill, int width ) FILL_T fill, int width )
/**************************************************************************************/ /**************************************************************************************/
...@@ -181,7 +181,7 @@ void PS_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon, ...@@ -181,7 +181,7 @@ void PS_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
/*****************************************************************/ /*****************************************************************/
void PS_Plotter::poly( int nb_segm, int* coord, FILL_T fill, int width ) void PS_PLOTTER::poly( int nb_segm, int* coord, FILL_T fill, int width )
/*****************************************************************/ /*****************************************************************/
/* Draw a polygon ( a filled polygon if fill == 1 ) in POSTSCRIPT format /* Draw a polygon ( a filled polygon if fill == 1 ) in POSTSCRIPT format
...@@ -218,7 +218,7 @@ void PS_Plotter::poly( int nb_segm, int* coord, FILL_T fill, int width ) ...@@ -218,7 +218,7 @@ void PS_Plotter::poly( int nb_segm, int* coord, FILL_T fill, int width )
/*************************************/ /*************************************/
void PS_Plotter::pen_to( wxPoint pos, char plume ) void PS_PLOTTER::pen_to( wxPoint pos, char plume )
/*************************************/ /*************************************/
/* Routine to draw to a new position /* Routine to draw to a new position
...@@ -247,7 +247,7 @@ void PS_Plotter::pen_to( wxPoint pos, char plume ) ...@@ -247,7 +247,7 @@ void PS_Plotter::pen_to( wxPoint pos, char plume )
/***********************************************************/ /***********************************************************/
void PS_Plotter::start_plot( FILE *fout) void PS_PLOTTER::start_plot( FILE *fout)
/***********************************************************/ /***********************************************************/
/* The code within this function (and the CloseFilePS function) /* The code within this function (and the CloseFilePS function)
...@@ -378,7 +378,7 @@ void PS_Plotter::start_plot( FILE *fout) ...@@ -378,7 +378,7 @@ void PS_Plotter::start_plot( FILE *fout)
} }
/******************************************/ /******************************************/
void PS_Plotter::end_plot() void PS_PLOTTER::end_plot()
/******************************************/ /******************************************/
{ {
wxASSERT(output_file); wxASSERT(output_file);
...@@ -388,7 +388,7 @@ void PS_Plotter::end_plot() ...@@ -388,7 +388,7 @@ void PS_Plotter::end_plot()
} }
/***********************************************************************************/ /***********************************************************************************/
void PS_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, void PS_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode modetrace ) GRTraceMode modetrace )
/************************************************************************************/ /************************************************************************************/
...@@ -426,7 +426,7 @@ void PS_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient, ...@@ -426,7 +426,7 @@ void PS_Plotter::flash_pad_oval( wxPoint pos, wxSize size, int orient,
} }
/*******************************************************************************/ /*******************************************************************************/
void PS_Plotter::flash_pad_circle(wxPoint pos, int diametre, void PS_PLOTTER::flash_pad_circle(wxPoint pos, int diametre,
GRTraceMode modetrace) GRTraceMode modetrace)
/*******************************************************************************/ /*******************************************************************************/
/* Trace 1 pastille RONDE (via,pad rond) en position pos_X,Y /* Trace 1 pastille RONDE (via,pad rond) en position pos_X,Y
...@@ -447,7 +447,7 @@ void PS_Plotter::flash_pad_circle(wxPoint pos, int diametre, ...@@ -447,7 +447,7 @@ void PS_Plotter::flash_pad_circle(wxPoint pos, int diametre,
} }
/**************************************************************************/ /**************************************************************************/
void PS_Plotter::flash_pad_rect(wxPoint pos, wxSize size, void PS_PLOTTER::flash_pad_rect(wxPoint pos, wxSize size,
int orient, GRTraceMode trace_mode) int orient, GRTraceMode trace_mode)
/**************************************************************************/ /**************************************************************************/
/* /*
...@@ -488,7 +488,7 @@ void PS_Plotter::flash_pad_rect(wxPoint pos, wxSize size, ...@@ -488,7 +488,7 @@ void PS_Plotter::flash_pad_rect(wxPoint pos, wxSize size,
} }
/*******************************************************************/ /*******************************************************************/
void PS_Plotter::flash_pad_trapez( wxPoint centre, wxSize size, wxSize delta, void PS_PLOTTER::flash_pad_trapez( wxPoint centre, wxSize size, wxSize delta,
int orient, GRTraceMode modetrace ) int orient, GRTraceMode modetrace )
/*******************************************************************/ /*******************************************************************/
/* /*
......
This diff is collapsed.
...@@ -172,7 +172,7 @@ static void DrawGraphicTextPline( ...@@ -172,7 +172,7 @@ static void DrawGraphicTextPline(
int point_count, int point_count,
wxPoint* coord, wxPoint* coord,
void (* aCallback)(int x0, int y0, int xf, int yf ), void (* aCallback)(int x0, int y0, int xf, int yf ),
Plotter *plotter ) PLOTTER *plotter )
{ {
if( plotter ) if( plotter )
{ {
...@@ -242,7 +242,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -242,7 +242,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
bool aItalic, bool aItalic,
bool aBold, bool aBold,
void (* aCallback)( int x0, int y0, int xf, int yf ), void (* aCallback)( int x0, int y0, int xf, int yf ),
Plotter *plotter ) PLOTTER *plotter )
/****************************************************************************************************/ /****************************************************************************************************/
{ {
int AsciiCode; int AsciiCode;
...@@ -520,7 +520,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, ...@@ -520,7 +520,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0) * @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
*/ */
/******************************************************************************************/ /******************************************************************************************/
void Plotter::text( const wxPoint& aPos, void PLOTTER::text( const wxPoint& aPos,
enum EDA_Colors aColor, enum EDA_Colors aColor,
const wxString& aText, const wxString& aText,
int aOrient, int aOrient,
......
...@@ -714,7 +714,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel, ...@@ -714,7 +714,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
* If TextInside then the text is been put inside (moving from x1, y1 in * * If TextInside then the text is been put inside (moving from x1, y1 in *
* the opposite direction to x2,y2), otherwise all is drawn outside. * * the opposite direction to x2,y2), otherwise all is drawn outside. *
*****************************************************************************/ *****************************************************************************/
void LibDrawPin::PlotPinTexts( Plotter *plotter, void LibDrawPin::PlotPinTexts( PLOTTER *plotter,
wxPoint& pin_pos, wxPoint& pin_pos,
int orient, int orient,
int TextInside, int TextInside,
......
...@@ -300,7 +300,7 @@ public: ...@@ -300,7 +300,7 @@ public:
wxPoint& pin_pos, int orient, wxPoint& pin_pos, int orient,
int TextInside, bool DrawPinNum, int TextInside, bool DrawPinNum,
bool DrawPinName, int Color, int DrawMode ); bool DrawPinName, int Color, int DrawMode );
void PlotPinTexts( Plotter *plotter, void PlotPinTexts( PLOTTER *plotter,
wxPoint& pin_pos, wxPoint& pin_pos,
int orient, int orient,
int TextInside, int TextInside,
......
...@@ -182,10 +182,9 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref ) ...@@ -182,10 +182,9 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
fn = m_FileNameCtrl->GetValue(); fn = m_FileNameCtrl->GetValue();
if( !fn.IsOk() ) if( !fn.IsOk() )
{
fn = screen->m_FileName; fn = screen->m_FileName;
fn.SetExt( wxT( "svg" ) ); fn.SetExt( wxT( "svg" ) );
}
bool success = DrawPage( fn.GetFullPath(), screen, aPrint_Sheet_Ref ); bool success = DrawPage( fn.GetFullPath(), screen, aPrint_Sheet_Ref );
msg = _( "Create file " ) + fn.GetFullPath(); msg = _( "Create file " ) + fn.GetFullPath();
......
...@@ -16,17 +16,17 @@ ...@@ -16,17 +16,17 @@
#include "protos.h" #include "protos.h"
/* Local Variables : */ /* Local Variables : */
static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter, static void Plot_Hierarchical_PIN_Sheet( PLOTTER* plotter,
Hierarchical_PIN_Sheet_Struct* Struct ); Hierarchical_PIN_Sheet_Struct* Struct );
static void PlotTextField( Plotter* plotter, SCH_COMPONENT* DrawLibItem, static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
int FieldNumber, int IsMulti, int DrawMode ); int FieldNumber, int IsMulti, int DrawMode );
static void PlotPinSymbol( Plotter* plotter, const wxPoint& pos, static void PlotPinSymbol( PLOTTER* plotter, const wxPoint& pos,
int len, int orient, int Shape ); int len, int orient, int Shape );
/***/ /***/
/**********************************************************/ /**********************************************************/
static void PlotNoConnectStruct( Plotter* plotter, DrawNoConnectStruct* Struct ) static void PlotNoConnectStruct( PLOTTER* plotter, DrawNoConnectStruct* Struct )
/**********************************************************/ /**********************************************************/
/* Routine de dessin des symboles de "No Connexion" .. /* Routine de dessin des symboles de "No Connexion" ..
...@@ -46,7 +46,7 @@ static void PlotNoConnectStruct( Plotter* plotter, DrawNoConnectStruct* Struct ) ...@@ -46,7 +46,7 @@ static void PlotNoConnectStruct( Plotter* plotter, DrawNoConnectStruct* Struct )
/*************************************************/ /*************************************************/
static void PlotLibPart( Plotter* plotter, SCH_COMPONENT* DrawLibItem ) static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
/*************************************************/ /*************************************************/
/* Polt a component */ /* Polt a component */
{ {
...@@ -252,7 +252,7 @@ static void PlotLibPart( Plotter* plotter, SCH_COMPONENT* DrawLibItem ) ...@@ -252,7 +252,7 @@ static void PlotLibPart( Plotter* plotter, SCH_COMPONENT* DrawLibItem )
/*************************************************************/ /*************************************************************/
static void PlotTextField( Plotter* plotter, SCH_COMPONENT* DrawLibItem, static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
int FieldNumber, int IsMulti, int DrawMode ) int FieldNumber, int IsMulti, int DrawMode )
/**************************************************************/ /**************************************************************/
...@@ -398,7 +398,7 @@ static void PlotTextField( Plotter* plotter, SCH_COMPONENT* DrawLibItem, ...@@ -398,7 +398,7 @@ static void PlotTextField( Plotter* plotter, SCH_COMPONENT* DrawLibItem,
/**************************************************************************/ /**************************************************************************/
static void PlotPinSymbol( Plotter* plotter, const wxPoint& pos, static void PlotPinSymbol( PLOTTER* plotter, const wxPoint& pos,
int len, int orient, int Shape ) int len, int orient, int Shape )
/**************************************************************************/ /**************************************************************************/
...@@ -503,7 +503,7 @@ static void PlotPinSymbol( Plotter* plotter, const wxPoint& pos, ...@@ -503,7 +503,7 @@ static void PlotPinSymbol( Plotter* plotter, const wxPoint& pos,
/********************************************************************/ /********************************************************************/
static void PlotTextStruct( Plotter* plotter, SCH_TEXT* aSchText ) static void PlotTextStruct( PLOTTER* plotter, SCH_TEXT* aSchText )
/********************************************************************/ /********************************************************************/
/* /*
...@@ -574,7 +574,7 @@ static void PlotTextStruct( Plotter* plotter, SCH_TEXT* aSchText ) ...@@ -574,7 +574,7 @@ static void PlotTextStruct( Plotter* plotter, SCH_TEXT* aSchText )
/*****************************************************************************************/ /*****************************************************************************************/
static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter, static void Plot_Hierarchical_PIN_Sheet( PLOTTER* plotter,
Hierarchical_PIN_Sheet_Struct* aHierarchical_PIN ) Hierarchical_PIN_Sheet_Struct* aHierarchical_PIN )
/****************************************************************************************/ /****************************************************************************************/
...@@ -619,7 +619,7 @@ static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter, ...@@ -619,7 +619,7 @@ static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter,
/*************************************************/ /*************************************************/
static void PlotSheetStruct( Plotter* plotter, DrawSheetStruct* Struct ) static void PlotSheetStruct( PLOTTER* plotter, DrawSheetStruct* Struct )
/*************************************************/ /*************************************************/
/* Routine de dessin du bloc type hierarchie */ /* Routine de dessin du bloc type hierarchie */
{ {
...@@ -688,7 +688,7 @@ static void PlotSheetStruct( Plotter* plotter, DrawSheetStruct* Struct ) ...@@ -688,7 +688,7 @@ static void PlotSheetStruct( Plotter* plotter, DrawSheetStruct* Struct )
/********************************************************/ /********************************************************/
void PlotDrawlist( Plotter* plotter, SCH_ITEM* aDrawlist ) void PlotDrawlist( PLOTTER* plotter, SCH_ITEM* aDrawlist )
/*********************************************************/ /*********************************************************/
{ {
while( aDrawlist ) /* Plot each item in draw list */ while( aDrawlist ) /* Plot each item in draw list */
......
...@@ -370,7 +370,7 @@ void WinEDA_PlotDXFFrame::PlotOneSheetDXF( const wxString& FileName, ...@@ -370,7 +370,7 @@ void WinEDA_PlotDXFFrame::PlotOneSheetDXF( const wxString& FileName,
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() ); msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
m_MsgBox->AppendText( msg ); m_MsgBox->AppendText( msg );
DXF_Plotter *plotter = new DXF_Plotter(); DXF_PLOTTER *plotter = new DXF_PLOTTER();
plotter->set_paper_size(sheet); plotter->set_paper_size(sheet);
plotter->set_viewport( plot_offset, scale, 0); plotter->set_viewport( plot_offset, scale, 0);
plotter->set_color_mode(PlotDXFColorOpt); plotter->set_color_mode(PlotDXFColorOpt);
......
...@@ -592,7 +592,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FileName, ...@@ -592,7 +592,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FileName,
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() ); msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
m_MsgBox->AppendText( msg ); m_MsgBox->AppendText( msg );
HPGL_Plotter *plotter = new HPGL_Plotter(); HPGL_PLOTTER *plotter = new HPGL_PLOTTER();
plotter->set_paper_size(sheet); plotter->set_paper_size(sheet);
plotter->set_viewport( offset, plot_scale, 0); plotter->set_viewport( offset, plot_scale, 0);
plotter->set_default_line_width( g_DrawDefaultLineThickness ); plotter->set_default_line_width( g_DrawDefaultLineThickness );
......
...@@ -419,7 +419,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName, ...@@ -419,7 +419,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName,
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() ); msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
m_MsgBox->AppendText( msg ); m_MsgBox->AppendText( msg );
PS_Plotter *plotter = new PS_Plotter(); PS_PLOTTER *plotter = new PS_PLOTTER();
plotter->set_paper_size(sheet); plotter->set_paper_size(sheet);
plotter->set_viewport( plot_offset, scale, 0); plotter->set_viewport( plot_offset, scale, 0);
plotter->set_default_line_width( g_DrawDefaultLineThickness ); plotter->set_default_line_width( g_DrawDefaultLineThickness );
......
...@@ -278,7 +278,7 @@ void ReAnnotatePowerSymbolsOnly(); ...@@ -278,7 +278,7 @@ void ReAnnotatePowerSymbolsOnly();
/************/ /************/
/* PLOT.CPP */ /* PLOT.CPP */
/************/ /************/
void PlotDrawlist( Plotter* plotter, SCH_ITEM* drawlist ); void PlotDrawlist( PLOTTER* plotter, SCH_ITEM* drawlist );
/***************/ /***************/
/* DELSHEET.CPP */ /* DELSHEET.CPP */
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base_struct.h" #include "base_struct.h"
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
class Plotter; class PLOTTER;
/** Function Clamp_Text_PenSize /** Function Clamp_Text_PenSize
*As a rule, pen width should not be >1/4em, otherwise the character *As a rule, pen width should not be >1/4em, otherwise the character
...@@ -74,7 +74,7 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel, ...@@ -74,7 +74,7 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel,
bool aItalic, bool aItalic,
bool aBold, bool aBold,
void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL, void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL,
Plotter * plotter = NULL ); PLOTTER * plotter = NULL );
#endif /* __INCLUDE__DRAWTXT_H__ */ #endif /* __INCLUDE__DRAWTXT_H__ */
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#define __INCLUDE__PLOT_COMMON_H__ 1 #define __INCLUDE__PLOT_COMMON_H__ 1
#include <vector> #include <vector>
using namespace std;
#include "drawtxt.h" #include "drawtxt.h"
/** /**
...@@ -25,24 +24,14 @@ enum PlotFormat { ...@@ -25,24 +24,14 @@ enum PlotFormat {
const int PLOT_MIROIR = 1; const int PLOT_MIROIR = 1;
class Plotter class PLOTTER
{ {
public: public:
Plotter() PlotFormat m_PlotType; // type of plot
{ public:
plot_scale = 1; PLOTTER( PlotFormat aPlotType );
default_pen_width = 0;
current_pen_width = -1; /* To-be-set marker */
pen_state = 'Z'; /* End-of-path idle */
plot_orient_options = 0; /* Mirror flag */
output_file = 0;
color_mode = false; /* Start as a BW plot */
negative_mode = false;
sheet = NULL;
}
virtual ~Plotter() virtual ~PLOTTER()
{ {
/* Emergency cleanup */ /* Emergency cleanup */
if( output_file ) if( output_file )
...@@ -52,6 +41,12 @@ public: ...@@ -52,6 +41,12 @@ public:
} }
/** function GetPlotterType()
* @return the format of the plot file
*/
PlotFormat GetPlotterType()
{ return m_PlotType; }
virtual void start_plot( FILE* fout ) = 0; virtual void start_plot( FILE* fout ) = 0;
virtual void end_plot() = 0; virtual void end_plot() = 0;
...@@ -198,9 +193,13 @@ protected: ...@@ -198,9 +193,13 @@ protected:
wxSize paper_size; wxSize paper_size;
}; };
class HPGL_Plotter : public Plotter class HPGL_PLOTTER : public PLOTTER
{ {
public: public:
HPGL_PLOTTER() : PLOTTER(PLOT_FORMAT_HPGL)
{
}
virtual void start_plot( FILE* fout ); virtual void start_plot( FILE* fout );
virtual void end_plot(); virtual void end_plot();
...@@ -270,16 +269,15 @@ protected: ...@@ -270,16 +269,15 @@ protected:
double pen_overlap; double pen_overlap;
}; };
class PS_Plotter : public Plotter class PS_PLOTTER : public PLOTTER
{ {
public: public:
PS_Plotter() PS_PLOTTER() : PLOTTER(PLOT_FORMAT_POST)
{ {
plot_scale_adjX = 1; plot_scale_adjX = 1;
plot_scale_adjY = 1; plot_scale_adjY = 1;
} }
virtual void start_plot( FILE* fout ); virtual void start_plot( FILE* fout );
virtual void end_plot(); virtual void end_plot();
virtual void set_current_line_width( int width ); virtual void set_current_line_width( int width );
...@@ -318,7 +316,7 @@ protected: ...@@ -318,7 +316,7 @@ protected:
/* Class to handle a D_CODE when plotting a board : */ /* Class to handle a D_CODE when plotting a board : */
#define FIRST_DCODE_VALUE 10 // D_CODE < 10 is a command, D_CODE >= 10 is a tool #define FIRST_DCODE_VALUE 10 // D_CODE < 10 is a command, D_CODE >= 10 is a tool
struct Aperture struct APERTURE
{ {
enum Aperture_Type { enum Aperture_Type {
Circle = 1, Circle = 1,
...@@ -335,10 +333,10 @@ struct Aperture ...@@ -335,10 +333,10 @@ struct Aperture
* tool change? */ * tool change? */
}; };
class Gerber_Plotter : public Plotter class GERBER_PLOTTER : public PLOTTER
{ {
public: public:
Gerber_Plotter() GERBER_PLOTTER() : PLOTTER(PLOT_FORMAT_GERBER)
{ {
work_file = 0; work_file = 0;
final_file = 0; final_file = 0;
...@@ -370,21 +368,26 @@ public: ...@@ -370,21 +368,26 @@ public:
int orient, GRTraceMode trace_mode ); int orient, GRTraceMode trace_mode );
protected: protected:
void select_aperture( const wxSize& size, Aperture::Aperture_Type type ); void select_aperture( const wxSize& size,
APERTURE::Aperture_Type type );
vector<Aperture>::iterator get_aperture( const wxSize& size, std::vector<APERTURE>::iterator get_aperture( const wxSize& size,
Aperture::Aperture_Type type ); APERTURE::Aperture_Type type );
FILE* work_file, * final_file; FILE* work_file, * final_file;
void write_aperture_list(); void write_aperture_list();
vector<Aperture> apertures; std::vector<APERTURE> apertures;
vector<Aperture>::iterator current_aperture; std::vector<APERTURE>::iterator current_aperture;
}; };
class DXF_Plotter : public Plotter class DXF_PLOTTER : public PLOTTER
{ {
public: public:
DXF_PLOTTER() : PLOTTER(PLOT_FORMAT_DXF)
{
}
virtual void start_plot( FILE* fout ); virtual void start_plot( FILE* fout );
virtual void end_plot(); virtual void end_plot();
......
...@@ -91,6 +91,7 @@ public: ...@@ -91,6 +91,7 @@ public:
// General // General
virtual void OnCloseWindow( wxCloseEvent& Event ) = 0; virtual void OnCloseWindow( wxCloseEvent& Event ) = 0;
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { } virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) { }
virtual void ReCreateHToolbar() = 0; virtual void ReCreateHToolbar() = 0;
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
...@@ -199,7 +200,9 @@ public: ...@@ -199,7 +200,9 @@ public:
MODULE* module, MODULE* module,
int angle, int angle,
bool incremental ); bool incremental );
void Place_Module( MODULE* module, wxDC* DC, bool aDoNotRecreateRatsnest = false ); void Place_Module( MODULE* module,
wxDC* DC,
bool aDoNotRecreateRatsnest = false );
// module texts // module texts
void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC ); void RotateTextModule( TEXTE_MODULE* Text, wxDC* DC );
...@@ -223,6 +226,7 @@ public: ...@@ -223,6 +226,7 @@ public:
// loading footprints // loading footprints
/** function Get_Librairie_Module /** function Get_Librairie_Module
* *
* Read active libraries or one library to find and load a given module * Read active libraries or one library to find and load a given module
...@@ -267,26 +271,37 @@ public: ...@@ -267,26 +271,37 @@ public:
void Tst_Ratsnest( wxDC* DC, int ref_netcode ); void Tst_Ratsnest( wxDC* DC, int ref_netcode );
void test_connexions( wxDC* DC ); void test_connexions( wxDC* DC );
void test_1_net_connexion( wxDC* DC, int net_code ); void test_1_net_connexion( wxDC* DC, int net_code );
void RecalculateAllTracksNetcode( ); void RecalculateAllTracksNetcode();
// Plotting /* Plotting functions:
*/
void ToPlotter( wxCommandEvent& event ); void ToPlotter( wxCommandEvent& event );
void Genere_GERBER( const wxString& FullFileName, int Layer, void Genere_GERBER( const wxString& FullFileName, int Layer,
bool PlotOriginIsAuxAxis, bool PlotOriginIsAuxAxis, GRTraceMode trace_mode );
void Genere_HPGL( const wxString& FullFileName, int Layer, GRTraceMode trace_mode );
void Genere_PS( const wxString& FullFileName,
int Layer,
bool useA4,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void Genere_HPGL( const wxString& FullFileName, int Layer, void Genere_DXF( const wxString& FullFileName, int Layer, GRTraceMode trace_mode );
GRTraceMode trace_mode); void Plot_Layer( PLOTTER* plotter, int Layer, GRTraceMode trace_mode );
void Genere_PS( const wxString& FullFileName, int Layer, void Plot_Standard_Layer( PLOTTER* plotter, int masque_layer,
bool useA4, GRTraceMode trace_mode );
void Genere_DXF( const wxString& FullFileName, int Layer,
GRTraceMode trace_mode);
void Plot_Layer(Plotter *plotter, int Layer, GRTraceMode trace_mode );
void Plot_Standard_Layer( Plotter *plotter, int masque_layer,
int garde, bool trace_via, int garde, bool trace_via,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void Plot_Serigraphie( Plotter *plotter, int masque_layer, void Plot_Serigraphie( PLOTTER* plotter, int masque_layer, GRTraceMode trace_mode );
GRTraceMode trace_mode);
void PlotDrillMark(Plotter *plotter, GRTraceMode trace_mode ); /** function PlotDrillMark
* Draw a drill mark for pads and vias.
* Must be called after all drawings, because it
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape in FILLED plot mode
* @param aPlotter = the PLOTTER
* @param aTraceMode = the mode of plot (FILLED, SKETCH)
* @param aSmallDrillShape = true to plot a smalle drill shape, false to plot the actual drill shape
*/
void PlotDrillMark( PLOTTER* aPlotter, GRTraceMode aTraceMode, bool aSmallDrillShape );
/* Functions relative to Undo/redo commands:
*/
/** Function SaveCopyInUndoList (virtual pure) /** Function SaveCopyInUndoList (virtual pure)
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
...@@ -296,7 +311,7 @@ public: ...@@ -296,7 +311,7 @@ public:
* @param aTransformPoint = the reference point of the transformation, for commands like move * @param aTransformPoint = the reference point of the transformation, for commands like move
*/ */
virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UndoRedoOpType aTypeCommand, virtual void SaveCopyInUndoList( BOARD_ITEM* aItemToCopy, UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = wxPoint(0,0) ) = 0; const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) = 0;
/** Function SaveCopyInUndoList (virtual pure, overloaded). /** Function SaveCopyInUndoList (virtual pure, overloaded).
* Creates a new entry in undo list of commands. * Creates a new entry in undo list of commands.
...@@ -306,7 +321,7 @@ public: ...@@ -306,7 +321,7 @@ public:
* @param aTransformPoint = the reference point of the transformation, for commands like move * @param aTransformPoint = the reference point of the transformation, for commands like move
*/ */
virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, UndoRedoOpType aTypeCommand, virtual void SaveCopyInUndoList( PICKED_ITEMS_LIST& aItemsList, UndoRedoOpType aTypeCommand,
const wxPoint& aTransformPoint = wxPoint(0,0) ) = 0; const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) = 0;
// layerhandling: // layerhandling:
......
...@@ -45,7 +45,7 @@ class WinEDAChoiceBox; ...@@ -45,7 +45,7 @@ class WinEDAChoiceBox;
class PARAM_CFG_BASE; class PARAM_CFG_BASE;
class Ki_PageDescr; class Ki_PageDescr;
class Ki_HotkeyInfo; class Ki_HotkeyInfo;
class Plotter; class PLOTTER;
enum id_librarytype { enum id_librarytype {
LIBRARY_TYPE_EESCHEMA, LIBRARY_TYPE_EESCHEMA,
...@@ -244,7 +244,7 @@ public: ...@@ -244,7 +244,7 @@ public:
void OnActivate( wxActivateEvent& event ); void OnActivate( wxActivateEvent& event );
void ReDrawPanel(); void ReDrawPanel();
void TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_width ); void TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_width );
void PlotWorkSheet( Plotter *plotter, BASE_SCREEN* screen ); void PlotWorkSheet( PLOTTER *plotter, BASE_SCREEN* screen );
/** Function GetXYSheetReferences /** Function GetXYSheetReferences
* Return the X,Y sheet references where the point position is located * Return the X,Y sheet references where the point position is located
......
#include "wx/msw/wx.rc"
This diff is collapsed.
...@@ -85,7 +85,7 @@ void GenDrillMapFile( BOARD* aPcb, ...@@ -85,7 +85,7 @@ void GenDrillMapFile( BOARD* aPcb,
bool aUnit_Drill_is_Inch, bool aUnit_Drill_is_Inch,
int format, const wxPoint& auxoffset ); int format, const wxPoint& auxoffset );
void Gen_Drill_PcbMap( BOARD* aPcb, Plotter* plotter, void Gen_Drill_PcbMap( BOARD* aPcb, PLOTTER* plotter,
std::vector<HOLE_INFO>& aHoleListBuffer, std::vector<HOLE_INFO>& aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer); std::vector<DRILL_TOOL>& aToolListBuffer);
......
...@@ -577,7 +577,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event ) ...@@ -577,7 +577,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
break; break;
case PLOT_FORMAT_GERBER: case PLOT_FORMAT_GERBER:
m_Drill_Shape_Opt->SetSelection( 0 );
m_Drill_Shape_Opt->Enable( false ); m_Drill_Shape_Opt->Enable( false );
m_PlotModeOpt->SetSelection( 1 ); m_PlotModeOpt->SetSelection( 1 );
m_PlotModeOpt->Enable( false ); m_PlotModeOpt->Enable( false );
...@@ -600,7 +599,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event ) ...@@ -600,7 +599,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
case PLOT_FORMAT_HPGL: case PLOT_FORMAT_HPGL:
m_PlotMirorOpt->Enable( true ); m_PlotMirorOpt->Enable( true );
m_Drill_Shape_Opt->SetSelection( 0 );
m_Drill_Shape_Opt->Enable( false ); m_Drill_Shape_Opt->Enable( false );
m_PlotModeOpt->Enable( true ); m_PlotModeOpt->Enable( true );
m_Choice_Plot_Offset->Enable( false ); m_Choice_Plot_Offset->Enable( false );
...@@ -621,7 +619,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event ) ...@@ -621,7 +619,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
case PLOT_FORMAT_DXF: case PLOT_FORMAT_DXF:
m_PlotMirorOpt->Enable( false ); m_PlotMirorOpt->Enable( false );
m_PlotMirorOpt->SetValue( false ); m_PlotMirorOpt->SetValue( false );
m_Drill_Shape_Opt->SetSelection( 0 );
m_Drill_Shape_Opt->Enable( false ); m_Drill_Shape_Opt->Enable( false );
m_PlotModeOpt->Enable( true ); m_PlotModeOpt->Enable( true );
m_Choice_Plot_Offset->Enable( false ); m_Choice_Plot_Offset->Enable( false );
......
...@@ -70,29 +70,29 @@ extern PCB_Plot_Options g_pcb_plot_options; ...@@ -70,29 +70,29 @@ extern PCB_Plot_Options g_pcb_plot_options;
/*************************************/ /*************************************/
/* PLOT_RTN.CC */ /* PLOT_RTN.CC */
void PlotTextePcb( Plotter* plotter, TEXTE_PCB* pt_texte, int masque_layer, void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
/* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules, /* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules,
* prepare les parametres de trace de texte */ * prepare les parametres de trace de texte */
void PlotDrawSegment( Plotter* plotter, DRAWSEGMENT* PtSegm, int masque_layer, void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* PtSegm, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void PlotCotation( Plotter* plotter, COTATION* Cotation, int masque_layer, void PlotCotation( PLOTTER* plotter, COTATION* Cotation, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void PlotMirePcb( Plotter* plotter, MIREPCB* PtMire, int masque_layer, void PlotMirePcb( PLOTTER* plotter, MIREPCB* PtMire, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void Plot_1_EdgeModule( Plotter* plotter, EDGE_MODULE* PtEdge, void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* PtEdge,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void PlotFilledAreas( Plotter* plotter, ZONE_CONTAINER* aZone, void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
/* PLOTGERB.CPP */ /* PLOTGERB.CPP */
void SelectD_CODE_For_LineDraw( Plotter* plotter, int aSize ); void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize );
#endif /* #define PCBPLOT_H */ #endif /* #define PCBPLOT_H */
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
/* Fonctions locales */ /* Fonctions locales */
static void Plot_Edges_Modules( Plotter* plotter, BOARD* pcb, int masque_layer, static void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
static void PlotTextModule( Plotter* plotter, TEXTE_MODULE* pt_texte, static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
/**********************************************************/ /**********************************************************/
void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter* plotter, void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
int masque_layer, GRTraceMode trace_mode ) int masque_layer, GRTraceMode trace_mode )
/***********************************************************/ /***********************************************************/
...@@ -234,7 +234,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter* plotter, ...@@ -234,7 +234,7 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter* plotter,
/********************************************************************/ /********************************************************************/
static void PlotTextModule( Plotter* plotter, TEXTE_MODULE* pt_texte, static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/********************************************************************/ /********************************************************************/
{ {
...@@ -264,7 +264,7 @@ static void PlotTextModule( Plotter* plotter, TEXTE_MODULE* pt_texte, ...@@ -264,7 +264,7 @@ static void PlotTextModule( Plotter* plotter, TEXTE_MODULE* pt_texte,
/*******************************************************************************/ /*******************************************************************************/
void PlotCotation( Plotter* plotter, COTATION* Cotation, int masque_layer, void PlotCotation( PLOTTER* plotter, COTATION* Cotation, int masque_layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/*******************************************************************************/ /*******************************************************************************/
{ {
...@@ -313,7 +313,7 @@ void PlotCotation( Plotter* plotter, COTATION* Cotation, int masque_layer, ...@@ -313,7 +313,7 @@ void PlotCotation( Plotter* plotter, COTATION* Cotation, int masque_layer,
/*****************************************************************/ /*****************************************************************/
void PlotMirePcb( Plotter* plotter, MIREPCB* Mire, int masque_layer, void PlotMirePcb( PLOTTER* plotter, MIREPCB* Mire, int masque_layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/*****************************************************************/ /*****************************************************************/
{ {
...@@ -359,7 +359,7 @@ void PlotMirePcb( Plotter* plotter, MIREPCB* Mire, int masque_layer, ...@@ -359,7 +359,7 @@ void PlotMirePcb( Plotter* plotter, MIREPCB* Mire, int masque_layer,
/**********************************************************************/ /**********************************************************************/
void Plot_Edges_Modules( Plotter* plotter, BOARD* pcb, int masque_layer, void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int masque_layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/**********************************************************************/ /**********************************************************************/
/* Trace les contours des modules */ /* Trace les contours des modules */
...@@ -383,7 +383,7 @@ void Plot_Edges_Modules( Plotter* plotter, BOARD* pcb, int masque_layer, ...@@ -383,7 +383,7 @@ void Plot_Edges_Modules( Plotter* plotter, BOARD* pcb, int masque_layer,
/**************************************************************/ /**************************************************************/
void Plot_1_EdgeModule( Plotter* plotter, EDGE_MODULE* PtEdge, void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* PtEdge,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/**************************************************************/ /**************************************************************/
/* Trace les contours des modules */ /* Trace les contours des modules */
...@@ -462,7 +462,7 @@ void Plot_1_EdgeModule( Plotter* plotter, EDGE_MODULE* PtEdge, ...@@ -462,7 +462,7 @@ void Plot_1_EdgeModule( Plotter* plotter, EDGE_MODULE* PtEdge,
/****************************************************************************/ /****************************************************************************/
void PlotTextePcb( Plotter* plotter, TEXTE_PCB* pt_texte, int masque_layer, void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/****************************************************************************/ /****************************************************************************/
/* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules */ /* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules */
...@@ -516,7 +516,7 @@ void PlotTextePcb( Plotter* plotter, TEXTE_PCB* pt_texte, int masque_layer, ...@@ -516,7 +516,7 @@ void PlotTextePcb( Plotter* plotter, TEXTE_PCB* pt_texte, int masque_layer,
/*********************************************************/ /*********************************************************/
void PlotFilledAreas( Plotter* plotter, ZONE_CONTAINER* aZone, void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/*********************************************************/ /*********************************************************/
...@@ -598,7 +598,7 @@ void PlotFilledAreas( Plotter* plotter, ZONE_CONTAINER* aZone, ...@@ -598,7 +598,7 @@ void PlotFilledAreas( Plotter* plotter, ZONE_CONTAINER* aZone,
/******************************************************************************/ /******************************************************************************/
void PlotDrawSegment( Plotter* plotter, DRAWSEGMENT* pt_segm, int masque_layer, void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* pt_segm, int masque_layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/******************************************************************************/ /******************************************************************************/
...@@ -649,7 +649,7 @@ void PlotDrawSegment( Plotter* plotter, DRAWSEGMENT* pt_segm, int masque_layer, ...@@ -649,7 +649,7 @@ void PlotDrawSegment( Plotter* plotter, DRAWSEGMENT* pt_segm, int masque_layer,
/*********************************************************************/ /*********************************************************************/
void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer, void WinEDA_BasePcbFrame::Plot_Layer( PLOTTER* plotter, int Layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
/*********************************************************************/ /*********************************************************************/
{ {
...@@ -679,6 +679,17 @@ void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer, ...@@ -679,6 +679,17 @@ void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer,
case LAYER_N_15: case LAYER_N_15:
case LAST_COPPER_LAYER: case LAST_COPPER_LAYER:
Plot_Standard_Layer( plotter, layer_mask, 0, true, trace_mode ); Plot_Standard_Layer( plotter, layer_mask, 0, true, trace_mode );
// Adding drill marks, if required and if the plotter is able to plot them:
if( g_pcb_plot_options.DrillShapeOpt != PCB_Plot_Options::NO_DRILL_SHAPE )
{
if( plotter->GetPlotterType() == PLOT_FORMAT_POST )
PlotDrillMark(
plotter,
trace_mode,
g_pcb_plot_options.DrillShapeOpt ==
PCB_Plot_Options::SMALL_DRILL_SHAPE );
}
break; break;
case SOLDERMASK_N_CU: case SOLDERMASK_N_CU:
...@@ -697,13 +708,11 @@ void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer, ...@@ -697,13 +708,11 @@ void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer,
Plot_Serigraphie( plotter, layer_mask, trace_mode ); Plot_Serigraphie( plotter, layer_mask, trace_mode );
break; break;
} }
PlotDrillMark( plotter, trace_mode );
} }
/*********************************************************************/ /*********************************************************************/
void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter, void WinEDA_BasePcbFrame::Plot_Standard_Layer( PLOTTER* plotter,
int masque_layer, int masque_layer,
int garde, int garde,
bool trace_via, bool trace_via,
...@@ -888,14 +897,16 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter, ...@@ -888,14 +897,16 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
} }
/***********************************************************************************/ /** function PlotDrillMark
void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mode ) * Draw a drill mark for pads and vias.
/***********************************************************************************/
/* Draw a drill mark for pads and vias.
* Must be called after all drawings, because it * Must be called after all drawings, because it
* redraw the drill mark on a pad or via, as a negative (i.e. white) shape * redraw the drill mark on a pad or via, as a negative (i.e. white) shape in FILLED plot mode
* @param aPlotter = the PLOTTER
* @param aTraceMode = the mode of plot (FILLED, SKETCH)
* @param aSmallDrillShape = true to plot a smalle drill shape, false to plot the actual drill shape
*/ */
void WinEDA_BasePcbFrame::PlotDrillMark( PLOTTER* aPlotter, GRTraceMode aTraceMode,
bool aSmallDrillShape )
{ {
const int SMALL_DRILL = 150; const int SMALL_DRILL = 150;
wxPoint pos; wxPoint pos;
...@@ -904,12 +915,9 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod ...@@ -904,12 +915,9 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod
D_PAD* PtPad; D_PAD* PtPad;
TRACK* pts; TRACK* pts;
if( g_pcb_plot_options.DrillShapeOpt == PCB_Plot_Options::NO_DRILL_SHAPE ) if( aTraceMode == FILLED )
return;
if( trace_mode == FILLED )
{ {
plotter->set_color( WHITE ); aPlotter->set_color( WHITE );
} }
for( pts = m_Pcb->m_Track; pts != NULL; pts = pts->Next() ) for( pts = m_Pcb->m_Track; pts != NULL; pts = pts->Next() )
...@@ -922,7 +930,7 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod ...@@ -922,7 +930,7 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod
else else
diam.x = diam.y = pts->GetDrillValue(); diam.x = diam.y = pts->GetDrillValue();
plotter->flash_pad_circle( pos, diam.x, trace_mode ); aPlotter->flash_pad_circle( pos, diam.x, aTraceMode );
} }
for( Module = m_Pcb->m_Modules; for( Module = m_Pcb->m_Modules;
...@@ -941,19 +949,18 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod ...@@ -941,19 +949,18 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod
if( PtPad->m_DrillShape == PAD_OVAL ) if( PtPad->m_DrillShape == PAD_OVAL )
{ {
diam = PtPad->m_Drill; diam = PtPad->m_Drill;
plotter->flash_pad_oval( pos, diam, PtPad->m_Orient, trace_mode ); aPlotter->flash_pad_oval( pos, diam, PtPad->m_Orient, aTraceMode );
} }
else else
{ {
diam.x = (g_pcb_plot_options.DrillShapeOpt == PCB_Plot_Options::SMALL_DRILL_SHAPE) diam.x = aSmallDrillShape ? SMALL_DRILL : PtPad->m_Drill.x;
? SMALL_DRILL : PtPad->m_Drill.x; aPlotter->flash_pad_circle( pos, diam.x, aTraceMode );
plotter->flash_pad_circle( pos, diam.x, trace_mode );
} }
} }
} }
if( trace_mode == FILLED ) if( aTraceMode == FILLED )
{ {
plotter->set_color( BLACK ); aPlotter->set_color( BLACK );
} }
} }
...@@ -32,7 +32,7 @@ void WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer, ...@@ -32,7 +32,7 @@ void WinEDA_BasePcbFrame::Genere_DXF( const wxString& FullFileName, int Layer,
SetLocaleTo_C_standard(); SetLocaleTo_C_standard();
Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN ); Affiche_1_Parametre( this, 0, _( "File" ), FullFileName, CYAN );
DXF_Plotter* plotter = new DXF_Plotter(); DXF_PLOTTER* plotter = new DXF_PLOTTER();
plotter->set_paper_size( currentsheet ); plotter->set_paper_size( currentsheet );
plotter->set_viewport( wxPoint(0,0), 1, 0 ); plotter->set_viewport( wxPoint(0,0), 1, 0 );
plotter->set_creator( wxT( "PCBNEW-DXF" ) ); plotter->set_creator( wxT( "PCBNEW-DXF" ) );
......
...@@ -58,7 +58,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer ...@@ -58,7 +58,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
} }
SetLocaleTo_C_standard(); SetLocaleTo_C_standard();
Plotter* plotter = new Gerber_Plotter(); PLOTTER* plotter = new GERBER_PLOTTER();
/* No mirror and scaling for gerbers! */ /* No mirror and scaling for gerbers! */
plotter->set_viewport( offset, scale, 0 ); plotter->set_viewport( offset, scale, 0 );
plotter->set_default_line_width( g_pcb_plot_options.PlotLine_Width ); plotter->set_default_line_width( g_pcb_plot_options.PlotLine_Width );
......
...@@ -89,7 +89,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer, ...@@ -89,7 +89,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer,
offset.y = 0; offset.y = 0;
} }
HPGL_Plotter* plotter = new HPGL_Plotter(); HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
plotter->set_paper_size( currentsheet ); plotter->set_paper_size( currentsheet );
plotter->set_viewport( offset, scale, plotter->set_viewport( offset, scale,
g_pcb_plot_options.PlotOrient ); g_pcb_plot_options.PlotOrient );
......
...@@ -98,7 +98,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer, ...@@ -98,7 +98,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
offset.y = 0; offset.y = 0;
} }
PS_Plotter* plotter = new PS_Plotter(); PS_PLOTTER* plotter = new PS_PLOTTER();
plotter->set_paper_size( SheetPS ); plotter->set_paper_size( SheetPS );
plotter->set_scale_adjust( g_pcb_plot_options.ScaleAdjX, plotter->set_scale_adjust( g_pcb_plot_options.ScaleAdjX,
g_pcb_plot_options.ScaleAdjY ); g_pcb_plot_options.ScaleAdjY );
......
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