Commit b774d96f authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Minor coding policy and code readability improvements.

parent 0ba26e1d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ bool EDA_TEXT::TextHitTest( const EDA_RECT& aRect, bool aContains, int aAccuracy

void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
                     EDA_Colors aColor, int aDrawMode,
                     GRTraceMode aFillMode, EDA_Colors aAnchor_color )
                     EDA_DRAW_MODE_T aFillMode, EDA_Colors aAnchor_color )
{
    if( m_MultilineAllowed )
    {
@@ -471,13 +471,13 @@ void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,

void EDA_TEXT::DrawOneLineOfText( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
                                  const wxPoint& aOffset, EDA_Colors aColor,
                                  int aDrawMode, GRTraceMode aFillMode,
                                  int aDrawMode, EDA_DRAW_MODE_T aFillMode,
                                  EDA_Colors aAnchor_color,
                                  wxString& aText, wxPoint aPos )
{
    int width = m_Thickness;

    if( aFillMode == FILAIRE )
    if( aFillMode == LINE )
        width = 0;

    if( aDrawMode != -1 )
+9 −9
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ void PLOTTER::marker( const wxPoint& position, int diametre, int aShapeId )

/* Convert a thick segment and plot it as an oval */
void PLOTTER::segment_as_oval( wxPoint start, wxPoint end, int width,
                               GRTraceMode tracemode )
                               EDA_DRAW_MODE_T tracemode )
{
    wxPoint center( (start.x + end.x) / 2, (start.y + end.y) / 2 );
    wxSize  size( end.x - start.x, end.y - start.y );
@@ -328,12 +328,12 @@ void PLOTTER::sketch_oval( wxPoint pos, wxSize size, int orient,
/* Plot 1 segment like a track segment
 */
void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,
                             GRTraceMode tracemode )
                             EDA_DRAW_MODE_T tracemode )
{
    switch( tracemode )
    {
    case FILLED:
    case FILAIRE:
    case LINE:
        set_current_line_width( tracemode==FILLED ? width : -1 );
        move_to( start );
        finish_to( end );
@@ -348,11 +348,11 @@ void PLOTTER::thick_segment( wxPoint start, wxPoint end, int width,


void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius,
                         int width, GRTraceMode tracemode )
                         int width, EDA_DRAW_MODE_T tracemode )
{
    switch( tracemode )
    {
    case FILAIRE:
    case LINE:
        set_current_line_width( -1 );
        arc( centre, StAngle, EndAngle, radius, NO_FILL, -1 );
        break;
@@ -373,11 +373,11 @@ void PLOTTER::thick_arc( wxPoint centre, int StAngle, int EndAngle, int radius,


void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width,
                          GRTraceMode tracemode )
                          EDA_DRAW_MODE_T tracemode )
{
    switch( tracemode )
    {
    case FILAIRE:
    case LINE:
        rect( p1, p2, NO_FILL, -1 );
        break;

@@ -403,11 +403,11 @@ void PLOTTER::thick_rect( wxPoint p1, wxPoint p2, int width,


void PLOTTER::thick_circle( wxPoint pos, int diametre, int width,
                            GRTraceMode tracemode )
                            EDA_DRAW_MODE_T tracemode )
{
    switch( tracemode )
    {
    case FILAIRE:
    case LINE:
        circle( pos, diametre, NO_FILL, -1 );
        break;

+8 −6
Original line number Diff line number Diff line
@@ -213,16 +213,18 @@ void DXF_PLOTTER::set_dash( bool dashed )
 * @param aPlotMode = FILLED, SKETCH ..
 */
void DXF_PLOTTER::thick_segment( wxPoint aStart, wxPoint aEnd, int aWidth,
                                 GRTraceMode aPlotMode )
                                 EDA_DRAW_MODE_T aPlotMode )
{
    if( aPlotMode == FILAIRE )  /* just a line is Ok */
    if( aPlotMode == LINE )  /* just a line is Ok */
    {
        move_to( aStart );
        finish_to( aEnd );
    }
    else
    {
        segment_as_oval( aStart, aEnd, aWidth, aPlotMode );
    }
}


/* Plot an arc in DXF format.
@@ -253,7 +255,7 @@ void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius,

/* Plot oval pad at position. */
void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
                                  GRTraceMode trace_mode )
                                  EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );

@@ -272,7 +274,7 @@ void DXF_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,

/* Plot round pad or via. */
void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
                                    GRTraceMode trace_mode )
                                    EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );
    circle( pos, diametre, NO_FILL );
@@ -283,7 +285,7 @@ void DXF_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
 * Plot rectangular pad vertical or horizontal (rectangular Pad)
 */
void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
                                  int orient, GRTraceMode trace_mode )
                                  int orient, EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );
    wxSize size;
@@ -353,7 +355,7 @@ void DXF_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
 * Plot mode = FILLED, SKETCH (unused)
 */
void DXF_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
                                     int aPadOrient, GRTraceMode aTrace_Mode )
                                    int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{
    wxASSERT( output_file );
    wxPoint coord[4];       /* coord actual corners of a trapezoidal trace */
+6 −6
Original line number Diff line number Diff line
@@ -369,14 +369,14 @@ void GERBER_PLOTTER::PlotImage( wxImage & aImage, wxPoint aPos, double aScaleFac
/* 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, GRTraceMode trace_mode )
void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );
    wxSize size( diametre, diametre );

    switch( trace_mode )
    {
    case FILAIRE:
    case LINE:
    case SKETCH:
        set_current_line_width( -1 );
        circle( pos, diametre - current_pen_width, NO_FILL );
@@ -398,7 +398,7 @@ void GERBER_PLOTTER::flash_pad_circle( wxPoint pos, int diametre, GRTraceMode tr
 * For any orientation the shape is drawn as a segment
 */
void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
                                     GRTraceMode trace_mode )
                                     EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );
    int x0, y0, x1, y1, delta;
@@ -455,7 +455,7 @@ void GERBER_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
 * For others shape the direction is plotted as a polygon.
 */
void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
                                     int orient, GRTraceMode trace_mode )
                                     int orient, EDA_DRAW_MODE_T trace_mode )

{
    wxASSERT( output_file );
@@ -472,7 +472,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
    case 1800:
        switch( trace_mode )
        {
        case FILAIRE:
        case LINE:
        case SKETCH:
            set_current_line_width( -1 );
            rect( wxPoint( pos.x - (size.x - current_pen_width) / 2,
@@ -522,7 +522,7 @@ void GERBER_PLOTTER::flash_pad_rect( wxPoint pos, wxSize size,
 * Plot mode  = FILLED or SKETCH
 */
 void GERBER_PLOTTER::flash_pad_trapez( wxPoint aPadPos,  wxPoint aCorners[4],
                                        int aPadOrient, GRTraceMode aTrace_Mode )
                                        int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )

{
    // polygon corners list
+9 −8
Original line number Diff line number Diff line
@@ -203,13 +203,13 @@ void HPGL_PLOTTER::set_dash( bool dashed )
 * @param width = segment width (thickness)
 * @param tracemode = FILLED, SKETCH ..
 */
void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, GRTraceMode tracemode )
void HPGL_PLOTTER::thick_segment( wxPoint start, wxPoint end, int width, EDA_DRAW_MODE_T tracemode )
{
    wxASSERT( output_file );
    wxPoint center;
    wxSize  size;

    if( (pen_diameter >= width) || (tracemode == FILAIRE) )  /* just a line is
    if( (pen_diameter >= width) || (tracemode == LINE) )  /* just a line is
                                                              * Ok */
    {
        move_to( start );
@@ -266,7 +266,7 @@ void HPGL_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int rayon,
/* Plot oval pad.
 */
void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
                                   GRTraceMode trace_mode )
                                   EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );
    int deltaxy, cx, cy;
@@ -305,7 +305,7 @@ void HPGL_PLOTTER::flash_pad_oval( wxPoint pos, wxSize size, int orient,
/* Plot round pad or via.
 */
void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
                                     GRTraceMode trace_mode )
                                     EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );
    int rayon, delta;
@@ -314,7 +314,8 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,

    delta = wxRound( pen_diameter - pen_overlap );
    rayon = diametre / 2;
    if( trace_mode != FILAIRE )

    if( trace_mode != LINE )
    {
        rayon = ( diametre - wxRound( pen_diameter ) ) / 2;
    }
@@ -356,7 +357,7 @@ void HPGL_PLOTTER::flash_pad_circle( wxPoint pos, int diametre,
 * Units are user units
 */
void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
                                   int orient, GRTraceMode trace_mode )
                                   int orient, EDA_DRAW_MODE_T trace_mode )
{
    wxASSERT( output_file );
    wxSize size;
@@ -366,7 +367,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
    size.x = padsize.x / 2;
    size.y = padsize.y / 2;

    if( trace_mode != FILAIRE )
    if( trace_mode != LINE )
    {
        size.x = (padsize.x - (int) pen_diameter) / 2;
        size.y = (padsize.y - (int) pen_diameter) / 2;
@@ -474,7 +475,7 @@ void HPGL_PLOTTER::flash_pad_rect( wxPoint pos, wxSize padsize,
 * Plot mode FILLED or SKETCH
 */
void HPGL_PLOTTER::flash_pad_trapez( wxPoint aPadPos, wxPoint aCorners[4],
                                     int aPadOrient, GRTraceMode aTrace_Mode )
                                     int aPadOrient, EDA_DRAW_MODE_T aTrace_Mode )
{
    wxASSERT( output_file );
    wxPoint polygone[4];        // coordinates of corners relatives to the pad
Loading