KiCad PCB EDA Suite
EDA_3D_CANVAS Class Reference

Implement a canvas based on a wxGLCanvas. More...

#include <eda_3d_canvas.h>

Inheritance diagram for EDA_3D_CANVAS:
HIDPI_GL_CANVAS

Public Member Functions

 EDA_3D_CANVAS (wxWindow *aParent, const int *aAttribList, BOARD *aBoard, BOARD_ADAPTER &aSettings, CCAMERA &aCamera, S3D_CACHE *a3DCachePointer)
 EDA_3D_CANVAS - Creates a new 3D Canvas with a attribute list. More...
 
 ~EDA_3D_CANVAS ()
 
void SetEventDispatcher (TOOL_DISPATCHER *aEventDispatcher)
 Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools. More...
 
void SetStatusBar (wxStatusBar *aStatusBar)
 
void SetInfoBar (WX_INFOBAR *aInfoBar)
 
void ReloadRequest (BOARD *aBoard=NULL, S3D_CACHE *aCachePointer=NULL)
 
bool IsReloadRequestPending () const
 IsReloadRequestPending - Query if there is a pending reload request. More...
 
void RenderRaytracingRequest ()
 RenderRaytracingRequest - Request to render the current view in Raytracing mode. More...
 
void GetScreenshot (wxImage &aDstImage)
 Request a screenshot and output it to the aDstImage. More...
 
bool SetView3D (int aKeycode)
 SetView3D - Helper function to call view commands. More...
 
void AnimationEnabledSet (bool aAnimationEnabled)
 AnimationEnabledSet - Enable or disable camera animation when switching to a pre-defined view. More...
 
bool AnimationEnabledGet () const
 AnimationEnabledGet - Returns whether camera animation is enabled when switching to a pre-defined view. More...
 
void MovingSpeedMultiplierSet (int aMovingSpeedMultiplier)
 MovingSpeedMultiplierSet - Set the camera animation moving speed multiplier option. More...
 
int MovingSpeedMultiplierGet () const
 MovingSpeedMultiplierGet - Return the current camera animation moving speed multiplier option. More...
 
void RenderEngineChanged ()
 RenderEngineChanged - Notify that the render engine was changed. More...
 
void DisplayStatus ()
 DisplayStatus - Update the status bar with the position information. More...
 
void Request_refresh (bool aRedrawImmediately=true)
 Request_refresh - Schedule a refresh update of the canvas. More...
 
void OnEvent (wxEvent &aEvent)
 Used to forward events to the canvas from popups, etc. More...
 
virtual wxSize GetNativePixelSize () const
 
void SetScaleFactor (double aFactor)
 Set the canvas scale factor, probably for a hi-DPI display. More...
 
double GetScaleFactor () const
 Get the current scale factor. More...
 

Private Member Functions

void OnPaint (wxPaintEvent &aEvent)
 Called by a wxPaintEvent event. More...
 
void DoRePaint ()
 The actual function to repaint the canvas. More...
 
void OnEraseBackground (wxEraseEvent &event)
 
void OnRefreshRequest (wxEvent &aEvent)
 
void OnMouseWheel (wxMouseEvent &event)
 
void OnMouseMove (wxMouseEvent &event)
 
void OnLeftDown (wxMouseEvent &event)
 
void OnLeftUp (wxMouseEvent &event)
 
void OnMiddleUp (wxMouseEvent &event)
 
void OnMiddleDown (wxMouseEvent &event)
 
void OnTimerTimeout_Editing (wxTimerEvent &event)
 
void OnCloseWindow (wxCloseEvent &event)
 
void OnResize (wxSizeEvent &event)
 
void OnTimerTimeout_Redraw (wxTimerEvent &event)
 
void stop_editingTimeOut_Timer ()
 stop_editingTimeOut_Timer - stop the editing time, so it will not timeout More...
 
void restart_editingTimeOut_Timer ()
 restart_editingTimeOut_Timer - reset the editing timer More...
 
void request_start_moving_camera (float aMovingSpeed=2.0f, bool aRenderPivot=true)
 request_start_moving_camera - start a camera movement More...
 
void move_pivot_based_on_cur_mouse_position ()
 move_pivot_based_on_cur_mouse_position - This function hits a ray to the board and start a moviment More...
 
void render_pivot (float t, float aScale)
 render_pivot - render the pivot cursor More...
 
bool initializeOpenGL ()
 initializeOpenGL More...
 
void releaseOpenGL ()
 releaseOpenGL - free created targets and openGL context More...
 

Private Attributes

TOOL_DISPATCHERm_eventDispatcher
 
wxStatusBar * m_parentStatusBar
 
WX_INFOBARm_parentInfoBar
 
wxGLContext * m_glRC
 
bool m_is_opengl_initialized
 
wxTimer m_editing_timeout_timer
 
wxTimer m_redraw_trigger_timer
 
bool m_mouse_is_moving
 
bool m_mouse_was_moved
 
bool m_camera_is_moving
 
bool m_render_pivot
 
float m_camera_moving_speed
 
unsigned m_strtime_camera_movement
 
bool m_animation_enabled
 
int m_moving_speed_multiplier
 
BOARD_ADAPTERm_boardAdapter
 
CCAMERAm_camera
 
C3D_RENDER_BASEm_3d_render
 
C3D_RENDER_RAYTRACINGm_3d_render_raytracing
 
C3D_RENDER_OGL_LEGACYm_3d_render_ogl_legacy
 
bool m_opengl_supports_raytracing
 
bool m_render_raytracing_was_requested
 

Static Private Attributes

static const float m_delta_move_step_factor = 0.7f
 
static const wxChar * m_logTrace = wxT( "KI_TRACE_EDA_3D_CANVAS" )
 Trace mask used to enable or disable the trace output of this class. More...
 

Detailed Description

Implement a canvas based on a wxGLCanvas.

Definition at line 47 of file eda_3d_canvas.h.

Constructor & Destructor Documentation

◆ EDA_3D_CANVAS()

EDA_3D_CANVAS::EDA_3D_CANVAS ( wxWindow *  aParent,
const int *  aAttribList,
BOARD aBoard,
BOARD_ADAPTER aSettings,
CCAMERA aCamera,
S3D_CACHE a3DCachePointer 
)

EDA_3D_CANVAS - Creates a new 3D Canvas with a attribute list.

Parameters
aParentthe parent creator of this canvas
aAttribLista list of openGL options created by GetOpenGL_AttributesList
aBoardThe board
aSettingsthe settings options to be used by this canvas

Definition at line 93 of file eda_3d_canvas.cpp.

