BALL
1.4.2
|
#include <BALL/VIEW/RENDERING/renderSetup.h>
Public Types | |
enum | STEREO_SETUP { NONE, LEFT_EYE, RIGHT_EYE } |
Public Attributes | |
Renderer * | renderer |
RenderTarget * | target |
Protected Member Functions | |
void | renderToBuffer_ () |
This class encapsulates a (renderer, target) pair for Scene.
Please try to call functions inside this class instead of working with the renderers and targets directly to ensure thread safety.
Definition at line 36 of file renderSetup.h.
Enumerator | |
---|---|
NONE | |
LEFT_EYE | |
RIGHT_EYE |
Definition at line 50 of file renderSetup.h.
BALL::VIEW::RenderSetup::RenderSetup | ( | Renderer * | r, |
RenderTarget * | t, | ||
Scene * | scene, | ||
const Stage * | stage | ||
) |
BALL::VIEW::RenderSetup::RenderSetup | ( | const RenderSetup & | rs | ) |
void BALL::VIEW::RenderSetup::bufferRepresentation | ( | const Representation & | rep | ) |
Makes the target the current context and forwards the given representation to the renderer for buffering.
If the renderer is not receiving buffer updates, this is a noop.
Render the current state into a PNG file.
void BALL::VIEW::RenderSetup::init | ( | ) |
Initialize renderer and target.
|
inline |
Returns the mode of the render loop.
Definition at line 206 of file renderSetup.h.
|
inline |
This function returns the rendering state of our renderer.
Definition at line 81 of file renderSetup.h.
|
virtual |
Ensure correct current rendering context.
If the target type uses a GL context, this is made current if necessary. If the target does not need GL, this function is a noop.
Compute the 2D position on the screen corresponding to the 3D point vec
Compute the 3D position on the view plane corresponding to point (x,y) on the view port
const RenderSetup& BALL::VIEW::RenderSetup::operator= | ( | const RenderSetup & | rs | ) |
|
inline |
Pause rendering. This function allows to skip rendering while still buffering representations. Thus, a paused renderer will still receive all updates to representations, it will just not display anything.
Definition at line 70 of file renderSetup.h.
void BALL::VIEW::RenderSetup::pickObjects | ( | Position | x1, |
Position | y1, | ||
Position | x2, | ||
Position | y2, | ||
std::list< GeometricObject * > & | objects | ||
) |
Pick all objects in the given screen rectangle.
Position BALL::VIEW::RenderSetup::prepareGridTextures | ( | const RegularData3D & | grid, |
const ColorMap & | map | ||
) |
Send a grid texture to the renderer.
If the current renderer can not handle this kind of object, this is a noop.
void BALL::VIEW::RenderSetup::projectionModeChanged | ( | ) |
Notifies the renderer that the projection mode has changed.
|
inline |
Returns the buffering state of the renderer.
Definition at line 102 of file renderSetup.h.
void BALL::VIEW::RenderSetup::removeGridTextures | ( | const RegularData3D & | grid | ) |
Remove a grid texture from the renderer.
If the current renderer can not handle this kind of object, this is a noop.
void BALL::VIEW::RenderSetup::removeRepresentation | ( | const Representation & | rep | ) |
Makes the target the current context and forwards the given representation to the renderer for removal.
If the renderer is not receiving buffer updates, this is a noop.
void BALL::VIEW::RenderSetup::renderToBuffer | ( | ) |
Renders the current state into the given buffer.
Please note that this function only does anything when rendering is event-based, and if the renderer is not paused. If continuous rendering is set to true, the updates will be performed in a continuous loop instead and this function will immediately return.
|
protected |
|
virtual |
void BALL::VIEW::RenderSetup::setLights | ( | bool | reset_all = false | ) |
Calls light setup for the current renderer.
void BALL::VIEW::RenderSetup::setOffset | ( | const Vector3 & | offset | ) |
Sets an offset to apply to camera position and look at point.
Please note that the offset is interpreted as relative to the camera with components (right, up, view) and will be updated at each position change.
|
inline |
Prevent updating of rendering buffers.
This function allows to prevent the renderer from buffering or deleting representations.
Please note that this is potentially dangerous, since the renderer will not be made aware of deleted representations. Callers should make sure that the renderer state is effectively reset upon reactivating this switch.
A common use case for this function is to support two render targets sharing one render context, where we want to prevent the second target from rebuffering all representations already seen by the first.
Definition at line 98 of file renderSetup.h.
|
inline |
This function turns the connected renderer into part of a stereo setup.
Depending on the value set here, renderers will be passed additional information upon update camera to set eye separation and focal distance or to prepare correct frustra.
Definition at line 124 of file renderSetup.h.
void BALL::VIEW::RenderSetup::showRuler | ( | bool | show | ) |
Show a simple ruler.
If supported by the renderer implementation, this function can be used to produce a simple ruler that is rendered together with the other representations. The main use of this function is in the edit mode, where it can help to straighten-up structures and to correctly estimate angles and distances.
|
inline |
This function allows to activate a paused renderer again. Please note that the corresponding window will not be automatically updated. This has to be performed by the caller.
Definition at line 77 of file renderSetup.h.
void BALL::VIEW::RenderSetup::updateBackgroundColor | ( | ) |
Setup background color.
void BALL::VIEW::RenderSetup::updateCamera | ( | const Camera * | camera = 0 | ) |
Tells the connected renderer to update its camera.
This function applies transformations like adding an offset to camera position and view point before handing over the camera to the renderer.
void BALL::VIEW::RenderSetup::useContinuousLoop | ( | bool | use_loop | ) |
Decide between event based and (threaded) continuous loop rendering.
|
protected |
Definition at line 226 of file renderSetup.h.
|
protected |
Definition at line 227 of file renderSetup.h.
|
protected |
Definition at line 242 of file renderSetup.h.
|
protected |
Definition at line 248 of file renderSetup.h.
|
protected |
Definition at line 241 of file renderSetup.h.
|
protected |
Definition at line 223 of file renderSetup.h.
|
mutableprotected |
Definition at line 238 of file renderSetup.h.
Renderer* BALL::VIEW::RenderSetup::renderer |
Definition at line 47 of file renderSetup.h.
|
protected |
Definition at line 222 of file renderSetup.h.
|
protected |
Definition at line 234 of file renderSetup.h.
|
protected |
Definition at line 244 of file renderSetup.h.
|
protected |
Definition at line 235 of file renderSetup.h.
|
protected |
Definition at line 229 of file renderSetup.h.
RenderTarget* BALL::VIEW::RenderSetup::target |
Definition at line 48 of file renderSetup.h.
|
protected |
Definition at line 232 of file renderSetup.h.
|
protected |
Definition at line 224 of file renderSetup.h.
|
protected |
Definition at line 240 of file renderSetup.h.