Panel 3D previewer: for show 3D body shapes, regardless the 3D viewer itself.

the Panel 3D previewer is made to show 3D body shapes, so do not show them
when disabled in the board 3D viewer, is really stupid.
This commit is contained in:
jean-pierre charras 2022-01-06 12:04:28 +01:00
parent bf5cdec743
commit 0f0a540a65
3 changed files with 9 additions and 0 deletions

View File

@ -79,6 +79,7 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
m_Cfg( nullptr ),
m_IsBoardView( true ),
m_MousewheelPanning( true ),
m_IsPreviewer( false ),
m_board( nullptr ),
m_3dModelManager( nullptr ),
m_colors( nullptr ),
@ -257,6 +258,9 @@ bool BOARD_ADAPTER::Is3dLayerEnabled( PCB_LAYER_ID aLayer ) const
bool BOARD_ADAPTER::IsFootprintShown( FOOTPRINT_ATTR_T aFPAttributes ) const
{
if( m_IsPreviewer ) // In panel Preview, footprints are always shown, of cource
return true;
if( aFPAttributes & FP_SMD )
return m_Cfg->m_Render.show_footprints_insert;
else if( aFPAttributes & FP_THROUGH_HOLE )

View File

@ -527,6 +527,9 @@ public:
EDA_3D_VIEWER_SETTINGS* m_Cfg;
bool m_IsBoardView;
bool m_MousewheelPanning;
bool m_IsPreviewer; ///< true if the board adaptater is living in a
///< 3d preview panel, false for the standard 3D viewer
///< allows specific features for the panel previewer
SFVEC4F m_BgColorBot; ///< background bottom color
SFVEC4F m_BgColorTop; ///< background top color

View File

@ -98,6 +98,8 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
m_boardAdapter.SetBoard( m_dummyBoard );
m_boardAdapter.m_IsBoardView = false;
m_boardAdapter.m_IsPreviewer = true; // Force display 3D models, regardless the 3D viewer options
loadSettings();
// Create the manager