Workspace 6.21.5
Signals | Public Member Functions | Protected Member Functions | List of all members
WSGLRenderQueueBuilder Class Reference

Responsible for creating an ordered queue of WSGLRenderItem for use by the WSGLRenderer. More...

#include <Rendering/OpenGL/wsglrenderqueuebuilder.h>

Inheritance diagram for WSGLRenderQueueBuilder:
[legend]

Signals

void glDataUpdateFinished ()
 
void glDataUpdateStarted ()
 

Public Member Functions

 WSGLRenderQueueBuilder (WSGLModelProcessor &processor, WSGLSceneItemSymbolLibrary &symbolLibrary)
 
 ~WSGLRenderQueueBuilder () override
 
void clearManipulators ()
 
const WSGLAnnotationListgetAllAnnotations () const
 
const LightListgetAllLights () const
 
int getNumLayers () const
 
int getNumModelsAwaitingSourceUpdate () const
 
bool getProcessSymbols () const
 
WSGLRenderQueuegetRenderQueue ()
 
const WSGLRenderQueuegetRenderQueue () const
 
const Mesh::BoundingBoxMinimalgetSceneBoundingBox () const
 
bool getShowCameraFrustums () const
 
bool modelSourceUpdateRequested () const
 
bool modelsQueuedForProcessing () const
 
bool nonSsaoItemsProcessed () const
 
void setCameraFrustumSymbolsSelectable (bool b)
 
void setCurrentCamera (const Camera &camera)
 
void setCurrentProjectionMatrix (const Mesh::TransformMatrix &matrix)
 
void setCurrentViewMatrix (const Mesh::TransformMatrix &matrix, const Mesh::TransformMatrix &invMatrix)
 
void setCurrentViewportDimensions (int width, int height)
 
void setManipulators (const PickedItem &item, const QMap< QString, TransformManipulator * > &manipulators)
 
void setProcessSymbols (bool b)
 
void setShowCameraFrustums (bool b)
 
void setSymbolSize (double size)
 
void setSymbolSizeCoordinateSystem (RenderSettings::SymbolSizeCoordinateSystem coordSys)
 
bool specularItemsProcessed () const
 
bool transparentItemsProcessed () const
 
- Public Member Functions inherited from SceneProcessor
 ~SceneProcessor () override
 
bool process (Scene &scene)
 
bool process (Transform &transform)
 
bool visit (Annotation &annotation)
 
bool visit (Camera &camera)
 
bool visit (ClipRegion &clipRegion)
 
bool visit (Light &light)
 
bool visit (MeshModelInstance &model)
 
bool visit (SceneItemInstance &sceneItemInstance)
 
bool visit (Transform &transform)
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 

Protected Member Functions

bool postVisits (Scene &scene) override
 
bool preVisits (Scene &scene) override
 
bool visitImpl (Annotation &annotation) override
 
bool visitImpl (Camera &camera) override
 
bool visitImpl (ClipRegion &clipRegion) override
 
bool visitImpl (Light &light) override
 
bool visitImpl (MeshModelInstance &modelInstance) override
 
bool visitImpl (SceneItemInstance &sceneItemInstance) override
 
bool visitImpl (Transform &transform) override
 
- Protected Member Functions inherited from SceneProcessor
 SceneProcessor ()
 
 SceneProcessor (const SceneProcessor &p)
 
SceneProcessoroperator= (const SceneProcessor &p)
 
virtual bool postVisits (Scene &scene)
 
virtual bool preVisits (Scene &scene)
 
virtual bool traverseScene (Scene &scene)
 
virtual bool visitImpl (Annotation &annotation)
 
virtual bool visitImpl (Camera &camera)
 
virtual bool visitImpl (ClipRegion &clipRegion)
 
virtual bool visitImpl (Light &light)
 
virtual bool visitImpl (MeshModelInstance &modelInstance)
 
virtual bool visitImpl (SceneItemInstance &sceneItemInstance)
 
virtual bool visitImpl (Transform &transform)
 
- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Additional Inherited Members

- Static Public Attributes inherited from SceneProcessor
static const Application::LogManager::MessageCategory LOG_SCENEPROCESSOR
 

Detailed Description

The WSGLRenderQueueBuilder will populate a WSGLRenderQueue when its process function is called. The queue can be obtained by calling getRenderQueue. The ordering of items in the queue is handled internally by the render queue in order to minimise the number of OpenGL state changes required when rendering the scene. The items are ordered by each of the following fields in descending priority:

Constructor & Destructor Documentation

◆ WSGLRenderQueueBuilder()

Parameters
processorThe WSGLModelProcessor that will be used to generate OpenGL primitive data and determine the details of WSGLRenderItems.
symbolLibraryThe library that contains MeshModel symbol data for SceneItems that do not have geometry data associated with them.

Constructs a new WSGLRenderQueueBuilder. The builder depends upon a WSGLModelProcessor to generate its OpenGL data, and will attach the WSGLTextureBinder to any WSGLRenderItems that it generates. The provided WSGLSceneItemSymbolLibrary will be used to retrieve MeshModel 'symbols' for SceneItems which do not have associated geometry.

Note
The WSGLRenderQueueBuilder will not take ownership of any of the components passed in. It is the responsiblity of the caller to manage the life-span of these components.

◆ ~WSGLRenderQueueBuilder()

~WSGLRenderQueueBuilder ( )
override

Member Function Documentation

◆ clearManipulators()

void clearManipulators ( )

◆ getAllAnnotations()

const WSGLAnnotationList & getAllAnnotations ( ) const

◆ getAllLights()

const LightList & getAllLights ( ) const
Returns
List of all lights that were found during the last processing of the scene.

◆ getNumLayers()

int getNumLayers ( ) const
Returns
The number of layers used in the render queue.

◆ getNumModelsAwaitingSourceUpdate()

int getNumModelsAwaitingSourceUpdate ( ) const
Returns
The number of models currently awaiting updates from their ModelSource in order to be properly processed.

◆ getProcessSymbols()

bool getProcessSymbols ( ) const
Returns
true if processing of symbols is enabled, false otherwise.
See also
setProcessSymbols

◆ getRenderQueue() [1/2]

WSGLRenderQueue & getRenderQueue ( )
Returns
The render queue generated during the lass process request.

◆ getRenderQueue() [2/2]

const WSGLRenderQueue & getRenderQueue ( ) const
Returns
The render queue generated during the lass process request.

◆ getSceneBoundingBox()

const Mesh::BoundingBoxMinimal & getSceneBoundingBox ( ) const

◆ getShowCameraFrustums()

bool getShowCameraFrustums ( ) const
Returns

◆ glDataUpdateFinished

void glDataUpdateFinished ( )
signal

◆ glDataUpdateStarted

void glDataUpdateStarted ( )
signal

◆ modelSourceUpdateRequested()

bool modelSourceUpdateRequested ( ) const
Returns
True if a model source update was requested during the last process call. Use this to determine whether a genuine error occurred while processing the scene, or whether we can simply wait for sources to bring themselves up-to-date.

◆ modelsQueuedForProcessing()

bool modelsQueuedForProcessing ( ) const
Returns
True if a model is queued to be processed by the WSGLModelProcessor, false otherwise.

◆ nonSsaoItemsProcessed()

bool nonSsaoItemsProcessed ( ) const
Returns
True if one or more shader being used supports Screen Space Ambient Occlusion.

◆ postVisits()

bool postVisits ( Scene scene)
overrideprotectedvirtual
Parameters
sceneThe scene that has just been processed.

PostVisits is invoked by process immediately after processing of the scene is complete. This allows the render queue builder to perform any post-processing it requires.

See also
preVisits
process

Reimplemented from SceneProcessor.

◆ preVisits()

bool preVisits ( Scene scene)
overrideprotectedvirtual
Parameters
sceneThe scene that is about to be processed.

PreVisits is invoked by process immediately before doing any processing of the scene. It allows the render queue builder to do any pre-processing steps.

See also
process
postVisits

Reimplemented from SceneProcessor.

◆ setCameraFrustumSymbolsSelectable()

void setCameraFrustumSymbolsSelectable ( bool  b)
Parameters
bWhether or not camera frustums are selectable.

◆ setCurrentCamera()

void setCurrentCamera ( const Camera camera)
Parameters
cameraThe camera to be used by the renderQueue as the view camera.

Sets the current camera through which the scene is being viewed. The camera will be used by the render queue builder to test whether or not to bother adding an item to the render queue. If it's not in view of the camera, the item won't be added.

◆ setCurrentProjectionMatrix()

void setCurrentProjectionMatrix ( const Mesh::TransformMatrix matrix)
Parameters
matrixThe projection matrix that is in use during the course of the 'process' call.

◆ setCurrentViewMatrix()

void setCurrentViewMatrix ( const Mesh::TransformMatrix matrix,
const Mesh::TransformMatrix invMatrix 
)
Parameters
matrixThe view matrix that is in use during the course of the 'process' call.
invMatrixThe inverse of matrix. Passed in to avoid calculating it repeatedly.

◆ setCurrentViewportDimensions()

void setCurrentViewportDimensions ( int  width,
int  height 
)
Parameters
widthThe width of the viewport for the duration of the current frame.
heightThe height of the viewport for the duration of the current frame.

◆ setManipulators()

void setManipulators ( const PickedItem item,
const QMap< QString, TransformManipulator * > &  manipulators 
)
Parameters
item
manipulators

◆ setProcessSymbols()

void setProcessSymbols ( bool  b)
Parameters
bEnable processing of symbols when processing the queue.

