Commit 0c443357 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Lots and lots of PCBNew code cleaning and fix build bug introduced in r3108.

* Changed <wx-2.8/xml/xml.h> to "xnode.h" in pcbnew_config.cpp to fix bug
  when building against wxWidgets 2.9 and above.
* Convert broken wxXmlNode code to use XNODE.
* Overloaded XNODE constructor for creating child nodes.
* Translate French naming conventions.
* Translate French comments.
* Remove tabs from several source files.
* Coding style policy and Doxygen comment fixes.
parent c7dee039
Loading
Loading
Loading
Loading
+89 −37
Original line number Original line Diff line number Diff line
@@ -92,7 +92,9 @@ void Pcb3D_GLCanvas::Redraw( bool finish )
    glRotatef( g_Parm_3D_Visu.m_Rot[2], 0.0, 0.0, 1.0 );
    glRotatef( g_Parm_3D_Visu.m_Rot[2], 0.0, 0.0, 1.0 );


    if( m_gllist )
    if( m_gllist )
    {
        glCallList( m_gllist );
        glCallList( m_gllist );
    }
    else
    else
    {
    {
        CreateDrawGL_List();
        CreateDrawGL_List();
@@ -146,8 +148,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
    for( ii = 0; ii < 32; ii++ )
    for( ii = 0; ii < 32; ii++ )
    {
    {
        if( ii < g_Parm_3D_Visu.m_Layers )
        if( ii < g_Parm_3D_Visu.m_Layers )
            g_Parm_3D_Visu.m_LayerZcoord[ii] =
            g_Parm_3D_Visu.m_LayerZcoord[ii] = g_Parm_3D_Visu.m_Epoxy_Width
                g_Parm_3D_Visu.m_Epoxy_Width
                                               * ii / (g_Parm_3D_Visu.m_Layers - 1);
                                               * ii / (g_Parm_3D_Visu.m_Layers - 1);
        else
        else
            g_Parm_3D_Visu.m_LayerZcoord[ii] = g_Parm_3D_Visu.m_Epoxy_Width;
            g_Parm_3D_Visu.m_LayerZcoord[ii] = g_Parm_3D_Visu.m_Epoxy_Width;
@@ -277,16 +278,20 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
        for( ii = 0; ii < pcb->GetAreaCount(); ii++ )
        for( ii = 0; ii < pcb->GetAreaCount(); ii++ )
        {
        {
            ZONE_CONTAINER* zone = pcb->GetArea( ii );
            ZONE_CONTAINER* zone = pcb->GetArea( ii );

            if( zone->m_FilledPolysList.size() == 0 )
            if( zone->m_FilledPolysList.size() == 0 )
                continue;
                continue;

            if( zone->m_ZoneMinThickness <= 1 )
            if( zone->m_ZoneMinThickness <= 1 )
                continue;
                continue;

            int      imax = zone->m_FilledPolysList.size() - 1;
            int      imax = zone->m_FilledPolysList.size() - 1;
            CPolyPt* firstcorner = &zone->m_FilledPolysList[0];
            CPolyPt* firstcorner = &zone->m_FilledPolysList[0];
            CPolyPt* begincorner = firstcorner;
            CPolyPt* begincorner = firstcorner;
            SEGZONE  dummysegment( pcb );
            SEGZONE  dummysegment( pcb );
            dummysegment.SetLayer( zone->GetLayer() );
            dummysegment.SetLayer( zone->GetLayer() );
            dummysegment.m_Width = zone->m_ZoneMinThickness;
            dummysegment.m_Width = zone->m_ZoneMinThickness;

            for( int ic = 1; ic <= imax; ic++ )
            for( int ic = 1; ic <= imax; ic++ )
            {
            {
                CPolyPt* endcorner = &zone->m_FilledPolysList[ic];
                CPolyPt* endcorner = &zone->m_FilledPolysList[ic];
@@ -312,16 +317,19 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()


                        Draw3D_Track( &dummysegment );
                        Draw3D_Track( &dummysegment );
                    }
                    }

                    ic++;
                    ic++;

                    if( ic < imax - 1 )
                    if( ic < imax - 1 )
                        begincorner = firstcorner =
                        begincorner = firstcorner = &zone->m_FilledPolysList[ic];
                                          &zone->m_FilledPolysList[ic];
                }
                }
                else
                else
                {
                    begincorner = endcorner;
                    begincorner = endcorner;
                }
                }
            }
            }
        }
        }
    }


    /* draw graphic items */
    /* draw graphic items */
    EDA_ITEM* PtStruct;
    EDA_ITEM* PtStruct;
