Equalizer 1.0
|
A channel represents a two-dimensional viewport within a Window. More...
#include <channel.h>
Classes | |
struct | FrameStatistics |
Public Member Functions | |
Channel (Window *parent) | |
Construct a new channel. | |
virtual | ~Channel () |
Destruct the channel. | |
virtual bool | processEvent (const Event &event) |
Process a received event. | |
virtual void | drawStatistics () |
Draw a statistics overlay. | |
virtual void | outlineViewport () |
Outline the current pixel viewport. | |
void | changeLatency (const uint32_t latency) |
const Vector3ub & | getUniqueColor () const |
Data Access | |
co::CommandQueue * | getPipeThreadQueue () |
co::CommandQueue * | getCommandThreadQueue () |
bool | isStopped () const |
Pipe * | getPipe () |
const Pipe * | getPipe () const |
Node * | getNode () |
const Node * | getNode () const |
Config * | getConfig () |
const Config * | getConfig () const |
ServerPtr | getServer () |
const GLEWContext * | glewGetContext () const |
Get the GLEW context for this channel. | |
ObjectManager * | getObjectManager () |
const DrawableConfig & | getDrawableConfig () const |
View * | getNativeView () |
Get the channel's native view. | |
const View * | getNativeView () const |
const-version of getNativeView() | |
util::FrameBufferObject * | getFrameBufferObject () |
void | addStatistic (Event &event, const uint32_t index) |
Context-specific data access. | |
The data returned by these methods depends on the context (callback) they are called from, typically the data for the current rendering task. If they are called outside of a frame task method, they return the channel's native parameter or a placeholder value for the task decomposition parameters. | |
virtual Vector2f | getJitter () const |
const Frames & | getInputFrames () |
const Frames & | getOutputFrames () |
View * | getView () |
Get the channel's current View. | |
const View * | getView () const |
Const version of getView(). | |
Frustumf | getScreenFrustum () const |
Returns an orthographic frustum for 2D operations on the view. | |
Operations | |
Operations are only meaningful from within certain callbacks. They are just convenience wrappers applying context-specific data to the OpenGL state using the context-specific data access above. | |
virtual void | applyBuffer () |
Apply the current rendering buffer, including the color mask. | |
virtual void | applyColorMask () const |
Apply the current color mask. | |
virtual void | applyViewport () const |
Apply the OpenGL viewport for the current rendering task. | |
virtual void | applyFrustum () const |
Apply the frustum matrix for the current rendering task. | |
virtual void | applyPerspective () const |
Apply the perspective frustum matrix for the current rendering task. | |
virtual void | applyOrtho () const |
Apply the orthographic frustum matrix for the current rendering task. | |
void | applyScreenFrustum () const |
Apply an orthographic frustum for pixel-based 2D operations. | |
virtual void | applyHeadTransform () const |
Apply the transformation to position the view frustum. | |
virtual void | applyPerspectiveTransform () const |
Apply the transformation to position the perspective view frustum. | |
virtual void | applyOrthoTransform () const |
Apply the transformation to position the orthographic view frustum. | |
virtual void | applyFrameBufferObject () |
Apply the current alternate frame buffer. | |
void | bindFrameBuffer () |
Rebind the current alternate FBO of the channel or window. | |
Protected Member Functions | |
void | attach (const UUID &id, const uint32_t instanceID) |
virtual void | notifyViewportChanged () |
Notification that parameters influencing the vp/pvp have changed. | |
virtual void | notifyStopFrame (const uint32_t lastFrameNumber) |
Notify interruption of the rendering. | |
Actions | |
void | startFrame (const uint32_t frameNumber) |
Start a frame by unlocking all child resources. | |
void | releaseFrame (const uint32_t frameNumber) |
Signal the completion of a frame to the parent. | |
void | releaseFrameLocal (const uint32_t frameNumber) |
Release the local synchronization of the parent for a frame. | |
virtual void | setupAssemblyState () |
Setup the OpenGL state for a readback or assemble operation. | |
virtual void | resetAssemblyState () |
Reset the OpenGL state after an assembly operation. | |
Task Methods | |
The task methods (callbacks) are called by Equalizer during rendering to execute various rendering tasks. Each task method has a useful default implementation, but at least frameDraw() is implemented by an application. | |
virtual bool | configInit (const uint128_t &initID) |
Initialize this channel. | |
virtual bool | configExit () |
Exit this channel. | |
virtual void | frameStart (const uint128_t &frameID, const uint32_t frameNumber) |
Start rendering a frame. | |
virtual void | frameFinish (const uint128_t &frameID, const uint32_t frameNumber) |
Finish rendering a frame. | |
virtual void | frameDrawFinish (const uint128_t &frameID, const uint32_t frameNumber) |
Finish drawing. | |
virtual void | frameClear (const uint128_t &frameID) |
Clear the frame buffer. | |
virtual void | frameDraw (const uint128_t &frameID) |
Draw the scene. | |
virtual void | frameAssemble (const uint128_t &frameID) |
Assemble all input frames. | |
virtual void | frameReadback (const uint128_t &frameID) |
Read back the rendered frame buffer into all output frames. | |
virtual void | frameViewStart (const uint128_t &frameID) |
Start updating a destination channel. | |
virtual void | frameViewFinish (const uint128_t &frameID) |
Finish updating a destination channel. | |
Friends | |
class | fabric::Window< Pipe, Window, Channel > |
class | ChannelStatistics |
A channel represents a two-dimensional viewport within a Window.
The channel is the basic rendering entity. It represents a 2D rendering area within a Window. It executes all rendering-relevant tasks, such as clear, draw, assemble and readback. Each rendering task is using its own RenderContext, which is computed by the server based on the rendering description of the current configuration.
Definition at line 44 of file include/eq/channel.h.
eq::Channel::Channel | ( | Window * | parent | ) |
Construct a new channel.
Reimplemented in eqHello::Channel, eqNbody::Channel, eqPixelBench::Channel, eqPly::Channel, eVolve::Channel, and osgScaleViewer::Channel.
virtual eq::Channel::~Channel | ( | ) | [virtual] |
Destruct the channel.
Reimplemented from eq::fabric::Channel< Window, Channel >.
Reimplemented in eqNbody::Channel, eqPixelBench::Channel, eqPly::Channel, and eVolve::Channel.
virtual void eq::Channel::applyBuffer | ( | ) | [virtual] |
Apply the current rendering buffer, including the color mask.
Referenced by eqPly::Channel::frameAssemble(), eqPly::Channel::frameClear(), eVolve::Channel::frameStart(), and eqPly::Channel::frameViewFinish().
virtual void eq::Channel::applyColorMask | ( | ) | const [virtual] |
virtual void eq::Channel::applyFrameBufferObject | ( | ) | [virtual] |
Apply the current alternate frame buffer.
virtual void eq::Channel::applyFrustum | ( | ) | const [virtual] |
Apply the frustum matrix for the current rendering task.
If a sub-pixel decomposition is defined, the frustum is jittered by the amount given by getJitter() to implement software anti-aliasing. Applications which want to implement a different multi-sampling algorithm, e.g., depth-of-field, have to re-implement getJitter() or applyFrustum() accordingly.
virtual void eq::Channel::applyHeadTransform | ( | ) | const [virtual] |
virtual void eq::Channel::applyOrtho | ( | ) | const [virtual] |
Apply the orthographic frustum matrix for the current rendering task.
virtual void eq::Channel::applyOrthoTransform | ( | ) | const [virtual] |
Apply the transformation to position the orthographic view frustum.
virtual void eq::Channel::applyPerspective | ( | ) | const [virtual] |
Apply the perspective frustum matrix for the current rendering task.
virtual void eq::Channel::applyPerspectiveTransform | ( | ) | const [virtual] |
Apply the transformation to position the perspective view frustum.
void eq::Channel::applyScreenFrustum | ( | ) | const |
Apply an orthographic frustum for pixel-based 2D operations.
One unit of the frustum covers one pixel on screen. The frustum is positioned relative to the view.
Referenced by eVolve::Channel::frameViewFinish().
virtual void eq::Channel::applyViewport | ( | ) | const [virtual] |
Apply the OpenGL viewport for the current rendering task.
Referenced by eqPly::Channel::frameAssemble(), eqPly::Channel::frameClear(), eVolve::Channel::frameStart(), and eqPly::Channel::frameViewFinish().
void eq::Channel::bindFrameBuffer | ( | ) |
Rebind the current alternate FBO of the channel or window.
virtual bool eq::Channel::configExit | ( | ) | [protected, virtual] |
virtual bool eq::Channel::configInit | ( | const uint128_t & | initID | ) | [protected, virtual] |
Initialize this channel.
initID | the init identifier. |
Reimplemented in eqNbody::Channel, eqPly::Channel, and eVolve::Channel.
Referenced by eqPly::Channel::configInit(), and eqNbody::Channel::configInit().
virtual void eq::Channel::drawStatistics | ( | ) | [virtual] |
Draw a statistics overlay.
Referenced by eqPly::Channel::frameViewFinish().
virtual void eq::Channel::frameAssemble | ( | const uint128_t & | frameID | ) | [protected, virtual] |
Assemble all input frames.
Called 0 to n times during one frame.
frameID | the per-frame identifier. |
Reimplemented in eqPly::Channel, and eVolve::Channel.
virtual void eq::Channel::frameClear | ( | const uint128_t & | frameID | ) | [protected, virtual] |
Clear the frame buffer.
Called 0 to n times during one frame.
frameID | the per-frame identifier. |
Reimplemented in eqPly::Channel, eVolve::Channel, and osgScaleViewer::Channel.
virtual void eq::Channel::frameDraw | ( | const uint128_t & | frameID | ) | [protected, virtual] |
Draw the scene.
Called 0 to n times during one frame.
frameID | the per-frame identifier. |
Reimplemented in eqHello::Channel, eqNbody::Channel, eqPixelBench::Channel, eqPly::Channel, eVolve::Channel, and osgScaleViewer::Channel.
Referenced by eqHello::Channel::frameDraw().
virtual void eq::Channel::frameDrawFinish | ( | const uint128_t & | frameID, |
const uint32_t | frameNumber | ||
) | [protected, virtual] |
Finish drawing.
Called once per frame after the last draw operation. Typically releases the local node thread synchronization for this frame.
frameID | the per-frame identifier. |
frameNumber | the frame to finished with draw. |
virtual void eq::Channel::frameFinish | ( | const uint128_t & | frameID, |
const uint32_t | frameNumber | ||
) | [protected, virtual] |
Finish rendering a frame.
Called once at the end of each frame, to do per-frame updates of channel-specific data. This method has to call releaseFrame().
frameID | the per-frame identifier. |
frameNumber | the frame to finish. |
Reimplemented in eqPly::Channel.
virtual void eq::Channel::frameReadback | ( | const uint128_t & | frameID | ) | [protected, virtual] |
Read back the rendered frame buffer into all output frames.
Called 0 to n times during one frame.
frameID | the per-frame identifier. |
Reimplemented in eqPly::Channel, and eVolve::Channel.
virtual void eq::Channel::frameStart | ( | const uint128_t & | frameID, |
const uint32_t | frameNumber | ||
) | [protected, virtual] |
Start rendering a frame.
Called once at the beginning of each frame, to do per-frame updates of channel-specific data. This method has to call startFrame().
frameID | the per-frame identifier. |
frameNumber | the frame to start. |
Reimplemented in eqPixelBench::Channel, eqPly::Channel, and eVolve::Channel.
virtual void eq::Channel::frameViewFinish | ( | const uint128_t & | frameID | ) | [protected, virtual] |
Finish updating a destination channel.
Called once on each destination channel, e.g., channels which are defined by a view/segment intersection, before frameFinish to update a part of a view.
This is typically used to do operations on the output channel after it has been fully updated, e.g., to draw a 2D overlay.
frameID | the per-frame identifier. |
Reimplemented in eqPly::Channel, eVolve::Channel, and osgScaleViewer::Channel.
virtual void eq::Channel::frameViewStart | ( | const uint128_t & | frameID | ) | [protected, virtual] |
Start updating a destination channel.
Called once on each destination channel, e.g., channels which are defined by a view/segment intersection, after frameStart to update a part of a display.
frameID | the per-frame identifier. |
Reimplemented in eqPly::Channel.
Config* eq::Channel::getConfig | ( | ) |
Referenced by eqNbody::Channel::configInit(), and eqPly::Channel::frameViewFinish().
const Config* eq::Channel::getConfig | ( | ) | const |
const DrawableConfig& eq::Channel::getDrawableConfig | ( | ) | const |
util::FrameBufferObject* eq::Channel::getFrameBufferObject | ( | ) |
const Frames& eq::Channel::getInputFrames | ( | ) | [inline] |
Definition at line 150 of file include/eq/channel.h.
Referenced by eqPly::Channel::frameAssemble().
virtual Vector2f eq::Channel::getJitter | ( | ) | const [virtual] |
Reimplemented in eqPly::Channel.
Referenced by eqPly::Channel::getJitter().
View* eq::Channel::getNativeView | ( | ) |
Get the channel's native view.
This function always returns the channel's native view, no matter in which context it is called. Only destination channels have a native view.
const View* eq::Channel::getNativeView | ( | ) | const |
const-version of getNativeView()
const Node* eq::Channel::getNode | ( | ) | const |
Node* eq::Channel::getNode | ( | ) |
ObjectManager* eq::Channel::getObjectManager | ( | ) |
const Frames& eq::Channel::getOutputFrames | ( | ) | [inline] |
Definition at line 156 of file include/eq/channel.h.
Referenced by eqPly::Channel::frameReadback().
Pipe* eq::Channel::getPipe | ( | ) |
Referenced by eqNbody::Channel::configInit(), eqNbody::Channel::frameDraw(), and eVolve::Channel::useOrtho().
const Pipe* eq::Channel::getPipe | ( | ) | const |
Frustumf eq::Channel::getScreenFrustum | ( | ) | const |
Returns an orthographic frustum for 2D operations on the view.
One unit of the frustum covers one pixel on screen. The frustum is positioned relative to the view.
ServerPtr eq::Channel::getServer | ( | ) |
const Vector3ub& eq::Channel::getUniqueColor | ( | ) | const [inline] |
Definition at line 312 of file include/eq/channel.h.
Referenced by eVolve::Channel::configInit(), eqPly::Channel::frameClear(), and eqPly::Channel::frameDraw().
View* eq::Channel::getView | ( | ) |
Get the channel's current View.
During a frame task method, i.e., in one of the frameFoo functions, the view is set to the view of the destination channel, that is, the channel for which this channel is executing the rendering task. Outside of a frame task method the native view of the channel, or 0, is returned.
Referenced by eqPly::Channel::frameClear(), eqPly::Channel::frameViewFinish(), and eqPly::Channel::getJitter().
const GLEWContext* eq::Channel::glewGetContext | ( | ) | const |
Get the GLEW context for this channel.
The GLEW context is initialized during window initialization, and provides access to OpenGL extensions. This function does not follow the Equalizer naming conventions, since GLEW uses a function of this name to automatically resolve OpenGL function entry points. Therefore, any supported GL function can be called directly from an initialized Channel.
Referenced by eqNbody::Channel::Channel().
bool eq::Channel::isStopped | ( | ) | const [inline] |
Definition at line 62 of file include/eq/channel.h.
virtual void eq::Channel::notifyStopFrame | ( | const uint32_t | lastFrameNumber | ) | [inline, protected, virtual] |
Notify interruption of the rendering.
This method is called from the Client command thread, as opposed to the rendering thread. Its purpose is to cause the rendering thread to stop its operations as soon as possible. Normal rendering shall recommence after the given frame.
lastFrameNumber | stop rendering until this frame has been processed. |
Reimplemented in eqPly::Channel.
Definition at line 505 of file include/eq/channel.h.
virtual void eq::Channel::notifyViewportChanged | ( | ) | [protected, virtual] |
Notification that parameters influencing the vp/pvp have changed.
Reimplemented from eq::fabric::Channel< Window, Channel >.
virtual void eq::Channel::outlineViewport | ( | ) | [virtual] |
Outline the current pixel viewport.
Referenced by eqNbody::Channel::frameDraw().
virtual bool eq::Channel::processEvent | ( | const Event & | event | ) | [virtual] |
Process a received event.
The task of this method is to update the channel as necessary, and transform the event into an config event to be send to the application using Config::sendEvent().
event | the received event. |
void eq::Channel::releaseFrame | ( | const uint32_t | frameNumber | ) | [protected] |
Signal the completion of a frame to the parent.
frameNumber | the frame to end. |
void eq::Channel::releaseFrameLocal | ( | const uint32_t | frameNumber | ) | [protected] |
Release the local synchronization of the parent for a frame.
frameNumber | the frame to release. |
virtual void eq::Channel::resetAssemblyState | ( | ) | [protected, virtual] |
Reset the OpenGL state after an assembly operation.
Referenced by eqPly::Channel::frameAssemble(), and eqPly::Channel::frameViewFinish().
virtual void eq::Channel::setupAssemblyState | ( | ) | [protected, virtual] |
Setup the OpenGL state for a readback or assemble operation.
The default implementation is very conservative and saves any state which is potentially changed by the assembly routines. Applications may overwrite this and resetAssemblyState() to optimize performance in accordance with their rendering code.
Referenced by eqPly::Channel::frameAssemble(), and eqPly::Channel::frameViewFinish().
void eq::Channel::startFrame | ( | const uint32_t | frameNumber | ) | [protected] |
Start a frame by unlocking all child resources.
frameNumber | the frame to start. |