Commit 9a47f4c6 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Created a specialization of EDA_DRAW_PANEL_GAL: PCB_DRAW_PANEL_GAL.

Moved View related routines & fields from PCB_{BASE,EDIT}_FRAME & BOARD to PCB_DRAW_PANEL_GAL.
parent 2f6c5f31
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line Diff line number Diff line
@@ -199,6 +199,28 @@ void EDA_DRAW_PANEL_GAL::StopDrawing()
}
}




void EDA_DRAW_PANEL_GAL::SetHighContrastLayer( LAYER_NUM aLayer )
{
    // Set display settings for high contrast mode
    KIGFX::RENDER_SETTINGS* rSettings = m_view->GetPainter()->GetSettings();

    SetTopLayer( aLayer );

    rSettings->ClearActiveLayers();
    rSettings->SetActiveLayer( aLayer );

    m_view->UpdateAllLayersColor();
}


void EDA_DRAW_PANEL_GAL::SetTopLayer( LAYER_NUM aLayer )
{
    m_view->ClearTopLayers();
    m_view->SetTopLayer( aLayer );
    m_view->UpdateAllLayersOrder();
}


void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
{
{
    // Do not do anything if the currently used GAL is correct
    // Do not do anything if the currently used GAL is correct
+14 −2
Original line number Original line Diff line number Diff line
@@ -30,9 +30,9 @@
#ifndef  PANELGAL_WXSTRUCT_H
#ifndef  PANELGAL_WXSTRUCT_H
#define  PANELGAL_WXSTRUCT_H
#define  PANELGAL_WXSTRUCT_H


#include <wx/wx.h>
#include <wx/window.h>
#include <wx/window.h>

#include <wx/timer.h>
#include <layers_id_colors_and_visibility.h>
#include <math/vector2d.h>
#include <math/vector2d.h>


class BOARD;
class BOARD;
@@ -133,6 +133,18 @@ public:
     */
     */
    void StopDrawing();
    void StopDrawing();


    /**
     * Function SetHighContrastLayer
     * Takes care of display settings for the given layer to be displayed in high contrast mode.
     */
    virtual void SetHighContrastLayer( LAYER_NUM aLayer );

    /**
     * Function SetTopLayer
     * Moves the selected layer to the top, so it is displayed above all others.
     */
    virtual void SetTopLayer( LAYER_NUM aLayer );

protected:
protected:
    void onPaint( wxPaintEvent& WXUNUSED( aEvent ) );
    void onPaint( wxPaintEvent& WXUNUSED( aEvent ) );
    void onSize( wxSizeEvent& aEvent );
    void onSize( wxSizeEvent& aEvent );
+0 −4
Original line number Original line Diff line number Diff line
@@ -110,10 +110,6 @@ protected:
    MODULE* loadFootprint( const FPID& aFootprintId )
    MODULE* loadFootprint( const FPID& aFootprintId )
        throw( IO_ERROR, PARSE_ERROR );
        throw( IO_ERROR, PARSE_ERROR );


    ///> Rendering order of layers on GAL-based canvas (lower index in the array
    ///> means that layer is displayed closer to the user, ie. on the top).
    static const LAYER_NUM GAL_LAYER_ORDER[];

public:
public:
    PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
    PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
            const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
            const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
+0 −18
Original line number Original line Diff line number Diff line
@@ -531,18 +531,6 @@ public:
     */
     */
    virtual void OnModify();
    virtual void OnModify();


    /**
     * Function SetHighContrastLayer
     * takes care of display settings for the given layer to be displayed in high contrast mode.
     */
    void SetHighContrastLayer( LAYER_ID aLayer );

    /**
     * Function SetTopLayer
     * moves the selected layer to the top, so it is displayed above all others.
     */
    void SetTopLayer( LAYER_ID aLayer );

    /**
    /**
     * Function SetActiveLayer
     * Function SetActiveLayer
     * will change the currently active layer to \a aLayer and also
     * will change the currently active layer to \a aLayer and also
@@ -890,12 +878,6 @@ public:
    /// @copydoc PCB_BASE_FRAME::SetBoard()
    /// @copydoc PCB_BASE_FRAME::SetBoard()
    void SetBoard( BOARD* aBoard );
    void SetBoard( BOARD* aBoard );


    /**
    * Function ViewReloadBoard
    * adds all items from the current board to the VIEW, so they can be displayed by GAL.
    */
    void ViewReloadBoard( const BOARD* aBoard ) const;

    // Drc control
    // Drc control


    /* function GetDrcController
    /* function GetDrcController
+1 −0
Original line number Original line Diff line number Diff line
@@ -221,6 +221,7 @@ set( PCBNEW_CLASS_SRCS
    pad_edition_functions.cpp
    pad_edition_functions.cpp
    pcbnew_config.cpp
    pcbnew_config.cpp
    pcbplot.cpp
    pcbplot.cpp
    pcb_draw_panel_gal.cpp
    plot_board_layers.cpp
    plot_board_layers.cpp
    plot_brditems_plotter.cpp
    plot_brditems_plotter.cpp
    print_board_functions.cpp
    print_board_functions.cpp
Loading