@@ -345,6 +353,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()


    /* draw footprints */
    /* draw footprints */
    MODULE* Module = pcb->m_Modules;
    MODULE* Module = pcb->m_Modules;

    for( ; Module != NULL; Module = Module->Next() )
    for( ; Module != NULL; Module = Module->Next() )
    {
    {
        Module->Draw3D( this );
        Module->Draw3D( this );
@@ -373,6 +382,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track )


    if( layer == LAST_COPPER_LAYER )
    if( layer == LAST_COPPER_LAYER )
        layer = g_Parm_3D_Visu.m_Layers - 1;
        layer = g_Parm_3D_Visu.m_Layers - 1;

    zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
    zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];


    SetGLColor( color );
    SetGLColor( color );
@@ -404,6 +414,7 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )


    if( layer == LAST_COPPER_LAYER )
    if( layer == LAST_COPPER_LAYER )
        layer = g_Parm_3D_Visu.m_Layers - 1;
        layer = g_Parm_3D_Visu.m_Layers - 1;

    zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
    zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
    g_Parm_3D_Visu.m_ActZpos = zpos;
    g_Parm_3D_Visu.m_ActZpos = zpos;


@@ -471,16 +482,16 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
        zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
        zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
        if( layer < g_Parm_3D_Visu.m_Layers - 1 )
        if( layer < g_Parm_3D_Visu.m_Layers - 1 )
        {
        {
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
                false )
                continue;
                continue;

            color = g_ColorsSettings.GetLayerColor( layer );
            color = g_ColorsSettings.GetLayerColor( layer );
        }
        }
        else
        else
        {
        {
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) ==
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) == false )
                false )
                continue;
                continue;

            color = g_ColorsSettings.GetLayerColor( LAYER_N_FRONT );
            color = g_ColorsSettings.GetLayerColor( LAYER_N_FRONT );
        }
        }


@@ -488,11 +499,14 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )


        // SetGLColor( LIGHTGRAY );
        // SetGLColor( LIGHTGRAY );
        glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
        glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );

        if( layer == LAYER_N_BACK )
        if( layer == LAYER_N_BACK )
            zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
            zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
        else
        else
            zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
            zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;

        Draw3D_FilledCircle( x, -y, r, hole, zpos );
        Draw3D_FilledCircle( x, -y, r, hole, zpos );

        if( layer >= top_layer )
        if( layer >= top_layer )
            break;
            break;
    }
    }
@@ -500,10 +514,8 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
    // Drawing hole:
    // Drawing hole:
    color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + via->m_Shape );
    color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + via->m_Shape );
    SetGLColor( color );
    SetGLColor( color );
    height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] -
    height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] - g_Parm_3D_Visu.m_LayerZcoord[bottom_layer];
             g_Parm_3D_Visu.m_LayerZcoord[bottom_layer];
    Draw3D_FilledCylinder( x, -y, hole, height, g_Parm_3D_Visu.m_LayerZcoord[bottom_layer] );
    Draw3D_FilledCylinder( x, -y, hole, height,
                           g_Parm_3D_Visu.m_LayerZcoord[bottom_layer] );
}
}