96  : HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize,
97  wxFULL_REPAINT_ON_RESIZE ),
98  m_eventDispatcher( nullptr ),
99  m_parentStatusBar( nullptr ),
100  m_parentInfoBar( nullptr ),
101  m_glRC( nullptr ),
102  m_is_opengl_initialized( false ),
103  m_mouse_is_moving( false ),
104  m_mouse_was_moved( false ),
105  m_camera_is_moving( false ),
106  m_render_pivot( false ),
107  m_camera_moving_speed( 1.0f ),
109  m_animation_enabled( true ),
111  m_boardAdapter( aBoardAdapter ),
112  m_camera( aCamera ),
113  m_3d_render( nullptr ),
116 {
117  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::EDA_3D_CANVAS" );
118 
119  m_editing_timeout_timer.SetOwner( this );
120  Connect( m_editing_timeout_timer.GetId(),
121  wxEVT_TIMER,
122  wxTimerEventHandler( EDA_3D_CANVAS::OnTimerTimeout_Editing ),
123  NULL,
124  this );
125 
126  m_redraw_trigger_timer.SetOwner( this );
127  Connect( m_redraw_trigger_timer.GetId(),
128  wxEVT_TIMER,
129  wxTimerEventHandler( EDA_3D_CANVAS::OnTimerTimeout_Redraw ),
130  NULL,
131  this );
132 
135 
136  wxASSERT( m_3d_render_raytracing != NULL );
137  wxASSERT( m_3d_render_ogl_legacy != NULL );
138 
139  auto busy_indicator_factory = []() { return std::make_unique<WX_BUSY_INDICATOR>(); };
140 
141  m_3d_render_raytracing->SetBusyIndicatorFactory( busy_indicator_factory );
142  m_3d_render_ogl_legacy->SetBusyIndicatorFactory( busy_indicator_factory );
143 
145 
146  wxASSERT( aBoard != NULL );
147  m_boardAdapter.SetBoard( aBoard );
148 
149  m_boardAdapter.SetColorSettings( Pgm().GetSettingsManager().GetColorSettings() );
150 
151  wxASSERT( a3DCachePointer != NULL );
152  m_boardAdapter.Set3DCacheManager( a3DCachePointer );
153 
154  const wxEventType events[] =
155  {
156  // Binding both EVT_CHAR and EVT_CHAR_HOOK ensures that all key events,
157  // especially special key like arrow keys, are handled by the GAL event dispatcher,
158  // and not sent to GUI without filtering, because they have a default action (scroll)
159  // that must not be called.
160  wxEVT_LEFT_UP, wxEVT_LEFT_DOWN, wxEVT_LEFT_DCLICK,
161  wxEVT_RIGHT_UP, wxEVT_RIGHT_DOWN, wxEVT_RIGHT_DCLICK,
162  wxEVT_MIDDLE_UP, wxEVT_MIDDLE_DOWN, wxEVT_MIDDLE_DCLICK,
163  wxEVT_MOTION, wxEVT_MOUSEWHEEL, wxEVT_CHAR, wxEVT_CHAR_HOOK,
164 #if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT )
165  wxEVT_MAGNIFY,
166 #endif
167  wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT
168  };
169 
170  for( wxEventType eventType : events )
171  Connect( eventType, wxEventHandler( EDA_3D_CANVAS::OnEvent ), NULL, m_eventDispatcher );
172 }
C3D_RENDER_RAYTRACING * m_3d_render_raytracing
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
bool m_mouse_is_moving
unsigned m_strtime_camera_movement
WX_INFOBAR * m_parentInfoBar
wxStatusBar * m_parentStatusBar
wxGLContext * m_glRC
wxTimer m_editing_timeout_timer
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
C3D_RENDER_OGL_LEGACY * m_3d_render_ogl_legacy
void SetBoard(BOARD *aBoard) noexcept
SetBoard - Set current board to be rendered.
BOARD_ADAPTER & m_boardAdapter
float m_camera_moving_speed
HIDPI_GL_CANVAS(wxWindow *parent, wxWindowID id=wxID_ANY, const int *attribList=NULL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxGLCanvasName, const wxPalette &palette=wxNullPalette)
void SetBusyIndicatorFactory(BUSY_INDICATOR::FACTORY aNewFactory)
Set a new busy indicator factory.
#define NULL
CCAMERA & m_camera
bool m_mouse_was_moved
void RenderEngineChanged()
RenderEngineChanged - Notify that the render engine was changed.
bool m_camera_is_moving
void OnTimerTimeout_Redraw(wxTimerEvent &event)
SETTINGS_MANAGER * GetSettingsManager()
bool m_animation_enabled
void Set3DCacheManager(S3D_CACHE *aCachePointer) noexcept
Set3DCacheManager - Update the Cache manager pointer.
Definition: board_adapter.h:80
bool m_is_opengl_initialized
C3D_RENDER_BASE * m_3d_render
The C3D_RENDER_OGL_LEGACY class render the board using openGL legacy mode.
TOOL_DISPATCHER * m_eventDispatcher
int m_moving_speed_multiplier
void OnEvent(wxEvent &aEvent)
Used to forward events to the canvas from popups, etc.
bool m_opengl_supports_raytracing
void OnTimerTimeout_Editing(wxTimerEvent &event)
void SetColorSettings(COLOR_SETTINGS *aSettings) noexcept
wxTimer m_redraw_trigger_timer
bool m_render_raytracing_was_requested

References GetSettingsManager(), NULL, OnEvent(), OnTimerTimeout_Editing(), OnTimerTimeout_Redraw(), and Pgm().

◆ ~EDA_3D_CANVAS()

EDA_3D_CANVAS::~EDA_3D_CANVAS ( )

Definition at line 175 of file eda_3d_canvas.cpp.

176 {
177  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::~EDA_3D_CANVAS" );
178 
179  releaseOpenGL();
180 }
void releaseOpenGL()
releaseOpenGL - free created targets and openGL context
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.

References m_logTrace, and releaseOpenGL().

Member Function Documentation

◆ AnimationEnabledGet()

bool EDA_3D_CANVAS::AnimationEnabledGet ( ) const
inline

AnimationEnabledGet - Returns whether camera animation is enabled when switching to a pre-defined view.

Returns
true if animation is enabled

Definition at line 124 of file eda_3d_canvas.h.

124 { return m_animation_enabled; }
bool m_animation_enabled

References m_animation_enabled.

Referenced by EDA_3D_VIEWER::SaveSettings(), and DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow().

◆ AnimationEnabledSet()

void EDA_3D_CANVAS::AnimationEnabledSet ( bool  aAnimationEnabled)
inline

AnimationEnabledSet - Enable or disable camera animation when switching to a pre-defined view.

Parameters
aAnimationEnabledAnimation enabled state to set

Definition at line 118 of file eda_3d_canvas.h.

118 { m_animation_enabled = aAnimationEnabled; }
bool m_animation_enabled

References m_animation_enabled.

Referenced by EDA_3D_VIEWER::LoadSettings(), and DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow().

◆ DisplayStatus()

void EDA_3D_CANVAS::DisplayStatus ( )

DisplayStatus - Update the status bar with the position information.

Definition at line 324 of file eda_3d_canvas.cpp.

325 {
326  if( m_parentStatusBar )
327  {
328  wxString msg;
329 
330  msg.Printf( "dx %3.2f", m_camera.GetCameraPos().x );
331  m_parentStatusBar->SetStatusText( msg, static_cast<int>( EDA_3D_VIEWER_STATUSBAR::X_POS ) );
332 
333  msg.Printf( "dy %3.2f", m_camera.GetCameraPos().y );
334  m_parentStatusBar->SetStatusText( msg, static_cast<int>( EDA_3D_VIEWER_STATUSBAR::Y_POS ) );
335  }
336 }
wxStatusBar * m_parentStatusBar
CCAMERA & m_camera
const SFVEC3F & GetCameraPos() const
Definition: ccamera.h:134

References CCAMERA::GetCameraPos(), m_camera, m_parentStatusBar, X_POS, and Y_POS.

Referenced by DoRePaint(), EDA_3D_CONTROLLER::doZoomInOut(), OnMouseMove(), OnMouseWheel(), request_start_moving_camera(), SetView3D(), and EDA_3D_CONTROLLER::ZoomFitScreen().

◆ DoRePaint()

void EDA_3D_CANVAS::DoRePaint ( )
private

The actual function to repaint the canvas.

It is usually called by OnPaint() but because it does not use a wxPaintDC it can be called outside a wxPaintEvent

Definition at line 349 of file eda_3d_canvas.cpp.

