KiCad PCB EDA Suite
dialog_3D_view_option.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-2017 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 
27 #include <3d_canvas/cinfo3d_visu.h>
28 #include <bitmaps.h>
29 
31 {
32 public:
33  explicit DIALOG_3D_VIEW_OPTIONS( EDA_3D_VIEWER* parent );
34 
35 private:
38 
39  void initDialog();
40 
42  bool TransferDataFromWindow() override;
43 
45  bool TransferDataToWindow() override;
46 };
47 
48 
49 void EDA_3D_VIEWER::Install3DViewOptionDialog( wxCommandEvent& event )
50 {
51  DIALOG_3D_VIEW_OPTIONS dlg( this );
52 
53  if( dlg.ShowModal() == wxID_OK )
54  {
55  SetMenuBarOptionsState();
56 
57  NewDisplay( true );
58  }
59 }
60 
61 
63  :DIALOG_3D_VIEW_OPTIONS_BASE( parent ), m_3Dprms( parent->GetSettings() )
64 {
65  m_parent = parent;
66 
67  initDialog();
68 
69  m_sdbSizerOK->SetDefault();
70 
71  // Now all widgets have the size fixed, call FinishDialogSettings
73 }
74 
75 
77 {
78  m_bitmapRealisticMode->SetBitmap( KiBitmap( use_3D_copper_thickness_xpm ) );
79  m_bitmapBoardBody->SetBitmap( KiBitmap( ortho_xpm ) );
80  m_bitmapCuThickness->SetBitmap( KiBitmap( use_3D_copper_thickness_xpm ) );
81  m_bitmap3DshapesTH->SetBitmap( KiBitmap( shape_3d_xpm ) );
82  m_bitmap3DshapesSMD->SetBitmap( KiBitmap( shape_3d_xpm ) );
83  m_bitmap3DshapesVirtual->SetBitmap( KiBitmap( shape_3d_xpm ) );
84  m_bitmapBoundingBoxes->SetBitmap( KiBitmap( axis3d_xpm ) );
85  m_bitmapAreas->SetBitmap( KiBitmap( add_zone_xpm ) );
86  m_bitmapSilkscreen->SetBitmap( KiBitmap( text_xpm ) );
87  m_bitmapSolderMask->SetBitmap( KiBitmap( pads_mask_layers_xpm ) );
88  m_bitmapSolderPaste->SetBitmap( KiBitmap( pads_mask_layers_xpm ) );
89  m_bitmapAdhesive->SetBitmap( KiBitmap( tools_xpm ) );
90  m_bitmapComments->SetBitmap( KiBitmap( editor_xpm ) );
91  m_bitmapECO->SetBitmap( KiBitmap( editor_xpm ) );
92 }
93 
94 
96 {
97  // Check/uncheck checkboxes
101  m_checkBoxAreas->SetValue( m_3Dprms.GetFlag( FL_ZONE ) );
103 
107 
113  m_checkBoxECO->SetValue( m_3Dprms.GetFlag( FL_ECO ) );
114 
115  return true;
116 }
117 
118 
120 {
121  // Set render mode
123 
124  // Set visibility of items
127  m_3Dprms.SetFlag( FL_ZONE, m_checkBoxAreas->GetValue() );
129 
130  // Set 3D shapes visibility
134 
135  // Set Layer visibility
141  m_3Dprms.SetFlag( FL_ECO, m_checkBoxECO->GetValue( ) );
142 
143  return true;
144 }
void Install3DViewOptionDialog(wxCommandEvent &event)
DIALOG_3D_VIEW_OPTIONS(EDA_3D_VIEWER *parent)
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Class DIALOG_3D_VIEW_OPTIONS_BASE.
Handles data related with the board to be visualized.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
bool TransferDataToWindow() override
Automatically called after creating the dialog.
Class CINFO3D_VISU Helper class to handle information needed to display 3D board. ...
Definition: cinfo3d_visu.h:70
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
Declaration of the eda_3d_viewer class.
Class EDA_3D_VIEWER Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard...
Definition: eda_3d_viewer.h:50
static const char * text_xpm[]
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
bool TransferDataFromWindow() override
Automatically called when clicking on the OK button.