KiCad PCB EDA Suite
eda_3d_viewer.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) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 1992-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 
30 #include "eda_3d_viewer.h"
31 #include "../3d_viewer_id.h"
32 #include <project.h>
33 #include <gestfich.h>
34 #include <wx/colordlg.h>
35 #include <wx/colourdata.h>
36 #include <lru_cache.h>
37 #include "../common_ogl/cogl_att_list.h"
38 #include <hotkeys_basic.h>
39 #include <wx/toolbar.h>
40 #include <bitmaps.h>
41 
48 const wxChar * EDA_3D_VIEWER::m_logTrace = wxT( "KI_TRACE_EDA_3D_VIEWER" );
49 
50 
51 // Key to store 3D Viewer config
52 
53 static const wxChar keyBgColor_Red[] = wxT( "BgColor_Red" );
54 static const wxChar keyBgColor_Green[] = wxT( "BgColor_Green" );
55 static const wxChar keyBgColor_Blue[] = wxT( "BgColor_Blue" );
56 
57 static const wxChar keyBgColor_Red_Top[] = wxT( "BgColor_Red_Top" );
58 static const wxChar keyBgColor_Green_Top[] = wxT( "BgColor_Green_Top" );
59 static const wxChar keyBgColor_Blue_Top[] = wxT( "BgColor_Blue_Top" );
60 
61 static const wxChar keySMaskColor_Red[] = wxT( "SMaskColor_Red" );
62 static const wxChar keySMaskColor_Green[] = wxT( "SMaskColor_Green" );
63 static const wxChar keySMaskColor_Blue[] = wxT( "SMaskColor_Blue" );
64 
65 static const wxChar keySPasteColor_Red[] = wxT( "SPasteColor_Red" );
66 static const wxChar keySPasteColor_Green[] = wxT( "SPasteColor_Green" );
67 static const wxChar keySPasteColor_Blue[] = wxT( "SPasteColor_Blue" );
68 
69 static const wxChar keySilkColor_Red[] = wxT( "SilkColor_Red" );
70 static const wxChar keySilkColor_Green[] = wxT( "SilkColor_Green" );
71 static const wxChar keySilkColor_Blue[] = wxT( "SilkColor_Blue" );
72 
73 static const wxChar keyCopperColor_Red[] = wxT( "CopperColor_Red" );
74 static const wxChar keyCopperColor_Green[] = wxT( "CopperColor_Green" );
75 static const wxChar keyCopperColor_Blue[] = wxT( "CopperColor_Blue" );
76 
77 static const wxChar keyBoardBodyColor_Red[] = wxT( "BoardBodyColor_Red" );
78 static const wxChar keyBoardBodyColor_Green[] = wxT( "BoardBodyColor_Green" );
79 static const wxChar keyBoardBodyColor_Blue[] = wxT( "BoardBodyColor_Blue" );
80 
81 static const wxChar keyMousewheelPanning[] = wxT( "MousewheelPAN3D" );
82 
83 static const wxChar keyShowRealisticMode[] = wxT( "ShowRealisticMode" );
84 static const wxChar keyRenderEngine[] = wxT( "RenderEngine" );
85 //static const wxChar keyRenderTextures[] = wxT( "Render_Textures" );
86 static const wxChar keyRenderMaterial[] = wxT( "Render_Material" );
87 
88 static const wxChar keyRenderOGL_ShowCopperTck[]= wxT( "Render_OGL_ShowCopperThickness" );
89 static const wxChar keyRenderOGL_ShowModelBBox[]= wxT( "Render_OGL_ShowModelBoudingBoxes" );
90 
91 static const wxChar keyRenderRAY_Shadows[] = wxT( "Render_RAY_Shadows" );
92 static const wxChar keyRenderRAY_Backfloor[] = wxT( "Render_RAY_Backfloor" );
93 static const wxChar keyRenderRAY_Refractions[] = wxT( "Render_RAY_Refractions" );
94 static const wxChar keyRenderRAY_Reflections[] = wxT( "Render_RAY_Reflections" );
95 static const wxChar keyRenderRAY_PostProcess[] = wxT( "Render_RAY_PostProcess" );
96 static const wxChar keyRenderRAY_AAliasing[] = wxT( "Render_RAY_AntiAliasing" );
97 static const wxChar keyRenderRAY_ProceduralT[] = wxT( "Render_RAY_ProceduralTextures" );
98 
99 static const wxChar keyShowAxis[] = wxT( "ShowAxis" );
100 static const wxChar keyShowGrid[] = wxT( "ShowGrid3D" );
101 static const wxChar keyShowZones[] = wxT( "ShowZones" );
102 static const wxChar keyShowFootprints_Normal[] = wxT( "ShowFootprints_Normal" );
103 static const wxChar keyShowFootprints_Insert[] = wxT( "ShowFootprints_Insert" );
104 static const wxChar keyShowFootprints_Virtual[] = wxT( "ShowFootprints_Virtual" );
105 static const wxChar keyShowAdhesiveLayers[] = wxT( "ShowAdhesiveLayers" );
106 static const wxChar keyShowSilkScreenLayers[] = wxT( "ShowSilkScreenLayers" );
107 static const wxChar keyShowSolderMaskLayers[] = wxT( "ShowSolderMasLayers" );
108 static const wxChar keyShowSolderPasteLayers[] = wxT( "ShowSolderPasteLayers" );
109 static const wxChar keyShowCommentsLayer[] = wxT( "ShowCommentsLayers" );
110 static const wxChar keyShowBoardBody[] = wxT( "ShowBoardBody" );
111 static const wxChar keyShowEcoLayers[] = wxT( "ShowEcoLayers" );
112 
113 
114 BEGIN_EVENT_TABLE( EDA_3D_VIEWER, EDA_BASE_FRAME )
115 
116  EVT_ACTIVATE( EDA_3D_VIEWER::OnActivate )
117  EVT_SET_FOCUS( EDA_3D_VIEWER::OnSetFocus )
118 
120  EDA_3D_VIEWER::ProcessZoom )
121 
123  EDA_3D_VIEWER::Process_Special_Functions )
124 
125  EVT_TOOL( ID_TOOL_SET_VISIBLE_ITEMS, EDA_3D_VIEWER::Install3DViewOptionDialog )
126 
127  EVT_MENU( wxID_EXIT,
128  EDA_3D_VIEWER::Exit3DFrame )
129 
131  EDA_3D_VIEWER::On3DGridSelection )
132 
134  EDA_3D_VIEWER::OnRenderEngineSelection )
135 
136  EVT_CLOSE( EDA_3D_VIEWER::OnCloseWindow )
137 
138  EVT_UPDATE_UI_RANGE( ID_START_COMMAND_3D, ID_MENU_COMMAND_END,
139  EDA_3D_VIEWER::OnUpdateMenus )
140 
141 END_EVENT_TABLE()
142 
143 
145  PCB_BASE_FRAME *aParent,
146  const wxString &aTitle,
147  long style ) :
148 
149  KIWAY_PLAYER( aKiway,
150  aParent,
152  aTitle,
153  wxDefaultPosition,
154  wxDefaultSize,
155  style,
157 {
158  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::EDA_3D_VIEWER %s" ), aTitle );
159 
160  m_canvas = NULL;
161  m_defaultFileName = "";
162 
163  // Give it an icon
164  wxIcon icon;
165  icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) );
166  SetIcon( icon );
167 
168  LoadSettings( config() );
169  SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
170 
171  // Create the status line
172  static const int status_dims[4] = { -1, 130, 130, 170 };
173 
174  wxStatusBar *status_bar = CreateStatusBar( DIM( status_dims ) );
175  SetStatusWidths( DIM( status_dims ), status_dims );
176 
177  CreateMenuBar();
178  ReCreateMainToolbar();
179 
180  m_canvas = new EDA_3D_CANVAS( this,
182  aParent->GetBoard(),
183  m_settings,
184  Prj().Get3DCacheManager() );
185 
186  if( m_canvas )
187  m_canvas->SetStatusBar( status_bar );
188 
189  m_auimgr.SetManagedWindow( this );
190 
191  EDA_PANEINFO horiztb;
192  horiztb.HorizontalToolbarPane();
193 
194  m_auimgr.AddPane( m_mainToolBar,
195  wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() );
196 
197  if( m_canvas )
198  m_auimgr.AddPane( m_canvas,
199  wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );
200 
201  m_auimgr.Update();
202 
203  m_mainToolBar->EnableTool( ID_RENDER_CURRENT_VIEW,
204  (m_settings.RenderEngineGet() == RENDER_ENGINE_OPENGL_LEGACY) );
205 
206  // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
207  // in order to receive mouse events. Otherwise, the user has to click somewhere on
208  // the canvas before it will respond to mouse wheel events.
209  if( m_canvas )
210  m_canvas->SetFocus();
211 }
212 
213 
215 {
216  m_auimgr.UnInit();
217 
218  // m_canvas delete will be called by wxWidget manager
219  //delete m_canvas;
220  //m_canvas = 0;
221 }
222 
223 
225 {
226  // This will schedule a request to load later
227  if( m_canvas )
228  m_canvas->ReloadRequest( GetBoard(), Prj().Get3DCacheManager() );
229 }
230 
231 
232 void EDA_3D_VIEWER::NewDisplay( bool aForceImmediateRedraw )
233 {
234  ReloadRequest();
235 
236  // After the ReloadRequest call, the refresh often takes a bit of time,
237  // and it is made here only on request.
238  if( aForceImmediateRedraw )
239  m_canvas->Refresh();
240 }
241 
242 
243 void EDA_3D_VIEWER::Exit3DFrame( wxCommandEvent &event )
244 {
245  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::Exit3DFrame" ) );
246 
247  Close( true );
248 }
249 
250 
251 void EDA_3D_VIEWER::OnCloseWindow( wxCloseEvent &event )
252 {
253  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnCloseWindow" ) );
254 
255  if( m_canvas )
256  m_canvas->Close();
257 
258  // m_canvas delete will be called by wxWidget manager
259  //delete m_canvas;
260  //m_canvas = 0;
261 
262  Destroy();
263  event.Skip( true );
264 }
265 
266 #define ROT_ANGLE 10.0
267 
268 void EDA_3D_VIEWER::Process_Special_Functions( wxCommandEvent &event )
269 {
270  int id = event.GetId();
271  bool isChecked = event.IsChecked();
272 
273  wxLogTrace( m_logTrace,
274  wxT( "EDA_3D_VIEWER::Process_Special_Functions id:%d isChecked:%d" ),
275  id, isChecked );
276 
277  if( m_canvas == NULL )
278  return;
279 
280  switch( id )
281  {
284  break;
285 
286  case ID_RELOAD3D_BOARD:
287  NewDisplay( true );
288  break;
289 
290  case ID_ROTATE3D_X_POS:
291  m_settings.CameraGet().RotateX( glm::radians(ROT_ANGLE) );
293  break;
294 
295  case ID_ROTATE3D_X_NEG:
296  m_settings.CameraGet().RotateX( -glm::radians(ROT_ANGLE) );
298  break;
299 
300  case ID_ROTATE3D_Y_POS:
301  m_settings.CameraGet().RotateY( glm::radians(ROT_ANGLE) );
303  break;
304 
305  case ID_ROTATE3D_Y_NEG:
306  m_settings.CameraGet().RotateY( -glm::radians(ROT_ANGLE) );
308  break;
309 
310  case ID_ROTATE3D_Z_POS:
311  m_settings.CameraGet().RotateZ( glm::radians(ROT_ANGLE) );
313  break;
314 
315  case ID_ROTATE3D_Z_NEG:
316  m_settings.CameraGet().RotateZ( -glm::radians(ROT_ANGLE) );
318  break;
319 
320  case ID_MOVE3D_LEFT:
321  m_canvas->SetView3D( WXK_LEFT );
322  return;
323 
324  case ID_MOVE3D_RIGHT:
325  m_canvas->SetView3D( WXK_RIGHT );
326  return;
327 
328  case ID_MOVE3D_UP:
329  m_canvas->SetView3D( WXK_UP );
330  return;
331 
332  case ID_MOVE3D_DOWN:
333  m_canvas->SetView3D( WXK_DOWN );
334  return;
335 
336  case ID_ORTHO:
339  return;
340 
344  takeScreenshot( event );
345  return;
346 
348  if( Set3DColorFromUser( m_settings.m_BgColorBot, _( "Background Color, Bottom" ) ) )
349  {
352  else
353  NewDisplay( true );
354  }
355  return;
356 
358  if( Set3DColorFromUser( m_settings.m_BgColorTop, _( "Background Color, Top" ) ) )
359  {
362  else
363  NewDisplay( true );
364  }
365  return;
366 
369  return;
370 
373  return;
374 
377  return;
378 
381  break;
382 
385  break;
386 
389  break;
390 
394  NewDisplay( true );
395  return;
396 
399  NewDisplay( true );
400  return;
401 
404  NewDisplay( true );
405  return;
406 
409  NewDisplay( true );
410  return;
411 
414  NewDisplay( true );
415  return;
416 
420  return;
421 
425  return;
426 
429  NewDisplay( true );
430  return;
431 
434  NewDisplay( true );
435  return;
436 
440  return;
441 
445  return;
446 
449  NewDisplay( true );
450  return;
451 
455  return;
456 
458  m_settings.SetFlag( FL_SHOW_BOARD_BODY, isChecked );
459  NewDisplay( true );
460  return;
461 
463  m_settings.SetFlag( FL_AXIS, isChecked );
465  return;
466 
469  NewDisplay( true );
470  return;
471 
474  NewDisplay( true );
475  return;
476 
479  NewDisplay( true );
480  return;
481 
483  m_settings.SetFlag( FL_ZONE, isChecked );
484  NewDisplay( true );
485  return;
486 
488  m_settings.SetFlag( FL_ADHESIVE, isChecked );
489  NewDisplay( true );
490  return;
491 
493  m_settings.SetFlag( FL_SILKSCREEN, isChecked );
494  NewDisplay( true );
495  return;
496 
498  m_settings.SetFlag( FL_SOLDERMASK, isChecked );
499  NewDisplay( true );
500  return;
501 
503  m_settings.SetFlag( FL_SOLDERPASTE, isChecked );
504  NewDisplay( true );
505  return;
506 
508  m_settings.SetFlag( FL_COMMENTS, isChecked );
509  NewDisplay( true );
510  return;
511 
512  case ID_MENU3D_ECO_ONOFF:
513  m_settings.SetFlag( FL_ECO, isChecked );
514  NewDisplay( true );
515  return;
516 
518  {
519  // Reload settings with a dummy config, so it will load the defaults
520  wxConfig *fooconfig = new wxConfig("FooBarApp");
521  LoadSettings( fooconfig );
522  delete fooconfig;
523 
524  // Refresh menu option state
526 
527  // Tell canvas that we (may have) changed the render engine
529 
530  NewDisplay( true );
531  }
532  return;
533 
535  {
536  DisplayHotKeys();
537  }
538  return;
539 
540  default:
541  wxLogMessage( wxT( "EDA_3D_VIEWER::Process_Special_Functions() error: unknown command %d" ), id );
542  return;
543  }
544 }
545 
546 
547 void EDA_3D_VIEWER::On3DGridSelection( wxCommandEvent &event )
548 {
549  int id = event.GetId();
550 
551  wxASSERT( id < ID_MENU3D_GRID_END );
552  wxASSERT( id > ID_MENU3D_GRID );
553 
554  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::On3DGridSelection id:%d" ), id );
555 
556  switch( id )
557  {
560  break;
561 
564  break;
565 
566  case ID_MENU3D_GRID_5_MM:
568  break;
569 
572  break;
573 
574  case ID_MENU3D_GRID_1_MM:
576  break;
577 
578  default:
579  wxLogMessage( wxT( "EDA_3D_VIEWER::On3DGridSelection() error: unknown command %d" ), id );
580  return;
581  }
582 
583  if( m_canvas )
585 }
586 
587 
588 void EDA_3D_VIEWER::OnRenderEngineSelection( wxCommandEvent &event )
589 {
590  int id = event.GetId();
591 
592  wxASSERT( id < ID_MENU3D_ENGINE_END );
593  wxASSERT( id > ID_MENU3D_ENGINE );
594 
595  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnRenderEngineSelection id:%d" ), id );
596 
597  const RENDER_ENGINE old_engine = m_settings.RenderEngineGet();
598 
599  switch( id )
600  {
602  if( old_engine != RENDER_ENGINE_OPENGL_LEGACY )
604  break;
605 
607  if( old_engine != RENDER_ENGINE_RAYTRACING )
609  break;
610 
611  default:
612  wxLogMessage( wxT( "EDA_3D_VIEWER::OnRenderEngineSelection() error: unknown command %d" ), id );
613  return;
614  }
615 
616  if( old_engine != m_settings.RenderEngineGet() )
617  {
619  }
620 }
621 
622 
623 void EDA_3D_VIEWER::OnUpdateMenus(wxUpdateUIEvent &event)
624 {
626  // to have it working this way
628 }
629 
630 
631 void EDA_3D_VIEWER::ProcessZoom( wxCommandEvent &event )
632 {
633  int id = event.GetId();
634 
635  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::ProcessZoom id:%d" ), id );
636 
637  if( m_canvas == NULL )
638  return;
639 
640  switch( id )
641  {
642  case ID_ZOOM_PAGE:
643  m_canvas->SetView3D( WXK_HOME );
644  break;
645 
646  case ID_ZOOM_IN:
647  m_canvas->SetView3D( WXK_F1 );
648  break;
649 
650  case ID_ZOOM_OUT:
651  m_canvas->SetView3D( WXK_F2 );
652  break;
653 
654  case ID_ZOOM_REDRAW:
656  break;
657 
658  default:
659  wxLogMessage( wxT( "EDA_3D_VIEWER::ProcessZoom() error: unknown command %d" ), id );
660  return;
661  }
662 
664 }
665 
666 
667 void EDA_3D_VIEWER::OnActivate( wxActivateEvent &event )
668 {
669  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnActivate" ) );
670 
671  if( m_canvas )
672  {
673  // Reload data if 3D frame shows a board,
674  // because it can be changed since last frame activation
677 
678  // Activates again the focus of the canvas so it will catch mouse and key events
679  m_canvas->SetFocus();
680  }
681 
682  event.Skip(); // required under wxMAC
683 }
684 
685 
686 void EDA_3D_VIEWER::OnSetFocus(wxFocusEvent &event)
687 {
688  // Activates again the focus of the canvas so it will catch mouse and key events
689  if( m_canvas )
690  m_canvas->SetFocus();
691 
692  event.Skip();
693 }
694 
695 
696 void EDA_3D_VIEWER::LoadSettings( wxConfigBase *aCfg )
697 {
699 
700  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::LoadSettings" ) );
701 
702  aCfg->Read( keyBgColor_Red, &m_settings.m_BgColorBot.r, 0.4 );
703  aCfg->Read( keyBgColor_Green, &m_settings.m_BgColorBot.g, 0.4 );
704  aCfg->Read( keyBgColor_Blue, &m_settings.m_BgColorBot.b, 0.5 );
705 
706  aCfg->Read( keyBgColor_Red_Top, &m_settings.m_BgColorTop.r, 0.8 );
707  aCfg->Read( keyBgColor_Green_Top, &m_settings.m_BgColorTop.g, 0.8 );
708  aCfg->Read( keyBgColor_Blue_Top, &m_settings.m_BgColorTop.b, 0.9 );
709 
710  // m_SolderMaskColor default value = dark grey-green
711  aCfg->Read( keySMaskColor_Red, &m_settings.m_SolderMaskColor.r, 100.0 * 0.2 / 255.0 );
712  aCfg->Read( keySMaskColor_Green, &m_settings.m_SolderMaskColor.g, 255.0 * 0.2 / 255.0 );
713  aCfg->Read( keySMaskColor_Blue, &m_settings.m_SolderMaskColor.b, 180.0 * 0.2 / 255.0 );
714 
715  // m_SolderPasteColor default value = light grey
716  aCfg->Read( keySPasteColor_Red, &m_settings.m_SolderPasteColor.r, 128.0 /255.0 );
717  aCfg->Read( keySPasteColor_Green, &m_settings.m_SolderPasteColor.g, 128.0 /255.0 );
718  aCfg->Read( keySPasteColor_Blue, &m_settings.m_SolderPasteColor.b, 128.0 /255.0 );
719 
720  // m_SilkScreenColor default value = white
721  aCfg->Read( keySilkColor_Red, &m_settings.m_SilkScreenColor.r, 0.9 );
722  aCfg->Read( keySilkColor_Green, &m_settings.m_SilkScreenColor.g, 0.9 );
723  aCfg->Read( keySilkColor_Blue, &m_settings.m_SilkScreenColor.b, 0.9 );
724 
725  // m_CopperColor default value = gold
726  aCfg->Read( keyCopperColor_Red, &m_settings.m_CopperColor.r, 255.0 * 0.7 / 255.0 );
727  aCfg->Read( keyCopperColor_Green, &m_settings.m_CopperColor.g, 223.0 * 0.7 / 255.0 );
728  aCfg->Read( keyCopperColor_Blue, &m_settings.m_CopperColor.b, 0.0 /255.0 );
729 
730  // m_BoardBodyColor default value = FR4, in realistic mode
731  aCfg->Read( keyBoardBodyColor_Red, &m_settings.m_BoardBodyColor.r, 51.0 / 255.0 );
732  aCfg->Read( keyBoardBodyColor_Green, &m_settings.m_BoardBodyColor.g, 43.0 / 255.0 );
733  aCfg->Read( keyBoardBodyColor_Blue, &m_settings.m_BoardBodyColor.b, 22.0 /255.0 );
734 
735 
736  bool tmp;
737  aCfg->Read( keyMousewheelPanning, &tmp, false );
739 
740  aCfg->Read( keyShowRealisticMode, &tmp, true );
742 
743  // OpenGL options
744  aCfg->Read( keyRenderOGL_ShowCopperTck, &tmp, true );
746 
747  aCfg->Read( keyRenderOGL_ShowModelBBox, &tmp, false );
749 
750  // Raytracing options
751  aCfg->Read( keyRenderRAY_Shadows, &tmp, true );
753 
754  aCfg->Read( keyRenderRAY_Backfloor, &tmp, true );
756 
757  aCfg->Read( keyRenderRAY_Refractions, &tmp, true );
759 
760  aCfg->Read( keyRenderRAY_Reflections, &tmp, true );
762 
763  aCfg->Read( keyRenderRAY_PostProcess, &tmp, true );
765 
766  aCfg->Read( keyRenderRAY_AAliasing, &tmp, true );
768 
769  aCfg->Read( keyRenderRAY_ProceduralT, &tmp, true );
771 
772  aCfg->Read( keyShowAxis, &tmp, true );
773  m_settings.SetFlag( FL_AXIS, tmp );
774 
775  aCfg->Read( keyShowFootprints_Normal, &tmp, true );
777 
778  aCfg->Read( keyShowFootprints_Insert, &tmp, true );
780 
781  aCfg->Read( keyShowFootprints_Virtual, &tmp, true );
783 
784  aCfg->Read( keyShowZones, &tmp, true );
785  m_settings.SetFlag( FL_ZONE, tmp );
786 
787  aCfg->Read( keyShowAdhesiveLayers, &tmp, true );
789 
790  aCfg->Read( keyShowSilkScreenLayers, &tmp, true );
792 
793  aCfg->Read( keyShowSolderMaskLayers, &tmp, true );
795 
796  aCfg->Read( keyShowSolderPasteLayers, &tmp, true );
798 
799  aCfg->Read( keyShowCommentsLayer, &tmp, true );
801 
802  aCfg->Read( keyShowEcoLayers, &tmp, true );
803  m_settings.SetFlag( FL_ECO, tmp );
804 
805  aCfg->Read( keyShowBoardBody, &tmp, true );
807 
808  int tmpi;
809  aCfg->Read( keyShowGrid, &tmpi, (int)GRID3D_NONE );
810  m_settings.GridSet( (GRID3D_TYPE)tmpi );
811 
812  aCfg->Read( keyRenderEngine, &tmpi, (int)RENDER_ENGINE_OPENGL_LEGACY );
814 
815  aCfg->Read( keyRenderMaterial, &tmpi, (int)MATERIAL_MODE_NORMAL );
817 }
818 
819 
820 void EDA_3D_VIEWER::SaveSettings( wxConfigBase *aCfg )
821 {
823 
824  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::SaveSettings" ) );
825 
826  aCfg->Write( keyBgColor_Red, m_settings.m_BgColorBot.r );
827  aCfg->Write( keyBgColor_Green, m_settings.m_BgColorBot.g );
828  aCfg->Write( keyBgColor_Blue, m_settings.m_BgColorBot.b );
829 
830  aCfg->Write( keyBgColor_Red_Top, m_settings.m_BgColorTop.r );
831  aCfg->Write( keyBgColor_Green_Top, m_settings.m_BgColorTop.g );
832  aCfg->Write( keyBgColor_Blue_Top, m_settings.m_BgColorTop.b );
833 
837 
841 
845 
846  aCfg->Write( keyCopperColor_Red, m_settings.m_CopperColor.r );
848  aCfg->Write( keyCopperColor_Blue, m_settings.m_CopperColor.b );
849 
853 
855 
857 
858  aCfg->Write( keyRenderEngine, (int)m_settings.RenderEngineGet() );
859 
860  aCfg->Write( keyRenderMaterial, (int)m_settings.MaterialModeGet() );
861 
862  // OpenGL options
865 
866  // Raytracing options
874 
875  aCfg->Write( keyShowAxis, m_settings.GetFlag( FL_AXIS ) );
876  aCfg->Write( keyShowGrid, (int)m_settings.GridGet() );
877 
881 
882  aCfg->Write( keyShowZones, m_settings.GetFlag( FL_ZONE ) );
888  aCfg->Write( keyShowEcoLayers, m_settings.GetFlag( FL_ECO ) );
890 }
891 
892 
893 void EDA_3D_VIEWER::OnLeftClick( wxDC *DC, const wxPoint &MousePos )
894 {
895  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnLeftClick" ) );
896  // Do nothing
897 }
898 
899 
900 void EDA_3D_VIEWER::OnRightClick( const wxPoint &MousePos, wxMenu *PopMenu )
901 {
902  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::OnRightClick" ) );
903  // Do nothing
904 }
905 
906 
907 void EDA_3D_VIEWER::RedrawActiveWindow( wxDC *DC, bool EraseBg )
908 {
909  wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER::RedrawActiveWindow" ) );
910  // Do nothing
911 }
912 
913 
914 void EDA_3D_VIEWER::takeScreenshot( wxCommandEvent& event )
915 {
916  wxString fullFileName;
917  bool fmt_is_jpeg = false;
918 
919  if( event.GetId() == ID_MENU_SCREENCOPY_JPEG )
920  fmt_is_jpeg = true;
921 
922  if( event.GetId() != ID_TOOL_SCREENCOPY_TOCLIBBOARD )
923  {
924  // Remember path between saves during this session only.
925  static wxFileName fn;
926  const wxString file_ext = fmt_is_jpeg ? wxT( "jpg" ) : wxT( "png" );
927  const wxString mask = wxT( "*." ) + file_ext;
928 
929  // First time path is set to the project path.
930  if( !fn.IsOk() )
931  fn = Parent()->Prj().GetProjectFullName();
932 
933  fn.SetExt( file_ext );
934 
935  fullFileName = EDA_FILE_SELECTOR( _( "3D Image File Name:" ), fn.GetPath(),
936  m_defaultFileName, file_ext, mask, this,
937  wxFD_SAVE | wxFD_OVERWRITE_PROMPT, true );
938 
939  if( fullFileName.IsEmpty() )
940  return;
941 
942  fn = fullFileName;
943 
944  // Be sure the screen area destroyed by the file dialog is redrawn
945  // before making a screen copy.
946  // Without this call, under Linux the screen refresh is made to late.
947  wxYield();
948  }
949 
950  // Be sure we have the latest 3D view (remember 3D view is buffered)
951  Refresh();
952  wxYield();
953 
954  // Build image from the 3D buffer
955  wxWindowUpdateLocker noUpdates( this );
956 
957  wxImage screenshotImage;
958 
959  if( m_canvas )
960  m_canvas->GetScreenshot( screenshotImage );
961 
962  if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
963  {
964  wxBitmap bitmap( screenshotImage );
965 
966  if( wxTheClipboard->Open() )
967  {
968  wxBitmapDataObject* dobjBmp = new wxBitmapDataObject( bitmap );
969 
970  if( !wxTheClipboard->SetData( dobjBmp ) )
971  wxMessageBox( _( "Failed to copy image to clipboard" ) );
972 
973  wxTheClipboard->Flush(); /* the data in clipboard will stay
974  * available after the application exits */
975  wxTheClipboard->Close();
976  }
977  }
978  else
979  {
980  if( !screenshotImage.SaveFile( fullFileName,
981  fmt_is_jpeg ? wxBITMAP_TYPE_JPEG : wxBITMAP_TYPE_PNG ) )
982  wxMessageBox( _( "Can't save file" ) );
983 
984  screenshotImage.Destroy();
985  }
986 
987 }
988 
989 
991 {
992  if( m_canvas )
994 
997 
998  m_mainToolBar->Refresh();
999 }
1000 
1001 
1002 bool EDA_3D_VIEWER::Set3DColorFromUser( SFVEC3D &aColor, const wxString& aTitle,
1003  wxColourData* aPredefinedColors )
1004 {
1005  wxColour newcolor, oldcolor;
1006 
1007  oldcolor.Set( KiROUND( aColor.r * 255 ),
1008  KiROUND( aColor.g * 255 ),
1009  KiROUND( aColor.b * 255 ) );
1010 
1011  wxColourData emptyColorSet; // Provides a empty predefined set of colors
1012  // if no color set available to avoid use of an
1013  // old color set
1014 
1015  if( aPredefinedColors == NULL )
1016  aPredefinedColors = &emptyColorSet;
1017 
1018  newcolor = wxGetColourFromUser( this, oldcolor, aTitle, aPredefinedColors );
1019 
1020  if( !newcolor.IsOk() ) // Cancel command
1021  return false;
1022 
1023  if( newcolor != oldcolor )
1024  {
1025  aColor.r = (double) newcolor.Red() / 255.0;
1026  aColor.g = (double) newcolor.Green() / 255.0;
1027  aColor.b = (double) newcolor.Blue() / 255.0;
1028  }
1029 
1030  return true;
1031 }
1032 
1033 
1035 {
1036  wxColourData definedColors;
1037  unsigned int i = 0;
1038 
1039  definedColors.SetCustomColour( i++, wxColour( 241, 241, 241 ) ); // White
1040  definedColors.SetCustomColour( i++, wxColour( 4, 18, 21 ) ); // Dark
1041 
1042  for(; i < wxColourData::NUM_CUSTOM;)
1043  {
1044  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1045  }
1046 
1048  _( "Silk Screen Color" ),
1049  &definedColors );
1050 
1051  if( change )
1052  NewDisplay( true );
1053 
1054  return change;
1055 }
1056 
1057 
1059 {
1060  wxColourData definedColors;
1061  unsigned int i = 0;
1062 
1063  definedColors.SetCustomColour( i++, wxColour( 20, 51, 36 ) ); // Green
1064  definedColors.SetCustomColour( i++, wxColour( 91, 168, 12 ) ); // Light Green
1065  definedColors.SetCustomColour( i++, wxColour( 13, 104, 11 ) ); // Saturated Green
1066  definedColors.SetCustomColour( i++, wxColour(181, 19, 21 ) ); // Red
1067  definedColors.SetCustomColour( i++, wxColour(239, 53, 41 ) ); // Red Light Orange
1068  definedColors.SetCustomColour( i++, wxColour(210, 40, 14 ) ); // Red 2
1069  definedColors.SetCustomColour( i++, wxColour( 2, 59, 162 ) ); // Blue
1070  definedColors.SetCustomColour( i++, wxColour( 54, 79, 116 ) ); // Light blue 1
1071  definedColors.SetCustomColour( i++, wxColour( 61, 85, 130 ) ); // Light blue 2
1072  definedColors.SetCustomColour( i++, wxColour( 21, 70, 80 ) ); // Green blue (dark)
1073  definedColors.SetCustomColour( i++, wxColour( 11, 11, 11 ) ); // Black
1074  definedColors.SetCustomColour( i++, wxColour( 245, 245,245 ) ); // White
1075  definedColors.SetCustomColour( i++, wxColour(119, 31, 91 ) ); // Purple
1076  definedColors.SetCustomColour( i++, wxColour( 32, 2, 53 ) ); // Purple Dark
1077 
1078  for(; i < wxColourData::NUM_CUSTOM;)
1079  {
1080  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1081  }
1082 
1084  _( "Solder Mask Color" ),
1085  &definedColors );
1086 
1087  if( change )
1088  NewDisplay( true );
1089 
1090  return change;
1091 }
1092 
1093 
1095 {
1096  wxColourData definedColors;
1097  unsigned int i = 0;
1098 
1099  definedColors.SetCustomColour( i++, wxColour( 184, 115, 50) ); // Copper
1100  definedColors.SetCustomColour( i++, wxColour( 191, 155, 58) ); // Gold
1101  definedColors.SetCustomColour( i++, wxColour( 213, 213, 213) ); // Silver
1102  definedColors.SetCustomColour( i++, wxColour( 160, 160, 160) ); // tin
1103 
1104  for(; i < wxColourData::NUM_CUSTOM;)
1105  {
1106  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1107  }
1108 
1110  _( "Copper Color" ),
1111  &definedColors );
1112 
1113  if( change )
1114  NewDisplay( true );
1115 
1116  return change;
1117 }
1118 
1119 
1121 {
1122  wxColourData definedColors;
1123  unsigned int i = 0;
1124 
1125  definedColors.SetCustomColour( i++, wxColour( 51, 43, 22 ) ); // FR4 natural, dark
1126  definedColors.SetCustomColour( i++, wxColour( 109, 116, 75 ) ); // FR4 natural
1127  definedColors.SetCustomColour( i++, wxColour( 78, 14, 5 ) ); // brown/red
1128  definedColors.SetCustomColour( i++, wxColour( 146, 99, 47 ) ); // brown 1
1129  definedColors.SetCustomColour( i++, wxColour( 160, 123, 54 ) ); // brown 2
1130  definedColors.SetCustomColour( i++, wxColour( 146, 99, 47 ) ); // brown 3
1131  definedColors.SetCustomColour( i++, wxColour( 63, 126, 71 ) ); // green 1
1132  definedColors.SetCustomColour( i++, wxColour( 117, 122, 90 ) ); // green 2
1133 
1134  for(; i < wxColourData::NUM_CUSTOM;)
1135  {
1136  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1137  }
1138 
1140  _( "Board Body Color" ),
1141  &definedColors );
1142 
1143  if( change )
1144  NewDisplay( true );
1145 
1146  return change;
1147 }
1148 
1149 
1151 {
1152  wxColourData definedColors;
1153  unsigned int i = 0;
1154 
1155  definedColors.SetCustomColour( i++, wxColour( 128, 128, 128 ) ); // grey
1156  definedColors.SetCustomColour( i++, wxColour( 213, 213, 213 ) ); // Silver
1157  definedColors.SetCustomColour( i++, wxColour( 90, 90, 90 ) ); // grey 2
1158 
1159  for(; i < wxColourData::NUM_CUSTOM;)
1160  {
1161  definedColors.SetCustomColour( i++, wxColour( 0, 0, 0 ) );
1162  }
1163 
1165  _( "Solder Paste Color" ),
1166  &definedColors );
1167 
1168  if( change )
1169  NewDisplay( true );
1170 
1171  return change;
1172 }
static const wxChar keyShowSolderMaskLayers[]
static const wxChar keyShowFootprints_Normal[]
EDA_PANEINFO & HorizontalToolbarPane()
Function HorizontalToolbarPane Change *this to a horizontal toolbar for KiCad.
PCB_BASE_FRAME * Parent() const
Definition: eda_3d_viewer.h:62
#define DIM(x)
of elements in an array
Definition: macros.h:98
GRID3D_TYPE GridGet() const
GridGet - get the current grid.
Definition: cinfo3d_visu.h:216
static const wxChar keyRenderRAY_ProceduralT[]
static const wxChar keyShowGrid[]
bool Set3DCopperColorFromUser()
Function Set3DCopperColorFromUser Set the copper color from a set of colors.
Class KIWAY_PLAYER is a wxFrame capable of the OpenProjectFiles function, meaning it can load a porti...
Definition: kiway_player.h:111
static const wxChar keyShowBoardBody[]
Use only diffuse material properties.
Definition: 3d_enums.h:93
static const int * GetAttributesList(bool aUseAntiAliasing)
Get a list of attributes to pass to wxGLCanvas.
static const wxChar keyRenderRAY_Reflections[]
CINFO3D_VISU m_settings
Store all the settings and options to be used by the renders.
static const wxChar keyBgColor_Red_Top[]
void On3DGridSelection(wxCommandEvent &event)
This file is part of the common library TODO brief description.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
bool IsReloadRequestPending() const
IsReloadRequestPending - Query if there is a pending reload request.
Definition: eda_3d_canvas.h:82
MATERIAL_MODE MaterialModeGet() const
MaterialModeGet.
Definition: cinfo3d_visu.h:246
static const wxChar keySilkColor_Blue[]
static const wxChar keyMousewheelPanning[]
static const wxChar keyBgColor_Blue_Top[]
bool Set3DSolderMaskColorFromUser()
Function Set3DSolderMaskColorFromUser Set the solder mask color from a set of colors.
void GridSet(GRID3D_TYPE aGridType)
GridSet - set the current grid.
Definition: cinfo3d_visu.h:222
static const wxChar keyRenderEngine[]
static const wxChar keyBgColor_Red[]
SFVEC3D m_CopperColor
in realistic mode: copper color
Definition: cinfo3d_visu.h:509
void LoadSettings(wxConfigBase *aCfg) override
Function LoadSettings loads common frame parameters from a configuration file.
PROJECT & Prj()
Definition: kicad.cpp:270
void SetMenuBarOptionsState()
Set the state of toggle menus according to the current display options.
Definition: 3d_menubar.cpp:318
void RotateY(float aAngleInRadians)
Definition: ccamera.cpp:503
static const wxChar keyShowFootprints_Insert[]
virtual void SaveSettings(wxConfigBase *aCfg)
Function SaveSettings saves common frame parameters to a configuration data file. ...
void RedrawActiveWindow(wxDC *DC, bool EraseBg)
Definition: id.h:242
static const wxChar keyCopperColor_Green[]
static const wxChar keyShowFootprints_Virtual[]
void SetStatusBar(wxStatusBar *aStatusBar)
Definition: eda_3d_canvas.h:74
void SaveSettings(wxConfigBase *aCfg) override
Function SaveSettings saves common frame parameters to a configuration data file. ...
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:94
Class EDA_3D_CANVAS Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:53
static const wxChar keyShowAdhesiveLayers[]
static const wxChar keySilkColor_Green[]
wxAuiManager m_auimgr
SFVEC3D m_BgColorBot
background bottom color
Definition: cinfo3d_visu.h:503
void DisplayStatus()
DisplayStatus - Update the status bar with the position information.
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
void ReloadRequest(BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
SFVEC3D m_BgColorTop
background top color
Definition: cinfo3d_visu.h:504
void Exit3DFrame(wxCommandEvent &event)
Called when user press the File->Exit.
void MaterialModeSet(MATERIAL_MODE aMaterialMode)
MaterialModeSet.
Definition: cinfo3d_visu.h:240
Specialization of the wxAuiPaneInfo class for KiCad panels.
static const wxChar keyShowRealisticMode[]
SFVEC3D m_BoardBodyColor
in realistic mode: FR4 board color
Definition: cinfo3d_visu.h:505
EDA_3D_CANVAS * m_canvas
The canvas where the openGL context will be rendered.
static const wxChar keyCopperColor_Blue[]
static const wxChar keySMaskColor_Green[]
EDA_3D_VIEWER::Process_Special_Functions EVT_MENU(wxID_EXIT, EDA_3D_VIEWER::Exit3DFrame) EVT_MENU_RANGE(ID_MENU3D_GRID
static const wxChar keyBgColor_Green_Top[]
static const wxChar keyShowSolderPasteLayers[]
void RenderEngineSet(RENDER_ENGINE aRenderEngine)
RenderEngineSet.
Definition: cinfo3d_visu.h:228
static const wxChar keySPasteColor_Red[]
EVT_TOOL(ID_MODVIEW_SELECT_LIB, FOOTPRINT_VIEWER_FRAME::SelectCurrentLibrary) EVT_TOOL(ID_MODVIEW_SELECT_PART
static const wxChar keyShowSilkScreenLayers[]
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
void OnActivate(wxActivateEvent &event)
void OnUpdateMenus(wxUpdateUIEvent &event)
EDA_3D_VIEWER::Process_Special_Functions ID_MENU3D_GRID_END
static const wxChar keyCopperColor_Red[]
void RotateZ(float aAngleInRadians)
Definition: ccamera.cpp:510
void RotateX(float aAngleInRadians)
Definition: ccamera.cpp:496
void RenderRaytracingRequest()
RenderRaytracingRequest - Request to render the current view in Raytracing mode.
void Refresh()
Update the board display after modifying it bu a python script (note: it is automatically called by a...
static const wxChar keyShowZones[]
static const wxChar keyRenderMaterial[]
static const wxChar keyRenderRAY_AAliasing[]
void RenderEngineChanged()
RenderEngineChanged - Notify that the render engine was changed.
bool Set3DSilkScreenColorFromUser()
Function Set3DSilkScreenColorFromUser Set the silkscreen color from a set of colors.
virtual void LoadSettings(wxConfigBase *aCfg)
Function LoadSettings loads common frame parameters from a configuration file.
void ToggleProjection()
Definition: ccamera.cpp:417
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
Use a gray shading based on diffuse material.
Definition: 3d_enums.h:94
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:258
glm::dvec3 SFVEC3D
Definition: xv3d_types.h:48
void OnLeftClick(wxDC *DC, const wxPoint &MousePos)
void OnCloseWindow(wxCloseEvent &event)
Template define a least-recently-used cache algo based on wxHashMap and wxString http://docs.wxwidgets.org/3.0/classwx_hash_map.html.
EVT_TOOL_RANGE(ID_ZOOM_IN, ID_ZOOM_REDRAW, EDA_3D_VIEWER::ProcessZoom) EVT_TOOL_RANGE(ID_START_COMMAND_3D
static const wxChar keyBgColor_Green[]
static const wxChar keyBoardBodyColor_Blue[]
MATERIAL_MODE
Render 3d model shape materials mode.
Definition: 3d_enums.h:90
SFVEC3D m_SolderPasteColor
in realistic mode: solder paste color
Definition: cinfo3d_visu.h:507
bool Set3DSolderPasteColorFromUser()
Function Set3DSolderPasteColorFromUser Set the solder mask color from a set of colors.
wxAuiToolBar * m_mainToolBar
Standard horizontal Toolbar.
RENDER_ENGINE RenderEngineGet() const
RenderEngineGet.
Definition: cinfo3d_visu.h:234
SFVEC3D m_SolderMaskColor
in realistic mode: solder mask color
Definition: cinfo3d_visu.h:506
GRID3D_TYPE
Grid types.
Definition: 3d_enums.h:71
static const wxChar keyRenderOGL_ShowModelBBox[]
void RenderEngineChanged()
RenderEngineChanged - Update toolbar icon and call canvas RenderEngineChanged.
static const wxChar keySPasteColor_Green[]
Use all material properties from model file.
Definition: 3d_enums.h:92
static const wxChar keyBoardBodyColor_Red[]
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
void GetScreenshot(wxImage &aDstImage)
Request a screenshot and output it to the aDstImage.
SFVEC3D m_SilkScreenColor
in realistic mode: SilkScreen color
Definition: cinfo3d_visu.h:508
static const wxChar keySilkColor_Red[]
static const wxChar keyBgColor_Blue[]
static const wxChar keySMaskColor_Red[]
ID_MENU_COMMAND_END
static const wxChar keyRenderRAY_Refractions[]
Declaration of the eda_3d_viewer class.
wxString m_defaultFileName
Filename to propose for save a screenshot.
EDA_3D_VIEWER::Process_Special_Functions EDA_3D_VIEWER::On3DGridSelection EVT_MENU_RANGE(ID_MENU3D_ENGINE, ID_MENU3D_ENGINE_END, EDA_3D_VIEWER::OnRenderEngineSelection) EVT_UPDATE_UI_RANGE(ID_START_COMMAND_3D
static const wxChar keyRenderOGL_ShowCopperTck[]
static const wxChar keyRenderRAY_Backfloor[]
CCAMERA & CameraGet() const
CameraGet - get current camera in use.
Definition: cinfo3d_visu.h:210
bool SetView3D(int aKeycode)
SetView3D - Helper function to call view commands.
bool Set3DColorFromUser(SFVEC3D &aColor, const wxString &aTitle, wxColourData *aPredefinedColors=NULL)
Function Set3DColorFromUser Get a SFVEC3D from a wx colour dialog.
void ProcessZoom(wxCommandEvent &event)
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
#define ROT_ANGLE
static const wxChar keySMaskColor_Blue[]
Class EDA_BASE_FRAME is the base frame for deriving all KiCad main window classes.
void OnRenderEngineSelection(wxCommandEvent &event)
size_t i
Definition: json11.cpp:597
FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::ProcessPreferences FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::Process_Special_Functions FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard EVT_UPDATE_UI_RANGE(ID_MODEDIT_PAD_TOOL, ID_MODEDIT_MEASUREMENT_TOOL, FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar) EVT_UPDATE_UI(ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE
RENDER_ENGINE
Render engine mode.
Definition: 3d_enums.h:82
static const wxChar keyBoardBodyColor_Green[]
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void OnSetFocus(wxFocusEvent &event)
static const wxChar keyShowAxis[]
static const wxChar keySPasteColor_Blue[]
void OnRightClick(const wxPoint &MousePos, wxMenu *PopMenu)
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
Some functions to handle hotkeys in KiCad.
void SetFlag(DISPLAY3D_FLG aFlag, bool aState)
SetFlag - set the status of a flag.
static const wxChar keyShowEcoLayers[]
static const wxChar keyShowCommentsLayer[]
void NewDisplay(bool aForceImmediateRedraw=false)
Reload and refresh (rebuild) the 3D scene.
static const wxChar keyRenderRAY_Shadows[]
#define VIEWER3D_FRAMENAME
Definition: eda_3d_viewer.h:44
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
BOARD * GetBoard()
Definition: eda_3d_viewer.h:64
bool Set3DBoardBodyColorFromUser()
Function Set3DBoardBodyBodyColorFromUser Set the copper color from a set of colors.
static const wxChar keyRenderRAY_PostProcess[]
void ReloadRequest()
Request reloading the 3D view.
void Process_Special_Functions(wxCommandEvent &event)
void takeScreenshot(wxCommandEvent &event)
Function TakeScreenshot Create a Screenshot of the current 3D view.