Minor code cleaning.

This commit is contained in:
Wayne Stambaugh 2022-03-04 10:07:10 -05:00
parent 006e1be69c
commit aa9fa09000
1 changed files with 4 additions and 14 deletions

View File

@ -142,7 +142,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY* aKiway, PCB_BASE_FRAME* aParent
m_auimgr.SetManagedWindow( this ); m_auimgr.SetManagedWindow( this );
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) ); m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) ); m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer( 1 ) );
m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() ); m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
@ -186,10 +186,6 @@ EDA_3D_VIEWER_FRAME::~EDA_3D_VIEWER_FRAME()
m_canvas->SetEventDispatcher( nullptr ); m_canvas->SetEventDispatcher( nullptr );
m_auimgr.UnInit(); m_auimgr.UnInit();
// m_canvas delete will be called by wxWidget manager
//delete m_canvas;
//m_canvas = nullptr;
} }
@ -255,7 +251,6 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions()
mgr->SetConditions( EDA_3D_ACTIONS::show1mmGrid, GridSizeCheck( GRID3D_TYPE::GRID_1MM ) ); mgr->SetConditions( EDA_3D_ACTIONS::show1mmGrid, GridSizeCheck( GRID3D_TYPE::GRID_1MM ) );
mgr->SetConditions( EDA_3D_ACTIONS::toggleOrtho, ACTION_CONDITIONS().Check( ortho ) ); mgr->SetConditions( EDA_3D_ACTIONS::toggleOrtho, ACTION_CONDITIONS().Check( ortho ) );
#undef FlagCheck
#undef GridSizeCheck #undef GridSizeCheck
} }
@ -311,10 +306,6 @@ void EDA_3D_VIEWER_FRAME::OnCloseWindow( wxCloseEvent &event )
if( m_canvas ) if( m_canvas )
m_canvas->Close(); m_canvas->Close();
// m_canvas delete will be called by wxWidget manager
//delete m_canvas;
//m_canvas = nullptr;
Destroy(); Destroy();
event.Skip( true ); event.Skip( true );
} }
@ -444,16 +435,14 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
{ {
m_boardAdapter.m_Cfg = cfg; m_boardAdapter.m_Cfg = cfg;
// When opening the 3D viewer, we use the opengl mode, never the ray tracing engine // When opening the 3D viewer, we use the OpenGL mode, never the ray tracing engine
// because the ray tracing is very time consumming, and can be seen as not working // because the ray tracing is very time consuming, and can be seen as not working
// (freeze window) with large boards. // (freeze window) with large boards.
m_boardAdapter.m_Cfg->m_Render.engine = RENDER_ENGINE::OPENGL; m_boardAdapter.m_Cfg->m_Render.engine = RENDER_ENGINE::OPENGL;
m_canvas->SetAnimationEnabled( cfg->m_Camera.animation_enabled ); m_canvas->SetAnimationEnabled( cfg->m_Camera.animation_enabled );
m_canvas->SetMovingSpeedMultiplier( cfg->m_Camera.moving_speed_multiplier ); m_canvas->SetMovingSpeedMultiplier( cfg->m_Camera.moving_speed_multiplier );
m_canvas->SetProjectionMode( cfg->m_Camera.projection_mode ); m_canvas->SetProjectionMode( cfg->m_Camera.projection_mode );
#undef TRANSFER_SETTING
} }
} }
@ -610,6 +599,7 @@ void EDA_3D_VIEWER_FRAME::loadCommonSettings()
const DPI_SCALING dpi{ settings, this }; const DPI_SCALING dpi{ settings, this };
m_canvas->SetScaleFactor( dpi.GetScaleFactor() ); m_canvas->SetScaleFactor( dpi.GetScaleFactor() );
// TODO(JE) use all control options // TODO(JE) use all control options
m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0; m_boardAdapter.m_MousewheelPanning = settings->m_Input.scroll_modifier_zoom != 0;
} }