350 {
351  // SwapBuffer requires the window to be shown before calling
352  if( !IsShownOnScreen() )
353  {
354  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::DoRePaint !IsShown" );
355  return;
356  }
357 
358  // Because the board to draw is handled by the parent viewer frame,
359  // ensure this parent is still alive. When it is closed before the viewer
360  // frame, a paint event can be generated after the parent is closed,
361  // therefore with invalid board.
362  // This is dependent of the platform.
363  // Especially on OSX, but also on Windows, it frequently happens
364  if( !GetParent()->GetParent()->IsShown() )
365  return; // The parent board editor frame is no more alive
366 
367  wxString err_messages;
368 
369  // !TODO: implement error reporter
370  //WX_STRING_REPORTER errorReporter( &err_messages );
371  INFOBAR_REPORTER warningReporter( m_parentInfoBar );
372  STATUSBAR_REPORTER activityReporter(
374 
375  unsigned strtime = GetRunningMicroSecs();
376 
377  // "Makes the OpenGL state that is represented by the OpenGL rendering
378  // context context current, i.e. it will be used by all subsequent OpenGL calls.
379  // This function may only be called when the window is shown on screen"
380 
381  // Explicitly create a new rendering context instance for this canvas.
382  if( m_glRC == NULL )
384 
386 
387  // Set the OpenGL viewport according to the client size of this canvas.
388  // This is done here rather than in a wxSizeEvent handler because our
389  // OpenGL rendering context (and thus viewport setting) is used with
390  // multiple canvases: If we updated the viewport in the wxSizeEvent
391  // handler, changing the size of one canvas causes a viewport setting that
392  // is wrong when next another canvas is repainted.
393  wxSize clientSize = GetNativePixelSize();
394 
395  const bool windows_size_changed = m_camera.SetCurWindowSize( clientSize );
396 
397  // Initialize openGL if need
398  // /////////////////////////////////////////////////////////////////////////
400  {
401  if( !initializeOpenGL() )
402  {
404 
405  return;
406  }
407  }
408 
409  // Don't attend to ray trace if OpenGL doesn't support it.
411  {
415  }
416 
417  // Check if a raytacing was requested and need to switch to raytracing mode
419  {
420  const bool was_camera_changed = m_camera.ParametersChanged();
421 
422  // It reverts back to OpenGL mode if it was requested a raytracing
423  // render of the current scene. AND the mouse / camera is moving
424  if( ( m_mouse_is_moving ||
426  was_camera_changed ||
427  windows_size_changed ) &&
429  {
432  }
433  }
434 
435  float curtime_delta_s = 0.0f;
436 
437  if( m_camera_is_moving )
438  {
439  const unsigned curtime_delta = GetRunningMicroSecs() - m_strtime_camera_movement;
440  curtime_delta_s = (curtime_delta / 1e6) * m_camera_moving_speed;
441  m_camera.Interpolate( curtime_delta_s );
442 
443  if( curtime_delta_s > 1.0f )
444  {
445  m_render_pivot = false;
446  m_camera_is_moving = false;
447  m_mouse_was_moved = true;
448 
450  DisplayStatus();
451  }
452  else
453  {
454  Request_refresh();
455  }
456  }
457 
458  // It will return true if the render request a new redraw
459  bool requested_redraw = false;
460 
461  if( m_3d_render )
462  {
463  m_3d_render->SetCurWindowSize( clientSize );
464 
465  requested_redraw = m_3d_render->Redraw( m_mouse_was_moved || m_camera_is_moving,
466  &activityReporter, &warningReporter );
467  }
468 
469  if( m_render_pivot )
470  {
471  const float scale = glm::min( m_camera.ZoomGet(), 1.0f );
472  render_pivot( curtime_delta_s, scale * scale );
473  }
474 
475  // "Swaps the double-buffer of this window, making the back-buffer the
476  // front-buffer and vice versa, so that the output of the previous OpenGL
477  // commands is displayed on the window."
478  SwapBuffers();
479 
481 
482  if( !activityReporter.HasMessage() )
483  {
485  {
486  // Calculation time in milliseconds
487  const double calculation_time = (double)( GetRunningMicroSecs() - strtime) / 1e3;
488 
489  activityReporter.Report( wxString::Format( _( "Render time %.0f ms ( %.1f fps)" ),
490  calculation_time, 1000.0 / calculation_time ) );
491  }
492  }
493 
494  // This will reset the flag of camera parameters changed
496 
497  warningReporter.Finalize();
498 
499  if( !err_messages.IsEmpty() )
500  wxLogMessage( err_messages );
501 
502  if( (!m_camera_is_moving) && requested_redraw )
503  {
504  m_mouse_was_moved = false;
505  Request_refresh( false );
506  }
507 }
STATUSBAR_REPORTER is a wrapper for reporting to a specific text location in a statusbar.
Definition: reporter.h:264
virtual wxSize GetNativePixelSize() const
bool m_mouse_is_moving
unsigned m_strtime_camera_movement
WX_INFOBAR * m_parentInfoBar
wxStatusBar * m_parentStatusBar
virtual bool Redraw(bool aIsMoving, REPORTER *aStatusReporter=NULL, REPORTER *aWarningReporter=NULL)=0
Redraw - Ask to redraw the view.
wxGLContext * m_glRC
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
void DisplayStatus()
DisplayStatus - Update the status bar with the position information.
C3D_RENDER_OGL_LEGACY * m_3d_render_ogl_legacy
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
void UnlockCtx(wxGLContext *aContext)
Function UnlockCtx allows other canvases to bind an OpenGL context.
void RenderEngineSet(RENDER_ENGINE aRenderEngine) noexcept
RenderEngineSet.
BOARD_ADAPTER & m_boardAdapter
float m_camera_moving_speed
static GL_CONTEXT_MANAGER & Get()
Function Get returns the GL_CONTEXT_MANAGER instance (singleton).
void restart_editingTimeOut_Timer()
restart_editingTimeOut_Timer - reset the editing timer
float ZoomGet() const
Definition: ccamera.cpp:510
#define NULL
CCAMERA & m_camera
bool m_mouse_was_moved
bool m_camera_is_moving
virtual void Interpolate(float t)
Interpolate - It will update the matrix to interpolate between T0 and T1 values.
Definition: ccamera.cpp:569
RENDER_ENGINE RenderEngineGet() const noexcept
RenderEngineGet.
bool SetCurWindowSize(const wxSize &aSize)
SetCurWindowSize - update the windows size of the camera.
Definition: ccamera.cpp:448
void LockCtx(wxGLContext *aContext, wxGLCanvas *aCanvas)
Function LockCtx sets a context as current and prevents other canvases from switching it.
bool m_is_opengl_initialized
C3D_RENDER_BASE * m_3d_render
const int scale
bool initializeOpenGL()
initializeOpenGL
bool m_opengl_supports_raytracing
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
#define _(s)
Definition: 3d_actions.cpp:33
unsigned GetRunningMicroSecs()
Function GetRunningMicroSecs An alternate way to calculate an elapset time (in microsecondes) to clas...
wxGLContext * CreateCtx(wxGLCanvas *aCanvas, const wxGLContext *aOther=NULL)
Function CreateCtx creates a managed OpenGL context.
virtual void SetCurWindowSize(const wxSize &aSize)=0
SetCurWindowSize - Before each render, the canvas will tell the render what is the size of its window...
void render_pivot(float t, float aScale)
render_pivot - render the pivot cursor
INFOBAR_REPORTER is a wrapper for reporting to a WX_INFOBAR UI element.
Definition: reporter.h:292
bool ParametersChanged()
Function ParametersChanged.
Definition: ccamera.cpp:587
bool m_render_raytracing_was_requested

References _, GL_CONTEXT_MANAGER::CreateCtx(), DisplayStatus(), INFOBAR_REPORTER::Finalize(), Format(), GL_CONTEXT_MANAGER::Get(), HIDPI_GL_CANVAS::GetNativePixelSize(), GetRunningMicroSecs(), STATUSBAR_REPORTER::HasMessage(), initializeOpenGL(), CCAMERA::Interpolate(), GL_CONTEXT_MANAGER::LockCtx(), m_3d_render, m_3d_render_ogl_legacy, m_boardAdapter, m_camera, m_camera_is_moving, m_camera_moving_speed, m_glRC, m_is_opengl_initialized, m_logTrace, m_mouse_is_moving, m_mouse_was_moved, m_opengl_supports_raytracing, m_parentInfoBar, m_parentStatusBar, m_render_pivot, m_render_raytracing_was_requested, m_strtime_camera_movement, NULL, OPENGL_LEGACY, CCAMERA::ParametersChanged(), C3D_RENDER_BASE::Redraw(), render_pivot(), BOARD_ADAPTER::RenderEngineGet(), BOARD_ADAPTER::RenderEngineSet(), STATUSBAR_REPORTER::Report(), Request_refresh(), restart_editingTimeOut_Timer(), scale, C3D_RENDER_BASE::SetCurWindowSize(), CCAMERA::SetCurWindowSize(), STATUS_TEXT, GL_CONTEXT_MANAGER::UnlockCtx(), and CCAMERA::ZoomGet().

Referenced by OnPaint(), and OnRefreshRequest().

◆ GetNativePixelSize()

wxSize HIDPI_GL_CANVAS::GetNativePixelSize ( ) const
virtualinherited

Definition at line 46 of file hidpi_gl_canvas.cpp.

47 {
48  wxSize size = wxGLCanvas::GetClientSize();
49 
50  const double scaleFactor = GetScaleFactor();
51  size.x *= scaleFactor;
52  size.y *= scaleFactor;
53 
54  return size;
55 }
double GetScaleFactor() const
Get the current scale factor.

References HIDPI_GL_CANVAS::GetScaleFactor().

Referenced by DoRePaint(), OnMouseMove(), and KIGFX::OPENGL_GAL::OPENGL_GAL().

◆ GetScaleFactor()

double HIDPI_GL_CANVAS::GetScaleFactor ( ) const
inherited

◆ GetScreenshot()

void EDA_3D_CANVAS::GetScreenshot ( wxImage &  aDstImage)

Request a screenshot and output it to the aDstImage.

Parameters
aDstImage- Screenshot destination image

Definition at line 289 of file eda_3d_canvas.cpp.

290 {
291  OGL_GetScreenshot( aDstImage );
292 }
void OGL_GetScreenshot(wxImage &aDstImage)
OGL_GetScreenshot - got the pixel data of current OpenGL image.
Definition: ogl_utils.cpp:36

References OGL_GetScreenshot().

Referenced by EDA_3D_VIEWER::takeScreenshot().

◆ initializeOpenGL()

bool EDA_3D_CANVAS::initializeOpenGL ( )
private

initializeOpenGL

Returns
if OpenGL initialization succeed

Definition at line 219 of file eda_3d_canvas.cpp.

220 {
221  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::initializeOpenGL" );
222 
223  const GLenum err = glewInit();
224 
225  if( GLEW_OK != err )
226  {
227  const wxString msgError = (const char*) glewGetErrorString( err );
228 
229  wxLogMessage( msgError );
230 
231  return false;
232  }
233  else
234  {
235  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::initializeOpenGL Using GLEW version %s",
236  FROM_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
237  }
238 
239  wxString version = FROM_UTF8( (char *) glGetString( GL_VERSION ) );
240 
241  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::%s OpenGL version string %s.",
242  __WXFUNCTION__, version );
243 
244  // Extract OpenGL version from string. This method is used because prior to OpenGL 2,
245  // getting the OpenGL major and minor version as integers didn't exist.
246  wxString tmp;
247 
248  wxStringTokenizer tokenizer( version );
249 
251 
252  if( tokenizer.HasMoreTokens() )
253  {
254  long major = 0;
255  long minor = 0;
256 
257  tmp = tokenizer.GetNextToken();
258 
259  tokenizer.SetString( tmp, wxString( "." ) );
260 
261  if( tokenizer.HasMoreTokens() )
262  tokenizer.GetNextToken().ToLong( &major );
263 
264  if( tokenizer.HasMoreTokens() )
265  tokenizer.GetNextToken().ToLong( &minor );
266 
267  if( major < 2 || ( (major == 2 ) && (minor < 1) ) )
268  {
269  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::%s OpenGL ray tracing not supported.",
270  __WXFUNCTION__ );
271 
272  if( GetParent() )
273  {
274  wxCommandEvent evt( wxEVT_MENU, ID_DISABLE_RAY_TRACING );
275  GetParent()->ProcessWindowEvent( evt );
276  }
277 
279  }
280  }
281 
284 
285  return true;
286 }
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:114
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
bool m_is_opengl_initialized
bool m_opengl_supports_raytracing
static int SetSwapInterval(int aVal)
Attempts to set the OpenGL swap interval.
Definition: gl_utils.h:41