@@ -553,6 +565,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
    {
    {
        glNormal3f( 0.0, 0.0, Get3DLayerSide( layer ) );
        glNormal3f( 0.0, 0.0, Get3DLayerSide( layer ) );
        zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
        zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];

        if( Get3DLayerEnable( layer ) )
        if( Get3DLayerEnable( layer ) )
        {
        {
            switch( segment->m_Shape )
            switch( segment->m_Shape )
@@ -591,8 +604,7 @@ static void Draw3dTextSegm( int x0, int y0, int xf, int yf )
    double endx   = xf * g_Parm_3D_Visu.m_BoardScale;
    double endx   = xf * g_Parm_3D_Visu.m_BoardScale;
    double endy   = yf * g_Parm_3D_Visu.m_BoardScale;
    double endy   = yf * g_Parm_3D_Visu.m_BoardScale;


    Draw3D_FilledSegment( startx, -starty, endx, -endy,
    Draw3D_FilledSegment( startx, -starty, endx, -endy, s_Text3DWidth, s_Text3DZPos );
                          s_Text3DWidth, s_Text3DZPos );
}
}




@@ -605,14 +617,15 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )


    int color = g_ColorsSettings.GetLayerColor( layer );
    int color = g_ColorsSettings.GetLayerColor( layer );



    SetGLColor( color );
    SetGLColor( color );
    s_Text3DZPos  = g_Parm_3D_Visu.m_LayerZcoord[layer];
    s_Text3DZPos  = g_Parm_3D_Visu.m_LayerZcoord[layer];
    s_Text3DWidth = text->m_Thickness * g_Parm_3D_Visu.m_BoardScale;
    s_Text3DWidth = text->m_Thickness * g_Parm_3D_Visu.m_BoardScale;
    glNormal3f( 0.0, 0.0, Get3DLayerSide( layer ) );
    glNormal3f( 0.0, 0.0, Get3DLayerSide( layer ) );
    wxSize size = text->m_Size;
    wxSize size = text->m_Size;

    if( text->m_Mirror )
    if( text->m_Mirror )
        NEGATE( size.x );
        NEGATE( size.x );

    if( text->m_MultilineAllowed )
    if( text->m_MultilineAllowed )
    {
    {
        wxPoint        pos  = text->m_Pos;
        wxPoint        pos  = text->m_Pos;
@@ -622,6 +635,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
        offset.y = text->GetInterline();
        offset.y = text->GetInterline();


        RotatePoint( &offset, text->m_Orient );
        RotatePoint( &offset, text->m_Orient );

        for( unsigned i = 0; i<list->Count(); i++ )
        for( unsigned i = 0; i<list->Count(); i++ )
        {
        {
            wxString txt = list->Item( i );
            wxString txt = list->Item( i );
@@ -636,6 +650,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
        delete (list);
        delete (list);
    }
    }
    else
    else
    {
        DrawGraphicText( NULL, NULL, text->m_Pos, (EDA_Colors) color,
        DrawGraphicText( NULL, NULL, text->m_Pos, (EDA_Colors) color,
                         text->m_Text, text->m_Orient, size,
                         text->m_Text, text->m_Orient, size,
                         text->m_HJustify, text->m_VJustify,
                         text->m_HJustify, text->m_VJustify,
@@ -643,6 +658,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
                         true,
                         true,
                         Draw3dTextSegm );
                         Draw3dTextSegm );
    }
    }
}




