KiCad PCB EDA Suite
RENDER_3D_BASE Class Referenceabstract

This is a base class to hold data and functions for render targets. More...

#include <render_3d_base.h>

Inheritance diagram for RENDER_3D_BASE:
RENDER_3D_OPENGL RENDER_3D_RAYTRACE

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_INDICATORCreateBusyIndicator () const
 Return a created busy indicator, if a factory has been set, else a null pointer. More...
 

Protected Attributes

EDA_3D_CANVASm_canvas
 Settings reference in use for this render. More...
 
BOARD_ADAPTERm_boardAdapter
 
CAMERAm_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...
 

Detailed Description

This is a base class to hold data and functions for render targets.

Definition at line 42 of file render_3d_base.h.

Constructor & Destructor Documentation

◆ RENDER_3D_BASE()

RENDER_3D_BASE::RENDER_3D_BASE ( EDA_3D_CANVAS aCanvas,
BOARD_ADAPTER aBoardAdapter,
CAMERA aCamera 
)
explicit

Definition at line 47 of file render_3d_base.cpp.

47  :
48  m_boardAdapter( aBoardAdapter ),
49  m_camera( aCamera )
50 {
51  wxLogTrace( m_logTrace, wxT( "RENDER_3D_BASE::RENDER_3D_BASE" ) );
52  m_canvas = aCanvas;
54  m_windowSize = wxSize( -1, -1 );
55  m_reloadRequested = true;
56 }
BOARD_ADAPTER & m_boardAdapter
EDA_3D_CANVAS * m_canvas
Settings reference in use for this render.
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_reloadRequested
The window size that this camera is working.
CAMERA & m_camera
Flag if the opengl specific for this render was already initialized.

References m_canvas, m_is_opengl_initialized, m_logTrace, m_reloadRequested, and m_windowSize.

◆ ~RENDER_3D_BASE()

RENDER_3D_BASE::~RENDER_3D_BASE ( )
pure virtual

Definition at line 59 of file render_3d_base.cpp.

60 {
61 }

Member Function Documentation

◆ CreateBusyIndicator()

std::unique_ptr< BUSY_INDICATOR > RENDER_3D_BASE::CreateBusyIndicator ( ) const
protected

Return a created busy indicator, if a factory has been set, else a null pointer.

the canvas to disply the scene

Definition at line 70 of file render_3d_base.cpp.

71 {
72  std::unique_ptr<BUSY_INDICATOR> busy;
73 
75  busy = m_busyIndicatorFactory();
76 
77  return busy;
78 }
BUSY_INDICATOR::FACTORY m_busyIndicatorFactory
< Factory that returns a suitable busy indicator for the context.

References m_busyIndicatorFactory.

Referenced by RENDER_3D_OPENGL::Redraw(), and RENDER_3D_RAYTRACE::Redraw().

◆ GetWaitForEditingTimeOut()

virtual int RENDER_3D_BASE::GetWaitForEditingTimeOut ( )
pure virtual

Give the interface the time (in ms) that it should wait for editing or movements before (this works for display preview mode).

Returns
a value in milliseconds

Implemented in RENDER_3D_RAYTRACE, and RENDER_3D_OPENGL.

Referenced by EDA_3D_CANVAS::restart_editingTimeOut_Timer().

◆ IsReloadRequestPending()

bool RENDER_3D_BASE::IsReloadRequestPending ( ) const
inline

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 77 of file render_3d_base.h.

77 { return m_reloadRequested; }
bool m_reloadRequested
The window size that this camera is working.

References m_reloadRequested.

Referenced by EDA_3D_CANVAS::DoRePaint(), and EDA_3D_CANVAS::IsReloadRequestPending().

◆ Redraw()

virtual bool RENDER_3D_BASE::Redraw ( bool  aIsMoving,
REPORTER aStatusReporter = nullptr,
REPORTER aWarningReporter = nullptr 
)
pure virtual

Redraw the view.

Parameters
aIsMovingif the user is moving the scene, it should be render in preview mode.
aStatusReportera pointer to the status progress reporter.
Returns
true if the render would like to redraw again.

Implemented in RENDER_3D_RAYTRACE, and RENDER_3D_OPENGL.

Referenced by EDA_3D_CANVAS::DoRePaint().

◆ ReloadRequest()

void RENDER_3D_BASE::ReloadRequest ( )
inline
Todo:
This must be reviewed to add flags to improve specific render.

Definition at line 70 of file render_3d_base.h.

70 { m_reloadRequested = true; }
bool m_reloadRequested
The window size that this camera is working.

References m_reloadRequested.

Referenced by EDA_3D_CANVAS::ReloadRequest(), EDA_3D_CANVAS::RenderEngineChanged(), and EDA_3D_CANVAS::RenderRaytracingRequest().

◆ SetBusyIndicatorFactory()

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.

65 {
66  m_busyIndicatorFactory = aNewFactory;
67 }
BUSY_INDICATOR::FACTORY m_busyIndicatorFactory
< Factory that returns a suitable busy indicator for the context.

References m_busyIndicatorFactory.

◆ SetCurWindowSize()

virtual void RENDER_3D_BASE::SetCurWindowSize ( const wxSize &  aSize)
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.

Parameters
aSizethe current size of the render window

Implemented in RENDER_3D_RAYTRACE, and RENDER_3D_OPENGL.

Referenced by EDA_3D_CANVAS::DoRePaint().

Member Data Documentation

◆ m_boardAdapter

◆ m_busyIndicatorFactory

BUSY_INDICATOR::FACTORY RENDER_3D_BASE::m_busyIndicatorFactory
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().

◆ m_camera

◆ m_canvas

EDA_3D_CANVAS* RENDER_3D_BASE::m_canvas
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().

◆ m_is_opengl_initialized

bool RENDER_3D_BASE::m_is_opengl_initialized
protected
Todo:
This must be reviewed in order to flag change types.

Definition at line 110 of file render_3d_base.h.

Referenced by RENDER_3D_RAYTRACE::initializeOpenGL(), RENDER_3D_OPENGL::initializeOpenGL(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE::Redraw(), and RENDER_3D_BASE().

◆ m_reloadRequested

bool RENDER_3D_BASE::m_reloadRequested
protected

◆ m_windowSize


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