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
bezier_curves.cpp
block_commande.cpp
class_marker_base.cpp
class_plotter.cpp
class_undoredo_container.cpp
common.cpp
common_plot_functions.cpp
......
This diff is collapsed.
......@@ -12,7 +12,7 @@
#include "kicad_string.h"
/***********************************************************************************/
void DXF_Plotter::set_viewport( wxPoint offset,
void DXF_PLOTTER::set_viewport( wxPoint offset,
double aScale, int orient )
/***********************************************************************************/
......@@ -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 );
......@@ -54,7 +54,7 @@ void DXF_Plotter::start_plot( FILE* fout )
/**********************************/
void DXF_Plotter::end_plot()
void DXF_PLOTTER::end_plot()
/**********************************/
{
wxASSERT( output_file );
......@@ -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 )
/************************************************************/
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 );
......@@ -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 );
......@@ -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
......@@ -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 )
}
void DXF_Plotter::set_dash( bool dashed )
void DXF_PLOTTER::set_dash( bool dashed )
{
/* NOP for now */
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 )
/** Function Plot a filled segment (track)
......@@ -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 )
/********************************************************************/
......@@ -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 )
/************************************************************************************/
/* 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,
/*******************************************************************************/
void DXF_Plotter::flash_pad_circle( wxPoint pos, int diametre,
void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode trace_mode )
/*******************************************************************************/
/* Trace 1 pastille RONDE (via,pad rond) en position pos */
......@@ -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 )
/**************************************************************************/
......@@ -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 )
/*******************************************************************/
......
......@@ -14,7 +14,7 @@
/***************************************************************************/
void Gerber_Plotter::set_viewport( wxPoint offset,
void GERBER_PLOTTER::set_viewport( wxPoint offset,
double aScale, int orient )
/***************************************************************************/
......@@ -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
......@@ -70,7 +70,7 @@ void Gerber_Plotter::start_plot( FILE* aFile )
/******************************************************************/
void Gerber_Plotter::end_plot()
void GERBER_PLOTTER::end_plot()
/*****************************************************************/
{
char line[1024];
......@@ -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
......@@ -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
......@@ -127,20 +127,20 @@ void Gerber_Plotter::set_current_line_width( int width )
else
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;
}
/******************************************************/
vector<Aperture>::iterator Gerber_Plotter::get_aperture( const wxSize& size,
Aperture::Aperture_Type type )
std::vector<APERTURE>::iterator GERBER_PLOTTER::get_aperture( const wxSize& size,
APERTURE::Aperture_Type type )
/******************************************************/
{
int last_D_code = 9;
// Search an existing aperture
vector<Aperture>::iterator tool = apertures.begin();
std::vector<APERTURE>::iterator tool = apertures.begin();
while( tool != apertures.end() )
{
last_D_code = tool->D_code;
......@@ -151,7 +151,7 @@ vector<Aperture>::iterator Gerber_Plotter::get_aperture( const wxSize&
}
// Allocate a new aperture
Aperture new_tool;
APERTURE new_tool;
new_tool.size = size;
new_tool.type = type;
new_tool.D_code = last_D_code + 1;
......@@ -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 );
......@@ -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
......@@ -189,7 +189,7 @@ void Gerber_Plotter::write_aperture_list()
char cbuf[1024];
/* Init : */
for( vector<Aperture>::iterator tool = apertures.begin();
for( std::vector<APERTURE>::iterator tool = apertures.begin();
tool != apertures.end(); tool++ )
{
const float fscale = 0.0001f * plot_scale; // For 3.4 format
......@@ -199,20 +199,20 @@ void Gerber_Plotter::write_aperture_list()
switch( tool->type )
{
case Aperture::Circle:
case APERTURE::Circle:
sprintf( text, "C,%f*%%\n", tool->size.x * fscale );
break;
case Aperture::Rect:
case APERTURE::Rect:
sprintf( text, "R,%fX%f*%%\n", tool->size.x * fscale,
tool->size.y * fscale );
break;
case Aperture::Plotting:
case APERTURE::Plotting:
sprintf( text, "C,%f*%%\n", tool->size.x * fscale );
break;
case Aperture::Oval:
case APERTURE::Oval:
sprintf( text, "O,%fX%f*%%\n", tool->size.x * fscale,
tool->size.y * fscale );
break;
......@@ -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 );
user_to_device_coordinates( aPos );
......@@ -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 );
......@@ -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
......@@ -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
......@@ -338,7 +338,7 @@ void Gerber_Plotter::poly( int aCornersCount, int* aCoord, FILL_T aFill, int aWi
/* Function flash_pad_circle
* 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 )
{
wxASSERT( output_file );
......@@ -354,14 +354,14 @@ void Gerber_Plotter::flash_pad_circle( wxPoint pos, int diametre,
case FILLED:
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 );
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 )
/* 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,
if( orient == 900 || orient == 2700 ) /* orient tournee de 90 deg */
EXCHG( size.x, size.y );
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 );
}
else /* Forme tracee comme un segment */
......@@ -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 )
/* Plot 1 rectangular pad
......@@ -449,7 +449,7 @@ void Gerber_Plotter::flash_pad_rect( wxPoint pos, wxSize size,
case FILLED:
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 );
break;
}
......@@ -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 )
/* Trace 1 pad trapezoidal donne par :
......
......@@ -15,8 +15,7 @@
const double SCALE_HPGL = 0.102041;
/***********************************************************************************/
void HPGL_Plotter::set_viewport( wxPoint offset,
double aScale, int orient )
void HPGL_PLOTTER::set_viewport( wxPoint offset, double aScale, int orient )
/***********************************************************************************/
/* Set the plot offset for the current plotting
......@@ -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);
......@@ -40,7 +39,7 @@ void HPGL_Plotter::start_plot( FILE *fout )
}
/**********************************/
void HPGL_Plotter::end_plot()
void HPGL_PLOTTER::end_plot()
/**********************************/
{
wxASSERT(output_file);
......@@ -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);
......@@ -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);
......@@ -71,12 +70,12 @@ void HPGL_Plotter::circle( wxPoint centre, int diameter, FILL_T fill, int width
{
move_to(centre);
fprintf( output_file, "CI %g;\n", rayon);
pen_finish();
pen_finish();
}
}
/*****************************************************/
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
......@@ -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
......@@ -120,7 +119,7 @@ void HPGL_Plotter::pen_control( int plume )
}
break;
case 'D':
if( pen_state != 'D' )
if( pen_state != 'D' )
{
fputs( "PD;", output_file );
pen_state = 'D';
......@@ -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 )
/**********************************************/
/*
......@@ -156,11 +155,11 @@ void HPGL_Plotter::pen_to( wxPoint pos, char plume )
user_to_device_coordinates( pos );
if (pen_lastpos != pos)
fprintf( output_file, "PA %d,%d;\n", pos.x, pos.y );
fprintf( output_file, "PA %d,%d;\n", pos.x, pos.y );
pen_lastpos = pos;
}
void HPGL_Plotter::set_dash( bool dashed )
void HPGL_PLOTTER::set_dash( bool dashed )
{
wxASSERT(output_file);
if (dashed)
......@@ -169,7 +168,7 @@ void HPGL_Plotter::set_dash( bool dashed )
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)
/** Function Plot a filled segment (track)
* @param start = starting point
......@@ -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 )
/********************************************************************/
......@@ -213,7 +212,7 @@ void HPGL_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
if( rayon <= 0 )
return;
cpos = centre;
cpos = centre;
user_to_device_coordinates( cpos );
if( plot_orient_options == PLOT_MIROIR )
......@@ -226,13 +225,13 @@ void HPGL_Plotter::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
user_to_device_coordinates( cmap );
fprintf( output_file, "PU;PA %d,%d;PD;AA %d,%d, ", cmap.x, cmap.y, cpos.x, cpos.y );
fprintf( output_file, "%f", angle );
fprintf( output_file, "%f", angle );
fprintf( output_file, ";PU;\n" );
pen_finish();
}
/***********************************************************************************/
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 )
/************************************************************************************/
/* 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,
}
/*******************************************************************************/
void HPGL_Plotter::flash_pad_circle(wxPoint pos, int diametre,
void HPGL_PLOTTER::flash_pad_circle(wxPoint pos, int diametre,
GRTraceMode trace_mode)
/*******************************************************************************/
/* Trace 1 pastille RONDE (via,pad rond) en position pos */
......@@ -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)
/**************************************************************************/
/*
......@@ -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 )
/*******************************************************************/
/*
......
......@@ -12,7 +12,7 @@
#include "kicad_string.h"
/*************************************************************************************/
void PS_Plotter::set_viewport( wxPoint offset,
void PS_PLOTTER::set_viewport( wxPoint offset,
double aScale, int orient )
/*************************************************************************************/
......@@ -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
......@@ -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
......@@ -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:
......@@ -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);
if (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 );
......@@ -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);
......@@ -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 )
/**************************************************************************************/
......@@ -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
......@@ -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
......@@ -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)
......@@ -378,7 +378,7 @@ void PS_Plotter::start_plot( FILE *fout)
}
/******************************************/
void PS_Plotter::end_plot()
void PS_PLOTTER::end_plot()
/******************************************/
{
wxASSERT(output_file);
......@@ -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 )
/************************************************************************************/
......@@ -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)
/*******************************************************************************/
/* 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,
}
/**************************************************************************/
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)
/**************************************************************************/
/*
......@@ -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 )
/*******************************************************************/
/*
......
This diff is collapsed.
......@@ -172,7 +172,7 @@ static void DrawGraphicTextPline(
int point_count,
wxPoint* coord,
void (* aCallback)(int x0, int y0, int xf, int yf ),
Plotter *plotter )
PLOTTER *plotter )
{
if( plotter )
{
......@@ -242,7 +242,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel,
bool aItalic,
bool aBold,
void (* aCallback)( int x0, int y0, int xf, int yf ),
Plotter *plotter )
PLOTTER *plotter )
/****************************************************************************************************/
{
int AsciiCode;
......@@ -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)
*/
/******************************************************************************************/
void Plotter::text( const wxPoint& aPos,
void PLOTTER::text( const wxPoint& aPos,
enum EDA_Colors aColor,
const wxString& aText,
int aOrient,
......
......@@ -714,7 +714,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
* 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. *
*****************************************************************************/
void LibDrawPin::PlotPinTexts( Plotter *plotter,
void LibDrawPin::PlotPinTexts( PLOTTER *plotter,
wxPoint& pin_pos,
int orient,
int TextInside,
......
......@@ -300,7 +300,7 @@ public:
wxPoint& pin_pos, int orient,
int TextInside, bool DrawPinNum,
bool DrawPinName, int Color, int DrawMode );
void PlotPinTexts( Plotter *plotter,
void PlotPinTexts( PLOTTER *plotter,
wxPoint& pin_pos,
int orient,
int TextInside,
......
......@@ -182,10 +182,9 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Sheet_Ref )
fn = m_FileNameCtrl->GetValue();
if( !fn.IsOk() )
{
fn = screen->m_FileName;
fn.SetExt( wxT( "svg" ) );
}
fn.SetExt( wxT( "svg" ) );
bool success = DrawPage( fn.GetFullPath(), screen, aPrint_Sheet_Ref );
msg = _( "Create file " ) + fn.GetFullPath();
......
......@@ -16,17 +16,17 @@
#include "protos.h"
/* Local Variables : */
static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter,
static void Plot_Hierarchical_PIN_Sheet( PLOTTER* plotter,
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 );
static void PlotPinSymbol( Plotter* plotter, const wxPoint& pos,
static void PlotPinSymbol( PLOTTER* plotter, const wxPoint& pos,
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" ..
......@@ -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 */
{
......@@ -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 )
/**************************************************************/
......@@ -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 )
/**************************************************************************/
......@@ -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 )
/*****************************************************************************************/
static void Plot_Hierarchical_PIN_Sheet( Plotter* plotter,
static void Plot_Hierarchical_PIN_Sheet( PLOTTER* plotter,
Hierarchical_PIN_Sheet_Struct* aHierarchical_PIN )
/****************************************************************************************/
......@@ -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 */
{
......@@ -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 */
......
......@@ -370,7 +370,7 @@ void WinEDA_PlotDXFFrame::PlotOneSheetDXF( const wxString& FileName,
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
m_MsgBox->AppendText( msg );
DXF_Plotter *plotter = new DXF_Plotter();
DXF_PLOTTER *plotter = new DXF_PLOTTER();
plotter->set_paper_size(sheet);
plotter->set_viewport( plot_offset, scale, 0);
plotter->set_color_mode(PlotDXFColorOpt);
......
......@@ -592,7 +592,7 @@ void WinEDA_PlotHPGLFrame::Plot_1_Page_HPGL( const wxString& FileName,
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
m_MsgBox->AppendText( msg );
HPGL_Plotter *plotter = new HPGL_Plotter();
HPGL_PLOTTER *plotter = new HPGL_PLOTTER();
plotter->set_paper_size(sheet);
plotter->set_viewport( offset, plot_scale, 0);
plotter->set_default_line_width( g_DrawDefaultLineThickness );
......
......@@ -419,7 +419,7 @@ void WinEDA_PlotPSFrame::PlotOneSheetPS( const wxString& FileName,
msg.Printf( _( "Plot: %s\n" ), FileName.GetData() );
m_MsgBox->AppendText( msg );
PS_Plotter *plotter = new PS_Plotter();
PS_PLOTTER *plotter = new PS_PLOTTER();
plotter->set_paper_size(sheet);
plotter->set_viewport( plot_offset, scale, 0);
plotter->set_default_line_width( g_DrawDefaultLineThickness );
......
......@@ -278,7 +278,7 @@ void ReAnnotatePowerSymbolsOnly();
/************/
/* PLOT.CPP */
/************/
void PlotDrawlist( Plotter* plotter, SCH_ITEM* drawlist );
void PlotDrawlist( PLOTTER* plotter, SCH_ITEM* drawlist );
/***************/
/* DELSHEET.CPP */
......
......@@ -10,7 +10,7 @@
#include "base_struct.h"
class WinEDA_DrawPanel;
class Plotter;
class PLOTTER;
/** Function Clamp_Text_PenSize
*As a rule, pen width should not be >1/4em, otherwise the character
......@@ -74,7 +74,7 @@ void DrawGraphicText( WinEDA_DrawPanel * aPanel,
bool aItalic,
bool aBold,
void (*aCallback)( int x0, int y0, int xf, int yf ) = NULL,
Plotter * plotter = NULL );
PLOTTER * plotter = NULL );
#endif /* __INCLUDE__DRAWTXT_H__ */
......@@ -9,7 +9,6 @@
#define __INCLUDE__PLOT_COMMON_H__ 1
#include <vector>
using namespace std;
#include "drawtxt.h"
/**
......@@ -25,24 +24,14 @@ enum PlotFormat {
const int PLOT_MIROIR = 1;
class Plotter
class PLOTTER
{
public:
Plotter()
{
plot_scale = 1;
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;
}
PlotFormat m_PlotType; // type of plot
public:
PLOTTER( PlotFormat aPlotType );
virtual ~Plotter()
virtual ~PLOTTER()
{
/* Emergency cleanup */
if( output_file )
......@@ -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 end_plot() = 0;
......@@ -198,9 +193,13 @@ protected:
wxSize paper_size;
};
class HPGL_Plotter : public Plotter
class HPGL_PLOTTER : public PLOTTER
{
public:
HPGL_PLOTTER() : PLOTTER(PLOT_FORMAT_HPGL)
{
}
virtual void start_plot( FILE* fout );
virtual void end_plot();
......@@ -270,16 +269,15 @@ protected:
double pen_overlap;
};
class PS_Plotter : public Plotter
class PS_PLOTTER : public PLOTTER
{
public:
PS_Plotter()
PS_PLOTTER() : PLOTTER(PLOT_FORMAT_POST)
{
plot_scale_adjX = 1;
plot_scale_adjY = 1;
}
virtual void start_plot( FILE* fout );
virtual void end_plot();
virtual void set_current_line_width( int width );
......@@ -318,7 +316,7 @@ protected:
/* 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
struct Aperture
struct APERTURE
{
enum Aperture_Type {
Circle = 1,
......@@ -335,10 +333,10 @@ struct Aperture
* tool change? */
};
class Gerber_Plotter : public Plotter
class GERBER_PLOTTER : public PLOTTER
{
public:
Gerber_Plotter()
GERBER_PLOTTER() : PLOTTER(PLOT_FORMAT_GERBER)
{
work_file = 0;
final_file = 0;
......@@ -346,45 +344,50 @@ public:
}
virtual void start_plot( FILE* fout );
virtual void end_plot();
virtual void set_current_line_width( int width );
virtual void set_default_line_width( int width );
virtual void start_plot( FILE* fout );
virtual void end_plot();
virtual void set_current_line_width( int width );
virtual void set_default_line_width( int width );
/* RS274X has no dashing, nor colours */
virtual void set_dash( bool dashed ) {};
virtual void set_color( int color ) {};
virtual void set_viewport( wxPoint offset,
double scale, int orient );
virtual void rect( wxPoint p1, wxPoint p2, FILL_T fill, int width = -1 );
virtual void circle( wxPoint pos, int diametre, FILL_T fill, int width = -1 );
virtual void poly( int nb_segm, int* coord, FILL_T fill, int width = -1 );
virtual void pen_to( wxPoint pos, char plume );
virtual void flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode trace_mode );
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode );
virtual void flash_pad_rect( wxPoint pos, wxSize size,
int orient, GRTraceMode trace_mode );
virtual void flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta,
int orient, GRTraceMode trace_mode );
virtual void set_viewport( wxPoint offset,
double scale, int orient );
virtual void rect( wxPoint p1, wxPoint p2, FILL_T fill, int width = -1 );
virtual void circle( wxPoint pos, int diametre, FILL_T fill, int width = -1 );
virtual void poly( int nb_segm, int* coord, FILL_T fill, int width = -1 );
virtual void pen_to( wxPoint pos, char plume );
virtual void flash_pad_circle( wxPoint pos, int diametre,
GRTraceMode trace_mode );
virtual void flash_pad_oval( wxPoint pos, wxSize size, int orient,
GRTraceMode trace_mode );
virtual void flash_pad_rect( wxPoint pos, wxSize size,
int orient, GRTraceMode trace_mode );
virtual void flash_pad_trapez( wxPoint pos, wxSize size, wxSize delta,
int orient, GRTraceMode trace_mode );
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,
Aperture::Aperture_Type type );
std::vector<APERTURE>::iterator get_aperture( const wxSize& size,
APERTURE::Aperture_Type type );
FILE* work_file, * final_file;
void write_aperture_list();
FILE* work_file, * final_file;
void write_aperture_list();
vector<Aperture> apertures;
vector<Aperture>::iterator current_aperture;
std::vector<APERTURE> apertures;
std::vector<APERTURE>::iterator current_aperture;
};
class DXF_Plotter : public Plotter
class DXF_PLOTTER : public PLOTTER
{
public:
DXF_PLOTTER() : PLOTTER(PLOT_FORMAT_DXF)
{
}
virtual void start_plot( FILE* fout );
virtual void end_plot();
......@@ -394,10 +397,10 @@ public:
/* Handy override */
current_pen_width = 0;
};
virtual void set_default_line_width( int width )
virtual void set_default_line_width( int width )
{
/* DXF lines are infinitesimal */
default_pen_width = 0;
/* DXF lines are infinitesimal */
default_pen_width = 0;
};
virtual void set_dash( bool dashed );
......@@ -423,7 +426,7 @@ public:
int orient, GRTraceMode trace_mode );
protected:
int current_color;
int current_color;
};
#endif /* __INCLUDE__PLOT_COMMON_H__ */
This diff is collapsed.
......@@ -45,7 +45,7 @@ class WinEDAChoiceBox;
class PARAM_CFG_BASE;
class Ki_PageDescr;
class Ki_HotkeyInfo;
class Plotter;
class PLOTTER;
enum id_librarytype {
LIBRARY_TYPE_EESCHEMA,
......@@ -244,7 +244,7 @@ public:
void OnActivate( wxActivateEvent& event );
void ReDrawPanel();
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
* 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,
bool aUnit_Drill_is_Inch,
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<DRILL_TOOL>& aToolListBuffer);
......@@ -95,8 +95,8 @@ void Gen_Drill_PcbMap( BOARD* aPcb, Plotter* plotter,
*/
void GenDrillReportFile( FILE* aFile, BOARD * aPcb, const wxString& aBoardFilename,
bool aUnit_Drill_is_Inch,
std::vector<HOLE_INFO> & aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer
std::vector<HOLE_INFO> & aHoleListBuffer,
std::vector<DRILL_TOOL>& aToolListBuffer
);
#endif // #ifndef GENDRILL_H
......@@ -577,7 +577,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
break;
case PLOT_FORMAT_GERBER:
m_Drill_Shape_Opt->SetSelection( 0 );
m_Drill_Shape_Opt->Enable( false );
m_PlotModeOpt->SetSelection( 1 );
m_PlotModeOpt->Enable( false );
......@@ -600,7 +599,6 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
case PLOT_FORMAT_HPGL:
m_PlotMirorOpt->Enable( true );
m_Drill_Shape_Opt->SetSelection( 0 );
m_Drill_Shape_Opt->Enable( false );
m_PlotModeOpt->Enable( true );
m_Choice_Plot_Offset->Enable( false );
......@@ -620,8 +618,7 @@ void WinEDA_PlotFrame::SetCommands( wxCommandEvent& event )
case PLOT_FORMAT_DXF:
m_PlotMirorOpt->Enable( false );
m_PlotMirorOpt->SetValue( false );
m_Drill_Shape_Opt->SetSelection( 0 );
m_PlotMirorOpt->SetValue( false );
m_Drill_Shape_Opt->Enable( false );
m_PlotModeOpt->Enable( true );
m_Choice_Plot_Offset->Enable( false );
......
......@@ -70,29 +70,29 @@ extern PCB_Plot_Options g_pcb_plot_options;
/*************************************/
/* 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 );
/* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules,
* 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 );
void PlotCotation( Plotter* plotter, COTATION* Cotation, int masque_layer,
void PlotCotation( PLOTTER* plotter, COTATION* Cotation, int masque_layer,
GRTraceMode trace_mode );
void PlotMirePcb( Plotter* plotter, MIREPCB* PtMire, int masque_layer,
void PlotMirePcb( PLOTTER* plotter, MIREPCB* PtMire, int masque_layer,
GRTraceMode trace_mode );
void Plot_1_EdgeModule( Plotter* plotter, EDGE_MODULE* PtEdge,
void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* PtEdge,
GRTraceMode trace_mode );
void PlotFilledAreas( Plotter* plotter, ZONE_CONTAINER* aZone,
void PlotFilledAreas( PLOTTER* plotter, ZONE_CONTAINER* aZone,
GRTraceMode trace_mode );
/* PLOTGERB.CPP */
void SelectD_CODE_For_LineDraw( Plotter* plotter, int aSize );
void SelectD_CODE_For_LineDraw( PLOTTER* plotter, int aSize );
#endif /* #define PCBPLOT_H */
......@@ -16,13 +16,13 @@
/* 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 );
static void PlotTextModule( Plotter* plotter, TEXTE_MODULE* pt_texte,
static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte,
GRTraceMode trace_mode );
/**********************************************************/
void WinEDA_BasePcbFrame::Plot_Serigraphie( Plotter* plotter,
void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
int masque_layer, GRTraceMode trace_mode )
/***********************************************************/
......@@ -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 )
/********************************************************************/
{
......@@ -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 )
/*******************************************************************************/
{
......@@ -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 )
/*****************************************************************/
{
......@@ -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 )
/**********************************************************************/
/* Trace les contours des modules */
......@@ -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 )
/**************************************************************/
/* Trace les contours des modules */
......@@ -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 )
/****************************************************************************/
/* Trace 1 Texte type PCB , c.a.d autre que les textes sur modules */
......@@ -477,8 +477,8 @@ void PlotTextePcb( Plotter* plotter, TEXTE_PCB* pt_texte, int masque_layer,
return;
/* calcul des parametres du texte :*/
size = pt_texte->m_Size;
pos = pt_texte->m_Pos;
size = pt_texte->m_Size;
pos = pt_texte->m_Pos;
orient = pt_texte->m_Orient;
thickness = (trace_mode==FILAIRE) ? -1 : pt_texte->m_Width;
......@@ -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 )
/*********************************************************/
......@@ -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 )
/******************************************************************************/
......@@ -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 )
/*********************************************************************/
{
......@@ -679,6 +679,17 @@ void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer,
case LAYER_N_15:
case LAST_COPPER_LAYER:
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;
case SOLDERMASK_N_CU:
......@@ -697,13 +708,11 @@ void WinEDA_BasePcbFrame::Plot_Layer( Plotter* plotter, int Layer,
Plot_Serigraphie( plotter, layer_mask, trace_mode );
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 garde,
bool trace_via,
......@@ -888,14 +897,16 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( Plotter* plotter,
}
/***********************************************************************************/
void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mode )
/***********************************************************************************/
/* Draw a drill mark for pads and vias.
/** 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
* 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;
wxPoint pos;
......@@ -904,12 +915,9 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod
D_PAD* PtPad;
TRACK* pts;
if( g_pcb_plot_options.DrillShapeOpt == PCB_Plot_Options::NO_DRILL_SHAPE )
return;
if( trace_mode == FILLED )
if( aTraceMode == FILLED )
{
plotter->set_color( WHITE );
aPlotter->set_color( WHITE );
}
for( pts = m_Pcb->m_Track; pts != NULL; pts = pts->Next() )
......@@ -922,7 +930,7 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod
else
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;
......@@ -941,19 +949,18 @@ void WinEDA_BasePcbFrame::PlotDrillMark( Plotter* plotter, GRTraceMode trace_mod
if( PtPad->m_DrillShape == PAD_OVAL )
{
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
{
diam.x = (g_pcb_plot_options.DrillShapeOpt == PCB_Plot_Options::SMALL_DRILL_SHAPE)
? SMALL_DRILL : PtPad->m_Drill.x;
plotter->flash_pad_circle( pos, diam.x, trace_mode );
diam.x = aSmallDrillShape ? SMALL_DRILL : PtPad->m_Drill.x;
aPlotter->flash_pad_circle( pos, diam.x, aTraceMode );
}
}
}
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,
SetLocaleTo_C_standard();
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_viewport( wxPoint(0,0), 1, 0 );
plotter->set_creator( wxT( "PCBNEW-DXF" ) );
......
......@@ -58,7 +58,7 @@ void WinEDA_BasePcbFrame::Genere_GERBER( const wxString& FullFileName, int Layer
}
SetLocaleTo_C_standard();
Plotter* plotter = new Gerber_Plotter();
PLOTTER* plotter = new GERBER_PLOTTER();
/* No mirror and scaling for gerbers! */
plotter->set_viewport( offset, scale, 0 );
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,
offset.y = 0;
}
HPGL_Plotter* plotter = new HPGL_Plotter();
HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
plotter->set_paper_size( currentsheet );
plotter->set_viewport( offset, scale,
g_pcb_plot_options.PlotOrient );
......
......@@ -98,7 +98,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer,
offset.y = 0;
}
PS_Plotter* plotter = new PS_Plotter();
PS_PLOTTER* plotter = new PS_PLOTTER();
plotter->set_paper_size( SheetPS );
plotter->set_scale_adjust( g_pcb_plot_options.ScaleAdjX,
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