3D viewer: do not rebuild the board 3D shape when footprint 3D models visibility
has changed: the 3D models visibility does not change the board shape.
This commit is contained in:
parent
b837aa823c
commit
1f99a5caa6
|
@ -40,6 +40,8 @@
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/textdlg.h>
|
#include <wx/textdlg.h>
|
||||||
|
|
||||||
|
#include <../3d_rendering/opengl/render_3d_opengl.h>
|
||||||
|
|
||||||
|
|
||||||
#define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D // Render Row abbreviation to reduce source width
|
#define RR APPEARANCE_CONTROLS_3D::APPEARANCE_SETTING_3D // Render Row abbreviation to reduce source width
|
||||||
|
|
||||||
|
@ -294,6 +296,7 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
|
||||||
std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
|
std::bitset<LAYER_3D_END> visibleLayers = m_frame->GetAdapter().GetVisibleLayers();
|
||||||
const std::map<int, COLOR4D>& colors = m_frame->GetAdapter().GetLayerColors();
|
const std::map<int, COLOR4D>& colors = m_frame->GetAdapter().GetLayerColors();
|
||||||
bool killFollow = false;
|
bool killFollow = false;
|
||||||
|
bool doFastRefresh = false; // true to just refresh the display
|
||||||
|
|
||||||
// Special-case controls
|
// Special-case controls
|
||||||
switch( aLayer )
|
switch( aLayer )
|
||||||
|
@ -339,6 +342,15 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
|
||||||
killFollow = true;
|
killFollow = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LAYER_3D_TH_MODELS:
|
||||||
|
case LAYER_3D_SMD_MODELS:
|
||||||
|
case LAYER_3D_VIRTUAL_MODELS:
|
||||||
|
case LAYER_3D_MODELS_NOT_IN_POS:
|
||||||
|
case LAYER_3D_MODELS_MARKED_DNP:
|
||||||
|
doFastRefresh = true;
|
||||||
|
visibleLayers.set( aLayer, isVisible );
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
visibleLayers.set( aLayer, isVisible );
|
visibleLayers.set( aLayer, isVisible );
|
||||||
break;
|
break;
|
||||||
|
@ -353,7 +365,17 @@ void APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged( int aLayer, bool isVisibl
|
||||||
syncLayerPresetSelection();
|
syncLayerPresetSelection();
|
||||||
|
|
||||||
UpdateLayerCtls();
|
UpdateLayerCtls();
|
||||||
m_frame->NewDisplay( true );
|
|
||||||
|
if( doFastRefresh
|
||||||
|
&& m_frame->GetAdapter().m_Cfg->m_Render.engine == RENDER_ENGINE::OPENGL )
|
||||||
|
{
|
||||||
|
RENDER_3D_OPENGL* renderer =
|
||||||
|
static_cast<RENDER_3D_OPENGL*>( m_frame->GetCanvas()->GetCurrentRender() );
|
||||||
|
renderer->Load3dModelsIfNeeded();
|
||||||
|
m_frame->GetCanvas()->Request_refresh();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_frame->NewDisplay( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue