Workspace 6.21.5
Public Types | Public Member Functions | List of all members
RenderSettings Class Reference

Encapsulates the settings required for rendering. More...

#include <Rendering/SceneComponents/rendersettings.h>

Inheritance diagram for RenderSettings:
[legend]

Public Types

enum  FaceCulling { CullNone , CullBackFaces , CullFrontFaces , CullFrontAndBackFaces }
 
enum  SymbolSizeCoordinateSystem { Automatic , WorldSpace , ScreenSpace }
 

Public Member Functions

 RenderSettings ()
 
 RenderSettings (const RenderSettings &other)
 
 ~RenderSettings () override
 
RenderSettingsclone () const override
 
bool getAntialiasingEnabled () const
 
const QColor & getBackgroundColor () const
 
bool getCameraFrustumsSelectable () const
 
const QColor & getCameraFrustumSymbolColor () const
 
const QColor & getCameraFrustumSymbolLineColor () const
 
bool getDepthPeelingEnabled () const
 
FaceCulling getFaceCulling () const
 
int getHudFontSize () const
 
float getLineWidth () const
 
unsigned int getMaxTextureSize () const
 
int getNumAntialiasingSamples () const
 
unsigned getNumDepthLayers () const
 
float getPointSize () const
 
RenderFiltergetRenderFilter ()
 
const RenderFiltergetRenderFilter () const
 
bool getRenderWhileModelsQueuedForProcessing () const
 
bool getShowCameraFrustums () const
 
bool getShowHud () const
 
bool getShowOverlays () const
 
bool getShowSymbols () const
 
float getSsaoAttenuation () const
 
bool getSsaoEnabled () const
 
int getSsaoNumSamples () const
 
float getSsaoSampleLength () const
 
float getSsaoStrength () const
 
bool getSuppressCameraWarnings () const
 
const QColor & getSymbolColor () const
 
double getSymbolLineWidth () const
 
double getSymbolSize () const
 
SymbolSizeCoordinateSystem getSymbolSizeCoordinateSystem () const
 
bool operator!= (const RenderSettings &rhs) const
 
RenderSettingsoperator= (const RenderSettings &rhs)
 
bool operator== (const RenderSettings &rhs) const
 
void setAntialiasingEnabled (bool b)
 
void setBackgroundColor (const QColor &color)
 
void setCameraFrustumsSelectable (bool b)
 
void setCameraFrustumSymbolColor (const QColor &color)
 
void setCameraFrustumSymbolLineColor (const QColor &color)
 
void setDepthPeelingEnabled (bool b)
 
void setFaceCulling (FaceCulling culling)
 
void setHudFontSize (int size)
 
void setLineWidth (float width)
 
void setMaxTextureSize (unsigned int val)
 
void setNumAntialiasingSamples (int n)
 
void setNumDepthLayers (unsigned n)
 
void setPointSize (float size)
 
void setRenderFilter (const RenderFilter &val)
 
void setRenderWhileModelsQueuedForProcessing (bool b)
 
void setShowCameraFrustums (bool b)
 
void setShowHud (bool b)
 
void setShowOverlays (bool b)
 
void setShowSymbols (bool b)
 
void setSsaoAttenuation (float a)
 
void setSsaoEnabled (bool b)
 
void setSsaoNumSamples (int n)
 
void setSsaoSampleLength (float l)
 
void setSsaoStrength (float s)
 
void setSuppressCameraWarnings (bool b)
 
void setSymbolColor (const QColor &color)
 
void setSymbolLineWidth (double width)
 
void setSymbolSize (double size)
 
void setSymbolSizeCoordinateSystem (SymbolSizeCoordinateSystem coordSys)
 
- Public Member Functions inherited from ObjectGroup
 ~ObjectGroup () override
 
bool add (const QString &name, DataObject &obj)
 
bool canSerialize () const override
 
ObjectGroupclone () const override=0
 
bool empty () const
 
void ensureGroupHasData ()
 
void erase (int index)
 
DataObjectgetChild (const QString &name)
 
const DataObjectgetChild (const QString &name) const
 
DataObjectgetDataObject (int index)
 
const DataObjectgetDataObject (int index) const
 
int getIndex (const QString &name) const
 
const QString & getName (int index) const
 
virtual QString getPreferedWidget (const QString &name) const
 
bool hasData () const
 
bool haveName (const QString &name) const
 
bool insert (const QString &name, DataObject &obj, int index=-1)
 
bool load (const QJsonDocument &doc)
 
bool load (const SerializedItem &item) override
 
bool save (QJsonDocument &doc) const
 
bool save (SerializedItem &item) const override
 
unsigned size () const
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 
- Public Member Functions inherited from Serialize
virtual ~Serialize ()=default
 
virtual bool canSerialize () const =0
 
virtual bool load (const SerializedItem &item)=0
 
virtual bool save (SerializedItem &item) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from ObjectGroup
 ObjectGroup ()
 
void clear ()
 
ObjectGroupoperator= (const ObjectGroup &rhs)
 
bool operator== (const ObjectGroup &rhs) const
 
void swap (ObjectGroup &rhs)
 

Detailed Description

The RenderSettings class contains all of the settings that are required by the WSGLRenderer to produce a render EXCEPT picking settings, which are properties of the WSGLWidget a renderer may be attached to. There are a large number of parameters that must be set in order to configure a render, which without this class, would complicate the WSGLRenderer's public interface and therefore, the interface of any classes that use it within their implementation.

It also allows us to robustly manage any dependencies between settings.

Member Enumeration Documentation

◆ FaceCulling

Enumerator
CullNone 
CullBackFaces 
CullFrontFaces 
CullFrontAndBackFaces 

◆ SymbolSizeCoordinateSystem

Enumerator
Automatic 
WorldSpace 
ScreenSpace 

Constructor & Destructor Documentation

◆ RenderSettings() [1/2]

◆ RenderSettings() [2/2]

RenderSettings ( const RenderSettings other)

◆ ~RenderSettings()

~RenderSettings ( )
override

Member Function Documentation

◆ clone()

RenderSettings * clone ( ) const
overridevirtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

We redeclare this function only so that the more derived return type is available without casting.

Implements ObjectGroup.

◆ getAntialiasingEnabled()

bool getAntialiasingEnabled ( ) const
Returns
true if antialiasing is enabled, false otherwise.
See also
setAntialiasingEnabled

◆ getBackgroundColor()

const QColor & getBackgroundColor ( ) const
Returns
The background color being used for the render.
See also
setBackgroundColor

◆ getCameraFrustumsSelectable()

bool getCameraFrustumsSelectable ( ) const
Returns
Selectability of camera frustums: true if selectable, false otherwise.

◆ getCameraFrustumSymbolColor()

const QColor & getCameraFrustumSymbolColor ( ) const
Returns

◆ getCameraFrustumSymbolLineColor()

const QColor & getCameraFrustumSymbolLineColor ( ) const
Returns

◆ getDepthPeelingEnabled()

bool getDepthPeelingEnabled ( ) const
Returns
true if depth peeling is enabled in the renderer, false otherwise.
See also
setDepthPeelingEnabled

◆ getFaceCulling()

RenderSettings::FaceCulling getFaceCulling ( ) const
Returns
The face culling settings.

◆ getHudFontSize()

int getHudFontSize ( ) const
Returns
The current pt size of the HUD font.

◆ getLineWidth()

float getLineWidth ( ) const
Returns
The width of lines that will be rendered by the renderer.
See also
setLineWidth

◆ getMaxTextureSize()

unsigned int getMaxTextureSize ( ) const

◆ getNumAntialiasingSamples()

int getNumAntialiasingSamples ( ) const
Returns
the number of samples used when antialiasing.
See also
setNumAntialiasingSamples

◆ getNumDepthLayers()

unsigned getNumDepthLayers ( ) const
Returns
The number of layers used in the depth peeling technique.
See also
setNumDepthLayers
setDepthPeelingEnabled

◆ getPointSize()

float getPointSize ( ) const
Returns
The size that points will be rendered by the renderer.
See also
setPointSize

◆ getRenderFilter() [1/2]

CSIRO::Rendering::RenderFilter & getRenderFilter ( )

◆ getRenderFilter() [2/2]

const CSIRO::Rendering::RenderFilter & getRenderFilter ( ) const

◆ getRenderWhileModelsQueuedForProcessing()

bool getRenderWhileModelsQueuedForProcessing ( ) const
Returns
if true, the scene will continue to be rendered while models are awaiting processing

◆ getShowCameraFrustums()

bool getShowCameraFrustums ( ) const
Returns

◆ getShowHud()

