KiCad PCB EDA Suite
panel_3D_display_options.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) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2014-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
29 #include <tool/tool_manager.h>
30 
31 
34  m_frame( aFrame ),
35  m_settings( aFrame->GetAdapter() ),
36  m_canvas( aFrame->GetCanvas() )
37 {
38 }
39 
40 
42 {
45 }
46 
47 
49 {
50  // Check/uncheck checkboxes
53  m_checkBoxAreas->SetValue( m_settings.GetFlag( FL_ZONE ) );
54 
60  m_checkBoxECO->SetValue( m_settings.GetFlag( FL_ECO ) );
65 
66  switch( m_settings.GetMaterialMode() )
67  {
68  default:
69  case MATERIAL_MODE::NORMAL: m_materialProperties->SetSelection( 0 ); break;
70  case MATERIAL_MODE::DIFFUSE_ONLY: m_materialProperties->SetSelection( 1 ); break;
71  case MATERIAL_MODE::CAD_MODE: m_materialProperties->SetSelection( 2 ); break;
72  }
73 
74  // Camera Options
79 
81  m_spinCtrlRotationAngle->SetValue( ctrlTool->GetRotationIncrement() );
82 
83  return true;
84 }
85 
86 
88 {
89  // Set render mode
91 
92  // Set visibility of items
94  m_settings.SetFlag( FL_ZONE, m_checkBoxAreas->GetValue() );
99 
100  switch( m_materialProperties->GetSelection() )
101  {
102  default:
106  }
107 
108  // Set Layer visibility
114  m_settings.SetFlag( FL_ECO, m_checkBoxECO->GetValue( ) );
115 
116  // Camera Options
119 
121  ctrlTool->SetRotationIncrement( m_spinCtrlRotationAngle->GetValue() );
122 
123  // The 3D scene will be rebuilt by the caller
124 
125  return true;
126 }
Use a gray shading based on diffuse material.
bool GetFlag(DISPLAY3D_FLG aFlag) const
Get a configuration status of a flag.
int GetMovingSpeedMultiplier() const
PANEL_3D_DISPLAY_OPTIONS(EDA_3D_VIEWER_FRAME *aFrame, wxWindow *aParent)
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
Set the status of a flag.
void OnCheckEnableAnimation(wxCommandEvent &WXUNUSED(event)) override
void SetRotationIncrement(double aRotIncrement)
Set the increment used by the RotateView actions.
bool TransferDataFromWindow() override
Automatically called when clicking on the OK button.
void SetAnimationEnabled(bool aEnable)
Enable or disable camera animation when switching to a pre-defined view.
Use only diffuse material properties.
Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard.
Use all material properties from model file.
EDA_3D_CONTROLLER.
MATERIAL_MODE GetMaterialMode() const noexcept
void SetMaterialMode(MATERIAL_MODE aMaterialMode) noexcept
Class PANEL_3D_DISPLAY_OPTIONS_BASE.
double GetRotationIncrement()
Get the increment used by the RotateView actions.
void SetMovingSpeedMultiplier(int aMultiplier)
Set the camera animation moving speed multiplier option.
bool GetAnimationEnabled() const
bool TransferDataToWindow() override
Automatically called after creating the dialog.
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:54