Commit e9f557e6 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pcbnew plot functions: code cleanup, coding policy fixes and minor enhancements

parent dd5386db
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@
#endif
#endif


#ifndef KICAD_BUILD_VERSION
#ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2010-04-19 BZR 23xx)"
#define KICAD_BUILD_VERSION "(2010-12-10 BZR 26xx)"
#endif
#endif


//#define VERSION_STABILITY      "stable"
//#define VERSION_STABILITY      "stable"
+2 −2
Original line number Original line Diff line number Diff line
@@ -28,7 +28,7 @@ PLOTTER::PLOTTER( PlotFormat aPlotType )
    default_pen_width = 0;
    default_pen_width = 0;
    current_pen_width = -1;     /* To-be-set marker */
    current_pen_width = -1;     /* To-be-set marker */
    pen_state = 'Z';            /* End-of-path idle */
    pen_state = 'Z';            /* End-of-path idle */
    plot_orient_options = 0;    /* Mirror flag */
    plotMirror = 0;    /* Mirror flag */
    output_file   = 0;
    output_file   = 0;
    color_mode    = false;      /* Start as a BW plot */
    color_mode    = false;      /* Start as a BW plot */
    negative_mode = false;
    negative_mode = false;
@@ -43,7 +43,7 @@ void PLOTTER::user_to_device_coordinates( wxPoint& pos )
{
{
    pos.x = (int) ( (pos.x - plot_offset.x) * plot_scale * device_scale );
    pos.x = (int) ( (pos.x - plot_offset.x) * plot_scale * device_scale );


    if( plot_orient_options == PLOT_MIROIR )
    if( plotMirror )
        pos.y = (int) ( ( pos.y - plot_offset.y ) * plot_scale * device_scale );
        pos.y = (int) ( ( pos.y - plot_offset.y ) * plot_scale * device_scale );
    else
    else
        pos.y = (int) ( ( paper_size.y - ( pos.y - plot_offset.y )
        pos.y = (int) ( ( paper_size.y - ( pos.y - plot_offset.y )
+3 −4
Original line number Original line Diff line number Diff line
@@ -14,15 +14,14 @@


/* Set the plot offset for the current plotting
/* Set the plot offset for the current plotting
 */
 */
void DXF_PLOTTER::set_viewport( wxPoint offset,
void DXF_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
                                double aScale, int orient )
{
{
    wxASSERT( !output_file );
    wxASSERT( !output_file );
    plot_offset  = offset;
    plot_offset  = aOffset;
    plot_scale   = aScale;
    plot_scale   = aScale;
    device_scale = 1;
    device_scale = 1;
    set_default_line_width( 0 );    /* No line width on DXF */
    set_default_line_width( 0 );    /* No line width on DXF */
    plot_orient_options = 0;        /* No mirroring on DXF */
    plotMirror = false;             /* No mirroring on DXF */
    current_color = BLACK;
    current_color = BLACK;
}
}


+4 −5
Original line number Original line Diff line number Diff line
@@ -21,13 +21,12 @@
 * @param aOffset = plot offset
 * @param aOffset = plot offset
 * @param aScale = coordinate scale (scale coefficient for coordinates)
 * @param aScale = coordinate scale (scale coefficient for coordinates)
 */
 */
void GERBER_PLOTTER::set_viewport( wxPoint offset,
void GERBER_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
                                   double aScale, int orient )
{
{
    wxASSERT( !output_file );
    wxASSERT( !output_file );
    wxASSERT( orient == 0 );
    wxASSERT( aMirror == false );
    plot_orient_options = 0;
    plotMirror = false;
    plot_offset = offset;
    plot_offset = aOffset;
    wxASSERT( aScale == 1 );
    wxASSERT( aScale == 1 );
    plot_scale   = 1;
    plot_scale   = 1;
    device_scale = 1;
    device_scale = 1;
+4 −4
Original line number Original line Diff line number Diff line
@@ -17,14 +17,14 @@ const double SCALE_HPGL = 0.102041;


/* Set the plot offset for the current plotting
/* Set the plot offset for the current plotting
 */
 */
void HPGL_PLOTTER::set_viewport( wxPoint offset, double aScale, int orient )
void HPGL_PLOTTER::set_viewport( wxPoint aOffset, double aScale, bool aMirror )
{
{
    wxASSERT( !output_file );
    wxASSERT( !output_file );
    plot_offset  = offset;
    plot_offset  = aOffset;
    plot_scale   = aScale;
    plot_scale   = aScale;
    device_scale = SCALE_HPGL;
    device_scale = SCALE_HPGL;
    set_default_line_width( 100 ); /* default line width in 1 / 1000 inch */
    set_default_line_width( 100 ); /* default line width in 1 / 1000 inch */
    plot_orient_options = orient;
    plotMirror = aMirror;
}
}




@@ -213,7 +213,7 @@ void HPGL_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
    cpos = centre;
    cpos = centre;
    user_to_device_coordinates( cpos );
    user_to_device_coordinates( cpos );


    if( plot_orient_options == PLOT_MIROIR )
    if( plotMirror )
        angle = (StAngle - EndAngle) / 10.0;
        angle = (StAngle - EndAngle) / 10.0;
    else
    else
        angle = (EndAngle - StAngle) / 10.0;
        angle = (EndAngle - StAngle) / 10.0;
Loading