KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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_BASE RENDER_3D_RAYTRACE_GL RENDER_3D_RAYTRACE_RAM

Public Member Functions

 RENDER_3D_BASE (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.
 
virtual bool Redraw (bool aIsMoving, REPORTER *aStatusReporter=nullptr, REPORTER *aWarningReporter=nullptr)=0
 Redraw the view.
 
void ReloadRequest ()
 
bool IsReloadRequestPending () const
 Query if there is a pending reload request.
 
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).
 
void SetBusyIndicatorFactory (BUSY_INDICATOR::FACTORY aNewFactory)
 Set a new busy indicator factory.
 

Protected Member Functions

std::unique_ptr< BUSY_INDICATORCreateBusyIndicator () const
 Return a created busy indicator, if a factory has been set, else a null pointer.
 

Protected Attributes

BOARD_ADAPTERm_boardAdapter
 
CAMERAm_camera
 Flag if the canvas specific for this render was already initialized.
 
bool m_canvasInitialized
 
bool m_reloadRequested
 The window size that this camera is working.
 
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.
 

Private Attributes

BUSY_INDICATOR::FACTORY m_busyIndicatorFactory
 < Factory that returns a suitable busy indicator for the context.
 

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 ( BOARD_ADAPTER aBoardAdapter,
CAMERA aCamera 
)
explicit

Definition at line 47 of file render_3d_base.cpp.

References m_canvasInitialized, m_logTrace, m_reloadRequested, and m_windowSize.

◆ ~RENDER_3D_BASE()

RENDER_3D_BASE::~RENDER_3D_BASE ( )
pure virtual

Definition at line 58 of file render_3d_base.cpp.

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.

Settings reference in use for this render.

Definition at line 69 of file render_3d_base.cpp.

References m_busyIndicatorFactory.

Referenced by RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE_GL::Redraw(), and RENDER_3D_RAYTRACE_RAM::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_OPENGL, and RENDER_3D_RAYTRACE_BASE.

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.

References m_reloadRequested.

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

◆ 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_OPENGL, RENDER_3D_RAYTRACE_GL, and RENDER_3D_RAYTRACE_RAM.

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.

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 63 of file render_3d_base.cpp.

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_OPENGL, RENDER_3D_RAYTRACE_GL, and RENDER_3D_RAYTRACE_RAM.

Referenced by EDA_3D_CANVAS::DoRePaint().

Member Data Documentation

◆ m_boardAdapter

BOARD_ADAPTER& RENDER_3D_BASE::m_boardAdapter
protected

◆ m_busyIndicatorFactory

BUSY_INDICATOR::FACTORY RENDER_3D_BASE::m_busyIndicatorFactory
private

< Factory that returns a suitable busy indicator for the context.

Definition at line 125 of file render_3d_base.h.

Referenced by CreateBusyIndicator(), and SetBusyIndicatorFactory().

◆ m_camera

◆ m_canvasInitialized

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

Definition at line 107 of file render_3d_base.h.

Referenced by RENDER_3D_OPENGL::initializeOpenGL(), RENDER_3D_OPENGL::Redraw(), RENDER_3D_RAYTRACE_GL::Redraw(), RENDER_3D_RAYTRACE_RAM::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: