KiCad PCB EDA Suite
eda_3d_canvas.cpp File Reference

Implementation of a 3d canvas. More...

#include <GL/glew.h>
#include <wx/tokenzr.h>
#include "../common_ogl/openGL_includes.h"
#include "../common_ogl/ogl_utils.h"
#include "eda_3d_canvas.h"
#include "../3d_viewer_id.h"
#include "../3d_rendering/3d_render_raytracing/c3d_render_raytracing.h"
#include "../3d_viewer/eda_3d_viewer.h"
#include "../3d_rendering/test_cases.h"
#include <class_board.h>
#include "status_text_reporter.h"
#include <gl_context_mgr.h>
#include <profile.h>
#include <bitmaps.h>
#include <hotkeys_basic.h>
#include <menus_helpers.h>
#include <widgets/wx_busy_indicator.h>

Go to the source code of this file.

Functions

 EVT_MENU_RANGE (ID_POPUP_3D_VIEW_START, ID_POPUP_3D_VIEW_END, EDA_3D_CANVAS::OnPopUpMenu) EDA_3D_CANVAS
 

Detailed Description

Implementation of a 3d canvas.

Definition in file eda_3d_canvas.cpp.

Function Documentation

◆ EVT_MENU_RANGE()

Definition at line 83 of file eda_3d_canvas.cpp.

94  :
95  HIDPI_GL_CANVAS( aParent,
96  wxID_ANY,
97  aAttribList,
98  wxDefaultPosition,
99  wxDefaultSize,
100  wxFULL_REPAINT_ON_RESIZE
101  ),
102  m_settings( aSettings )
103 {
104  // Run test cases in debug mode, once.
105 
106  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::EDA_3D_CANVAS" );
107 
108  m_editing_timeout_timer.SetOwner( this );
109  Connect( m_editing_timeout_timer.GetId(),
110  wxEVT_TIMER,
111  wxTimerEventHandler( EDA_3D_CANVAS::OnTimerTimeout_Editing ),
112  NULL,
113  this );
114 
115  m_redraw_trigger_timer.SetOwner( this );
116  Connect( m_redraw_trigger_timer.GetId(),
117  wxEVT_TIMER,
118  wxTimerEventHandler( EDA_3D_CANVAS::OnTimerTimeout_Redraw ),
119  NULL,
120  this );
121 
122  m_mouse_was_moved = false;
123  m_mouse_is_moving = false;
124  m_camera_is_moving = false;
125  m_render_pivot = false;
126  m_camera_moving_speed = 1.0f;
127 
128  m_strtime_camera_movement = 0;
129 
130  m_is_opengl_initialized = false;
131 
132  m_render_raytracing_was_requested = false;
133  m_opengl_supports_raytracing = false;
134 
135  m_parentStatusBar = NULL;
136  m_glRC = NULL;
137 
138  m_3d_render = NULL;
139 
140  m_3d_render_raytracing = new C3D_RENDER_RAYTRACING( aSettings );
141  m_3d_render_ogl_legacy = new C3D_RENDER_OGL_LEGACY( aSettings );
142 
143  wxASSERT( m_3d_render_raytracing != NULL );
144  wxASSERT( m_3d_render_ogl_legacy != NULL );
145 
146  auto busy_indicator_factory = []() { return std::make_unique<WX_BUSY_INDICATOR>(); };
147 
148  m_3d_render_raytracing->SetBusyIndicatorFactory( busy_indicator_factory );
149  m_3d_render_ogl_legacy->SetBusyIndicatorFactory( busy_indicator_factory );
150 
151  RenderEngineChanged();
152 
153  wxASSERT( aBoard != NULL );
154  m_settings.SetBoard( aBoard );
155 
156  wxASSERT( a3DCachePointer != NULL );
157  m_settings.Set3DCacheManager( a3DCachePointer );
158 }
wxGLCanvas wrapper for HiDPI/Retina support.
void OnTimerTimeout_Redraw(wxTimerEvent &event)
The C3D_RENDER_OGL_LEGACY class render the board using openGL legacy mode.
void OnTimerTimeout_Editing(wxTimerEvent &event)

References EDA_3D_CANVAS::OnTimerTimeout_Editing(), and EDA_3D_CANVAS::OnTimerTimeout_Redraw().