3D viewer flip action
This commit is contained in:
parent
f8967550a8
commit
4a3743e7dd
|
@ -104,3 +104,8 @@ CMakeSettings.json
|
|||
|
||||
# Sublime Text
|
||||
*.sublime-*
|
||||
|
||||
# KDevelop
|
||||
.kdev4/
|
||||
*.kdev4
|
||||
|
||||
|
|
|
@ -948,6 +948,13 @@ bool EDA_3D_CANVAS::SetView3D( int aKeycode )
|
|||
request_start_moving_camera( glm::min( glm::max( m_camera.ZoomGet(), 0.5f ), 1.125f ) );
|
||||
return true;
|
||||
|
||||
case ID_VIEW3D_FLIP:
|
||||
m_camera.SetInterpolateMode( CAMERA_INTERPOLATION::BEZIER );
|
||||
m_camera.SetT0_and_T1_current_T();
|
||||
m_camera.RotateY_T1( glm::radians( 179.999f ) );
|
||||
request_start_moving_camera();
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -87,6 +87,9 @@ void EDA_3D_VIEWER::ReCreateMainToolbar()
|
|||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateZCW );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::rotateZCCW );
|
||||
|
||||
KiScaledSeparator( m_mainToolBar, this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::flipView );
|
||||
|
||||
KiScaledSeparator( m_mainToolBar, this );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::moveLeft );
|
||||
m_mainToolBar->Add( EDA_3D_ACTIONS::moveRight );
|
||||
|
|
|
@ -109,6 +109,12 @@ TOOL_ACTION EDA_3D_ACTIONS::resetView( "3DViewer.Control.resetView",
|
|||
_( "Reset view" ), _( "Reset view" ),
|
||||
nullptr, AF_NONE, (void*) ID_VIEW3D_RESET );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::flipView( "3DViewer.Control.flipView",
|
||||
AS_ACTIVE,
|
||||
0, "",
|
||||
_( "Flip Board" ), _( "Flip the board view" ),
|
||||
reload2_xpm, AF_NONE, (void*) ID_VIEW3D_FLIP );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::toggleOrtho( "3DViewer.Control.toggleOrtho",
|
||||
AS_GLOBAL, 0, "",
|
||||
_( "Toggle orthographic projection" ), _( "Enable/disable orthographic projection" ),
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
static TOOL_ACTION moveDown;
|
||||
static TOOL_ACTION homeView;
|
||||
static TOOL_ACTION resetView;
|
||||
static TOOL_ACTION flipView;
|
||||
static TOOL_ACTION toggleOrtho;
|
||||
|
||||
static TOOL_ACTION viewFront;
|
||||
|
|
|
@ -51,6 +51,9 @@ bool EDA_3D_CONTROLLER::Init()
|
|||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewFront, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::viewBack, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::flipView, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
||||
ctxMenu.AddSeparator();
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::moveLeft, SELECTION_CONDITIONS::ShowAlways );
|
||||
ctxMenu.AddItem( EDA_3D_ACTIONS::moveRight, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
@ -295,6 +298,7 @@ void EDA_3D_CONTROLLER::setTransitions()
|
|||
Go( &EDA_3D_CONTROLLER::ViewControl, EDA_3D_ACTIONS::pivotCenter.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ViewControl, EDA_3D_ACTIONS::homeView.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ViewControl, EDA_3D_ACTIONS::resetView.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::ViewControl, EDA_3D_ACTIONS::flipView.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::RotateView, EDA_3D_ACTIONS::rotateXCW.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::RotateView, EDA_3D_ACTIONS::rotateXCCW.MakeEvent() );
|
||||
Go( &EDA_3D_CONTROLLER::RotateView, EDA_3D_ACTIONS::rotateYCW.MakeEvent() );
|
||||
|
|
|
@ -31,6 +31,7 @@ enum id_3dview_frm
|
|||
ID_VIEW3D_FRONT,
|
||||
ID_VIEW3D_BACK,
|
||||
ID_VIEW3D_RESET,
|
||||
ID_VIEW3D_FLIP,
|
||||
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
|
||||
ID_MENU3D_COLOR,
|
||||
ID_MENU3D_BGCOLOR,
|
||||
|
|
Loading…
Reference in New Issue