References FROM_UTF8(), ID_DISABLE_RAY_TRACING, m_is_opengl_initialized, m_logTrace, m_opengl_supports_raytracing, and GL_UTILS::SetSwapInterval().

Referenced by DoRePaint().

◆ IsReloadRequestPending()

bool EDA_3D_CANVAS::IsReloadRequestPending ( ) const
inline

IsReloadRequestPending - Query if there is a pending reload request.

Returns
true if it wants to reload, false if there is no reload pending

Definition at line 87 of file eda_3d_canvas.h.

88  {
89  if( m_3d_render )
91  else
92  return false;
93  }
bool IsReloadRequestPending() const
IsReloadRequestPending - Query if there is a pending reload request.
C3D_RENDER_BASE * m_3d_render

References C3D_RENDER_BASE::IsReloadRequestPending(), and m_3d_render.

Referenced by EDA_3D_VIEWER::OnActivate().

◆ move_pivot_based_on_cur_mouse_position()

void EDA_3D_CANVAS::move_pivot_based_on_cur_mouse_position ( )
private

move_pivot_based_on_cur_mouse_position - This function hits a ray to the board and start a moviment

Definition at line 794 of file eda_3d_canvas.cpp.

795 {
796  SFVEC3F rayOrigin;
797  SFVEC3F rayDir;
798 
799  // Generate a ray origin and direction based on current mouser position and camera
800  m_camera.MakeRayAtCurrrentMousePosition( rayOrigin, rayDir );
801 
802  RAY mouseRay;
803  mouseRay.Init( rayOrigin, rayDir );
804 
805  float hit_t;
806 
807  // Test it with the board bounding box
808  if( m_boardAdapter.GetBBox3DU().Intersect( mouseRay, &hit_t ) )
809  {
812  m_camera.SetLookAtPos_T1( mouseRay.at( hit_t ) );
814 
816  }
817 }
void SetLookAtPos_T1(const SFVEC3F &aLookAtPos)
Definition: ccamera.h:128
void request_start_moving_camera(float aMovingSpeed=2.0f, bool aRenderPivot=true)
request_start_moving_camera - start a camera movement
virtual void SetT0_and_T1_current_T()
SetT0_and_T1_current_T - This will set T0 and T1 with the current values.
Definition: ccamera.cpp:555
void ResetXYpos_T1()
Definition: ccamera.cpp:412
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:41
const CBBOX & GetBBox3DU() const noexcept
GetBBox3DU - Get the bbox of the pcb board.
Definition: ray.h:67
SFVEC3F at(float t) const
Definition: ray.h:89
BOARD_ADAPTER & m_boardAdapter
CCAMERA & m_camera
void MakeRayAtCurrrentMousePosition(SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
MakeRayAtCurrrentMousePosition - Make a ray based on the latest mouse position.
Definition: ccamera.cpp:380
bool Intersect(const RAY &aRay, float *t) const
Function Intersect.
Definition: cbbox_ray.cpp:46
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
void SetInterpolateMode(CAMERA_INTERPOLATION aInterpolateMode)
Definition: ccamera.h:200

References RAY::at(), BEZIER, BOARD_ADAPTER::GetBBox3DU(), RAY::Init(), CBBOX::Intersect(), m_boardAdapter, m_camera, CCAMERA::MakeRayAtCurrrentMousePosition(), request_start_moving_camera(), CCAMERA::ResetXYpos_T1(), CCAMERA::SetInterpolateMode(), CCAMERA::SetLookAtPos_T1(), and CCAMERA::SetT0_and_T1_current_T().

Referenced by OnMiddleUp(), and SetView3D().

◆ MovingSpeedMultiplierGet()

int EDA_3D_CANVAS::MovingSpeedMultiplierGet ( ) const
inline

MovingSpeedMultiplierGet - Return the current camera animation moving speed multiplier option.

Returns
current moving speed multiplier option, one of [1,2,3,4,5]

Definition at line 136 of file eda_3d_canvas.h.

136 { return m_moving_speed_multiplier; }
int m_moving_speed_multiplier

References m_moving_speed_multiplier.

Referenced by EDA_3D_VIEWER::SaveSettings(), and DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow().

◆ MovingSpeedMultiplierSet()

void EDA_3D_CANVAS::MovingSpeedMultiplierSet ( int  aMovingSpeedMultiplier)
inline

MovingSpeedMultiplierSet - Set the camera animation moving speed multiplier option.

Parameters
aMovingSpeedMultiplierOne of the possible integer options: [1,2,3,4,5]

Definition at line 130 of file eda_3d_canvas.h.

130 { m_moving_speed_multiplier = aMovingSpeedMultiplier; }
int m_moving_speed_multiplier

References m_moving_speed_multiplier.

Referenced by EDA_3D_VIEWER::LoadSettings(), and DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow().

◆ OnCloseWindow()

void EDA_3D_CANVAS::OnCloseWindow ( wxCloseEvent &  event)
private

Definition at line 205 of file eda_3d_canvas.cpp.

206 {
207  releaseOpenGL();
208 
209  event.Skip();
210 }
void releaseOpenGL()
releaseOpenGL - free created targets and openGL context

References releaseOpenGL().

◆ OnEraseBackground()

void EDA_3D_CANVAS::OnEraseBackground ( wxEraseEvent &  event)
private

Definition at line 541 of file eda_3d_canvas.cpp.

542 {
543  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::OnEraseBackground" );
544  // Do nothing, to avoid flashing.
545 }
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.

References m_logTrace.

◆ OnEvent()

void EDA_3D_CANVAS::OnEvent ( wxEvent &  aEvent)

Used to forward events to the canvas from popups, etc.

Definition at line 530 of file eda_3d_canvas.cpp.

531 {
532  if( !m_eventDispatcher )
533  aEvent.Skip();
534  else
536 
537  Refresh();
538 }
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
virtual void DispatchWxEvent(wxEvent &aEvent)
Processes wxEvents (mostly UI events), translates them to TOOL_EVENTs, and makes tools handle those.
TOOL_DISPATCHER * m_eventDispatcher

References TOOL_DISPATCHER::DispatchWxEvent(), m_eventDispatcher, and Refresh().

Referenced by EDA_3D_CANVAS().

◆ OnLeftDown()

void EDA_3D_CANVAS::OnLeftDown ( wxMouseEvent &  event)
private

Definition at line 665 of file eda_3d_canvas.cpp.

666 {
667  SetFocus();
669 }
void stop_editingTimeOut_Timer()
stop_editingTimeOut_Timer - stop the editing time, so it will not timeout

References stop_editingTimeOut_Timer().

◆ OnLeftUp()

void EDA_3D_CANVAS::OnLeftUp ( wxMouseEvent &  event)
private

Definition at line 672 of file eda_3d_canvas.cpp.

673 {
674  if( m_camera_is_moving )
675  return;
676 
677  if( m_mouse_is_moving )
678  {
679  m_mouse_is_moving = false;
681  }
682 }
bool m_mouse_is_moving
void restart_editingTimeOut_Timer()
restart_editingTimeOut_Timer - reset the editing timer
bool m_camera_is_moving

References m_camera_is_moving, m_mouse_is_moving, and restart_editingTimeOut_Timer().

◆ OnMiddleDown()

void EDA_3D_CANVAS::OnMiddleDown ( wxMouseEvent &  event)
private

Definition at line 685 of file eda_3d_canvas.cpp.

686 {
687  SetFocus();
689 }
void stop_editingTimeOut_Timer()
stop_editingTimeOut_Timer - stop the editing time, so it will not timeout

References stop_editingTimeOut_Timer().

◆ OnMiddleUp()

void EDA_3D_CANVAS::OnMiddleUp ( wxMouseEvent &  event)
private

Definition at line 692 of file eda_3d_canvas.cpp.

693 {
694  if( m_camera_is_moving )
695  return;
696 
697  if( m_mouse_is_moving )
698  {
699  m_mouse_is_moving = false;
701  }
702  else
703  {
705  }
706 }
bool m_mouse_is_moving
void restart_editingTimeOut_Timer()
restart_editingTimeOut_Timer - reset the editing timer
bool m_camera_is_moving
void move_pivot_based_on_cur_mouse_position()
move_pivot_based_on_cur_mouse_position - This function hits a ray to the board and start a moviment

References m_camera_is_moving, m_mouse_is_moving, move_pivot_based_on_cur_mouse_position(), and restart_editingTimeOut_Timer().

◆ OnMouseMove()

void EDA_3D_CANVAS::OnMouseMove ( wxMouseEvent &  event)
private

Definition at line 636 of file eda_3d_canvas.cpp.

637 {
638  //wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::OnMouseMove" ) );
639 
640  if( m_camera_is_moving )
641  return;
642 
644 
645  if( event.Dragging() )
646  {
647  if( event.LeftIsDown() ) // Drag
648  m_camera.Drag( event.GetPosition() );
649  else if( event.MiddleIsDown() ) // Pan
650  m_camera.Pan( event.GetPosition() );
651 
652  m_mouse_is_moving = true;
653  m_mouse_was_moved = true;
654 
655  // orientation has changed, redraw mesh
656  DisplayStatus();
657  Request_refresh();
658  }
659 
660  const wxPoint eventPosition = event.GetPosition();
661  m_camera.SetCurMousePosition( eventPosition );
662 }
virtual wxSize GetNativePixelSize() const
bool m_mouse_is_moving
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 SetCurMousePosition(const wxPoint &aPosition)
It updates the current mouse position without make any new recalculations on camera.
Definition: ccamera.cpp:431
CCAMERA & m_camera
bool m_mouse_was_moved
bool m_camera_is_moving
virtual void Drag(const wxPoint &aNewMousePosition)=0
Calculate a new mouse drag position.
bool SetCurWindowSize(const wxSize &aSize)
SetCurWindowSize - update the windows size of the camera.
Definition: ccamera.cpp:448
virtual void Pan(const wxPoint &aNewMousePosition)=0

References DisplayStatus(), CCAMERA::Drag(), HIDPI_GL_CANVAS::GetNativePixelSize(), m_camera, m_camera_is_moving, m_mouse_is_moving, m_mouse_was_moved, CCAMERA::Pan(), Request_refresh(), CCAMERA::SetCurMousePosition(), and CCAMERA::SetCurWindowSize().

◆ OnMouseWheel()

void EDA_3D_CANVAS::OnMouseWheel ( wxMouseEvent &  event)
private

Definition at line 548 of file eda_3d_canvas.cpp.

549 {
550  bool mouseActivity = false;
551 
552  wxLogTrace( m_logTrace, "EDA_3D_CANVAS::OnMouseWheel" );
553 
554  if( m_camera_is_moving )
555  return;
556 
557  float delta_move = m_delta_move_step_factor * m_camera.ZoomGet();
558 
560  delta_move *= (0.01f * event.GetWheelRotation());
561  else
562  if( event.GetWheelRotation() < 0 )
563  delta_move = -delta_move;
564 
565  // mousewheel_panning enabled:
566  // wheel -> pan;
567  // wheel + shift -> horizontal scrolling;
568  // wheel + ctrl -> zooming;
569  // mousewheel_panning disabled:
570  // wheel + shift -> vertical scrolling;
571  // wheel + ctrl -> horizontal scrolling;
572  // wheel -> zooming.
573 
574  if( m_boardAdapter.GetFlag( FL_MOUSEWHEEL_PANNING ) && !event.ControlDown() )
575  {
576  if( event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL || event.ShiftDown() )
577  m_camera.Pan( SFVEC3F( -delta_move, 0.0f, 0.0f ) );
578  else
579  m_camera.Pan( SFVEC3F( 0.0f, -delta_move, 0.0f ) );
580 
581  mouseActivity = true;
582  }
583  else if( event.ShiftDown() && !m_boardAdapter.GetFlag( FL_MOUSEWHEEL_PANNING ) )
584  {
585  m_camera.Pan( SFVEC3F( 0.0f, -delta_move, 0.0f ) );
586  mouseActivity = true;
587  }
588  else if( event.ControlDown() && !m_boardAdapter.GetFlag( FL_MOUSEWHEEL_PANNING ) )
589  {
590  m_camera.Pan( SFVEC3F( delta_move, 0.0f, 0.0f ) );
591  mouseActivity = true;
592  }
593  else
594  {
595  mouseActivity = m_camera.Zoom( event.GetWheelRotation() > 0 ? 1.1f : 1/1.1f );
596  }
597 
598  // If it results on a camera movement
599  if( mouseActivity )
600  {
601  DisplayStatus();
602  Request_refresh();
603 
604  m_mouse_is_moving = true;
605  m_mouse_was_moved = true;
606 
608  }
609 
610  // Update the cursor current mouse position on the camera
611  m_camera.SetCurMousePosition( event.GetPosition() );
612 }
bool GetFlag(DISPLAY3D_FLG aFlag) const
GetFlag - get a configuration status of a flag.
bool m_mouse_is_moving
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
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 SetCurMousePosition(const wxPoint &aPosition)
It updates the current mouse position without make any new recalculations on camera.
Definition: ccamera.cpp:431
BOARD_ADAPTER & m_boardAdapter
bool Zoom(float aFactor)
Definition: ccamera.cpp:474
void restart_editingTimeOut_Timer()
restart_editingTimeOut_Timer - reset the editing timer
float ZoomGet() const
Definition: ccamera.cpp:510
CCAMERA & m_camera
bool m_mouse_was_moved
bool m_camera_is_moving
virtual void Pan(const wxPoint &aNewMousePosition)=0
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
static const float m_delta_move_step_factor

References DisplayStatus(), FL_MOUSEWHEEL_PANNING, BOARD_ADAPTER::GetFlag(), m_boardAdapter, m_camera, m_camera_is_moving, m_delta_move_step_factor, m_logTrace, m_mouse_is_moving, m_mouse_was_moved, CCAMERA::Pan(), Request_refresh(), restart_editingTimeOut_Timer(), CCAMERA::SetCurMousePosition(), CCAMERA::Zoom(), and CCAMERA::ZoomGet().

◆ OnPaint()

void EDA_3D_CANVAS::OnPaint ( wxPaintEvent &  aEvent)
private

Called by a wxPaintEvent event.

Definition at line 339 of file eda_3d_canvas.cpp.

340 {
341  // Please have a look at:
342  // https://lists.launchpad.net/kicad-developers/msg25149.html
343  // wxPaintDC( this );
344  // aEvent.Skip( false );
345  DoRePaint();
346 }
void DoRePaint()
The actual function to repaint the canvas.

References DoRePaint().

◆ OnRefreshRequest()

void EDA_3D_CANVAS::OnRefreshRequest ( wxEvent &  aEvent)
private

Definition at line 738 of file eda_3d_canvas.cpp.

739 {
740  DoRePaint();
741 }
void DoRePaint()
The actual function to repaint the canvas.

References DoRePaint().

◆ OnResize()

void EDA_3D_CANVAS::OnResize ( wxSizeEvent &  event)
private

Definition at line 213 of file eda_3d_canvas.cpp.

214 {
215  this->Request_refresh();
216 }
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.

References Request_refresh().

◆ OnTimerTimeout_Editing()

void EDA_3D_CANVAS::OnTimerTimeout_Editing ( wxTimerEvent &  event)
private

Definition at line 709 of file eda_3d_canvas.cpp.

710 {
711  (void)event;
712 
713  m_mouse_is_moving = false;
714  m_mouse_was_moved = false;
715 
716  Request_refresh();
717 }
bool m_mouse_is_moving
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
bool m_mouse_was_moved

References m_mouse_is_moving, m_mouse_was_moved, and Request_refresh().

Referenced by EDA_3D_CANVAS().

◆ OnTimerTimeout_Redraw()

void EDA_3D_CANVAS::OnTimerTimeout_Redraw ( wxTimerEvent &  event)
private

Definition at line 732 of file eda_3d_canvas.cpp.

733 {
734  Request_refresh( true );
735 }
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.

References Request_refresh().

Referenced by EDA_3D_CANVAS().

◆ releaseOpenGL()

void EDA_3D_CANVAS::releaseOpenGL ( )
private

releaseOpenGL - free created targets and openGL context

Definition at line 183 of file eda_3d_canvas.cpp.

184 {
185  if( m_glRC )
186  {
188 
189  delete m_3d_render_raytracing;
191 
192  delete m_3d_render_ogl_legacy;
194 
195  // This is just a copy of a pointer, can safely be set to NULL
196  m_3d_render = NULL;
197 
200  m_glRC = NULL;
201  }
202 }
C3D_RENDER_RAYTRACING * m_3d_render_raytracing
wxGLContext * m_glRC
C3D_RENDER_OGL_LEGACY * m_3d_render_ogl_legacy
void UnlockCtx(wxGLContext *aContext)
Function UnlockCtx allows other canvases to bind an OpenGL context.
static GL_CONTEXT_MANAGER & Get()
Function Get returns the GL_CONTEXT_MANAGER instance (singleton).
#define NULL
void LockCtx(wxGLContext *aContext, wxGLCanvas *aCanvas)
Function LockCtx sets a context as current and prevents other canvases from switching it.
C3D_RENDER_BASE * m_3d_render
void DestroyCtx(wxGLContext *aContext)
Function DestroyCtx destroys a managed OpenGL context.

References GL_CONTEXT_MANAGER::DestroyCtx(), GL_CONTEXT_MANAGER::Get(), GL_CONTEXT_MANAGER::LockCtx(), m_3d_render, m_3d_render_ogl_legacy, m_3d_render_raytracing, m_glRC, NULL, and GL_CONTEXT_MANAGER::UnlockCtx().

Referenced by OnCloseWindow(), and ~EDA_3D_CANVAS().

◆ ReloadRequest()

void EDA_3D_CANVAS::ReloadRequest ( BOARD aBoard = NULL,
S3D_CACHE aCachePointer = NULL 
)

Definition at line 295 of file eda_3d_canvas.cpp.

296 {
297  if( aCachePointer != NULL )
298  m_boardAdapter.Set3DCacheManager( aCachePointer );
299 
300  if( aBoard != NULL )
301  m_boardAdapter.SetBoard( aBoard );
302 
303  m_boardAdapter.SetColorSettings( Pgm().GetSettingsManager().GetColorSettings() );
304 
305  if( m_3d_render )
307 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
void SetBoard(BOARD *aBoard) noexcept
SetBoard - Set current board to be rendered.
BOARD_ADAPTER & m_boardAdapter
#define NULL
SETTINGS_MANAGER * GetSettingsManager()
void Set3DCacheManager(S3D_CACHE *aCachePointer) noexcept
Set3DCacheManager - Update the Cache manager pointer.
Definition: board_adapter.h:80
C3D_RENDER_BASE * m_3d_render
void SetColorSettings(COLOR_SETTINGS *aSettings) noexcept
void ReloadRequest()
ReloadRequest - !TODO: this must be reviewed to add flags to improve specific render.

References GetSettingsManager(), m_3d_render, m_boardAdapter, NULL, Pgm(), C3D_RENDER_BASE::ReloadRequest(), BOARD_ADAPTER::Set3DCacheManager(), BOARD_ADAPTER::SetBoard(), and BOARD_ADAPTER::SetColorSettings().

Referenced by EDA_3D_VIEWER::ReloadRequest(), PANEL_PREV_3D::UpdateDummyModule(), and PANEL_PREV_3D::View3DUpdate().

◆ render_pivot()

void EDA_3D_CANVAS::render_pivot ( float  t,
float  aScale 
)
private

render_pivot - render the pivot cursor

Parameters
ttime between 0.0 and 1.0
aScalescale to apply on the cursor

Definition at line 76 of file eda_3d_canvas_pivot.cpp.

77 {
78  wxASSERT( aScale >= 0.0f );
79  wxASSERT( t >= 0.0f );
80 
81  if( t > 1.0f )
82  t = 1.0f;
83 
84  const SFVEC3F &lookAtPos = m_camera.GetLookAtPos_T1();
85 
86  glDisable( GL_LIGHTING );
87  glDisable( GL_DEPTH_TEST );
88  glDisable( GL_CULL_FACE );
89 
90  // Set projection and modelview matrixes
91  // /////////////////////////////////////////////////////////////////////////
92  glMatrixMode( GL_PROJECTION );
93  glLoadMatrixf( glm::value_ptr( m_camera.GetProjectionMatrix() ) );
94 
95  glMatrixMode( GL_MODELVIEW );
96  glLoadIdentity();
97  glLoadMatrixf( glm::value_ptr( m_camera.GetViewMatrix() ) );
98 
99  glEnable( GL_COLOR_MATERIAL );
100  glColor4f( 0.0f, 1.0f, 0.0f, 0.75f - t * 0.75f );
101 
102  // Translate to the look at position
103  glTranslatef( lookAtPos.x, lookAtPos.y, lookAtPos.z );
104 
105  glScalef( aScale, aScale, aScale );
106 
107  pivot_render_triangles( t * 0.5f );
108 
109  t = t * 0.80f;
110  glScalef( 1.0f - t, 1.0f - t, 1.0f - t );
111  glColor4f( 0.0f, 1.0f, 0.0f, 0.8f - t );
112 
113  glPushMatrix();
114  glRotatef( t * 90.0f, 0.0f, 0.0f, 1.0f );
115  pivot_render_triangles( t * 0.5f );
116  glPopMatrix();
117 
118  glPushMatrix();
119  glRotatef( -t * 90.0f, 0.0f, 0.0f, 1.0f );
120  pivot_render_triangles( t * 0.5f );
121  glPopMatrix();
122 }
const SFVEC3F & GetLookAtPos_T1() const
Definition: ccamera.h:132
CCAMERA & m_camera
const glm::mat4 & GetViewMatrix() const
Definition: ccamera.cpp:419
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
static void pivot_render_triangles(float t)
const glm::mat4 & GetProjectionMatrix() const
Definition: ccamera.cpp:389

References CCAMERA::GetLookAtPos_T1(), CCAMERA::GetProjectionMatrix(), CCAMERA::GetViewMatrix(), m_camera, and pivot_render_triangles().

Referenced by DoRePaint().

◆ RenderEngineChanged()

void EDA_3D_CANVAS::RenderEngineChanged ( )

RenderEngineChanged - Notify that the render engine was changed.

Definition at line 981 of file eda_3d_canvas.cpp.

982 {
983  switch( m_boardAdapter.RenderEngineGet() )
984  {
987  default: m_3d_render = NULL; break;
988  }
989 
990  if( m_3d_render )
992 
993  m_mouse_was_moved = false;
994 
995  Request_refresh();
996 }
C3D_RENDER_RAYTRACING * m_3d_render_raytracing
C3D_RENDER_OGL_LEGACY * m_3d_render_ogl_legacy
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
BOARD_ADAPTER & m_boardAdapter
#define NULL
bool m_mouse_was_moved
RENDER_ENGINE RenderEngineGet() const noexcept
RenderEngineGet.
C3D_RENDER_BASE * m_3d_render
void ReloadRequest()
ReloadRequest - !TODO: this must be reviewed to add flags to improve specific render.

References m_3d_render, m_3d_render_ogl_legacy, m_3d_render_raytracing, m_boardAdapter, m_mouse_was_moved, NULL, OPENGL_LEGACY, RAYTRACING, C3D_RENDER_BASE::ReloadRequest(), BOARD_ADAPTER::RenderEngineGet(), and Request_refresh().

Referenced by EDA_3D_VIEWER::RenderEngineChanged().

◆ RenderRaytracingRequest()

void EDA_3D_CANVAS::RenderRaytracingRequest ( )

RenderRaytracingRequest - Request to render the current view in Raytracing mode.

Definition at line 310 of file eda_3d_canvas.cpp.

311 {
313 
314  if( m_3d_render )
316 
318  //m_mouse_was_moved = true;
319 
320  Request_refresh();
321 }
C3D_RENDER_RAYTRACING * m_3d_render_raytracing
void Request_refresh(bool aRedrawImmediately=true)
Request_refresh - Schedule a refresh update of the canvas.
C3D_RENDER_BASE * m_3d_render
void ReloadRequest()
ReloadRequest - !TODO: this must be reviewed to add flags to improve specific render.
bool m_render_raytracing_was_requested

References m_3d_render, m_3d_render_raytracing, m_render_raytracing_was_requested, C3D_RENDER_BASE::ReloadRequest(), and Request_refresh().

Referenced by EDA_3D_CONTROLLER::RotateView(), and EDA_3D_CONTROLLER::ToggleOrtho().

◆ Request_refresh()

void EDA_3D_CANVAS::Request_refresh ( bool  aRedrawImmediately = true)

Request_refresh - Schedule a refresh update of the canvas.

Parameters
aRedrawImmediately- true will request a redraw, false will schedule a redraw, after a short timeout.

Definition at line 744 of file eda_3d_canvas.cpp.

745 {
746  if( aRedrawImmediately )
747  {
748  // Just calling Refresh() does not work always
749  // Using an event to call DoRepaint ensure the repaint code will be executed,
750  // and PostEvent will take priority to other events like mouse movements, keys, etc.
751  // and is executed during the next idle time
752  wxCommandEvent redrawEvent( wxEVT_REFRESH_CUSTOM_COMMAND, ID_CUSTOM_EVENT_1 );
753  wxPostEvent( this, redrawEvent );
754  }
755  else
756  {
757  // Schedule a timed redraw
758  m_redraw_trigger_timer.Start( 10 , wxTIMER_ONE_SHOT );
759  }
760 }
wxTimer m_redraw_trigger_timer

References ID_CUSTOM_EVENT_1, and m_redraw_trigger_timer.

Referenced by DoRePaint(), EDA_3D_CONTROLLER::On3DGridSelection(), EDA_3D_VIEWER::OnActivate(), OnMouseMove(), OnMouseWheel(), OnResize(), OnTimerTimeout_Editing(), OnTimerTimeout_Redraw(), EDA_3D_VIEWER::Process_Special_Functions(), RenderEngineChanged(), RenderRaytracingRequest(), request_start_moving_camera(), EDA_3D_CONTROLLER::RotateView(), EDA_3D_VIEWER::Set3DBoardBodyColorFromUser(), EDA_3D_VIEWER::Set3DSolderMaskColorFromUser(), EDA_3D_CONTROLLER::SetMaterial(), SetView3D(), EDA_3D_VIEWER::takeScreenshot(), EDA_3D_CONTROLLER::ToggleOrtho(), EDA_3D_CONTROLLER::ToggleVisibility(), PANEL_PREV_3D::UpdateDummyModule(), and EDA_3D_CONTROLLER::ZoomRedraw().

◆ request_start_moving_camera()

void EDA_3D_CANVAS::request_start_moving_camera ( float  aMovingSpeed = 2.0f,
bool  aRenderPivot = true 
)
private

request_start_moving_camera - start a camera movement

Parameters
aMovingSpeedthe time speed
aRenderPivotif it should display pivot cursor while move

Definition at line 763 of file eda_3d_canvas.cpp.

764 {
765  wxASSERT( aMovingSpeed > FLT_EPSILON );
766 
767  // Fast forward the animation if the animation is disabled
768  if( !m_animation_enabled )
769  {
770  m_camera.Interpolate( 1.0f );
771  DisplayStatus();
772  Request_refresh();
773  return;
774  }
775 
776  // Map speed multipler option to actual multiplier value
777  // [1,2,3,4,5] -> [0.25, 0.5, 1, 2, 4]
778  aMovingSpeed *= ( 1 << m_moving_speed_multiplier ) / 8.0f;
779 
780  m_render_pivot = aRenderPivot;
781  m_camera_moving_speed = aMovingSpeed;
782 
784 
785  DisplayStatus();
786  Request_refresh();
787 
788  m_camera_is_moving = true;
789 
791 }
unsigned m_strtime_camera_movement
void stop_editingTimeOut_Timer()
stop_editingTimeOut_Timer - stop the editing time, so it will not timeout
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.
float m_camera_moving_speed
CCAMERA & m_camera
bool m_camera_is_moving
virtual void Interpolate(float t)
Interpolate - It will update the matrix to interpolate between T0 and T1 values.
Definition: ccamera.cpp:569
bool m_animation_enabled
int m_moving_speed_multiplier
unsigned GetRunningMicroSecs()
Function GetRunningMicroSecs An alternate way to calculate an elapset time (in microsecondes) to clas...

References DisplayStatus(), GetRunningMicroSecs(), CCAMERA::Interpolate(), m_animation_enabled, m_camera, m_camera_is_moving, m_camera_moving_speed, m_moving_speed_multiplier, m_render_pivot, m_strtime_camera_movement, Request_refresh(), and stop_editingTimeOut_Timer().

Referenced by move_pivot_based_on_cur_mouse_position(), and SetView3D().

◆ restart_editingTimeOut_Timer()

void EDA_3D_CANVAS::restart_editingTimeOut_Timer ( )
private

restart_editingTimeOut_Timer - reset the editing timer

Definition at line 726 of file eda_3d_canvas.cpp.

727 {
728  m_editing_timeout_timer.Start( m_3d_render->GetWaitForEditingTimeOut() , wxTIMER_ONE_SHOT );
729 }
wxTimer m_editing_timeout_timer
virtual int GetWaitForEditingTimeOut()=0
GetWaitForEditingTimeOut - Give the interface the time (in ms) that it should wait for editing or mov...
C3D_RENDER_BASE * m_3d_render

References C3D_RENDER_BASE::GetWaitForEditingTimeOut(), m_3d_render, and m_editing_timeout_timer.

Referenced by DoRePaint(), OnLeftUp(), OnMiddleUp(), OnMouseWheel(), and SetView3D().

◆ SetEventDispatcher()

void EDA_3D_CANVAS::SetEventDispatcher ( TOOL_DISPATCHER aEventDispatcher)

Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools.

Parameters
aEventDispatcheris the object that will be used for dispatching events. DRAW_PANEL_GAL does not take over the ownership. Passing NULL disconnects all event handlers from the DRAW_PANEL_GAL and parent frame.

Definition at line 510 of file eda_3d_canvas.cpp.

511 {
512  m_eventDispatcher = aEventDispatcher;
513 
514  if( m_eventDispatcher )
515  {
516  m_parent->Connect( wxEVT_TOOL,
517  wxCommandEventHandler( TOOL_DISPATCHER::DispatchWxCommand ),
519  }
520  else
521  {
522  // While loop is used to be sure that all event handlers are removed.
523  while( m_parent->Disconnect( wxEVT_TOOL,
524  wxCommandEventHandler( TOOL_DISPATCHER::DispatchWxCommand ),
525  NULL, m_eventDispatcher ) );
526  }
527 }
#define NULL
TOOL_DISPATCHER * m_eventDispatcher
virtual void DispatchWxCommand(wxCommandEvent &aEvent)
Processes wxCommands (mostly menu related events) and runs appropriate actions (eg.

References TOOL_DISPATCHER::DispatchWxCommand(), m_eventDispatcher, and NULL.

Referenced by PANEL_PREV_3D::PANEL_PREV_3D(), and EDA_3D_VIEWER::~EDA_3D_VIEWER().

◆ SetInfoBar()

void EDA_3D_CANVAS::SetInfoBar ( WX_INFOBAR aInfoBar)
inline

Definition at line 76 of file eda_3d_canvas.h.

77  {
78  m_parentInfoBar = aInfoBar;
79  }
WX_INFOBAR * m_parentInfoBar

References m_parentInfoBar.

◆ SetScaleFactor()

void HIDPI_GL_CANVAS::SetScaleFactor ( double  aFactor)
inherited

Set the canvas scale factor, probably for a hi-DPI display.

Definition at line 58 of file hidpi_gl_canvas.cpp.

59 {
60  m_scale_factor = aNewScaleFactor;
61 }
double m_scale_factor
The current scale factor (e.g.

References HIDPI_GL_CANVAS::m_scale_factor.

Referenced by PANEL_PREV_3D::loadCommonSettings(), EDA_3D_VIEWER::loadCommonSettings(), and KIGFX::OPENGL_GAL::updatedGalDisplayOptions().

◆ SetStatusBar()

void EDA_3D_CANVAS::SetStatusBar ( wxStatusBar *  aStatusBar)
inline

Definition at line 71 of file eda_3d_canvas.h.

72  {
73  m_parentStatusBar = aStatusBar;
74  }
wxStatusBar * m_parentStatusBar

References m_parentStatusBar.

◆ SetView3D()

bool EDA_3D_CANVAS::SetView3D ( int  aKeycode)

SetView3D - Helper function to call view commands.

Parameters
aKeycodeascii key commands
Returns
true if the key code was handled, false if no command found for this code.

Definition at line 820 of file eda_3d_canvas.cpp.

821 {
822  if( m_camera_is_moving )
823  return false;
824 
825  const float delta_move = m_delta_move_step_factor * m_camera.ZoomGet();
826  const float arrow_moving_time_speed = 8.0f;
827  bool handled = false;
828 
829  switch( aKeycode )
830  {
831  case WXK_SPACE:
833  return true;
834 
835  case WXK_LEFT:
838  m_camera.Pan_T1( SFVEC3F( -delta_move, 0.0f, 0.0f ) );
839  request_start_moving_camera( arrow_moving_time_speed, false );
840  return true;
841 
842  case WXK_RIGHT:
845  m_camera.Pan_T1( SFVEC3F( +delta_move, 0.0f, 0.0f ) );
846  request_start_moving_camera( arrow_moving_time_speed, false );
847  return true;
848 
849  case WXK_UP:
852  m_camera.Pan_T1( SFVEC3F( 0.0f, +delta_move, 0.0f ) );
853  request_start_moving_camera( arrow_moving_time_speed, false );
854  return true;
855 
856  case WXK_DOWN:
859  m_camera.Pan_T1( SFVEC3F( 0.0f, -delta_move, 0.0f ) );
860  request_start_moving_camera( arrow_moving_time_speed, false );
861  return true;
862 
863  case WXK_HOME:
866  m_camera.Reset_T1();
867  request_start_moving_camera( glm::min( glm::max( m_camera.ZoomGet(), 1/1.26f ), 1.26f ) );
868  return true;
869 
870  case WXK_END:
871  break;
872 
873  case WXK_TAB:
876  m_camera.RotateZ_T1( glm::radians( 45.0f ) );
878  handled = true;
879  break;
880 
881  case WXK_F1:
884 
885  if( m_camera.Zoom_T1( 1.26f ) ) // 3 steps per doubling
887 
888  return true;
889 
890  case WXK_F2:
893 
894  if( m_camera.Zoom_T1( 1/1.26f ) ) // 3 steps per halving
896 
897  return true;
898 
899  case ID_VIEW3D_RESET:
902  m_camera.Reset_T1();
903  request_start_moving_camera( glm::min( glm::max( m_camera.ZoomGet(), 0.5f ), 1.125f ) );
904  return true;
905 
906  case ID_VIEW3D_RIGHT:
909  m_camera.Reset_T1();
910  m_camera.RotateZ_T1( glm::radians( -90.0f ) );
911  m_camera.RotateX_T1( glm::radians( -90.0f ) );
913  return true;
914 
915  case ID_VIEW3D_LEFT:
918  m_camera.Reset_T1();
919  m_camera.RotateZ_T1( glm::radians( 90.0f ) );
920  m_camera.RotateX_T1( glm::radians( -90.0f ) );
922  return true;
923 
924  case ID_VIEW3D_FRONT:
927  m_camera.Reset_T1();
928  m_camera.RotateX_T1( glm::radians( -90.0f ) );
930  return true;
931 
932  case ID_VIEW3D_BACK:
935  m_camera.Reset_T1();
936  m_camera.RotateX_T1( glm::radians( -90.0f ) );
937  // The rotation angle should be 180.
938  // We use 179.999 (180 - epsilon) to avoid a full 360 deg rotation when
939  // using 180 deg if the previous rotated position was already 180 deg
940  m_camera.RotateZ_T1( glm::radians( 179.999f ) );
942  return true;
943 
944  case ID_VIEW3D_TOP:
947  m_camera.Reset_T1();
948  request_start_moving_camera( glm::min( glm::max( m_camera.ZoomGet(), 0.5f ), 1.125f ) );
949  return true;
950 
951  case ID_VIEW3D_BOTTOM:
954  m_camera.Reset_T1();
955  m_camera.RotateY_T1( glm::radians( 179.999f ) ); // Rotation = 180 - epsilon
956  request_start_moving_camera( glm::min( glm::max( m_camera.ZoomGet(), 0.5f ), 1.125f ) );
957  return true;
958 
959  case ID_VIEW3D_FLIP:
962  m_camera.RotateY_T1( glm::radians( 179.999f ) );
964  return true;
965 
966  default:
967  return false;
968  }
969 
970  m_mouse_was_moved = true;
971 
973 
974  DisplayStatus();
975  Request_refresh();
976 
977  return handled;
978 }
void request_start_moving_camera(float aMovingSpeed=2.0f, bool aRenderPivot=true)
request_start_moving_camera - start a camera movement
virtual void SetT0_and_T1_current_T()
SetT0_and_T1_current_T - This will set T0 and T1 with the current values.
Definition: ccamera.cpp:555
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 restart_editingTimeOut_Timer()
restart_editingTimeOut_Timer - reset the editing timer
float ZoomGet() const
Definition: ccamera.cpp:510
CCAMERA & m_camera
bool m_mouse_was_moved
bool m_camera_is_moving
bool Zoom_T1(float aFactor)
Definition: ccamera.cpp:493
virtual void Pan_T1(const SFVEC3F &aDeltaOffsetInc)=0
void RotateX_T1(float aAngleInRadians)
Definition: ccamera.cpp:537
virtual void Reset_T1()
Definition: ccamera.cpp:103
void RotateY_T1(float aAngleInRadians)
Definition: ccamera.cpp:543
void move_pivot_based_on_cur_mouse_position()
move_pivot_based_on_cur_mouse_position - This function hits a ray to the board and start a moviment
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
void RotateZ_T1(float aAngleInRadians)
Definition: ccamera.cpp:549
static const float m_delta_move_step_factor
void SetInterpolateMode(CAMERA_INTERPOLATION aInterpolateMode)
Definition: ccamera.h:200

References BEZIER, DisplayStatus(), EASING_IN_OUT, ID_VIEW3D_BACK, ID_VIEW3D_BOTTOM, ID_VIEW3D_FLIP, ID_VIEW3D_FRONT, ID_VIEW3D_LEFT, ID_VIEW3D_RESET, ID_VIEW3D_RIGHT, ID_VIEW3D_TOP, LINEAR, m_camera, m_camera_is_moving, m_delta_move_step_factor, m_mouse_was_moved, move_pivot_based_on_cur_mouse_position(), CCAMERA::Pan_T1(), Request_refresh(), request_start_moving_camera(), CCAMERA::Reset_T1(), restart_editingTimeOut_Timer(), CCAMERA::RotateX_T1(), CCAMERA::RotateY_T1(), CCAMERA::RotateZ_T1(), CCAMERA::SetInterpolateMode(), CCAMERA::SetT0_and_T1_current_T(), CCAMERA::Zoom_T1(), and CCAMERA::ZoomGet().

Referenced by EDA_3D_CONTROLLER::doZoomInOut(), EDA_3D_CONTROLLER::PanControl(), PANEL_PREV_3D::View3DBack(), PANEL_PREV_3D::View3DBottom(), PANEL_PREV_3D::View3DFront(), PANEL_PREV_3D::View3DLeft(), PANEL_PREV_3D::View3DRight(), PANEL_PREV_3D::View3DTop(), EDA_3D_CONTROLLER::ViewControl(), and EDA_3D_CONTROLLER::ZoomFitScreen().

◆ stop_editingTimeOut_Timer()

void EDA_3D_CANVAS::stop_editingTimeOut_Timer ( )
private

stop_editingTimeOut_Timer - stop the editing time, so it will not timeout

Definition at line 720 of file eda_3d_canvas.cpp.

721 {
723 }
wxTimer m_editing_timeout_timer

References m_editing_timeout_timer.

Referenced by OnLeftDown(), OnMiddleDown(), and request_start_moving_camera().

Member Data Documentation

◆ m_3d_render

◆ m_3d_render_ogl_legacy

C3D_RENDER_OGL_LEGACY* EDA_3D_CANVAS::m_3d_render_ogl_legacy
private

Definition at line 262 of file eda_3d_canvas.h.

Referenced by DoRePaint(), releaseOpenGL(), and RenderEngineChanged().

◆ m_3d_render_raytracing

C3D_RENDER_RAYTRACING* EDA_3D_CANVAS::m_3d_render_raytracing
private

Definition at line 261 of file eda_3d_canvas.h.

Referenced by releaseOpenGL(), RenderEngineChanged(), and RenderRaytracingRequest().

◆ m_animation_enabled

bool EDA_3D_CANVAS::m_animation_enabled
private

◆ m_boardAdapter

BOARD_ADAPTER& EDA_3D_CANVAS::m_boardAdapter
private

◆ m_camera

◆ m_camera_is_moving

bool EDA_3D_CANVAS::m_camera_is_moving
private

◆ m_camera_moving_speed

float EDA_3D_CANVAS::m_camera_moving_speed
private

Definition at line 253 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and request_start_moving_camera().

◆ m_delta_move_step_factor

const float EDA_3D_CANVAS::m_delta_move_step_factor = 0.7f
staticprivate

Definition at line 264 of file eda_3d_canvas.h.

Referenced by OnMouseWheel(), and SetView3D().

◆ m_editing_timeout_timer

wxTimer EDA_3D_CANVAS::m_editing_timeout_timer
private

Definition at line 245 of file eda_3d_canvas.h.

Referenced by restart_editingTimeOut_Timer(), and stop_editingTimeOut_Timer().

◆ m_eventDispatcher

TOOL_DISPATCHER* EDA_3D_CANVAS::m_eventDispatcher
private

Definition at line 238 of file eda_3d_canvas.h.

Referenced by OnEvent(), and SetEventDispatcher().

◆ m_glRC

wxGLContext* EDA_3D_CANVAS::m_glRC
private

Definition at line 242 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and releaseOpenGL().

◆ m_is_opengl_initialized

bool EDA_3D_CANVAS::m_is_opengl_initialized
private

Definition at line 243 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and initializeOpenGL().

◆ m_mouse_is_moving

bool EDA_3D_CANVAS::m_mouse_is_moving
private

◆ m_mouse_was_moved

bool EDA_3D_CANVAS::m_mouse_was_moved
private

◆ m_moving_speed_multiplier

int EDA_3D_CANVAS::m_moving_speed_multiplier
private

◆ m_opengl_supports_raytracing

bool EDA_3D_CANVAS::m_opengl_supports_raytracing
private

Definition at line 267 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and initializeOpenGL().

◆ m_parentInfoBar

WX_INFOBAR* EDA_3D_CANVAS::m_parentInfoBar
private

Definition at line 240 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and SetInfoBar().

◆ m_parentStatusBar

wxStatusBar* EDA_3D_CANVAS::m_parentStatusBar
private

Definition at line 239 of file eda_3d_canvas.h.

Referenced by DisplayStatus(), DoRePaint(), and SetStatusBar().

◆ m_redraw_trigger_timer

wxTimer EDA_3D_CANVAS::m_redraw_trigger_timer
private

Definition at line 247 of file eda_3d_canvas.h.

Referenced by Request_refresh().

◆ m_render_pivot

bool EDA_3D_CANVAS::m_render_pivot
private

Definition at line 252 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and request_start_moving_camera().

◆ m_render_raytracing_was_requested

bool EDA_3D_CANVAS::m_render_raytracing_was_requested
private

Definition at line 268 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and RenderRaytracingRequest().

◆ m_strtime_camera_movement

unsigned EDA_3D_CANVAS::m_strtime_camera_movement
private

Definition at line 254 of file eda_3d_canvas.h.

Referenced by DoRePaint(), and request_start_moving_camera().


The documentation for this class was generated from the following files: