Workspace 6.21.5
|
Renders a scene using OpenGL.
#include <Rendering/OpenGL/wsglrenderer.h>
Signals | |
void | glSettingsUpdateRequested () |
void | renderSceneSuccess () |
Additional Inherited Members | |
Static Public Member Functions inherited from TypedSceneRenderer< WSGLRenderer > | |
static SceneRendererTypeId & | typeId () |
Static Public Member Functions inherited from SceneRenderer | |
static void | renderOverlays (QPainter &painter, Scene &scene, const Camera &camera) |
static bool | renderOverlaysUnthreaded (QPainter &painter, Scene &scene, const Camera &camera) |
Protected Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
WSGLRenderer | ( | int | width, |
int | height, | ||
const Shader & | defaultShader = LambertShader() |
||
) |
width | Width of the viewport in pixels |
height | Height of the viewport in pixels |
defaultShader | The default shader to use when no shader has been applied to an object, or when an invalid shader has been applied to an object. |
Creates a new WSGLRenderer, used for drawing a Scene using OpenGL.
|
override |
void addManipulator | ( | TransformManipulator * | manip | ) |
manip | The activeManipulator we wish to use to modify picked objects. |
void clearManipulators | ( | ) |
TransformManipulator * getActiveManipulator | ( | ) | const |
bool getAllowRenderWhileModelsQueuedForProcessing | ( | ) | const |
Camera * getCamera | ( | ) |
If the camera is not currently set when the renderer tries to render a scene, it will attempt to find a camera in the scene itself and set the camera to whatever it finds. It first looks for a camera with the name "Default" (case-sensitive). If no such camera exists, then it will simply use the first camera it finds. If no cameras exist in the scene, rendering will fail.
Because the renderer will attempt to find a camera if one is not supplied, then if the value returned from this function is a null pointer before rendering is attempted, after an attempt to render is made the value returned by this function could be something other than a null pointer.
const Camera * getCamera | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
overridevirtual |
Implements SceneRenderer.
QVector2D getCurrentDepthRange | ( | ) | const |
const LightList & getCurrentLights | ( | ) | const |
Retrieves the set of lights currently active in the scene during rendering. Can only be called by objects that interact with the renderer while it is in the process of rendering.
NOTE: This function will fail if it is called when the renderer is not processing a scene.
const Mesh::TransformMatrix & getCurrentProjectionMatrix | ( | ) | const |
Returns the current projection matrix being used for rendering. Can only be called by objects that interact with the renderer while it is in the process of rendering.
NOTE: This function will fail if it is called when the renderer is not processing a scene.
WSGLRenderItem & getCurrentRenderItem | ( | ) | const |
Retrieves the item which is currently in the process of being rendered. Can only be called by objects that interact with the renderer while it is in the process of rendering.
NOTE: This function will fail if it is called when the renderer is not processing a scene.
const Mesh::TransformMatrix & getCurrentViewMatrix | ( | ) | const |
Retrieves the view matrix currently being used to render the scene. Can only be called by objects that interact with the renderer while it is in the process of rendering.
NOTE: This function will fail if it is called when the renderer is not processing a scene.
const Mesh::TransformMatrix & getCurrentViewMatrixInverse | ( | ) | const |
Returns the inverse of the view matrix currently being used. This function has been made available for efficiency reasons.
Can only be called by objects that interact with the renderer while it is in the process of rendering.
NOTE: This function will fail if it is called when the renderer is not processing a scene.
const PickedItem * getFirstPickedItem | ( | ) | const |
bool getForceDefaultShader | ( | ) | const |
Use this option if you have a single shader that you wish to render the entire scene with.
QOpenGLFunctions_2_1 & getGLFunctions | ( | ) |
int getHeight | ( | ) | const |
unsigned getMaxSupportedDepthLayers | ( | ) | const |
const PickedItemMap & getPickedItems | ( | ) | const |
const PickFilter & getPickFilter | ( | ) | const |
const CSIRO::Rendering::RenderFilter & getRenderFilter | ( | ) | const |
bool getRenderingWithSsao | ( | ) | const |
const RenderSettings & getRenderSettings | ( | ) | const |
const Mesh::BoundingBoxMinimal & getSceneBoundingBox | ( | ) | const |
WSGLScreenSpaceLayers & getScreenSpaceLayers | ( | ) |
const WSGLScreenSpaceLayers & getScreenSpaceLayers | ( | ) | const |
int getWidth | ( | ) | const |
WSGLContext * getWSGLContext | ( | ) |
const WSGLContext * getWSGLContext | ( | ) | const |
|
signal |
bool hasManipulators | ( | ) |
bool initialize | ( | WSGLContext & | context | ) |
context | The context in which the renderer is being initialized. |
This function should be called once only after the creation of the renderer, as it requires that a GL context exists. It will generally be invoked by the initialize event triggered by the GLWidget parent of the renderer. If the parent of the renderer does not have such an initialization event, this function will need to be invoked manually.
No renderering will occur if initialize has not yet been called on the renderer.
bool isBlendingEnabled | ( | ) | const |
bool isInitialized | ( | ) |
bool modelSourceUpdateRequested | ( | ) | const |
bool modelsQueuedForProcessing | ( | ) | const |
bool pick | ( | const QPoint & | point, |
bool | accumulate = false |
||
) | const |
point | The point (in window coordinates) under which the closest visible object in the current scene will be selected. |
accumulate | If true, the picked items will be added to our existing selection. |
Picks all of the items in the scene that lie underneath the specified rect (in window coordinates). This is useful for drag-selecting a set of items.
bool pick | ( | const QRect & | rect, |
bool | accumulate = false |
||
) | const |
rect | The rectangle (in window coordinates) under which the closest visible objects in the current scene will be selected. |
accumulate | If true, the picked items will be added to our existing selection. |
Picks all of the items in the scene that lie underneath the specified rect (in window coordinates). This is useful for drag-selecting a set of items.
bool pick | ( | const QString & | opIdPath, |
bool | accumulate = false |
||
) | const |
opIdPath | The opIdPath of the model we wish to mark as picked |
accumulate | Whether or not to add this model to our existing selection |
Marks the scene item with the specified opIdPath as picked. This is useful for navigating through the scene in an external widget, and having the renderer highlight the selected item.
bool pick | ( | Mesh::ItemHandle::size_type | elementId | ) | const |
elementId | The elementId of the element we want to highlight as picked. |
Picks a specific element in the currently picked model. This is useful for navigating through a mesh-model structure using an external widget, and having the renderer synchronise with it.
bool pickNone | ( | ) |
Ensures that no items in the renderer are picked.
void popBlendState | ( | ) |
void pushBlendState | ( | bool | enabled, |
GLuint | srcRgb, | ||
GLuint | dstRgb, | ||
GLuint | srcAlpha, | ||
GLuint | dstAlpha, | ||
GLuint | depthMask = GL_FALSE , |
||
GLuint | depthFunc = GL_LESS , |
||
QColor | blendColor = QColor() |
||
) |
bool renderLoadScreen | ( | ) |
bool renderPlaceholderImage | ( | ) |
bool renderProcessingOverlay | ( | ) |
bool renderScene | ( | Scene & | scene, |
GLuint | fboHandle = 0 |
||
) |
scene | The scene to render using OpenGL |
fboHandle | The target framebuffer to render the output to. 0 is the default screen framebuffer. |
Renders the scene to the target fboHandle.
|
signal |
bool resize | ( | int | width, |
int | height | ||
) |
width | The desired width of the renderer. |
height | The desired height of the renderer. |
void setAllowRenderWhileModelsQueuedForProcessing | ( | bool | b | ) |
b | Whether or not the renderer should continue to render if any models are queued for processing. |
void setCamera | ( | Camera * | camera | ) |
camera | The camera the renderer should use. It is allowable for this to be a null pointer, in which case the renderer will attempt to find a camera the next time a render is attempted. See getCamera() for more information. |
void setDefaultShader | ( | const Shader & | defaultShader | ) |
defaultShader | The shader to use as the default if an item does not have a shader applied. Alternatively, if setForceDefaultShader() is enabled, the shader will be used for all items in the scene. |
void setForceDefaultShader | ( | bool | b | ) |
b | Whether or not to force the renderer to always use the default shader. |
Use this option if you have a single shader that you wish to render the entire scene with.
void setPickFilter | ( | const PickFilter & | filter | ) |
filter | The filter to assign to the renderer. |
Setting the renderer's pick filter will control what type of object/element is targeted for interactive selection. This will have no effect when using an off-screen renderer.
void setRenderFilter | ( | const RenderFilter & | filter | ) |
filter | The filter to assign to the renderer. |
Setting the renderer's render filter will control what type of object/element is rendered. Affects off-screen render too.
void setRenderSettings | ( | const RenderSettings & | settings | ) |
bool shouldRenderType | ( | const Mesh::ElementType::Type & | type | ) | const |