Commit b5c0cada authored by Miguel Angel Ajo's avatar Miguel Angel Ajo
Browse files

merges tip, conflict resolved

parents 30e251bf e936d3c1
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
            if( curr_zone->m_FillMode == 0 )
            {
                // solid polygons only are used to fill areas
                if( curr_zone->m_FilledPolysList.size() > 3 )
                if( curr_zone->GetFilledPolysList().size() > 3 )
                {
                    Draw3D_SolidPolygonsInZones( curr_zone );
                }
@@ -286,14 +286,16 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
        {
            ZONE_CONTAINER* zone = pcb->GetArea( ii );

            if( zone->m_FilledPolysList.size() == 0 )
            std::vector<CPolyPt> polysList = zone->GetFilledPolysList();

            if( polysList.size() == 0 )
                continue;

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

            int      imax = zone->m_FilledPolysList.size() - 1;
            CPolyPt* firstcorner = &zone->m_FilledPolysList[0];
            int      imax = polysList.size() - 1;
            CPolyPt* firstcorner = &polysList[0];
            CPolyPt* begincorner = firstcorner;
            SEGZONE  dummysegment( pcb );
            dummysegment.SetLayer( zone->GetLayer() );
@@ -301,7 +303,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()

            for( int ic = 1; ic <= imax; ic++ )
            {
                CPolyPt* endcorner = &zone->m_FilledPolysList[ic];
                CPolyPt* endcorner = &polysList[ic];

                if( begincorner->utility == 0 )
                {
@@ -330,7 +332,7 @@ GLuint EDA_3D_CANVAS::CreateDrawGL_List()
                    ic++;

                    if( ic < imax - 1 )
                        begincorner = firstcorner = &zone->m_FilledPolysList[ic];
                        begincorner = firstcorner = &polysList[ic];
                }
                else
                {
@@ -440,7 +442,8 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )
    // Draw solid areas contained in this zone
    int StartContour = 1;

    for( unsigned ii = 0; ii < aZone->m_FilledPolysList.size(); ii++ )
    std::vector<CPolyPt> polysList = aZone->GetFilledPolysList();
    for( unsigned ii = 0; ii < polysList.size(); ii++ )
    {
        if( StartContour == 1 )
        {
@@ -449,11 +452,11 @@ void EDA_3D_CANVAS::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone )
            StartContour = 0;
        }

        v_data[0] = aZone->m_FilledPolysList[ii].x * g_Parm_3D_Visu.m_BoardScale;
        v_data[1] = -aZone->m_FilledPolysList[ii].y * g_Parm_3D_Visu.m_BoardScale;
        gluTessVertex( tess, v_data, &aZone->m_FilledPolysList[ii] );
        v_data[0] = polysList[ii].x * g_Parm_3D_Visu.m_BoardScale;
        v_data[1] = -polysList[ii].y * g_Parm_3D_Visu.m_BoardScale;
        gluTessVertex( tess, v_data, &polysList[ii] );

        if( aZone->m_FilledPolysList[ii].end_contour == 1 )
        if( polysList[ii].end_contour == 1 )
        {
            gluTessEndContour( tess );
            gluTessEndPolygon( tess );
+8 −0
Original line number Diff line number Diff line
@@ -42,6 +42,14 @@ Dialogs:
    leaving them all bundled tightly together.  The dialog box should look
    nice at any size large enough to show all the components.

    When using wxFormBuilder, please add the following settings to the
    "Dialog" node:
        subclass.name   <- DIALOG_SHIM
        subclass.header <- dialog_shim.h

    This will provide for an override of the Show( bool ) wxWindow() function
    and provide retentitive size and position for the session.

    Use tooltips to explain the functionality of each non-obvious control.
    This is important because the help files and the wiki often lag behind
    the source code.
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" )
const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) );
const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) );
const wxString LegacyPcbFileWildcard( _( "KiCad printed circuit board files (*.brd)|*.brd" ) );
const wxString EaglePcbFileWildcard( _( "Eagle ver. 6.x XML PCB files (*.brd)|*.brd" ) );
const wxString PcbFileWildcard( _( "KiCad s-expr printed circuit board files (*.kicad_pcb)|*.kicad_pcb" ) );
const wxString FootprintLibFileWildcard( _( "KiCad footprint library file (*.mod)|*.mod" ) );
const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) );
+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,14 @@ public:
    void OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent );
    void OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent );

    /**
     * Function InitDisplay
     * Refresh the full display for this frame:
     * Set the title, the status line and redraw the canvas
     * Must be called after the footprint to display is modifed
     */
    void InitDisplay();

    /**
     * Function IsGridVisible() , virtual
     * @return true if the grid must be shown
+38 −42
Original line number Diff line number Diff line
@@ -30,82 +30,78 @@
 */
void CVPCB_MAINFRAME::CreateScreenCmp()
{
    wxString msg, FootprintName;
    bool     IsNew = false;

    FootprintName = m_FootprintList->GetSelectedFootprint();

    if( m_DisplayFootprintFrame == NULL )
    {
        m_DisplayFootprintFrame = new DISPLAY_FOOTPRINTS_FRAME( this, _( "Module" ),
                                                  wxPoint( 0, 0 ),
                                                  wxSize( 600, 400 ),
                                                  KICAD_DEFAULT_DRAWFRAME_STYLE );
        IsNew = true;
        m_DisplayFootprintFrame->Show( true );
    }
    else
    {
        // Raising the window does not show the window on Windows if iconized.
        // This should work on any platform.
        if( m_DisplayFootprintFrame->IsIconized() )
             m_DisplayFootprintFrame->Iconize( false );
        m_DisplayFootprintFrame->Raise();
    }

        // Raising the window does not set the focus on Linux.  This should work on any platform.
        if( wxWindow::FindFocus() != m_DisplayFootprintFrame )
            m_DisplayFootprintFrame->SetFocus();
    m_DisplayFootprintFrame->InitDisplay();
}

    if( !FootprintName.IsEmpty() )
/* Refresh the full display for this frame:
 * Set the title, the status line and redraw the canvas
 * Must be called after the footprint to display is modifed
 */
void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
{
        msg = _( "Footprint: " ) + FootprintName;
        m_DisplayFootprintFrame->SetTitle( msg );
        FOOTPRINT_INFO* Module = m_footprints.GetModuleInfo( FootprintName );
    wxString msg;
    CVPCB_MAINFRAME * parentframe = (CVPCB_MAINFRAME *) GetParent();
    wxString footprintName = parentframe->m_FootprintList->GetSelectedFootprint();

    if( !footprintName.IsEmpty() )
    {
        msg = _( "Footprint: " ) + footprintName;
        SetTitle( msg );
        FOOTPRINT_INFO* module_info = parentframe->m_footprints.GetModuleInfo( footprintName );
        msg = _( "Lib: " );

        if( Module )
            msg += Module->m_LibName;
        if( module_info )
            msg += module_info->m_LibName;
        else
            msg += wxT( "???" );

        m_DisplayFootprintFrame->SetStatusText( msg, 0 );
        SetStatusText( msg, 0 );

        if( m_DisplayFootprintFrame->GetBoard()->m_Modules.GetCount() )
        if( GetBoard()->m_Modules.GetCount() )
        {
            // there is only one module in the list
            m_DisplayFootprintFrame->GetBoard()->m_Modules.DeleteAll();
            GetBoard()->m_Modules.DeleteAll();
        }

        MODULE* mod = m_DisplayFootprintFrame->Get_Module( FootprintName );
        MODULE* module = Get_Module( footprintName );

        if( mod )
            m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod );
        if( module )
            GetBoard()->m_Modules.PushBack( module );

        m_DisplayFootprintFrame->Zoom_Automatique( false );
        m_DisplayFootprintFrame->GetCanvas()->Refresh();
        Zoom_Automatique( false );

        // Display new cursor coordinates and zoom value:
        m_DisplayFootprintFrame->UpdateStatusBar();

        if( m_DisplayFootprintFrame->m_Draw3DFrame )
            m_DisplayFootprintFrame->m_Draw3DFrame->NewDisplay();
    }
    else if( !IsNew )   // No footprint to display. Erase old footprint, if any
    else   // No footprint to display. Erase old footprint, if any
    {
        if( m_DisplayFootprintFrame->GetBoard()->m_Modules.GetCount() )
        if( GetBoard()->m_Modules.GetCount() )
        {
            m_DisplayFootprintFrame->GetBoard()->m_Modules.DeleteAll();
            m_DisplayFootprintFrame->Zoom_Automatique( false );
            m_DisplayFootprintFrame->SetStatusText( wxEmptyString, 0 );
            m_DisplayFootprintFrame->UpdateStatusBar();
            GetBoard()->m_Modules.DeleteAll();
            Zoom_Automatique( false );
            SetStatusText( wxEmptyString, 0 );
        }
    }

        m_DisplayFootprintFrame->Refresh();
    // Display new cursor coordinates and zoom value:
    UpdateStatusBar();

        if( m_DisplayFootprintFrame->m_Draw3DFrame )
            m_DisplayFootprintFrame->m_Draw3DFrame->NewDisplay();
    }
    GetCanvas()->Refresh();

    if( m_Draw3DFrame )
        m_Draw3DFrame->NewDisplay();
}

/*
Loading