KiCad PCB EDA Suite
|
This is a base class to hold data and functions for render targets. More...
#include <render_3d_base.h>
Public Member Functions | |
RENDER_3D_BASE (EDA_3D_CANVAS *aCanvas, BOARD_ADAPTER &aBoardAdapter, CAMERA &aCamera) | |
virtual | ~RENDER_3D_BASE ()=0 |
virtual void | SetCurWindowSize (const wxSize &aSize)=0 |
Before each render, the canvas will tell the render what is the size of its windows, so render can take actions if it changed. More... | |
virtual bool | Redraw (bool aIsMoving, REPORTER *aStatusReporter=nullptr, REPORTER *aWarningReporter=nullptr)=0 |
Redraw the view. More... | |
void | ReloadRequest () |
bool | IsReloadRequestPending () const |
Query if there is a pending reload request. More... | |
virtual int | GetWaitForEditingTimeOut ()=0 |
Give the interface the time (in ms) that it should wait for editing or movements before (this works for display preview mode). More... | |
void | SetBusyIndicatorFactory (BUSY_INDICATOR::FACTORY aNewFactory) |
Set a new busy indicator factory. More... | |
Protected Member Functions | |
std::unique_ptr< BUSY_INDICATOR > | CreateBusyIndicator () const |
Return a created busy indicator, if a factory has been set, else a null pointer. More... | |
Protected Attributes | |
EDA_3D_CANVAS * | m_canvas |
Settings reference in use for this render. More... | |
BOARD_ADAPTER & | m_boardAdapter |
CAMERA & | m_camera |
Flag if the opengl specific for this render was already initialized. More... | |
bool | m_is_opengl_initialized |
bool | m_reloadRequested |
The window size that this camera is working. More... | |
wxSize | m_windowSize |
Static Protected Attributes | |
static const wxChar * | m_logTrace = wxT( "KI_TRACE_3D_RENDER" ) |
Trace mask used to enable or disable the trace output of this class. More... | |
Private Attributes | |
BUSY_INDICATOR::FACTORY | m_busyIndicatorFactory |
< Factory that returns a suitable busy indicator for the context. More... | |
This is a base class to hold data and functions for render targets.
Definition at line 42 of file render_3d_base.h.
|
explicit |
Definition at line 47 of file render_3d_base.cpp.
References m_canvas, m_is_opengl_initialized, m_logTrace, m_reloadRequested, and m_windowSize.
|
pure virtual |
Definition at line 59 of file render_3d_base.cpp.
|
protected |
Return a created busy indicator, if a factory has been set, else a null pointer.
the canvas to display the scene
Definition at line 70 of file render_3d_base.cpp.
References m_busyIndicatorFactory.
Referenced by RENDER_3D_OPENGL::Redraw(), and RENDER_3D_RAYTRACE::Redraw().
|
pure virtual |
Give the interface the time (in ms) that it should wait for editing or movements before (this works for display preview mode).
Implemented in RENDER_3D_OPENGL, and RENDER_3D_RAYTRACE.
Referenced by EDA_3D_CANVAS::restart_editingTimeOut_Timer().
|
inline |
Query if there is a pending reload request.
Definition at line 77 of file render_3d_base.h.
References m_reloadRequested.
Referenced by EDA_3D_CANVAS::DoRePaint(), EDA_3D_CANVAS::IsReloadRequestPending(), and EDA_3D_CANVAS::OnMouseMove().
|
pure virtual |
Redraw the view.
aIsMoving | if the user is moving the scene, it should be render in preview mode. |
aStatusReporter | a pointer to the status progress reporter. |
Implemented in RENDER_3D_OPENGL, and RENDER_3D_RAYTRACE.
Referenced by EDA_3D_CANVAS::DoRePaint().
|
inline |
Definition at line 70 of file render_3d_base.h.
References m_reloadRequested.
Referenced by EDA_3D_CANVAS::ReloadRequest(), EDA_3D_CANVAS::RenderEngineChanged(), and EDA_3D_CANVAS::RenderRaytracingRequest().
void RENDER_3D_BASE::SetBusyIndicatorFactory | ( | BUSY_INDICATOR::FACTORY | aNewFactory | ) |
Set a new busy indicator factory.
When set, this factory will be used to generate busy indicators when suitable. If not set, no busy indicator will be used.
Definition at line 64 of file render_3d_base.cpp.
References m_busyIndicatorFactory.
|
pure virtual |
Before each render, the canvas will tell the render what is the size of its windows, so render can take actions if it changed.
aSize | the current size of the render window |
Implemented in RENDER_3D_OPENGL, and RENDER_3D_RAYTRACE.
Referenced by EDA_3D_CANVAS::DoRePaint().
|
protected |
Definition at line 105 of file render_3d_base.h.
Referenced by RENDER_3D_RAYTRACE::addModels(), RENDER_3D_OPENGL::addObjectTriangles(), RENDER_3D_RAYTRACE::addPadsAndVias(), RENDER_3D_OPENGL::createBoard(), RENDER_3D_RAYTRACE::createItemsFromContainer(), RENDER_3D_OPENGL::generate3dGrid(), RENDER_3D_OPENGL::generateHoles(), RENDER_3D_OPENGL::generateLayerList(), RENDER_3D_OPENGL::generateViasAndPads(), RENDER_3D_OPENGL::get3dModelsFromFootprint(), RENDER_3D_OPENGL::get3dModelsSelected(), RENDER_3D_OPENGL::getLayerZPos(), RENDER_3D_RAYTRACE::getModelMaterial(), RENDER_3D_RAYTRACE::insertHole(), RENDER_3D_RAYTRACE::load3DModels(), RENDER_3D_OPENGL::load3dModels(), RENDER_3D_RAYTRACE::postProcessBlurFinish(), RENDER_3D_RAYTRACE::postProcessShading(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE::Redraw(), RENDER_3D_OPENGL::reload(), RENDER_3D_RAYTRACE::Reload(), RENDER_3D_RAYTRACE::render(), RENDER_3D_RAYTRACE::renderAntiAliasPackets(), RENDER_3D_RAYTRACE::renderBlockTracing(), RENDER_3D_OPENGL::renderBoardBody(), RENDER_3D_OPENGL::renderModel(), RENDER_3D_OPENGL::renderOpaqueModels(), RENDER_3D_OPENGL::renderSolderMaskLayer(), RENDER_3D_OPENGL::renderTransparentModels(), RENDER_3D_OPENGL::setLayerMaterial(), RENDER_3D_OPENGL::setupMaterials(), RENDER_3D_RAYTRACE::setupMaterials(), and RENDER_3D_RAYTRACE::shadeHit().
|
private |
< Factory that returns a suitable busy indicator for the context.
Definition at line 128 of file render_3d_base.h.
Referenced by CreateBusyIndicator(), and SetBusyIndicatorFactory().
|
protected |
Flag if the opengl specific for this render was already initialized.
Definition at line 107 of file render_3d_base.h.
Referenced by RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE::Redraw(), RENDER_3D_OPENGL::reload(), RENDER_3D_RAYTRACE::Reload(), RENDER_3D_RAYTRACE::render(), RENDER_3D_OPENGL::render3dArrows(), RENDER_3D_RAYTRACE::renderBlockTracing(), and RENDER_3D_OPENGL::renderTransparentModels().
|
protected |
Settings reference in use for this render.
Definition at line 102 of file render_3d_base.h.
Referenced by RENDER_3D_OPENGL::Load3dModelsIfNeeded(), and RENDER_3D_BASE().
|
protected |
Definition at line 110 of file render_3d_base.h.
Referenced by RENDER_3D_OPENGL::initializeOpenGL(), RENDER_3D_RAYTRACE::initializeOpenGL(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE::Redraw(), and RENDER_3D_BASE().
|
protected |
The window size that this camera is working.
Definition at line 113 of file render_3d_base.h.
Referenced by IsReloadRequestPending(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE::Redraw(), RENDER_3D_OPENGL::reload(), RENDER_3D_RAYTRACE::Reload(), ReloadRequest(), and RENDER_3D_BASE().
|
protected |
Definition at line 116 of file render_3d_base.h.
Referenced by RENDER_3D_RAYTRACE::initializeBlockPositions(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE::Redraw(), RENDER_3D_OPENGL::render3dArrows(), RENDER_3D_BASE(), RENDER_3D_RAYTRACE::renderBlockTracing(), RENDER_3D_OPENGL::SetCurWindowSize(), and RENDER_3D_RAYTRACE::SetCurWindowSize().