2016-07-19 17:35:25 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2018-03-16 12:38:36 +00:00
|
|
|
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
|
2019-01-13 19:04:34 +00:00
|
|
|
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2016-07-19 17:35:25 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file 3d_toolbar.cpp
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <fctsys.h>
|
|
|
|
|
|
|
|
#include <eda_3d_viewer.h>
|
|
|
|
#include <3d_canvas/cinfo3d_visu.h>
|
|
|
|
#include <menus_helpers.h>
|
|
|
|
#include <3d_viewer_id.h>
|
|
|
|
|
|
|
|
|
|
|
|
void EDA_3D_VIEWER::ReCreateMainToolbar()
|
|
|
|
{
|
2019-01-13 19:04:34 +00:00
|
|
|
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::ReCreateMainToolbar" );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
wxWindowUpdateLocker dummy( this );
|
|
|
|
|
|
|
|
if( m_mainToolBar )
|
2016-07-19 17:35:25 +00:00
|
|
|
{
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->Clear();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_mainToolBar = new wxAuiToolBar( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
|
|
|
|
KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT );
|
2016-07-19 17:35:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Set up toolbar
|
|
|
|
m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( import3d_xpm, this ), _( "Reload board" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( copy_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Copy 3D image to clipboard" ) );
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2017-12-28 08:29:56 +00:00
|
|
|
m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( read_setup_xpm, this ),
|
2018-03-16 12:38:36 +00:00
|
|
|
_( "Set display options, and some layers visibility" ) );
|
2017-12-28 08:29:56 +00:00
|
|
|
m_mainToolBar->AddSeparator();
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
|
|
|
|
KiScaledBitmap( render_mode_xpm, this ),
|
2019-01-19 13:02:10 +00:00
|
|
|
_( "Render current view using Raytracing" ), wxITEM_CHECK );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_IN, wxEmptyString,
|
|
|
|
KiScaledBitmap( zoom_in_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Zoom in" ) );
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString,
|
|
|
|
KiScaledBitmap( zoom_out_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Zoom out" ) );
|
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( zoom_redraw_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Redraw view" ) );
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString,
|
|
|
|
KiScaledBitmap( zoom_fit_in_page_xpm, this ),
|
2018-03-16 12:38:36 +00:00
|
|
|
_( "Zoom to fit 3D model" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ROTATE3D_X_NEG, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( rotate_neg_x_xpm, this ),
|
2018-04-26 18:58:49 +00:00
|
|
|
_( "Rotate X Clockwise" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_ROTATE3D_X_POS, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( rotate_pos_x_xpm, this ),
|
2018-04-26 18:58:49 +00:00
|
|
|
_( "Rotate X Counterclockwise" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ROTATE3D_Y_NEG, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( rotate_neg_y_xpm, this ),
|
2018-04-26 18:58:49 +00:00
|
|
|
_( "Rotate Y Clockwise" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_ROTATE3D_Y_POS, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( rotate_pos_y_xpm, this ),
|
2018-04-26 18:58:49 +00:00
|
|
|
_( "Rotate Y Counterclockwise" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
|
2016-07-19 17:35:25 +00:00
|
|
|
m_mainToolBar->AddTool( ID_ROTATE3D_Z_NEG, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( rotate_neg_z_xpm, this ),
|
2018-04-26 18:58:49 +00:00
|
|
|
_( "Rotate Z Clockwise" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_ROTATE3D_Z_POS, wxEmptyString,
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledBitmap( rotate_pos_z_xpm, this ),
|
2018-04-26 18:58:49 +00:00
|
|
|
_( "Rotate Z Counterclockwise" ) );
|
2016-07-19 17:35:25 +00:00
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_MOVE3D_LEFT, wxEmptyString,
|
|
|
|
KiScaledBitmap( left_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Move left" ) );
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MOVE3D_RIGHT, wxEmptyString,
|
|
|
|
KiScaledBitmap( right_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Move right" ) );
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MOVE3D_UP, wxEmptyString,
|
|
|
|
KiScaledBitmap( up_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Move up" ) );
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
m_mainToolBar->AddTool( ID_MOVE3D_DOWN, wxEmptyString,
|
|
|
|
KiScaledBitmap( down_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Move down" ) );
|
|
|
|
|
2019-04-08 12:19:17 +00:00
|
|
|
KiScaledSeparator( m_mainToolBar, this );
|
|
|
|
|
|
|
|
m_mainToolBar->AddTool( ID_ORTHO, wxEmptyString,
|
|
|
|
KiScaledBitmap( ortho_xpm, this ),
|
2016-07-19 17:35:25 +00:00
|
|
|
_( "Enable/Disable orthographic projection" ),
|
|
|
|
wxITEM_CHECK );
|
|
|
|
|
|
|
|
m_mainToolBar->Realize();
|
2019-04-08 12:19:17 +00:00
|
|
|
}
|