Workspace 6.21.5
Public Member Functions | Static Public Member Functions | List of all members
SceneRenderer Class Referenceabstract

Base class anything that renders a scene.

#include <Rendering/SceneComponents/scenerenderer.h>

Inheritance diagram for SceneRenderer:
[legend]

Public Member Functions

virtual const SceneRendererContextgetContext () const =0
 
virtual const SceneRendererTypeIdgetTypeId () const =0
 

Static Public Member Functions

static void renderOverlays (QPainter &painter, Scene &scene, const Camera &camera)
 
static bool renderOverlaysUnthreaded (QPainter &painter, Scene &scene, const Camera &camera)
 

Member Function Documentation

◆ getContext()

virtual const SceneRendererContext * getContext ( ) const
pure virtual

Implemented in WSGLRenderer.

◆ getTypeId()

virtual const SceneRendererTypeId & getTypeId ( ) const
pure virtual

◆ renderOverlays()

void renderOverlays ( QPainter &  painter,
Scene scene,
const Camera camera 
)
static
Parameters
painterThe QPainter with which to draw the image overlays.
sceneThe scene whose image overlays are to be drawn.
cameraThe camera that was used to render the scene. This will be used to decide whether or not to show any camera-specific overlays.

This is a convenience function which draws each of the image overlays in scene using the specified painter. Because of implementation details and bugs in Qt, the painting is done using drawTiledPixmap() which can only be called from the main thread. To handle this, drawOverlays() blocks the calling thread and performs the drawing actions in the main thread instead. Once the drawing is done, then drawOverlays() will unblock and return. For most scenarios, this is safe unless the main thread tries to do something which would result in thread lock (eg calling a function which somehow leads to a blocking wait on the drawOverlays() calling thread). Such behavior is not generally advisable, since it would potentially lock up the main thread under other scenarios, so we consider this an acceptable risk. See the documentation for the BlockingTask class for more details.

◆ renderOverlaysUnthreaded()

bool renderOverlaysUnthreaded ( QPainter &  painter,
Scene scene,
const Camera camera 
)
static