void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
@@ -652,6 +668,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
    /* Draw pads */
    /* Draw pads */
    glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
    glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
    glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
    glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis

    for( ; pad != NULL; pad = pad->Next() )
    for( ; pad != NULL; pad = pad->Next() )
    {
    {
        pad->Draw3D( glcanvas );
        pad->Draw3D( glcanvas );
@@ -679,6 +696,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
            glRotatef( 180.0, 0.0, 1.0, 0.0 );
            glRotatef( 180.0, 0.0, 1.0, 0.0 );
            glRotatef( 180.0, 0.0, 0.0, 1.0 );
            glRotatef( 180.0, 0.0, 0.0, 1.0 );
        }
        }

        DataScale3D = g_Parm_3D_Visu.m_BoardScale * UNITS3D_TO_UNITSPCB;
        DataScale3D = g_Parm_3D_Visu.m_BoardScale * UNITS3D_TO_UNITSPCB;


        for( ; Struct3D != NULL; Struct3D = Struct3D->Next() )
        for( ; Struct3D != NULL; Struct3D = Struct3D->Next() )
@@ -889,8 +907,8 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )


    glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
    glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
    nlmax = g_Parm_3D_Visu.m_Layers - 1;
    nlmax = g_Parm_3D_Visu.m_Layers - 1;
    Oncu  = (m_Masque_Layer & LAYER_BACK) ? TRUE : FALSE;
    Oncu  = (m_layerMask & LAYER_BACK) ? TRUE : FALSE;
    Oncmp = (m_Masque_Layer & LAYER_FRONT) ? TRUE : FALSE;
    Oncmp = (m_layerMask & LAYER_FRONT) ? TRUE : FALSE;
    Both  = Oncu && Oncmp;
    Both  = Oncu && Oncmp;


    switch( m_PadShape & 0x7F )
    switch( m_PadShape & 0x7F )
@@ -899,29 +917,35 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
        x = xc * scale;
        x = xc * scale;
        y = yc * scale;
        y = yc * scale;
        r = (double) dx * scale;
        r = (double) dx * scale;

        for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
        for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
        {
        {
            if( layer && (layer == nlmax) )
            if( layer && (layer == nlmax) )
                layer = LAYER_N_FRONT;
                layer = LAYER_N_FRONT;

            if( (layer == LAYER_N_FRONT) && !Oncmp )
            if( (layer == LAYER_N_FRONT) && !Oncmp )
                continue;
                continue;

            if( (layer == LAYER_N_BACK) && !Oncu )
            if( (layer == LAYER_N_BACK) && !Oncu )
                continue;
                continue;
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)

               && !Both )
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
                continue;
                continue;

            color = g_ColorsSettings.GetLayerColor( layer );
            color = g_ColorsSettings.GetLayerColor( layer );
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==

                false )
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
                continue;
                continue;


            SetGLColor( color );
            SetGLColor( color );
            glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
            glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
            zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
            zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];

            if( layer == LAYER_N_BACK )
            if( layer == LAYER_N_BACK )
                zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
                zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
            else
            else
                zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
                zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;

            Draw3D_FilledCircle( x, -y, r, hole, zpos );
            Draw3D_FilledCircle( x, -y, r, hole, zpos );
        }
        }