bool getShowHud ( ) const
Returns
true if the renderer is displaying the Heads-up-display, false otherwise.

The Heads-up-display is an overlay displayed in a render which reports basic render information, such as the camera's position, orientation and field of view, and the current frames-per-second.

See also
setShowHud

◆ getShowOverlays()

bool getShowOverlays ( ) const
Returns
Whether or not overlays are to be displayed when rendering.

◆ getShowSymbols()

bool getShowSymbols ( ) const
Returns
true if Symbols are being displayed, false otherwise.
See also
setShowSymbols

◆ getSsaoAttenuation()

float getSsaoAttenuation ( ) const
Returns
The attenuation for the screen space ambient occlusion effect.

◆ getSsaoEnabled()

bool getSsaoEnabled ( ) const
Returns
True if ambient occlusion is enabled, false otherwise.

◆ getSsaoNumSamples()

int getSsaoNumSamples ( ) const
Returns
the number of sample points used to calculation a fragments ambient occlusion.

◆ getSsaoSampleLength()

float getSsaoSampleLength ( ) const
Returns
the length of samples used in the screen space ambient occlusion.

◆ getSsaoStrength()

float getSsaoStrength ( ) const
Returns
strength of the screen space ambient occlusion effect.

◆ getSuppressCameraWarnings()

bool getSuppressCameraWarnings ( ) const
Returns
True if camera warnings are being suppressed, false otherwise.
See also
setSuppressCameraWarnings

◆ getSymbolColor()

const QColor & getSymbolColor ( ) const
Returns
The current symbol color.

◆ getSymbolLineWidth()

double getSymbolLineWidth ( ) const
Returns
The current symbol line width.

◆ getSymbolSize()

double getSymbolSize ( ) const
Returns
The size of the symbols in either world space or screen space, depending on what the value of getSymbolSizeCoordinateSystem().

◆ getSymbolSizeCoordinateSystem()

RenderSettings::SymbolSizeCoordinateSystem getSymbolSizeCoordinateSystem ( ) const
Returns
The coordinate system in which the symbol size is represented.

◆ operator!=()

bool operator!= ( const RenderSettings rhs) const
inline

◆ operator=()

RenderSettings & operator= ( const RenderSettings rhs)
Parameters
rhs

◆ operator==()

bool operator== ( const RenderSettings rhs) const

◆ setAntialiasingEnabled()

void setAntialiasingEnabled ( bool  b)
Parameters
bTrue if antialiasing is enabled in the renderer, false otherwise.
Note
Enabling antialiasing here doesn't guarantee that it will be enabled in the final render, due to system limitations. To test whether antialiasing was successfully enabled, invoke getAntialiasingEnabled() after the settings have been assigned to a renderer.
See also
getAntialiasingEnabled

◆ setBackgroundColor()

void setBackgroundColor ( const QColor &  color)
Parameters
colorThe background color to use for the render.
See also
getBackgroundColor

◆ setCameraFrustumsSelectable()

void setCameraFrustumsSelectable ( bool  b)
Parameters
bTrue if camera frustums should be interactively selectable using picking, false otherwise.

◆ setCameraFrustumSymbolColor()

void setCameraFrustumSymbolColor ( const QColor &  color)
Parameters
color

◆ setCameraFrustumSymbolLineColor()

void setCameraFrustumSymbolLineColor ( const QColor &  color)

◆ setDepthPeelingEnabled()

void setDepthPeelingEnabled ( bool  b)
Parameters
bIf set to true, depth peeling is enabled.

Depth peeling is a method of rendering transparent objects in a realistic way using an order-independent technique. It can be costly to enable so it is recommended for use only in scenes with many overlapping transparent surfaces, or in final, high-quality renders.

Note
Enabling depth peeling here does not guarantee depth peeling will be enabled in the WSGLRenderer - the renderer will attempt to enable depth peeling, but may fail if the underlying system does not support it. To test whether it has been enabled, call getDepthPeelingEnabled() immediately after assigning the settings to a renderer.
See also
getDepthPeelingEnabled

◆ setFaceCulling()

void setFaceCulling ( FaceCulling  culling)
Parameters
cullingWhether to use back, front or no culling at all.

◆ setHudFontSize()

void setHudFontSize ( int  size)
Parameters
sizeThe desired pt size of the HUD font.

◆ setLineWidth()

