KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
5 * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
6 * Copyright (C) 2013 Wayne Stambaugh <[email protected]>
7 * Copyright (C) 2023 CERN
8 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, you may find one here:
22 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
23 * or you may search the http://www.gnu.org website for the version 2 license,
24 * or you may write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26 */
27
28#include <wx/wupdlock.h>
29#include <wx/choice.h>
30
31#include <bitmaps.h>
33#include <eda_3d_viewer_frame.h>
34#include <tool/action_toolbar.h>
36#include <3d_viewer_id.h>
37
39{
40 wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::ReCreateMainToolbar" ) );
41
42 wxWindowUpdateLocker dummy( this );
43
44 if( m_mainToolBar )
45 {
47 }
48 else
49 {
50 m_mainToolBar = new ACTION_TOOLBAR( this, ID_H_TOOLBAR, wxDefaultPosition, wxDefaultSize,
51 KICAD_AUI_TB_STYLE | wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_HORIZONTAL );
53 }
54
55 // Set up toolbar
56 m_mainToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
57 KiScaledBitmap( BITMAPS::import3d, this ), _( "Reload board" ) );
58
60 m_mainToolBar->AddTool( ID_TOOL_SCREENCOPY_TOCLIBBOARD, wxEmptyString,
61 KiScaledBitmap( BITMAPS::copy, this ),
62 _( "Copy 3D image to clipboard" ) );
63
65 m_mainToolBar->AddTool( ID_RENDER_CURRENT_VIEW, wxEmptyString,
66 KiScaledBitmap( BITMAPS::render_mode, this ),
67 _( "Render current view using Raytracing" ), wxITEM_CHECK );
68
74
78
82
86
89
95
98
101
103}
104
105
@ ID_RELOAD3D_BOARD
Definition: 3d_viewer_id.h:37
@ ID_TOOL_SCREENCOPY_TOCLIBBOARD
Definition: 3d_viewer_id.h:38
@ ID_RENDER_CURRENT_VIEW
Definition: 3d_viewer_id.h:49
wxBitmap KiScaledBitmap(BITMAPS aBitmap, wxWindow *aWindow, int aHeight, bool aQuantized)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
Definition: bitmap.cpp:147
static TOOL_ACTION zoomRedraw
Definition: actions.h:114
static TOOL_ACTION zoomOutCenter
Definition: actions.h:118
static TOOL_ACTION zoomFitScreen
Definition: actions.h:124
static TOOL_ACTION zoomInCenter
Definition: actions.h:117
Define the structure of a toolbar with buttons that invoke ACTIONs.
static constexpr bool TOGGLE
void SetAuiManager(wxAuiManager *aManager)
Set the AUI manager that this toolbar belongs to.
void AddScaledSeparator(wxWindow *aWindow)
Add a separator that introduces space on either side to not squash the tools when scaled.
bool KiRealize()
Use this over Realize() to avoid a rendering glitch with fixed orientation toolbars.
void ClearToolbar()
Clear the toolbar and remove all associated menus.
void Add(const TOOL_ACTION &aAction, bool aIsToggleEntry=false, bool aIsCancellable=false)
Add a TOOL_ACTION-based button to the toolbar.
static TOOL_ACTION showLayersManager
static TOOL_ACTION rotateXCCW
static TOOL_ACTION rotateZCCW
static TOOL_ACTION rotateZCW
static TOOL_ACTION rotateYCCW
static TOOL_ACTION rotateXCW
static TOOL_ACTION toggleOrtho
static TOOL_ACTION moveLeft
static TOOL_ACTION moveUp
static TOOL_ACTION flipView
static TOOL_ACTION moveDown
static TOOL_ACTION moveRight
static TOOL_ACTION rotateYCW
ACTION_TOOLBAR * m_mainToolBar
void ReCreateMainToolbar()
Definition: 3d_toolbar.cpp:38
static constexpr int KICAD_AUI_TB_STYLE
< Default style flags used for wxAUI toolbars.
wxAuiManager m_auimgr
#define _(s)
Declaration of the eda_3d_viewer class.
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
@ ID_H_TOOLBAR
Definition: id.h:100
std::vector< FAB_LAYER_COLOR > dummy