KiCad PCB EDA Suite
|
Implement a canvas based on a wxGLCanvas. More...
#include <eda_3d_canvas.h>
Public Member Functions | |
EDA_3D_CANVAS (wxWindow *aParent, const wxGLAttributes &aGLAttribs, BOARD_ADAPTER &aSettings, CAMERA &aCamera, S3D_CACHE *a3DCachePointer) | |
Create a new 3D Canvas with an attribute list. | |
~EDA_3D_CANVAS () | |
void | SetEventDispatcher (TOOL_DISPATCHER *aEventDispatcher) |
Set a dispatcher that processes events and forwards them to tools. | |
void | SetStatusBar (wxStatusBar *aStatusBar) |
void | SetInfoBar (WX_INFOBAR *aInfoBar) |
void | ReloadRequest (BOARD *aBoard=nullptr, S3D_CACHE *aCachePointer=nullptr) |
bool | IsReloadRequestPending () const |
Query if there is a pending reload request. | |
RENDER_3D_BASE * | GetCurrentRender () const |
void | RenderRaytracingRequest () |
Request to render the current view in Raytracing mode. | |
void | GetScreenshot (wxImage &aDstImage) |
Request a screenshot and output it to the aDstImage. | |
bool | SetView3D (VIEW3D_TYPE aRequestedView) |
Select a specific 3D view or operation. | |
void | SetAnimationEnabled (bool aEnable) |
Enable or disable camera animation when switching to a pre-defined view. | |
bool | GetAnimationEnabled () const |
void | SetMovingSpeedMultiplier (int aMultiplier) |
Set the camera animation moving speed multiplier option. | |
int | GetMovingSpeedMultiplier () const |
int | GetProjectionMode () const |
void | SetProjectionMode (int aMode) |
void | RenderEngineChanged () |
Notify that the render engine was changed. | |
void | DisplayStatus () |
Update the status bar with the position information. | |
void | Request_refresh (bool aRedrawImmediately=true) |
Schedule a refresh update of the canvas. | |
void | OnEvent (wxEvent &aEvent) |
Used to forward events to the canvas from popups, etc. | |
const BOARD_ADAPTER & | GetBoardAdapter () const |
Get information used to display 3D board. | |
bool | GetRenderPivot () |
Get a value indicating whether to render the pivot. | |
void | SetRenderPivot (bool aValue) |
Set aValue indicating whether to render the pivot. | |
bool | GetRender3dmousePivot () |
Get a value indicating whether to render the 3dmouse pivot. | |
void | SetRender3dmousePivot (bool aValue) |
Set aValue indicating whether to render the 3dmouse pivot. | |
void | Set3dmousePivotPos (const SFVEC3F &aPos) |
Set the position of the the 3dmouse pivot. | |
void | DoRePaint () |
The actual function to repaint the canvas. | |
CAMERA * | GetCamera () |
Get the canvas camera. | |
void | OnMouseMoveCamera (wxMouseEvent &event) |
void | OnMouseWheelCamera (wxMouseEvent &event, bool aPan) |
virtual wxSize | GetNativePixelSize () const |
wxPoint | GetNativePosition (const wxPoint &aPoint) const |
Convert the given point from client coordinates to native pixel coordinates. | |
double | GetScaleFactor () const |
Get the current scale factor. | |
void | SetVcSettings (const KIGFX::VC_SETTINGS &aVcSettings) |
Public Attributes | |
bool | m_mouse_is_moving |
bool | m_mouse_was_moved |
bool | m_camera_is_moving |
CAMERA & | m_camera |
Static Public Attributes | |
static const float | m_delta_move_step_factor = 0.7f |
Protected Attributes | |
KIGFX::VC_SETTINGS | m_settings |
< Current VIEW_CONTROLS settings. | |
Private Member Functions | |
void | OnPaint (wxPaintEvent &aEvent) |
void | OnEraseBackground (wxEraseEvent &event) |
void | OnRefreshRequest (wxEvent &aEvent) |
void | OnMouseWheel (wxMouseEvent &event) |
void | OnMagnify (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 | OnZoomGesture (wxZoomGestureEvent &event) |
void | OnPanGesture (wxPanGestureEvent &event) |
void | OnRotateGesture (wxRotateGestureEvent &event) |
void | stop_editingTimeOut_Timer () |
Stop the editing time so it will not timeout. | |
void | restart_editingTimeOut_Timer () |
Reset the editing timer. | |
void | request_start_moving_camera (float aMovingSpeed=2.0f, bool aRenderPivot=true) |
Start a camera movement. | |
void | move_pivot_based_on_cur_mouse_position () |
This function hits a ray to the board and start a movement. | |
void | render_pivot (float t, float aScale) |
Render the pivot cursor. | |
void | render3dmousePivot (float aScale) |
Render the 3dmouse pivot cursor. | |
bool | initializeOpenGL () |
void | releaseOpenGL () |
Free created targets and openGL context. | |
RAY | getRayAtCurrentMousePosition () |
Private Attributes | |
TOOL_DISPATCHER * | m_eventDispatcher |
wxStatusBar * | m_parentStatusBar |
WX_INFOBAR * | m_parentInfoBar |
wxGLContext * | m_glRC |
bool | m_is_opengl_initialized |
bool | m_is_opengl_version_supported |
wxTimer | m_editing_timeout_timer |
wxTimer | m_redraw_trigger_timer |
std::atomic_flag | m_is_currently_painting |
bool | m_render_pivot |
float | m_camera_moving_speed |
int64_t | m_strtime_camera_movement |
bool | m_animation_enabled |
int | m_moving_speed_multiplier |
BOARD_ADAPTER & | m_boardAdapter |
RENDER_3D_BASE * | m_3d_render |
RENDER_3D_RAYTRACE_GL * | m_3d_render_raytracing |
RENDER_3D_OPENGL * | m_3d_render_opengl |
bool | m_opengl_supports_raytracing |
bool | m_render_raytracing_was_requested |
ACCELERATOR_3D * | m_accelerator3DShapes |
BOARD_ITEM * | m_currentRollOverItem |
bool | m_render3dmousePivot = false |
SFVEC3F | m_3dmousePivotPos |
double | m_gestureLastZoomFactor = 1.0 |
< Used to track gesture events. | |
double | m_gestureLastAngle = 0.0 |
Static Private Attributes | |
static const wxChar * | m_logTrace = wxT( "KI_TRACE_EDA_3D_CANVAS" ) |
Trace mask used to enable or disable the trace output of this class. | |
Implement a canvas based on a wxGLCanvas.
Definition at line 48 of file eda_3d_canvas.h.
EDA_3D_CANVAS::EDA_3D_CANVAS | ( | wxWindow * | aParent, |
const wxGLAttributes & | aGLAttribs, | ||
BOARD_ADAPTER & | aSettings, | ||
CAMERA & | aCamera, | ||
S3D_CACHE * | a3DCachePointer | ||
) |
Create a new 3D Canvas with an attribute list.
aParent | the parent creator of this canvas. |
aGLAttribs | openGL attributes created by OGL_ATT_LIST::GetAttributesList. |
aBoard | The board. |
aSettings | the settings options to be used by this canvas. |
Definition at line 90 of file eda_3d_canvas.cpp.
References OnEvent(), OnTimerTimeout_Editing(), and OnTimerTimeout_Redraw().
EDA_3D_CANVAS::~EDA_3D_CANVAS | ( | ) |
Definition at line 175 of file eda_3d_canvas.cpp.
References m_accelerator3DShapes, m_logTrace, and releaseOpenGL().
void EDA_3D_CANVAS::DisplayStatus | ( | ) |
Update the status bar with the position information.
Definition at line 335 of file eda_3d_canvas.cpp.
References CAMERA::GetCameraPos(), CAMERA::GetZoom(), HIDPI_GL_3D_CANVAS::m_camera, and m_parentStatusBar.
Referenced by DoRePaint(), EDA_3D_CONTROLLER::doZoomInOut(), OnMagnify(), OnMouseMove(), OnMouseWheel(), OnPanGesture(), OnRotateGesture(), OnZoomGesture(), request_start_moving_camera(), and EDA_3D_CONTROLLER::ZoomFitScreen().
void EDA_3D_CANVAS::DoRePaint | ( | ) |
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 360 of file eda_3d_canvas.cpp.
References _, GL_CONTEXT_MANAGER::CreateCtx(), DisplayStatus(), EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS::engine, INFOBAR_REPORTER::Finalize(), GL_CONTEXT_MANAGER::Get(), HIDPI_GL_CANVAS::GetNativePixelSize(), GetRunningMicroSecs(), CAMERA::GetZoom(), initializeOpenGL(), CAMERA::Interpolate(), RENDER_3D_BASE::IsReloadRequestPending(), GL_CONTEXT_MANAGER::LockCtx(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_camera_moving_speed, BOARD_ADAPTER::m_Cfg, m_glRC, m_is_currently_painting, m_is_opengl_initialized, m_is_opengl_version_supported, m_logTrace, HIDPI_GL_3D_CANVAS::m_mouse_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, m_opengl_supports_raytracing, m_parentInfoBar, m_parentStatusBar, EDA_3D_VIEWER_SETTINGS::m_Render, m_render3dmousePivot, m_render_pivot, m_render_raytracing_was_requested, m_strtime_camera_movement, CAMERA::ParametersChanged(), RENDER_3D_BASE::Redraw(), RENDER_3D_RAYTRACE_BASE::Reload(), render3dmousePivot(), render_pivot(), STATUSBAR_REPORTER::Report(), INFOBAR_REPORTER::Report(), Request_refresh(), restart_editingTimeOut_Timer(), RPT_SEVERITY_ERROR, scale, CAMERA::SetCurWindowSize(), RENDER_3D_BASE::SetCurWindowSize(), and GL_CONTEXT_MANAGER::UnlockCtx().
Referenced by OnPaint(), and EDA_3D_VIEWER_FRAME::takeScreenshot().
|
inline |
Definition at line 128 of file eda_3d_canvas.h.
References m_animation_enabled.
Referenced by EDA_3D_VIEWER_FRAME::SaveSettings().
|
inline |
Get information used to display 3D board.
Definition at line 167 of file eda_3d_canvas.h.
References m_boardAdapter.
Referenced by NL_3D_VIEWER_PLUGIN_IMPL::GetHitLookAt(), NL_3D_VIEWER_PLUGIN_IMPL::GetModelExtents(), and NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::GetModelExtents().
|
inlineinherited |
Get the canvas camera.
Definition at line 62 of file hidpi_gl_3D_canvas.h.
Referenced by NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL().
|
inline |
Definition at line 102 of file eda_3d_canvas.h.
References m_3d_render.
Referenced by APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged().
|
inline |
Definition at line 136 of file eda_3d_canvas.h.
References m_moving_speed_multiplier.
Referenced by EDA_3D_VIEWER_FRAME::SaveSettings().
|
virtualinherited |
Definition at line 42 of file hidpi_gl_canvas.cpp.
References HIDPI_GL_CANVAS::GetScaleFactor().
Referenced by DoRePaint(), EDA_3D_MODEL_VIEWER::OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), EDA_3D_MODEL_VIEWER::OnPaint(), and KIGFX::OPENGL_GAL::OPENGL_GAL().
|
inherited |
Convert the given point from client coordinates to native pixel coordinates.
Definition at line 54 of file hidpi_gl_canvas.cpp.
References HIDPI_GL_CANVAS::GetScaleFactor().
Referenced by EDA_3D_MODEL_VIEWER::OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), and HIDPI_GL_3D_CANVAS::OnMouseWheelCamera().
|
inline |
Definition at line 138 of file eda_3d_canvas.h.
References CAMERA::GetProjection(), and HIDPI_GL_3D_CANVAS::m_camera.
Referenced by EDA_3D_VIEWER_FRAME::SaveSettings().
|
private |
Definition at line 1114 of file eda_3d_canvas.cpp.
References RAY::Init(), HIDPI_GL_3D_CANVAS::m_camera, and CAMERA::MakeRayAtCurrentMousePosition().
Referenced by move_pivot_based_on_cur_mouse_position(), OnLeftDown(), and OnMouseMove().
|
inline |
Get a value indicating whether to render the 3dmouse pivot.
Definition at line 184 of file eda_3d_canvas.h.
References m_render3dmousePivot.
Referenced by NL_3D_VIEWER_PLUGIN_IMPL::GetPivotVisible().
|
inline |
Get a value indicating whether to render the pivot.
Definition at line 172 of file eda_3d_canvas.h.
References m_render_pivot.
|
inherited |
Get the current scale factor.
Definition at line 66 of file hidpi_gl_canvas.cpp.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::PREVIEW::GetConstantGlyphHeight(), HIDPI_GL_CANVAS::GetNativePixelSize(), HIDPI_GL_CANVAS::GetNativePosition(), KIGFX::OPENGL_GAL::getScreenPixelSize(), and KIGFX::OPENGL_GAL::ResizeScreen().
void EDA_3D_CANVAS::GetScreenshot | ( | wxImage & | aDstImage | ) |
Request a screenshot and output it to the aDstImage.
aDstImage | - Screenshot destination image |
Definition at line 301 of file eda_3d_canvas.cpp.
References OglGetScreenshot().
Referenced by EDA_3D_VIEWER_FRAME::takeScreenshot().
|
private |
Definition at line 222 of file eda_3d_canvas.cpp.
References From_UTF8(), ID_DISABLE_RAY_TRACING, m_is_opengl_initialized, m_is_opengl_version_supported, m_logTrace, m_opengl_supports_raytracing, SetOpenGLInfo(), and GL_UTILS::SetSwapInterval().
Referenced by DoRePaint().
|
inline |
Query if there is a pending reload request.
Definition at line 91 of file eda_3d_canvas.h.
References RENDER_3D_BASE::IsReloadRequestPending(), and m_3d_render.
Referenced by EDA_3D_VIEWER_FRAME::OnActivate().
|
private |
This function hits a ray to the board and start a movement.
Definition at line 982 of file eda_3d_canvas.cpp.
References RAY::at(), BOARD_ADAPTER::GetBBox(), getRayAtCurrentMousePosition(), BBOX_3D::Intersect(), m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, request_start_moving_camera(), CAMERA::ResetXYpos_T1(), CAMERA::SetInterpolateMode(), CAMERA::SetLookAtPos_T1(), and CAMERA::SetT0_and_T1_current_T().
Referenced by OnMiddleUp(), and SetView3D().
|
private |
Definition at line 208 of file eda_3d_canvas.cpp.
References releaseOpenGL().
|
private |
Definition at line 602 of file eda_3d_canvas.cpp.
References m_logTrace.
void EDA_3D_CANVAS::OnEvent | ( | wxEvent & | aEvent | ) |
Used to forward events to the canvas from popups, etc.
Definition at line 591 of file eda_3d_canvas.cpp.
References TOOL_DISPATCHER::DispatchWxEvent(), m_eventDispatcher, and Refresh().
Referenced by EDA_3D_CANVAS().
|
private |
Definition at line 828 of file eda_3d_canvas.cpp.
References getRayAtCurrentMousePosition(), RENDER_3D_RAYTRACE_BASE::IntersectBoardItem(), m_3d_render_raytracing, HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), and stop_editingTimeOut_Timer().
|
private |
Definition at line 849 of file eda_3d_canvas.cpp.
References HIDPI_GL_3D_CANVAS::m_camera_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_is_moving, and restart_editingTimeOut_Timer().
|
private |
Definition at line 624 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, Request_refresh(), restart_editingTimeOut_Timer(), and CAMERA::Zoom().
|
private |
Definition at line 862 of file eda_3d_canvas.cpp.
References stop_editingTimeOut_Timer().
|
private |
Definition at line 869 of file eda_3d_canvas.cpp.
References HIDPI_GL_3D_CANVAS::m_camera_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_is_moving, move_pivot_based_on_cur_mouse_position(), and restart_editingTimeOut_Timer().
|
private |
Definition at line 712 of file eda_3d_canvas.cpp.
References _, DisplayStatus(), EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS::engine, ZONE::GetIsRuleArea(), getRayAtCurrentMousePosition(), FOOTPRINT::GetReference(), ZONE::GetZoneName(), RENDER_3D_RAYTRACE_BASE::IntersectBoardItem(), ZONE::IsOnCopperLayer(), RENDER_3D_BASE::IsReloadRequestPending(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera_is_moving, BOARD_ADAPTER::m_Cfg, m_currentRollOverItem, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, m_parentStatusBar, EDA_3D_VIEWER_SETTINGS::m_Render, HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), pad, PCB_ARC_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, STATUSBAR_REPORTER::Report(), Request_refresh(), RENDER_3D_OPENGL::SetCurrentRollOverItem(), and EDA_ITEM::Type().
|
inherited |
Definition at line 44 of file hidpi_gl_3D_canvas.cpp.
References CAMERA::Drag(), HIDPI_GL_CANVAS::GetNativePixelSize(), HIDPI_GL_CANVAS::GetNativePosition(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, CAMERA::Pan(), CAMERA::SetCurMousePosition(), and CAMERA::SetCurWindowSize().
Referenced by OnLeftDown(), and OnMouseMove().
|
private |
Definition at line 609 of file eda_3d_canvas.cpp.
References DisplayStatus(), m_boardAdapter, m_logTrace, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, BOARD_ADAPTER::m_MousewheelPanning, HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), Request_refresh(), and restart_editingTimeOut_Timer().
|
inherited |
Definition at line 68 of file hidpi_gl_3D_canvas.cpp.
References HIDPI_GL_CANVAS::GetNativePosition(), CAMERA::GetZoom(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, HIDPI_GL_3D_CANVAS::m_delta_move_step_factor, HIDPI_GL_3D_CANVAS::m_mouse_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, KIGFX::VC_SETTINGS::m_scrollModifierPanH, KIGFX::VC_SETTINGS::m_scrollModifierPanV, KIGFX::VC_SETTINGS::m_scrollModifierZoom, KIGFX::VC_SETTINGS::m_scrollReversePanH, KIGFX::VC_SETTINGS::m_scrollReverseZoom, HIDPI_GL_CANVAS::m_settings, CAMERA::Pan(), CAMERA::SetCurMousePosition(), and CAMERA::Zoom().
Referenced by OnMouseWheel().
|
private |
Definition at line 353 of file eda_3d_canvas.cpp.
References DoRePaint().
|
private |
Definition at line 670 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, CAMERA::Pan(), Request_refresh(), and CAMERA::SetCurMousePosition().
|
private |
Definition at line 926 of file eda_3d_canvas.cpp.
References Refresh().
|
private |
Definition at line 216 of file eda_3d_canvas.cpp.
References Request_refresh().
|
private |
Definition at line 688 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_gestureLastAngle, Request_refresh(), CAMERA::RotateScreen(), and CAMERA::SetCurMousePosition().
|
private |
Definition at line 886 of file eda_3d_canvas.cpp.
References m_editing_timeout_timer, HIDPI_GL_3D_CANVAS::m_mouse_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, and Request_refresh().
Referenced by EDA_3D_CANVAS().
|
private |
Definition at line 914 of file eda_3d_canvas.cpp.
References m_redraw_trigger_timer, and Request_refresh().
Referenced by EDA_3D_CANVAS().
|
private |
Definition at line 643 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_gestureLastZoomFactor, CAMERA::Pan(), Request_refresh(), restart_editingTimeOut_Timer(), CAMERA::SetCurMousePosition(), and CAMERA::Zoom().
|
private |
Free created targets and openGL context.
Definition at line 186 of file eda_3d_canvas.cpp.
References GL_CONTEXT_MANAGER::DestroyCtx(), GL_CONTEXT_MANAGER::Get(), GL_CONTEXT_MANAGER::LockCtx(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, m_glRC, and GL_CONTEXT_MANAGER::UnlockCtx().
Referenced by OnCloseWindow(), and ~EDA_3D_CANVAS().
Definition at line 307 of file eda_3d_canvas.cpp.
References m_3d_render, m_boardAdapter, BOARD_ADAPTER::ReloadColorSettings(), RENDER_3D_BASE::ReloadRequest(), BOARD_ADAPTER::Set3dCacheManager(), and BOARD_ADAPTER::SetBoard().
Referenced by EDA_3D_VIEWER_FRAME::NewDisplay(), DIALOG_FOOTPRINT_CHOOSER::on3DviewReq(), EDA_3D_VIEWER_FRAME::ReloadRequest(), PANEL_PREVIEW_3D_MODEL::setBodyStyleView(), PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint(), FOOTPRINT_CHOOSER_FRAME::updateViews(), PANEL_PREVIEW_3D_MODEL::View3DSettings(), and PANEL_PREVIEW_3D_MODEL::View3DUpdate().
|
private |
Render the 3dmouse pivot cursor.
aScale | scale to apply on the cursor. |
Definition at line 123 of file eda_3d_canvas_pivot.cpp.
References CAMERA::GetProjectionMatrix(), CAMERA::GetViewMatrix(), m_3dmousePivotPos, and HIDPI_GL_3D_CANVAS::m_camera.
Referenced by DoRePaint().
|
private |
Render the pivot cursor.
t | time between 0.0 and 1.0. |
aScale | scale to apply on the cursor. |
Definition at line 76 of file eda_3d_canvas_pivot.cpp.
References CAMERA::GetLookAtPos_T1(), CAMERA::GetProjectionMatrix(), CAMERA::GetViewMatrix(), HIDPI_GL_3D_CANVAS::m_camera, and pivot_render_triangles().
Referenced by DoRePaint().
void EDA_3D_CANVAS::RenderEngineChanged | ( | ) |
Notify that the render engine was changed.
Definition at line 1093 of file eda_3d_canvas.cpp.
References EDA_3D_VIEWER_SETTINGS::RENDER_SETTINGS::engine, SETTINGS_MANAGER::GetAppSettings(), PGM_BASE::GetSettingsManager(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, EDA_3D_VIEWER_SETTINGS::m_Render, Pgm(), RENDER_3D_BASE::ReloadRequest(), and Request_refresh().
Referenced by EDA_3D_VIEWER_FRAME::RenderEngineChanged().
void EDA_3D_CANVAS::RenderRaytracingRequest | ( | ) |
Request to render the current view in Raytracing mode.
Definition at line 322 of file eda_3d_canvas.cpp.
References m_3d_render, m_3d_render_raytracing, m_render_raytracing_was_requested, RENDER_3D_BASE::ReloadRequest(), and Request_refresh().
Referenced by APPEARANCE_CONTROLS_3D::doApplyViewport(), EDA_3D_CONTROLLER::RotateView(), and EDA_3D_CONTROLLER::ToggleOrtho().
void EDA_3D_CANVAS::Request_refresh | ( | bool | aRedrawImmediately = true | ) |
Schedule a refresh update of the canvas.
aRedrawImmediately | true will request a redraw, false will schedule a redraw after a short timeout. |
Definition at line 932 of file eda_3d_canvas.cpp.
References ID_CUSTOM_EVENT_1, and m_redraw_trigger_timer.
Referenced by APPEARANCE_CONTROLS_3D::doApplyViewport(), DoRePaint(), EDA_3D_CONTROLLER::On3DGridSelection(), DIALOG_FOOTPRINT_CHOOSER::on3DviewReq(), EDA_3D_VIEWER_FRAME::OnActivate(), APPEARANCE_CONTROLS_3D::OnLayerVisibilityChanged(), OnMagnify(), OnMouseMove(), OnMouseWheel(), OnPanGesture(), OnResize(), OnRotateGesture(), OnTimerTimeout_Editing(), OnTimerTimeout_Redraw(), OnZoomGesture(), EDA_3D_VIEWER_FRAME::Redraw(), EDA_3D_VIEWER_FRAME::refreshRender(), RenderEngineChanged(), RenderRaytracingRequest(), request_start_moving_camera(), EDA_3D_CONTROLLER::RotateView(), NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand(), EDA_3D_CONTROLLER::SetMaterial(), NL_3D_VIEWER_PLUGIN_IMPL::SetPivotPosition(), NL_3D_VIEWER_PLUGIN_IMPL::SetPivotVisible(), NL_3D_VIEWER_PLUGIN_IMPL::SetTransaction(), EDA_3D_CONTROLLER::ToggleOrtho(), PANEL_PREVIEW_3D_MODEL::UpdateDummyFootprint(), FOOTPRINT_CHOOSER_FRAME::updateViews(), and EDA_3D_CONTROLLER::ZoomRedraw().
|
private |
Start a camera movement.
aMovingSpeed | the time speed. |
aRenderPivot | if it should display pivot cursor while move. |
Definition at line 951 of file eda_3d_canvas.cpp.
References DisplayStatus(), GetRunningMicroSecs(), CAMERA::Interpolate(), m_animation_enabled, HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::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().
|
private |
Reset the editing timer.
Definition at line 907 of file eda_3d_canvas.cpp.
References RENDER_3D_BASE::GetWaitForEditingTimeOut(), m_3d_render, and m_editing_timeout_timer.
Referenced by DoRePaint(), OnLeftUp(), OnMagnify(), OnMiddleUp(), OnMouseWheel(), and OnZoomGesture().
|
inline |
Set the position of the the 3dmouse pivot.
aPos | is the position of the 3dmouse rotation pivot |
Definition at line 206 of file eda_3d_canvas.h.
References m_3dmousePivotPos.
Referenced by NL_3D_VIEWER_PLUGIN_IMPL::SetPivotPosition().
|
inline |
Enable or disable camera animation when switching to a pre-defined view.
Definition at line 127 of file eda_3d_canvas.h.
References m_animation_enabled.
Referenced by EDA_3D_VIEWER_FRAME::applySettings(), DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), and PANEL_PREVIEW_3D_MODEL::loadSettings().
void EDA_3D_CANVAS::SetEventDispatcher | ( | TOOL_DISPATCHER * | aEventDispatcher | ) |
Set a dispatcher that processes events and forwards them to tools.
#DRAW_PANEL_GAL does not take over the ownership. Passing NULL disconnects all event handlers from the DRAW_PANEL_GAL and parent frame.
aEventDispatcher | is the object that will be used for dispatching events. |
Definition at line 585 of file eda_3d_canvas.cpp.
References m_eventDispatcher.
Referenced by PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), and EDA_3D_VIEWER_FRAME::~EDA_3D_VIEWER_FRAME().
|
inline |
Definition at line 79 of file eda_3d_canvas.h.
References m_parentInfoBar.
Referenced by PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL().
|
inline |
Set the camera animation moving speed multiplier option.
aMultiplier | one of the possible integer options: [1,2,3,4,5]. |
Definition at line 135 of file eda_3d_canvas.h.
References m_moving_speed_multiplier.
Referenced by EDA_3D_VIEWER_FRAME::applySettings(), DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), and PANEL_PREVIEW_3D_MODEL::loadSettings().
|
inline |
Definition at line 139 of file eda_3d_canvas.h.
References HIDPI_GL_3D_CANVAS::m_camera, and CAMERA::SetProjection().
Referenced by EDA_3D_VIEWER_FRAME::applySettings(), DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), and PANEL_PREVIEW_3D_MODEL::loadSettings().
|
inline |
Set aValue indicating whether to render the 3dmouse pivot.
aValue | true will cause the pivot to be rendered on the next redraw. |
Definition at line 195 of file eda_3d_canvas.h.
References m_render3dmousePivot.
Referenced by NL_3D_VIEWER_PLUGIN_IMPL::SetPivotVisible().
|
inline |
Set aValue indicating whether to render the pivot.
aValue | true will cause the pivot to be rendered on the next redraw. |
Definition at line 179 of file eda_3d_canvas.h.
References m_render_pivot.
|
inline |
Definition at line 74 of file eda_3d_canvas.h.
References m_parentStatusBar.
|
inlineinherited |
Definition at line 62 of file hidpi_gl_canvas.h.
Referenced by EDA_3D_VIEWER_FRAME::applySettings().
bool EDA_3D_CANVAS::SetView3D | ( | VIEW3D_TYPE | aRequestedView | ) |
Select a specific 3D view or operation.
aRequestedView | the view to move to |
Definition at line 1001 of file eda_3d_canvas.cpp.
References CAMERA::GetZoom(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, HIDPI_GL_3D_CANVAS::m_delta_move_step_factor, move_pivot_based_on_cur_mouse_position(), CAMERA::Pan_T1(), request_start_moving_camera(), CAMERA::Reset_T1(), CAMERA::SetInterpolateMode(), CAMERA::SetT0_and_T1_current_T(), CAMERA::ViewCommand_T1(), and CAMERA::Zoom_T1().
Referenced by EDA_3D_CONTROLLER::doZoomInOut(), EDA_3D_CONTROLLER::PanControl(), PANEL_PREVIEW_3D_MODEL::View3DBack(), PANEL_PREVIEW_3D_MODEL::View3DBottom(), PANEL_PREVIEW_3D_MODEL::View3DFront(), PANEL_PREVIEW_3D_MODEL::View3DLeft(), PANEL_PREVIEW_3D_MODEL::View3DRight(), PANEL_PREVIEW_3D_MODEL::View3DTop(), EDA_3D_CONTROLLER::ViewControl(), and EDA_3D_CONTROLLER::ZoomFitScreen().
|
private |
Stop the editing time so it will not timeout.
Definition at line 901 of file eda_3d_canvas.cpp.
References m_editing_timeout_timer.
Referenced by OnLeftDown(), OnMiddleDown(), and request_start_moving_camera().
|
private |
Definition at line 317 of file eda_3d_canvas.h.
Referenced by DoRePaint(), GetCurrentRender(), IsReloadRequestPending(), OnMouseMove(), releaseOpenGL(), ReloadRequest(), RenderEngineChanged(), RenderRaytracingRequest(), and restart_editingTimeOut_Timer().
|
private |
Definition at line 319 of file eda_3d_canvas.h.
Referenced by DoRePaint(), OnMouseMove(), releaseOpenGL(), and RenderEngineChanged().
|
private |
Definition at line 318 of file eda_3d_canvas.h.
Referenced by DoRePaint(), OnLeftDown(), OnMouseMove(), releaseOpenGL(), RenderEngineChanged(), and RenderRaytracingRequest().
|
private |
Definition at line 329 of file eda_3d_canvas.h.
Referenced by render3dmousePivot(), and Set3dmousePivotPos().
|
private |
Definition at line 324 of file eda_3d_canvas.h.
Referenced by ~EDA_3D_CANVAS().
|
private |
Definition at line 313 of file eda_3d_canvas.h.
Referenced by GetAnimationEnabled(), request_start_moving_camera(), and SetAnimationEnabled().
|
private |
Definition at line 316 of file eda_3d_canvas.h.
Referenced by DoRePaint(), GetBoardAdapter(), move_pivot_based_on_cur_mouse_position(), OnMouseMove(), OnMouseWheel(), and ReloadRequest().
|
inherited |
Definition at line 55 of file hidpi_gl_3D_canvas.h.
Referenced by DisplayStatus(), DoRePaint(), GetProjectionMode(), getRayAtCurrentMousePosition(), move_pivot_based_on_cur_mouse_position(), OnMagnify(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), OnPanGesture(), OnRotateGesture(), OnZoomGesture(), render3dmousePivot(), render_pivot(), request_start_moving_camera(), SetProjectionMode(), and SetView3D().
|
inherited |
Definition at line 53 of file hidpi_gl_3D_canvas.h.
Referenced by DoRePaint(), OnLeftUp(), OnMagnify(), OnMiddleUp(), OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), OnPanGesture(), OnRotateGesture(), OnZoomGesture(), request_start_moving_camera(), and SetView3D().
|
private |
Definition at line 311 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and request_start_moving_camera().
|
private |
Definition at line 326 of file eda_3d_canvas.h.
Referenced by OnMouseMove().
|
staticinherited |
Definition at line 56 of file hidpi_gl_3D_canvas.h.
Referenced by HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), and SetView3D().
|
private |
Definition at line 305 of file eda_3d_canvas.h.
Referenced by OnTimerTimeout_Editing(), restart_editingTimeOut_Timer(), and stop_editingTimeOut_Timer().
|
private |
Definition at line 297 of file eda_3d_canvas.h.
Referenced by OnEvent(), and SetEventDispatcher().
|
private |
Definition at line 333 of file eda_3d_canvas.h.
Referenced by OnRotateGesture().
|
private |
< Used to track gesture events.
Definition at line 332 of file eda_3d_canvas.h.
Referenced by OnZoomGesture().
|
private |
Definition at line 301 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and releaseOpenGL().
|
private |
Definition at line 308 of file eda_3d_canvas.h.
Referenced by DoRePaint().
|
private |
Definition at line 302 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and initializeOpenGL().
|
private |
Definition at line 303 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and initializeOpenGL().
|
inherited |
Definition at line 51 of file hidpi_gl_3D_canvas.h.
Referenced by DoRePaint(), OnLeftUp(), OnMiddleUp(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), and OnTimerTimeout_Editing().
|
inherited |
Definition at line 52 of file hidpi_gl_3D_canvas.h.
Referenced by DoRePaint(), OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), OnMouseWheel(), HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), OnTimerTimeout_Editing(), and RenderEngineChanged().
|
private |
Definition at line 314 of file eda_3d_canvas.h.
Referenced by GetMovingSpeedMultiplier(), request_start_moving_camera(), and SetMovingSpeedMultiplier().
|
private |
Definition at line 321 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and initializeOpenGL().
|
private |
Definition at line 299 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and SetInfoBar().
|
private |
Definition at line 298 of file eda_3d_canvas.h.
Referenced by DisplayStatus(), DoRePaint(), OnMouseMove(), and SetStatusBar().
|
private |
Definition at line 307 of file eda_3d_canvas.h.
Referenced by OnTimerTimeout_Redraw(), and Request_refresh().
|
private |
Definition at line 328 of file eda_3d_canvas.h.
Referenced by DoRePaint(), GetRender3dmousePivot(), and SetRender3dmousePivot().
|
private |
Definition at line 310 of file eda_3d_canvas.h.
Referenced by DoRePaint(), GetRenderPivot(), request_start_moving_camera(), and SetRenderPivot().
|
private |
Definition at line 322 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and RenderRaytracingRequest().
|
protectedinherited |
< Current VIEW_CONTROLS settings.
Definition at line 66 of file hidpi_gl_canvas.h.
Referenced by HIDPI_GL_3D_CANVAS::OnMouseWheelCamera().
|
private |
Definition at line 312 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and request_start_moving_camera().