Symbols are representations of items in a scene that do not have any geometry associated with them (e.g. lights, cameras, clip objects). Users may want to display them, or hide them.

See also
getProcessSymbols

◆ setShowCameraFrustums()

void setShowCameraFrustums ( bool  b)
Parameters
bWhether or not to show camera frustums.

◆ setSymbolSize()

void setSymbolSize ( double  size)
Parameters
sizeThe size of symbols. Units are depending on the selected symbol size coordinate system.
See also
setSymbolSizeCoordinateSystem

◆ setSymbolSizeCoordinateSystem()

void setSymbolSizeCoordinateSystem ( RenderSettings::SymbolSizeCoordinateSystem  coordSys)
Parameters
coordSysThe coordinate system that the symbol size represents.

◆ specularItemsProcessed()

bool specularItemsProcessed ( ) const
Returns
True if one or more shiny (has specular highlights) WSGLRenderItems were processed during the last process call. This can be used to determine whether or not to perform any setup / configuration for shiny (specular) object rendering.

◆ transparentItemsProcessed()

bool transparentItemsProcessed ( ) const
Returns
True if one or more transparent WSGLRenderItems were processed during the last process call. This can be used to determine whether or not to perform any setup / configuration for transparent object rendering.

◆ visitImpl() [1/7]

bool visitImpl ( Annotation annotation)
overrideprotectedvirtual
Parameters
annotationThe specific Annotation being processed by the WSGLRenderQueueBuilder.

Adds the annotation to the list of annotations that have been processed. The caller is then able to use the list of annotations in any way they wish.

Warning
This function should only be invoked by the SceneProcessor base-class's visit function. there should be no need to call the function directly.

Reimplemented from SceneProcessor.

◆ visitImpl() [2/7]

bool visitImpl ( Camera camera)
overrideprotectedvirtual
Parameters
cameraThe specific Camera being processed by the WSGLRenderQueue.

Adds the camera to the list of things that need to be processed.

Warning
This function should only be invoked by the SceneProcessor base-class's visit function. there should be no need to call the function directly.

Reimplemented from SceneProcessor.

◆ visitImpl() [3/7]

bool visitImpl ( ClipRegion clipRegion)
overrideprotectedvirtual
Parameters
clipRegionThe specific ClipRegion being processed by the WSGLRenderQueueBuilder.

Visits the ClipRegion, recording its clipping information relative to other items to be drawn. ClipRegions are accumulated added to WSGLRenderItems in the render queue so that Shaders can make use of them if necessary.

Warning
This function should only be invoked by the SceneProcessor base-class's visit function. there should be no need to call this function directly.

Reimplemented from SceneProcessor.

◆ visitImpl() [4/7]

bool visitImpl ( Light light)
overrideprotectedvirtual
Parameters
lightThe Light that is being visited by the WSGLRenderQueueBuilder.

Visits the Light, appending it to the light list for use by the renderer. A visual representation of the light is also added to the render queue if applicable.

See also
getAllLights
getRenderQueue
Warning
This function should only be invoked by the SceneProcessor base-class's visit function. there should be no need to call this function directly.

Reimplemented from SceneProcessor.

◆ visitImpl() [5/7]

bool visitImpl ( MeshModelInstance modelInstance)
overrideprotectedvirtual
Parameters
modelInstanceThe particular MeshModelInstance currently being visited by the WSGLRenderQueueBuilder.

Visits the MeshModelInstance, adding it to the WSGLRenderQueue if necessary. The MeshModelInstance will only be added to the render queue if the builder determines that the geometry needs to be rendered. If the item doesn't need to be rendered (e.g. it is invisible or out-of-picture) it will not be added to the queue.

See also
getRenderQueue
Warning
This function should only be invoked by the SceneProcessor base-class's visit function. there should be no need to call this function directly.

Reimplemented from SceneProcessor.

◆ visitImpl() [6/7]

bool visitImpl ( SceneItemInstance sceneItemInstance)
overrideprotectedvirtual
Parameters
sceneItemInstanceThe specific SceneItemInstance being processed by the WSGLRenderQueueBuilder.

Visits the SceneItemInstance, retrieving the particular SceneItem it refers to from the SceneItemInstanceLibrary, transforming it as specified by the instance.

Warning
This function should only be invoked by the SceneProcessor base-class's visit function. there should be no need to call this function directly.

Reimplemented from SceneProcessor.

◆ visitImpl() [7/7]

bool visitImpl ( Transform transform)
overrideprotectedvirtual
Parameters
transformThe Transform that is being visited by the WSGLRenderQueueBuilder.

Visits the Transform, recording its spatial information before proceeding to process its child SceneItems, which may include SceneItems of type Light, Camera or MeshModelInstance.

Warning
This function should only be invoked by the SceneProcessor base-class's visit function. there should be no need to call this function directly.

Reimplemented from SceneProcessor.