KiCad PCB EDA Suite
3d_toolbar.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
6  * Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
7  * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #include <wx/wupdlock.h>
28 
29 #include <bitmaps.h>
30 #include <eda_3d_viewer.h>
31 #include <menus_helpers.h>
32 #include <tool/action_toolbar.h>
33 #include <tools/3d_actions.h>
34 #include <3d_viewer_id.h>
35 
37 {
38  wxLogTrace( m_logTrace, "EDA_3D_VIEWER::ReCreateMainToolbar" );
39 
40  wxWindowUpdateLocker dummy( this );
41 
42  if( m_mainToolBar )
43  {
45  }
46  else
47  {
48  m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
49  KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_HORIZONTAL );
51  }
52 
53  // Set up toolbar
54  m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
55  KiScaledBitmap( BITMAPS::import3d, this ), _( "Reload board" ) );
56 
58  m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
60  _( "Copy 3D image to clipboard" ) );
61 
63  m_mainToolBar->AddTool( ID_TOOL_SET_VISIBLE_ITEMS, wxEmptyString,
65  _( "Set display options, and some layers visibility" ) );
66 
68  m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
70  _( "Render current view using Raytracing" ), wxITEM_CHECK );
71 
77 
81 
85 
89 
92 
98 
101 
103 }
static TOOL_ACTION rotateXCW
Definition: 3d_actions.h:47
Define the structure of a toolbar with buttons that invoke ACTIONs.
static TOOL_ACTION zoomInCenter
Definition: actions.h:96
static constexpr bool TOGGLE
void AddScaledSeparator(wxWindow *aWindow)
Add a separator that introduces space on either side to not squash the tools when scaled.
void Add(const TOOL_ACTION &aAction, bool aIsToggleEntry=false, bool aIsCancellable=false)
Add a TOOL_ACTION-based button to the toolbar.
static TOOL_ACTION zoomFitScreen
Definition: actions.h:99
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
Definition: sch_symbol.cpp:69
void SetAuiManager(wxAuiManager *aManager)
Set the AUI manager that this toolbar belongs to.
wxAuiManager m_auimgr
bool KiRealize()
Use this over Realize() to avoid a rendering glitch with fixed orientation toolbars.
static TOOL_ACTION zoomOutCenter
Definition: actions.h:97
static TOOL_ACTION flipView
Definition: 3d_actions.h:59
static TOOL_ACTION moveLeft
Definition: 3d_actions.h:53
static TOOL_ACTION rotateYCW
Definition: 3d_actions.h:49
static TOOL_ACTION rotateXCCW
Definition: 3d_actions.h:48
void ReCreateMainToolbar()
Definition: 3d_toolbar.cpp:36
static TOOL_ACTION rotateZCCW
Definition: 3d_actions.h:52
static TOOL_ACTION rotateZCW
Definition: 3d_actions.h:51
static TOOL_ACTION moveDown
Definition: 3d_actions.h:56
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
Declaration of the eda_3d_viewer class.
static TOOL_ACTION rotateYCCW
Definition: 3d_actions.h:50
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION zoomRedraw
Definition: actions.h:93
static TOOL_ACTION moveUp
Definition: 3d_actions.h:55
static constexpr int KICAD_AUI_TB_STYLE
< Default style flags used for wxAUI toolbars.
ACTION_TOOLBAR * m_mainToolBar
static TOOL_ACTION toggleOrtho
Definition: 3d_actions.h:60
static TOOL_ACTION moveRight
Definition: 3d_actions.h:54
wxBitmap KiScaledBitmap(BITMAPS aBitmap, wxWindow *aWindow, int aHeight)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:147
void ClearToolbar()
Clear the toolbar and remove all associated menus.