3D-Viewer: request a redraw when a footprint is selected in pcbnew

This commit is contained in:
Mario Luzeiro 2020-09-02 17:54:57 +01:00 committed by Jon Evans
parent fe51cc947c
commit a1e94c2583
5 changed files with 26 additions and 0 deletions

View File

@ -271,6 +271,12 @@ void EDA_3D_VIEWER::NewDisplay( bool aForceImmediateRedraw )
m_canvas->Refresh();
}
void EDA_3D_VIEWER::Redraw()
{
// Only update in OpenGL for an interactive interaction
if( m_boardAdapter.RenderEngineGet() == RENDER_ENGINE::OPENGL_LEGACY )
m_canvas->Refresh();
}
void EDA_3D_VIEWER::Exit3DFrame( wxCommandEvent &event )
{

View File

@ -101,6 +101,8 @@ class EDA_3D_VIEWER : public EDA_3D_BOARD_HOLDER, public KIWAY_PLAYER
*/
void NewDisplay( bool aForceImmediateRedraw = false );
void Redraw();
BOARD_ADAPTER& GetAdapter() override { return m_boardAdapter; }
CCAMERA& GetCurrentCamera() override { return m_currentCamera; }

View File

@ -118,6 +118,11 @@ public:
*/
virtual void Update3DView( bool aForceReload, const wxString* aTitle = nullptr );
/**
* Request a redraw of 3D-Viewer canvas
*/
void Redraw3Dview();
/**
* Function LoadFootprint
* attempts to load \a aFootprintId from the footprint library table.

View File

@ -95,6 +95,17 @@ void PCB_BASE_FRAME::Update3DView( bool aForceReload, const wxString* aTitle )
}
void PCB_BASE_FRAME::Redraw3Dview()
{
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame )
{
draw3DFrame->Redraw();
}
}
FP_LIB_TABLE* PROJECT::PcbFootprintLibs()
{
// This is a lazy loading function, it loads the project specific table when

View File

@ -471,6 +471,8 @@ int PCB_INSPECTION_TOOL::CrossProbePcbToSch( const TOOL_EVENT& aEvent )
else
m_frame->SendMessageToEESCHEMA( nullptr );
m_frame->Redraw3Dview();
return 0;
}