|
KiCad PCB EDA Suite
|
Implement a canvas based on a wxGLCanvas. More...
#include <eda_3d_canvas.h>
Classes | |
| struct | MODEL_HIT |
| struct | OVERLAY |
| A translucent triangle soup drawn over the scene. More... | |
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 () override | |
| 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 | SetPickHandler (std::function< bool(const RAY &)> aHandler) |
| Consume plain canvas clicks before the normal selection handler. | |
| void | SetHoverHandler (std::function< void(const std::optional< RAY > &)> aHandler) |
| Report the mouse position while a pick handler is installed. | |
| void | SetOverlays (std::vector< OVERLAY > aOverlays) |
| std::optional< MODEL_HIT > | PickModel (const RAY &aRay, const S3DMODEL &aGeometry, const FP_3DMODEL &aModel, const FOOTPRINT &aFootprint) const |
| Pick current mesh geometry; independent of the renderer's cached hit-test scene. | |
| PAD * | PickFootprintPad (const RAY &aRay, const FOOTPRINT &aFootprint) const |
| Project onto the footprint's seating plane and hit-test copper pads. | |
| void | ReloadRequest (BOARD *aBoard=nullptr, S3D_CACHE *aCachePointer=nullptr) |
| void | ReloadRaytracingForHitTesting (std::stop_token aStop) |
| Rebuild the auxiliary raytracing BVH used for hover hit-testing in OpenGL mode. | |
| void | InvalidateRaytracingHitTesting () |
| Invalidate the hover hit-test BVH before board layers are rebuilt. | |
| 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. | |
| void | JoinBgWorker () |
| Block until any in-progress OpenGL background loading has finished. | |
| 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. | |
| void | RenderToFrameBuffer (unsigned char *aBuffer, int aWidth, int aHeight) |
| void | OnCloseWindow (wxCloseEvent &event) |
| 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 | OnMouseLeave (wxMouseEvent &event) |
| void | OnLeftDown (wxMouseEvent &event) |
| void | OnLeftUp (wxMouseEvent &event) |
| void | OnMiddleUp (wxMouseEvent &event) |
| void | OnMiddleDown (wxMouseEvent &event) |
| void | OnRightUp (wxMouseEvent &event) |
| void | OnRightDown (wxMouseEvent &event) |
| void | OnTimerTimeout_Editing (wxTimerEvent &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. | |
| void | render_overlays () |
| Draw the translucent overlays over the rendered scene. | |
| bool | initializeOpenGL () |
| void | releaseOpenGL () |
| Free created targets and openGL context. | |
| RAY | getRayAtCurrentMousePosition () |
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 59 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. |
| aSettings | the settings options to be used by this canvas. |
| aCamera | is the CAMERA settings. |
| a3DCachePointer | is a pointer to the 3D cache. |
Definition at line 118 of file eda_3d_canvas.cpp.
References EDA_3D_CANVAS(), EDA_3D_CANVAS_ID, HIDPI_GL_3D_CANVAS::HIDPI_GL_3D_CANVAS(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, m_editing_timeout_timer, m_eventDispatcher, m_is_currently_painting, m_logTrace, m_redraw_trigger_timer, OnEvent(), OnTimerTimeout_Editing(), and OnTimerTimeout_Redraw().
Referenced by EDA_3D_CANVAS().
|
override |
Definition at line 186 of file eda_3d_canvas.cpp.
References m_accelerator3DShapes, m_activityReporterSync, m_logTrace, m_warningReporterSync, and releaseOpenGL().
| void EDA_3D_CANVAS::DisplayStatus | ( | ) |
Update the status bar with the position information.
Definition at line 396 of file eda_3d_canvas.cpp.
References HIDPI_GL_3D_CANVAS::m_camera, m_parentStatusBar, X_POS, Y_POS, and ZOOM_LEVEL.
Referenced by DoRePaint(), OnMagnify(), OnMouseMove(), OnMouseWheel(), OnPanGesture(), OnRotateGesture(), OnZoomGesture(), and request_start_moving_camera().
| 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 422 of file eda_3d_canvas.cpp.
References _, ACTIVITY, SPHERES_GIZMO::Count, GL_CONTEXT_MANAGER::CreateCtx(), DisplayStatus(), PGM_BASE::GetGLContextManager(), HIDPI_GL_CANVAS::GetNativePixelSize(), GetRunningMicroSecs(), index, initializeOpenGL(), GL_CONTEXT_MANAGER::LockCtx(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, m_activityReporterSync, m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_camera_moving_speed, m_glRC, m_infoBarReporter, 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, m_render3dmousePivot, m_render_pivot, m_render_raytracing_was_requested, m_statusBarReporter, m_strtime_camera_movement, m_warningReporterSync, OPENGL, Pgm(), render3dmousePivot(), render_overlays(), render_pivot(), RENDER_TIME, Request_refresh(), restart_editingTimeOut_Timer(), RPT_SEVERITY_ERROR, scale, SetView3D(), GL_CONTEXT_MANAGER::UnlockCtx(), VIEW3D_BACK, VIEW3D_BOTTOM, VIEW3D_FRONT, VIEW3D_LEFT, VIEW3D_RIGHT, and VIEW3D_TOP.
Referenced by OnPaint().
|
inline |
Definition at line 201 of file eda_3d_canvas.h.
References m_animation_enabled.
|
inline |
Get information used to display 3D board.
Definition at line 240 of file eda_3d_canvas.h.
References m_boardAdapter.
Referenced by NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::GetModelExtents().
|
inlineinherited |
Get the canvas camera.
Definition at line 58 of file hidpi_gl_3D_canvas.h.
References m_camera.
Referenced by SPNAV_VIEWER_PLUGIN::SPNAV_VIEWER_PLUGIN().
|
inline |
Definition at line 170 of file eda_3d_canvas.h.
References m_3d_render.
|
inline |
Definition at line 209 of file eda_3d_canvas.h.
References m_moving_speed_multiplier.
|
virtualinherited |
Definition at line 38 of file hidpi_gl_canvas.cpp.
References GetScaleFactor().
Referenced by EDA_3D_CANVAS::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 50 of file hidpi_gl_canvas.cpp.
References GetScaleFactor().
Referenced by EDA_3D_MODEL_VIEWER::OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), and HIDPI_GL_3D_CANVAS::OnMouseWheelCamera().
|
inline |
Definition at line 211 of file eda_3d_canvas.h.
References HIDPI_GL_3D_CANVAS::m_camera.
|
private |
Definition at line 1681 of file eda_3d_canvas.cpp.
References RAY::Init(), and HIDPI_GL_3D_CANVAS::m_camera.
Referenced by move_pivot_based_on_cur_mouse_position(), OnLeftUp(), and OnMouseMove().
|
inline |
Get a value indicating whether to render the 3dmouse pivot.
Definition at line 257 of file eda_3d_canvas.h.
References m_render3dmousePivot.
|
inline |
Get a value indicating whether to render the pivot.
Definition at line 245 of file eda_3d_canvas.h.
References m_render_pivot.
|
inherited |
Get the current scale factor.
Definition at line 62 of file hidpi_gl_canvas.cpp.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::OPENGL_GAL::drawGridSources(), KIGFX::PREVIEW::GetConstantGlyphHeight(), GetNativePixelSize(), 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 338 of file eda_3d_canvas.cpp.
References OglGetScreenshot().
|
private |
Definition at line 254 of file eda_3d_canvas.cpp.
References GL_UTILS::DetectGLBackend(), From_UTF8(), ID_DISABLE_RAY_TRACING, m_is_opengl_initialized, m_is_opengl_version_supported, m_logTrace, m_opengl_supports_raytracing, SetOpenGLBackendInfo(), SetOpenGLInfo(), and GL_UTILS::SetSwapInterval().
Referenced by DoRePaint(), and RenderToFrameBuffer().
| void EDA_3D_CANVAS::InvalidateRaytracingHitTesting | ( | ) |
Invalidate the hover hit-test BVH before board layers are rebuilt.
Definition at line 376 of file eda_3d_canvas.cpp.
References m_3d_render_raytracing.
|
inline |
Query if there is a pending reload request.
Definition at line 159 of file eda_3d_canvas.h.
References m_3d_render.
| void EDA_3D_CANVAS::JoinBgWorker | ( | ) |
Block until any in-progress OpenGL background loading has finished.
Definition at line 344 of file eda_3d_canvas.cpp.
References m_3d_render.
|
private |
This function hits a ray to the board and start a movement.
Definition at line 1404 of file eda_3d_canvas.cpp.
References RAY::at(), BEZIER, getRayAtCurrentMousePosition(), m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, and request_start_moving_camera().
Referenced by OnMiddleUp(), and SetView3D().
| void EDA_3D_CANVAS::OnCloseWindow | ( | wxCloseEvent & | event | ) |
Definition at line 240 of file eda_3d_canvas.cpp.
References releaseOpenGL().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 906 of file eda_3d_canvas.cpp.
References m_logTrace.
Referenced by wxDEFINE_EVENT().
| void EDA_3D_CANVAS::OnEvent | ( | wxEvent & | aEvent | ) |
Used to forward events to the canvas from popups, etc.
Definition at line 895 of file eda_3d_canvas.cpp.
References m_eventDispatcher.
Referenced by EDA_3D_CANVAS().
|
private |
Definition at line 1149 of file eda_3d_canvas.cpp.
References HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), and stop_editingTimeOut_Timer().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1164 of file eda_3d_canvas.cpp.
References FRAME_PCB_EDITOR, FRAME_SCH, getRayAtCurrentMousePosition(), FOOTPRINT::GetReference(), m_3d_render_opengl, m_3d_render_raytracing, m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, HIDPI_GL_3D_CANVAS::m_mouse_is_moving, m_pickHandler, MAIL_SELECTION, SPHERES_GIZMO::None, OPENGL, kiapi::common::PackKiwayApiMessage(), PCB_FIELD_T, PCB_FOOTPRINT_T, PCB_PAD_T, restart_editingTimeOut_Timer(), and EDA_ITEM::Type().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 928 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, Request_refresh(), and restart_editingTimeOut_Timer().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1284 of file eda_3d_canvas.cpp.
References stop_editingTimeOut_Timer().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1291 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().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1140 of file eda_3d_canvas.cpp.
References m_hoverHandler.
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1016 of file eda_3d_canvas.cpp.
References _, DisplayStatus(), ZONE::GetIsRuleArea(), getRayAtCurrentMousePosition(), FOOTPRINT::GetReference(), FOOTPRINT::GetValue(), ZONE::GetZoneName(), HOVERED_ITEM, ZONE::IsOnCopperLayer(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_currentRollOverItem, m_hoverHandler, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, m_parentStatusBar, HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), OPENGL, pad, PCB_ARC_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, reporter, Request_refresh(), and EDA_ITEM::Type().
Referenced by wxDEFINE_EVENT().
|
inherited |
Definition at line 40 of file hidpi_gl_3D_canvas.cpp.
References HIDPI_GL_CANVAS::GetNativePixelSize(), HIDPI_GL_CANVAS::GetNativePosition(), m_camera, m_camera_is_moving, m_mouse_is_moving, m_mouse_was_moved, HIDPI_GL_CANVAS::m_settings, and PAN.
Referenced by EDA_3D_CANVAS::OnLeftDown(), EDA_3D_CANVAS::OnMouseMove(), and EDA_3D_CANVAS::OnRightDown().
|
private |
Definition at line 913 of file eda_3d_canvas.cpp.
References DisplayStatus(), m_boardAdapter, m_logTrace, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), Request_refresh(), and restart_editingTimeOut_Timer().
Referenced by wxDEFINE_EVENT().
|
inherited |
Definition at line 76 of file hidpi_gl_3D_canvas.cpp.
References HIDPI_GL_CANVAS::GetNativePosition(), m_camera, m_camera_is_moving, m_delta_move_step_factor, m_mouse_is_moving, m_mouse_was_moved, and HIDPI_GL_CANVAS::m_settings.
Referenced by EDA_3D_CANVAS::OnMouseWheel().
|
private |
Definition at line 415 of file eda_3d_canvas.cpp.
References DoRePaint().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 974 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, and Request_refresh().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1348 of file eda_3d_canvas.cpp.
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 248 of file eda_3d_canvas.cpp.
References Request_refresh().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1261 of file eda_3d_canvas.cpp.
References HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), and stop_editingTimeOut_Timer().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1271 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().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 992 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_gestureLastAngle, and Request_refresh().
Referenced by wxDEFINE_EVENT().
|
private |
Definition at line 1308 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 1336 of file eda_3d_canvas.cpp.
References m_redraw_trigger_timer, and Request_refresh().
Referenced by EDA_3D_CANVAS().
|
private |
Definition at line 947 of file eda_3d_canvas.cpp.
References DisplayStatus(), HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_gestureLastZoomFactor, Request_refresh(), and restart_editingTimeOut_Timer().
Referenced by wxDEFINE_EVENT().
Project onto the footprint's seating plane and hit-test copper pads.
Definition at line 1649 of file eda_3d_canvas.cpp.
References std::abs(), B_Cu, distance(), F_Cu, FOOTPRINT::IsFlipped(), KiROUND(), m_boardAdapter, RAY::m_Dir, RAY::m_Origin, pad, and FOOTPRINT::Pads().
| std::optional< EDA_3D_CANVAS::MODEL_HIT > EDA_3D_CANVAS::PickModel | ( | const RAY & | aRay, |
| const S3DMODEL & | aGeometry, | ||
| const FP_3DMODEL & | aModel, | ||
| const FOOTPRINT & | aFootprint ) const |
Pick current mesh geometry; independent of the renderer's cached hit-test scene.
Definition at line 1590 of file eda_3d_canvas.cpp.
References std::abs(), CalcModelMatrix(), delta, distance(), IsTriangleInRange(), m_boardAdapter, RAY::m_Dir, SMESH::m_FaceIdx, SMESH::m_FaceIdxSize, S3DMODEL::m_Meshes, S3DMODEL::m_MeshesSize, FP_3DMODEL::m_Offset, RAY::m_Origin, SMESH::m_Positions, FP_3DMODEL::m_Rotation, FP_3DMODEL::m_Scale, SMESH::m_VertexSize, VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
|
private |
Free created targets and openGL context.
Definition at line 204 of file eda_3d_canvas.cpp.
References GL_CONTEXT_MANAGER::DestroyCtx(), PGM_BASE::GetGLContextManager(), GL_CONTEXT_MANAGER::LockCtx(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, m_glRC, Pgm(), and GL_CONTEXT_MANAGER::UnlockCtx().
Referenced by OnCloseWindow(), and ~EDA_3D_CANVAS().
| void EDA_3D_CANVAS::ReloadRaytracingForHitTesting | ( | std::stop_token | aStop | ) |
Rebuild the auxiliary raytracing BVH used for hover hit-testing in OpenGL mode.
Called from the OpenGL background loader once board layers are ready.
Definition at line 369 of file eda_3d_canvas.cpp.
References m_3d_render_raytracing.
Definition at line 351 of file eda_3d_canvas.cpp.
References m_3d_render, m_3d_render_opengl, and m_boardAdapter.
|
private |
Render the 3dmouse pivot cursor.
| aScale | scale to apply on the cursor. |
Definition at line 120 of file eda_3d_canvas_pivot.cpp.
References m_3dmousePivotPos, and HIDPI_GL_3D_CANVAS::m_camera.
Referenced by DoRePaint().
|
private |
Draw the translucent overlays over the rendered scene.
Definition at line 1536 of file eda_3d_canvas.cpp.
References m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, m_overlays, OPENGL, and overlay.
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 73 of file eda_3d_canvas_pivot.cpp.
References 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 1515 of file eda_3d_canvas.cpp.
References GetAppSettings(), m_3d_render, m_3d_render_opengl, m_3d_render_raytracing, HIDPI_GL_3D_CANVAS::m_mouse_was_moved, OPENGL, RAYTRACING, and Request_refresh().
Referenced by EDA_3D_CONTROLLER::ToggleRaytracing().
| void EDA_3D_CANVAS::RenderRaytracingRequest | ( | ) |
Request to render the current view in Raytracing mode.
Definition at line 383 of file eda_3d_canvas.cpp.
References m_3d_render, m_3d_render_raytracing, m_render_raytracing_was_requested, and Request_refresh().
| void EDA_3D_CANVAS::RenderToFrameBuffer | ( | unsigned char * | aBuffer, |
| int | aWidth, | ||
| int | aHeight ) |
Definition at line 674 of file eda_3d_canvas.cpp.
References _, GL_CONTEXT_MANAGER::CreateCtx(), PGM_BASE::GetGLContextManager(), GetRunningMicroSecs(), initializeOpenGL(), GL_CONTEXT_MANAGER::LockCtx(), m_3d_render, m_3d_render_opengl, m_boardAdapter, HIDPI_GL_3D_CANVAS::m_camera, HIDPI_GL_3D_CANVAS::m_camera_is_moving, m_camera_moving_speed, 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_render_pivot, m_render_raytracing_was_requested, m_strtime_camera_movement, OPENGL, Pgm(), and GL_CONTEXT_MANAGER::UnlockCtx().
| 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 1354 of file eda_3d_canvas.cpp.
References ID_CUSTOM_EVENT_1, and m_redraw_trigger_timer.
Referenced by DoRePaint(), OnMagnify(), OnMouseMove(), OnMouseWheel(), OnPanGesture(), OnResize(), OnRotateGesture(), OnTimerTimeout_Editing(), OnTimerTimeout_Redraw(), OnZoomGesture(), RenderEngineChanged(), RenderRaytracingRequest(), and request_start_moving_camera().
|
private |
Start a camera movement.
| aMovingSpeed | the time speed. |
| aRenderPivot | if it should display pivot cursor while move. |
Definition at line 1373 of file eda_3d_canvas.cpp.
References DisplayStatus(), GetRunningMicroSecs(), 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 1329 of file eda_3d_canvas.cpp.
References m_3d_render, and m_editing_timeout_timer.
Referenced by DoRePaint(), OnLeftUp(), OnMagnify(), OnMiddleUp(), OnMouseWheel(), OnRightUp(), and OnZoomGesture().
|
inline |
Set the position of the the 3dmouse pivot.
| aPos | is the position of the 3dmouse rotation pivot |
Definition at line 279 of file eda_3d_canvas.h.
References m_3dmousePivotPos.
|
inline |
Enable or disable camera animation when switching to a pre-defined view.
Definition at line 200 of file eda_3d_canvas.h.
References m_animation_enabled.
| void EDA_3D_CANVAS::SetEventDispatcher | ( | TOOL_DISPATCHER * | aEventDispatcher | ) |
Set a dispatcher that processes events and forwards them to tools.
EDA_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 889 of file eda_3d_canvas.cpp.
References m_eventDispatcher.
|
inline |
Report the mouse position while a pick handler is installed.
The handler is called with the ray under the cursor, or with nothing when the cursor leaves the canvas. Board item roll-over is suspended while it is set.
Definition at line 108 of file eda_3d_canvas.h.
References m_hoverHandler.
|
inline |
Definition at line 91 of file eda_3d_canvas.h.
References m_parentInfoBar.
|
inline |
Set the camera animation moving speed multiplier option.
| aMultiplier | one of the possible integer options: [1,2,3,4,5]. |
Definition at line 208 of file eda_3d_canvas.h.
References m_moving_speed_multiplier.
|
inline |
Definition at line 122 of file eda_3d_canvas.h.
References m_overlays.
|
inline |
Consume plain canvas clicks before the normal selection handler.
Definition at line 97 of file eda_3d_canvas.h.
References m_pickHandler.
|
inline |
Definition at line 212 of file eda_3d_canvas.h.
References HIDPI_GL_3D_CANVAS::m_camera.
|
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 268 of file eda_3d_canvas.h.
References m_render3dmousePivot.
|
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 252 of file eda_3d_canvas.h.
References m_render_pivot.
|
inline |
Definition at line 86 of file eda_3d_canvas.h.
References m_parentStatusBar.
|
inlineinherited |
Definition at line 60 of file hidpi_gl_canvas.h.
References m_settings.
| bool EDA_3D_CANVAS::SetView3D | ( | VIEW3D_TYPE | aRequestedView | ) |
Select a specific 3D view or operation.
| aRequestedView | the view to move to. |
Definition at line 1423 of file eda_3d_canvas.cpp.
References BEZIER, LINEAR, 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(), request_start_moving_camera(), VIEW3D_BACK, VIEW3D_BOTTOM, VIEW3D_FIT_SCREEN, VIEW3D_FLIP, VIEW3D_FRONT, VIEW3D_LEFT, VIEW3D_PAN_DOWN, VIEW3D_PAN_LEFT, VIEW3D_PAN_RIGHT, VIEW3D_PAN_UP, VIEW3D_PIVOT_CENTER, VIEW3D_RIGHT, VIEW3D_TOP, VIEW3D_ZOOM_IN, and VIEW3D_ZOOM_OUT.
Referenced by DoRePaint().
|
private |
Stop the editing time so it will not timeout.
Definition at line 1323 of file eda_3d_canvas.cpp.
References m_editing_timeout_timer.
Referenced by OnLeftDown(), OnMiddleDown(), OnRightDown(), and request_start_moving_camera().
|
private |
Non-owning pointer to the active renderer (one of the two below).
Definition at line 414 of file eda_3d_canvas.h.
Referenced by DoRePaint(), EDA_3D_CANVAS(), GetCurrentRender(), IsReloadRequestPending(), JoinBgWorker(), OnMouseMove(), releaseOpenGL(), ReloadRequest(), RenderEngineChanged(), RenderRaytracingRequest(), RenderToFrameBuffer(), and restart_editingTimeOut_Timer().
|
private |
Definition at line 416 of file eda_3d_canvas.h.
Referenced by DoRePaint(), EDA_3D_CANVAS(), OnLeftUp(), OnMouseMove(), releaseOpenGL(), ReloadRequest(), RenderEngineChanged(), and RenderToFrameBuffer().
|
private |
Definition at line 415 of file eda_3d_canvas.h.
Referenced by DoRePaint(), EDA_3D_CANVAS(), InvalidateRaytracingHitTesting(), OnLeftUp(), OnMouseMove(), releaseOpenGL(), ReloadRaytracingForHitTesting(), RenderEngineChanged(), and RenderRaytracingRequest().
|
private |
Definition at line 426 of file eda_3d_canvas.h.
Referenced by render3dmousePivot(), and Set3dmousePivotPos().
|
private |
Definition at line 421 of file eda_3d_canvas.h.
Referenced by ~EDA_3D_CANVAS().
|
private |
Definition at line 393 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and ~EDA_3D_CANVAS().
|
private |
Definition at line 408 of file eda_3d_canvas.h.
Referenced by GetAnimationEnabled(), request_start_moving_camera(), and SetAnimationEnabled().
|
private |
Definition at line 411 of file eda_3d_canvas.h.
Referenced by DoRePaint(), EDA_3D_CANVAS(), GetBoardAdapter(), move_pivot_based_on_cur_mouse_position(), OnLeftUp(), OnMouseMove(), OnMouseWheel(), PickFootprintPad(), PickModel(), ReloadRequest(), render_overlays(), and RenderToFrameBuffer().
|
inherited |
Definition at line 51 of file hidpi_gl_3D_canvas.h.
Referenced by EDA_3D_CANVAS::DisplayStatus(), EDA_3D_CANVAS::DoRePaint(), EDA_3D_CANVAS::EDA_3D_CANVAS(), GetCamera(), EDA_3D_CANVAS::GetProjectionMode(), EDA_3D_CANVAS::getRayAtCurrentMousePosition(), HIDPI_GL_3D_CANVAS(), EDA_3D_CANVAS::move_pivot_based_on_cur_mouse_position(), EDA_3D_CANVAS::OnLeftUp(), EDA_3D_CANVAS::OnMagnify(), OnMouseMoveCamera(), OnMouseWheelCamera(), EDA_3D_CANVAS::OnPanGesture(), EDA_3D_CANVAS::OnRotateGesture(), EDA_3D_CANVAS::OnZoomGesture(), EDA_3D_CANVAS::render3dmousePivot(), EDA_3D_CANVAS::render_overlays(), EDA_3D_CANVAS::render_pivot(), EDA_3D_CANVAS::RenderToFrameBuffer(), EDA_3D_CANVAS::request_start_moving_camera(), EDA_3D_CANVAS::SetProjectionMode(), and EDA_3D_CANVAS::SetView3D().
|
inherited |
Definition at line 49 of file hidpi_gl_3D_canvas.h.
Referenced by EDA_3D_CANVAS::DoRePaint(), HIDPI_GL_3D_CANVAS(), EDA_3D_CANVAS::OnLeftUp(), EDA_3D_CANVAS::OnMagnify(), EDA_3D_CANVAS::OnMiddleUp(), EDA_3D_CANVAS::OnMouseMove(), OnMouseMoveCamera(), OnMouseWheelCamera(), EDA_3D_CANVAS::OnPanGesture(), EDA_3D_CANVAS::OnRightUp(), EDA_3D_CANVAS::OnRotateGesture(), EDA_3D_CANVAS::OnZoomGesture(), EDA_3D_CANVAS::RenderToFrameBuffer(), EDA_3D_CANVAS::request_start_moving_camera(), and EDA_3D_CANVAS::SetView3D().
|
private |
Definition at line 406 of file eda_3d_canvas.h.
Referenced by DoRePaint(), RenderToFrameBuffer(), and request_start_moving_camera().
|
private |
Definition at line 423 of file eda_3d_canvas.h.
Referenced by OnMouseMove().
|
staticinherited |
Definition at line 52 of file hidpi_gl_3D_canvas.h.
Referenced by OnMouseWheelCamera(), and EDA_3D_CANVAS::SetView3D().
|
private |
Definition at line 400 of file eda_3d_canvas.h.
Referenced by EDA_3D_CANVAS(), OnTimerTimeout_Editing(), restart_editingTimeOut_Timer(), and stop_editingTimeOut_Timer().
|
private |
Definition at line 386 of file eda_3d_canvas.h.
Referenced by EDA_3D_CANVAS(), OnEvent(), and SetEventDispatcher().
|
private |
Definition at line 430 of file eda_3d_canvas.h.
Referenced by OnRotateGesture().
|
private |
Used to track gesture events.
Definition at line 429 of file eda_3d_canvas.h.
Referenced by OnZoomGesture().
|
private |
Definition at line 396 of file eda_3d_canvas.h.
Referenced by DoRePaint(), releaseOpenGL(), and RenderToFrameBuffer().
|
private |
Definition at line 383 of file eda_3d_canvas.h.
Referenced by OnMouseLeave(), OnMouseMove(), and SetHoverHandler().
|
private |
Definition at line 391 of file eda_3d_canvas.h.
Referenced by DoRePaint().
|
private |
Definition at line 403 of file eda_3d_canvas.h.
Referenced by DoRePaint(), EDA_3D_CANVAS(), and RenderToFrameBuffer().
|
private |
Definition at line 397 of file eda_3d_canvas.h.
Referenced by DoRePaint(), initializeOpenGL(), and RenderToFrameBuffer().
|
private |
Definition at line 398 of file eda_3d_canvas.h.
Referenced by DoRePaint(), initializeOpenGL(), and RenderToFrameBuffer().
|
inherited |
Definition at line 47 of file hidpi_gl_3D_canvas.h.
Referenced by EDA_3D_CANVAS::DoRePaint(), HIDPI_GL_3D_CANVAS(), EDA_3D_CANVAS::OnLeftUp(), EDA_3D_CANVAS::OnMiddleUp(), OnMouseMoveCamera(), OnMouseWheelCamera(), EDA_3D_CANVAS::OnRightUp(), EDA_3D_CANVAS::OnTimerTimeout_Editing(), and EDA_3D_CANVAS::RenderToFrameBuffer().
|
inherited |
Definition at line 48 of file hidpi_gl_3D_canvas.h.
Referenced by EDA_3D_CANVAS::DoRePaint(), HIDPI_GL_3D_CANVAS(), EDA_3D_CANVAS::OnMouseMove(), OnMouseMoveCamera(), EDA_3D_CANVAS::OnMouseWheel(), OnMouseWheelCamera(), EDA_3D_CANVAS::OnTimerTimeout_Editing(), EDA_3D_CANVAS::RenderEngineChanged(), and EDA_3D_CANVAS::RenderToFrameBuffer().
|
private |
Definition at line 409 of file eda_3d_canvas.h.
Referenced by GetMovingSpeedMultiplier(), request_start_moving_camera(), and SetMovingSpeedMultiplier().
|
private |
Definition at line 418 of file eda_3d_canvas.h.
Referenced by DoRePaint(), initializeOpenGL(), and RenderToFrameBuffer().
|
private |
Definition at line 384 of file eda_3d_canvas.h.
Referenced by render_overlays(), and SetOverlays().
|
private |
Definition at line 388 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and SetInfoBar().
|
private |
Definition at line 387 of file eda_3d_canvas.h.
Referenced by DisplayStatus(), DoRePaint(), OnMouseMove(), and SetStatusBar().
|
private |
Definition at line 382 of file eda_3d_canvas.h.
Referenced by OnLeftUp(), and SetPickHandler().
|
private |
Definition at line 402 of file eda_3d_canvas.h.
Referenced by EDA_3D_CANVAS(), OnTimerTimeout_Redraw(), and Request_refresh().
|
private |
Definition at line 425 of file eda_3d_canvas.h.
Referenced by DoRePaint(), GetRender3dmousePivot(), and SetRender3dmousePivot().
|
private |
Definition at line 405 of file eda_3d_canvas.h.
Referenced by DoRePaint(), GetRenderPivot(), RenderToFrameBuffer(), request_start_moving_camera(), and SetRenderPivot().
|
private |
Definition at line 419 of file eda_3d_canvas.h.
Referenced by DoRePaint(), RenderRaytracingRequest(), and RenderToFrameBuffer().
|
protectedinherited |
Current VIEW_CONTROLS settings.
Definition at line 64 of file hidpi_gl_canvas.h.
Referenced by HIDPI_GL_CANVAS(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), and SetVcSettings().
|
private |
Definition at line 390 of file eda_3d_canvas.h.
Referenced by DoRePaint().
|
private |
Definition at line 407 of file eda_3d_canvas.h.
Referenced by DoRePaint(), RenderToFrameBuffer(), and request_start_moving_camera().
|
private |
Definition at line 394 of file eda_3d_canvas.h.
Referenced by DoRePaint(), and ~EDA_3D_CANVAS().