@@ -940,42 +964,48 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
            delta_cy = dy - dx;
            delta_cy = dy - dx;
            w = m_Size.x * scale;
            w = m_Size.x * scale;
        }
        }

        RotatePoint( &delta_cx, &delta_cy, angle );
        RotatePoint( &delta_cx, &delta_cy, angle );

        {
        {
            double ox, oy, fx, fy;
            double ox, oy, fx, fy;
            ox = (double) ( ux0 + delta_cx ) * scale;
            ox = (double) ( ux0 + delta_cx ) * scale;
            oy = (double) ( uy0 + delta_cy ) * scale;
            oy = (double) ( uy0 + delta_cy ) * scale;
            fx = (double) ( ux0 - delta_cx ) * scale;
            fx = (double) ( ux0 - delta_cx ) * scale;
            fy = (double) ( uy0 - delta_cy ) * scale;
            fy = (double) ( uy0 - delta_cy ) * scale;
            for( layer = FIRST_COPPER_LAYER;

                 layer <= LAST_COPPER_LAYER;
            for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
                 layer++ )
            {
            {
                if( layer && (layer == nlmax) )
                if( layer && (layer == nlmax) )
                    layer = LAYER_N_FRONT;
                    layer = LAYER_N_FRONT;

                if( (layer == LAYER_N_FRONT) && !Oncmp )
                if( (layer == LAYER_N_FRONT) && !Oncmp )
                    continue;
                    continue;

                if( (layer == LAYER_N_BACK) && !Oncu )
                if( (layer == LAYER_N_BACK) && !Oncu )
                    continue;
                    continue;
                if( (layer > FIRST_COPPER_LAYER)

                   && (layer < LAST_COPPER_LAYER) && !Both )
                if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
                    continue;
                    continue;

                color = g_ColorsSettings.GetLayerColor( layer );
                color = g_ColorsSettings.GetLayerColor( layer );
                glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
                glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
                if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==

                    false )
                if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
                    continue;
                    continue;


                SetGLColor( color );
                SetGLColor( color );
                zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
                zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];

                if( layer == LAYER_N_BACK )
                if( layer == LAYER_N_BACK )
                    zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
                    zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
                else
                else
                    zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
                    zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
                Draw3D_FilledSegmentWithHole( ox, -oy, fx, -fy, w, drillx,

                                              -drilly, hole, zpos );
                Draw3D_FilledSegmentWithHole( ox, -oy, fx, -fy, w, drillx, -drilly, hole, zpos );
            }
            }
        }
        }

        break;
        break;


    case PAD_RECT:
    case PAD_RECT:
@@ -984,6 +1014,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
        wxPoint  coord[5];
        wxPoint  coord[5];
        wxRealPoint  fcoord[8], f_hole_coord[8];
        wxRealPoint  fcoord[8], f_hole_coord[8];
        BuildPadPolygon( coord, wxSize(0,0), angle );
        BuildPadPolygon( coord, wxSize(0,0), angle );

        for( ii = 0; ii < 4; ii++ )
        for( ii = 0; ii < 4; ii++ )
        {
        {
            coord[ii].x += ux0;
            coord[ii].x += ux0;
@@ -996,8 +1027,10 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
        for( ii = 0; ii < 7; ii += 2 )
        for( ii = 0; ii < 7; ii += 2 )
        {
        {
            ll = ii + 2;
            ll = ii + 2;

            if( ll > 7 )
            if( ll > 7 )
                ll -= 8;
                ll -= 8;

            fcoord[ii + 1].x = (fcoord[ii].x + fcoord[ll].x) / 2;
            fcoord[ii + 1].x = (fcoord[ii].x + fcoord[ll].x) / 2;
            fcoord[ii + 1].y = (fcoord[ii].y + fcoord[ll].y) / 2;
            fcoord[ii + 1].y = (fcoord[ii].y + fcoord[ll].y) / 2;
        }
        }
@@ -1015,26 +1048,32 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
        {
        {
            if( layer && (layer == nlmax) )
            if( layer && (layer == nlmax) )
                layer = LAYER_N_FRONT;
                layer = LAYER_N_FRONT;

            if( (layer == LAYER_N_FRONT) && !Oncmp )
            if( (layer == LAYER_N_FRONT) && !Oncmp )
                continue;
                continue;

            if( (layer == LAYER_N_BACK) && !Oncu )
            if( (layer == LAYER_N_BACK) && !Oncu )
                continue;
                continue;
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)

               && !Both )
            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
                continue;
                continue;

            color = g_ColorsSettings.GetLayerColor( layer );
            color = g_ColorsSettings.GetLayerColor( layer );
            glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
            glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==

                false )
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
                continue;
                continue;


            SetGLColor( color );
            SetGLColor( color );
            zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
            zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];

            if( layer == LAYER_N_BACK )
            if( layer == LAYER_N_BACK )
                zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
                zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
            else
            else
                zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
                zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;

            glBegin( GL_QUAD_STRIP );
            glBegin( GL_QUAD_STRIP );

            for( ii = 0; ii < 8; ii++ )
            for( ii = 0; ii < 8; ii++ )
            {
            {
                glVertex3f( f_hole_coord[ii].x, -f_hole_coord[ii].y, zpos );
                glVertex3f( f_hole_coord[ii].x, -f_hole_coord[ii].y, zpos );
@@ -1073,6 +1112,7 @@ static void Draw3D_FilledCircle( double posx, double posy,
    double x, y;
    double x, y;


    glBegin( GL_QUAD_STRIP );
    glBegin( GL_QUAD_STRIP );

    for( ii = 0; ii <= slice; ii++ )
    for( ii = 0; ii <= slice; ii++ )
    {
    {
        x = hole;
        x = hole;
@@ -1151,6 +1191,7 @@ static void Draw3D_FilledSegment( double startx, double starty, double endx,
        x += dx;
        x += dx;
        RotatePoint( &x, &y, -angle );
        RotatePoint( &x, &y, -angle );
        glVertex3f( startx + x, starty + y, zpos );
        glVertex3f( startx + x, starty + y, zpos );

        if( ii == 0 )
        if( ii == 0 )
        {
        {
            firstx = startx + x;
            firstx = startx + x;
@@ -1217,6 +1258,7 @@ static void Draw3D_FilledSegmentWithHole( double startx, double starty,
        RotatePoint( &xin, &yin, -angle );
        RotatePoint( &xin, &yin, -angle );
        glVertex3f( startx + xin, starty + yin, zpos );
        glVertex3f( startx + xin, starty + yin, zpos );
        glVertex3f( startx + x, starty + y, zpos );
        glVertex3f( startx + x, starty + y, zpos );

        if( ii == 0 )
        if( ii == 0 )
        {
        {
            firstx   = startx + x;
            firstx   = startx + x;
@@ -1263,8 +1305,10 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex,


    // Calculate the number of segments to approximate this arc
    // Calculate the number of segments to approximate this arc
    int imax = (int) ( (double) arc_angle * slice / 3600.0 );
    int imax = (int) ( (double) arc_angle * slice / 3600.0 );

    if( imax < 0 )
    if( imax < 0 )
        imax = -imax;
        imax = -imax;

    if( imax == 0 )
    if( imax == 0 )
        imax = 1;
        imax = 1;


@@ -1273,6 +1317,7 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex,
    double delta_angle = (double) arc_angle / imax;
    double delta_angle = (double) arc_angle / imax;


    glBegin( GL_QUAD_STRIP );
    glBegin( GL_QUAD_STRIP );

    for( ii = 0; ii <= imax; ii++ )
    for( ii = 0; ii <= imax; ii++ )
    {
    {
        double angle = (double) ii * delta_angle;
        double angle = (double) ii * delta_angle;
@@ -1301,6 +1346,7 @@ static void Draw3D_CircleSegment( double startx, double starty, double endx,
    hole  = rayon - width;
    hole  = rayon - width;


    glBegin( GL_QUAD_STRIP );
    glBegin( GL_QUAD_STRIP );

    for( ii = 0; ii <= slice; ii++ )
    for( ii = 0; ii <= slice; ii++ )
    {
    {
        x = hole; y = 0.0;
        x = hole; y = 0.0;
@@ -1339,6 +1385,7 @@ void Pcb3D_GLCanvas::Draw3D_Polygon( std::vector<wxPoint>& aCornersList, double
    // Draw solid polygon
    // Draw solid polygon
    gluTessBeginPolygon( tess, NULL );
    gluTessBeginPolygon( tess, NULL );
    gluTessBeginContour( tess );
    gluTessBeginContour( tess );

    for( unsigned ii = 0; ii < aCornersList.size(); ii++ )
    for( unsigned ii = 0; ii < aCornersList.size(); ii++ )
    {
    {
        v_data[0] = aCornersList[ii].x * g_Parm_3D_Visu.m_BoardScale;
        v_data[0] = aCornersList[ii].x * g_Parm_3D_Visu.m_BoardScale;
@@ -1361,12 +1408,16 @@ static int Get3DLayerEnable( int act_layer )
    bool enablelayer;
    bool enablelayer;


    enablelayer = TRUE;
    enablelayer = TRUE;

    if( act_layer == DRAW_N && !g_Parm_3D_Visu.m_Draw3DDrawings )
    if( act_layer == DRAW_N && !g_Parm_3D_Visu.m_Draw3DDrawings )
        enablelayer = FALSE;
        enablelayer = FALSE;

    if( act_layer == COMMENT_N && !g_Parm_3D_Visu.m_Draw3DComments )
    if( act_layer == COMMENT_N && !g_Parm_3D_Visu.m_Draw3DComments )
        enablelayer = FALSE;
        enablelayer = FALSE;

    if( act_layer == ECO1_N && !g_Parm_3D_Visu.m_Draw3DEco1 )
    if( act_layer == ECO1_N && !g_Parm_3D_Visu.m_Draw3DEco1 )
        enablelayer = FALSE;
        enablelayer = FALSE;

    if( act_layer == ECO2_N && !g_Parm_3D_Visu.m_Draw3DEco2 )
    if( act_layer == ECO2_N && !g_Parm_3D_Visu.m_Draw3DEco2 )
        enablelayer = FALSE;
        enablelayer = FALSE;


@@ -1379,6 +1430,7 @@ static GLfloat Get3DLayerSide( int act_layer )
    GLfloat nZ;
    GLfloat nZ;


    nZ = 1.0;
    nZ = 1.0;

    if( ( act_layer <= LAST_COPPER_LAYER - 1 )
    if( ( act_layer <= LAST_COPPER_LAYER - 1 )
       || ( act_layer == ADHESIVE_N_BACK )
       || ( act_layer == ADHESIVE_N_BACK )
       || ( act_layer == SOLDERPASTE_N_BACK )
       || ( act_layer == SOLDERPASTE_N_BACK )
+6 −6
Original line number Original line Diff line number Diff line
@@ -136,7 +136,7 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
 *  but they must exist because they appear in some classes.
 *  but they must exist because they appear in some classes.
 *  Do nothing in CvPcb.
 *  Do nothing in CvPcb.
 */
 */
TRACK* Marque_Une_Piste( BOARD* aPcb,
TRACK* MarkTrace( BOARD* aPcb,
                  TRACK* aStartSegm,
                  TRACK* aStartSegm,
                  int*   aSegmCount,
                  int*   aSegmCount,
                  int*   aTrackLen,
                  int*   aTrackLen,
+6 −6
Original line number Original line Diff line number Diff line
@@ -420,7 +420,7 @@ void PCB_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER&, int )
 *  but they must exist because they appear in some classes, and here, no nothing.
 *  but they must exist because they appear in some classes, and here, no nothing.
 */
 */


TRACK* Marque_Une_Piste( BOARD* aPcb,
TRACK* MarkTrace( BOARD* aPcb,
                  TRACK* aStartSegm,
                  TRACK* aStartSegm,
                  int*   aSegmCount,
                  int*   aSegmCount,
                  int*   aTrackLen,
                  int*   aTrackLen,
+5 −4
Original line number Original line Diff line number Diff line
/*********************************************************************/
/**
/*  base_struct.h :  Basic classes for most kicad item descriptions  */
 * @file  base_struct.h
/*********************************************************************/
 * @brief Basic classes for most kicad items.
 */


#ifndef BASE_STRUCT_H
#ifndef BASE_STRUCT_H
#define BASE_STRUCT_H
#define BASE_STRUCT_H
@@ -41,7 +42,7 @@ enum KICAD_T {
                            // copper layer)
                            // copper layer)
    TYPE_MARKER_PCB,        // a marker used to show something
    TYPE_MARKER_PCB,        // a marker used to show something
    TYPE_DIMENSION,         // a dimension (graphic item)
    TYPE_DIMENSION,         // a dimension (graphic item)
    TYPE_MIRE,              // a target (graphic item)
    PCB_TARGET_T,           // a target (graphic item)
    TYPE_ZONE_EDGE_CORNER,  // in zone outline: a point to define an outline
    TYPE_ZONE_EDGE_CORNER,  // in zone outline: a point to define an outline
    TYPE_ZONE_CONTAINER,    // a zone area
    TYPE_ZONE_CONTAINER,    // a zone area
    TYPE_BOARD_ITEM_LIST,   // a list of board items
    TYPE_BOARD_ITEM_LIST,   // a list of board items
+8 −9
Original line number Original line Diff line number Diff line
@@ -28,7 +28,7 @@ class SEGZONE;
class SEGVIA;
class SEGVIA;
class D_PAD;
class D_PAD;
class TEXTE_MODULE;
class TEXTE_MODULE;
class MIREPCB;
class PCB_TARGET;
class DIMENSION;
class DIMENSION;
class EDGE_MODULE;
class EDGE_MODULE;
class DRC;
class DRC;
@@ -830,8 +830,8 @@ public:
     *                the case where DRC would not allow a via.
     *                the case where DRC would not allow a via.
     */
     */
    bool   Other_Layer_Route( TRACK* track, wxDC* DC );
    bool   Other_Layer_Route( TRACK* track, wxDC* DC );
    void   Affiche_PadsNoConnect( wxDC* DC );
    void   HighlightUnconnectedPads( wxDC* DC );
    void   Affiche_Status_Net( wxDC* DC );
    void   DisplayNetStatus( wxDC* DC );
    TRACK* Delete_Segment( wxDC* DC, TRACK* Track );
    TRACK* Delete_Segment( wxDC* DC, TRACK* Track );
    void   Delete_Track( wxDC* DC, TRACK* Track );
    void   Delete_Track( wxDC* DC, TRACK* Track );
    void   Delete_net( wxDC* DC, TRACK* Track );
    void   Delete_net( wxDC* DC, TRACK* Track );
@@ -910,7 +910,6 @@ public:
    void   Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC );
    void   Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC );
    void   SwitchLayer( wxDC* DC, int layer );
    void   SwitchLayer( wxDC* DC, int layer );
    bool   Add_45_degrees_Segment( wxDC* DC );
    bool   Add_45_degrees_Segment( wxDC* DC );
    bool   Genere_Pad_Connexion( wxDC* DC, int layer );


    /**
    /**
     * Function EraseRedundantTrack
     * Function EraseRedundantTrack
@@ -1085,11 +1084,11 @@ public:
    void         Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );
    void         Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_container );


    // Target handling
    // Target handling
    MIREPCB*     Create_Mire( wxDC* DC );
    PCB_TARGET*  CreateTarget( wxDC* DC );
    void         Delete_Mire( MIREPCB* MirePcb, wxDC* DC );
    void         DeleteTarget( PCB_TARGET* aTarget, wxDC* DC );
    void         StartMove_Mire( MIREPCB* MirePcb, wxDC* DC );
    void         BeginMoveTarget( PCB_TARGET* aTarget, wxDC* DC );
    void         Place_Mire( MIREPCB* MirePcb, wxDC* DC );
    void         PlaceTarget( PCB_TARGET* aTarget, wxDC* DC );
    void         InstallMireOptionsFrame( MIREPCB* MirePcb, wxDC* DC );
    void         ShowTargetOptionsDialog( PCB_TARGET* aTarget, wxDC* DC );


    // Graphic segments type DRAWSEGMENT handling:
    // Graphic segments type DRAWSEGMENT handling:
    DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC );
    DRAWSEGMENT* Begin_DrawSegment( DRAWSEGMENT* Segment, int shape, wxDC* DC );
Loading