void setLineWidth ( float  width)
Parameters
widthThe width of lines that will be rendered by the renderer.
See also
getLineWidth

◆ setMaxTextureSize()

void setMaxTextureSize ( unsigned int  val)

◆ setNumAntialiasingSamples()

void setNumAntialiasingSamples ( int  n)
Parameters
nThe number of samples to use when antialiasing.
Note
The number specified here may not match the final number of samples used when rendering, due to system limitations. To test the final number of samples used, invoke getNumAntialiasingSamples() after the settings have been applied to the renderer.
See also
getNumAntialiasingSamples

◆ setNumDepthLayers()

void setNumDepthLayers ( unsigned  n)
Parameters
nThe number of layers to use in the depth peeling. The more layers, the more layers of overlapping transparent surfaces can be seen in the scene, with a performance cost per layer.
Note
Assigning a number of depth layers does not guarantee that the renderer will use the requested number of layers. If the number of layers requested is over the system limits, the renderer will use the maximum supported. To test whether the requested number of layers are active, invoke getNumDepthLayers() after the settings object has been assigned to a renderer.
See also
getNumDepthLayers
setDepthPeelingEnabled

◆ setPointSize()

void setPointSize ( float  size)
Parameters
sizeThe size (in pixels) to use for points rendered by the WSGLRenderer.
Note
If antialiasing is enabled, these points will be tapered and smoothed. If antialiasing is not enabled, these points will be rendered square.
See also
getPointSize

◆ setRenderFilter()

void setRenderFilter ( const RenderFilter val)

◆ setRenderWhileModelsQueuedForProcessing()

void setRenderWhileModelsQueuedForProcessing ( bool  b)
Parameters
bIf true, the scene will continue to be rendered while models are awaiting processing. If false, frames will only be rendered once all queued items have been processed.

◆ setShowCameraFrustums()

void setShowCameraFrustums ( bool  b)
Parameters
b

◆ setShowHud()

void setShowHud ( bool  b)
Parameters
bIf set to true, the Heads-up-display will be shown. If false, it will be invisible.

The Heads-up-display is an overlay displayed in a render which reports basic render information, such as the camera's position, orientation and field of view, and the current frames-per-second.

See also
getShowHud

◆ setShowOverlays()

void setShowOverlays ( bool  b)
Parameters
bWhether or not to show overlays when rendering.

◆ setShowSymbols()

void setShowSymbols ( bool  b)
Parameters
bIf set to true, the renderer will display symbols for items in a scene which would be otherwise un-renderable, such as a camera, a light or a clipping plane.
See also
getShowSymbols

◆ setSsaoAttenuation()

void setSsaoAttenuation ( float  a)
Parameters
aThe desired attenuation for the screen space ambient occlusion effect.

◆ setSsaoEnabled()

void setSsaoEnabled ( bool  b)
Parameters
bIf true, enable Screen Space Ambient Occlusion

◆ setSsaoNumSamples()

void setSsaoNumSamples ( int  n)
Parameters
nThe desired number of samples for screen space ambient occlusion.

◆ setSsaoSampleLength()

void setSsaoSampleLength ( float  l)
Parameters
lThe desired sample length for the screen space ambient occlusion.

◆ setSsaoStrength()

void setSsaoStrength ( float  s)
Parameters
sThe desired strength of the screen space ambient occlusion effect.

◆ setSuppressCameraWarnings()

void setSuppressCameraWarnings ( bool  b)
Parameters
bIf true, camera warnings will be suppressed by the renderer. These camera warnings are shown whenever no camera exists in the scene, which can happen quite regularly when a scene is modified frequently (such as when the SceneInteractionWidget is editing the scene.
See also
getSuppressCameraWarnings

◆ setSymbolColor()

void setSymbolColor ( const QColor &  color)
Parameters
colorThe desired symbol color.

◆ setSymbolLineWidth()

void setSymbolLineWidth ( double  width)
Parameters
widthThe desired symbol line width.

◆ setSymbolSize()

void setSymbolSize ( double  size)
Parameters
sizeThe size of the symbols in either world space or screen space, depending on what the value of getSymbolSizeCoordinateSystem().

◆ setSymbolSizeCoordinateSystem()

void setSymbolSizeCoordinateSystem ( SymbolSizeCoordinateSystem  coordSys)
Parameters
coordSysThe desired coordinate system that SymboSize os represented in.