#include <channel.h>


The channel is the basic rendering entity. It executes all rendering-relevant tasks, such as clear, draw, assemble and readback. It is a child of a Window.
Definition at line 32 of file lib/client/channel.h.
Attributes | |
| enum | IAttribute { IATTR_HINT_STATISTICS, IATTR_ALL } |
| class | Window |
| int32_t | getIAttribute (const IAttribute attr) const |
| static const std::string & | getIAttributeString (const IAttribute attr) |
| virtual | ~Channel () |
| Destructs the channel. | |
Error information. | |
| void | setErrorMessage (const std::string &message) |
| Set a message why the last operation failed. | |
Public Member Functions | |
| Channel (Window *parent) | |
| Constructs a new channel. | |
Data Access | |
| Window * | getWindow () const |
| Pipe * | getPipe () const |
| Node * | getNode () const |
| Config * | getConfig () const |
| base::RefPtr< Server > | getServer () const |
| GLEWContext * | glewGetContext () |
| Get the GLEW context for this channel. | |
| const std::string & | getName () const |
| ChannelVisitor::Result | accept (ChannelVisitor *visitor) |
| Traverse this channel and all children using a channel visitor. | |
| void | setNearFar (const float nearPlane, const float farPlane) |
| Set the near and far planes for this channel. | |
| const vmml::Vector3ub & | getUniqueColor () const |
| Return a stable, unique color for this channel. | |
| const View * | getView () const |
| Get the channel's view. | |
| void | addStatistic (Event &event) |
| Add a new statistics event for the current frame. | |
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. | |
| uint32_t | getDrawBuffer () const |
| uint32_t | getReadBuffer () const |
| const ColorMask & | getDrawBufferMask () const |
| const PixelViewport & | getPixelViewport () const |
| const vmml::Vector2i & | getPixelOffset () const |
| Get the channel's current position wrt the destination channel. | |
| const vmml::Frustumf & | getFrustum () const |
| const vmml::Frustumf & | getOrtho () const |
| const Viewport & | getViewport () const |
| const Range & | getRange () const |
| const Pixel & | getPixel () const |
| Eye | getEye () const |
| const vmml::Matrix4f & | getHeadTransform () const |
| const FrameVector & | getInputFrames () |
| const FrameVector & | getOutputFrames () |
| const vmml::Vector2i & | getScreenOrigin () const |
| vmml::Vector2i | getScreenSize () const |
| vmml::Frustumf | getScreenFrustum () const |
Operations | |
Operations are only meaningfull from within certain callbacks.
They are just convenience wrappers applying context-specific data to the OpenGL state. | |
| virtual void | applyBuffer () const |
| 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 perspective frustum matrix for the current rendering task. | |
| virtual void | applyOrtho () const |
| Apply the orthographic frustum matrix for the current rendering task. | |
| virtual void | applyHeadTransform () const |
| Apply the modelling transformation to position and orient the view frustum. | |
| virtual bool | processEvent (const Event &event) |
| Process a received event. | |
| virtual void | drawStatistics () |
| Draw a statistics overlay. | |
| virtual void | outlineViewport () |
| Outlines the current pixel viewport. | |
| void | applyScreenFrustum () const |
| Apply a orthographic frustum for the 2D virtual screen. | |
Protected Member Functions | |
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. | |
Callbacks | |
The callbacks are called by Equalizer during rendering to execute various actions. | |
| virtual bool | configInit (const uint32_t initID) |
| Initialize this channel. | |
| virtual bool | configExit () |
| Exit this channel. | |
| virtual void | frameStart (const uint32_t frameID, const uint32_t frameNumber) |
| Start rendering a frame. | |
| virtual void | frameFinish (const uint32_t frameID, const uint32_t frameNumber) |
| Finish rendering a frame. | |
| virtual void | frameDrawFinish (const uint32_t frameID, const uint32_t frameNumber) |
| Finish drawing. | |
| virtual void | frameClear (const uint32_t frameID) |
| Clear the frame buffer. | |
| virtual void | frameDraw (const uint32_t frameID) |
| Draw the scene. | |
| virtual void | frameAssemble (const uint32_t frameID) |
| Assemble input frames. | |
| virtual void | frameReadback (const uint32_t frameID) |
| Read back the rendered scene. | |
| virtual void | setupAssemblyState () |
| Setup the OpenGL state for a readback or assemble operation. | |
| virtual void | resetAssemblyState () |
| Reset the OpenGL state after an assembly operation. | |
| GLEWContext* eq::Channel::glewGetContext | ( | ) | [inline] |
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.
Definition at line 68 of file lib/client/channel.h.
| ChannelVisitor::Result eq::Channel::accept | ( | ChannelVisitor * | visitor | ) | [inline] |
Traverse this channel and all children using a channel visitor.
| visitor | the visitor. |
Definition at line 78 of file lib/client/channel.h.
References eq::ChannelVisitor::visit().
Referenced by eq::Window::accept().


| void Channel::setNearFar | ( | const float | nearPlane, | |
| const float | farPlane | |||
| ) |
Set the near and far planes for this channel.
The near and far planes are set during initialisation and are inherited by source channels contributing to the rendering of this channel. Dynamic near and far planes can be applied using applyNearFar.
| nearPlane | the near plane. | |
| farPlane | the far plane. |
Definition at line 177 of file lib/client/channel.cpp.
References eq::RenderContext::frustum, and eq::RenderContext::ortho.
| const vmml::Vector3ub& eq::Channel::getUniqueColor | ( | ) | const [inline] |
Return a stable, unique color for this channel.
Definition at line 95 of file lib/client/channel.h.
Referenced by frameClear().

| const View* eq::Channel::getView | ( | ) | const [inline] |
Get the channel's view.
A channel has a View if a Wall or Projection description is configured for it. This is typically the case for destination channels, source channels do not have a view.
Definition at line 106 of file lib/client/channel.h.
Referenced by processEvent().

| void Channel::addStatistic | ( | Event & | event | ) |
Add a new statistics event for the current frame.
Definition at line 203 of file lib/client/channel.cpp.
References processEvent().

| uint32_t Channel::getDrawBuffer | ( | ) | const |
Definition at line 353 of file lib/client/channel.cpp.
References eq::RenderContext::buffer.
Referenced by applyBuffer().

| uint32_t Channel::getReadBuffer | ( | ) | const |
Definition at line 358 of file lib/client/channel.cpp.
References eq::RenderContext::buffer.
Referenced by applyBuffer().

| const ColorMask & Channel::getDrawBufferMask | ( | ) | const |
Definition at line 363 of file lib/client/channel.cpp.
References eq::RenderContext::drawBufferMask.
Referenced by applyColorMask(), and eq::Compositor::setupStencilBuffer().

| const PixelViewport & Channel::getPixelViewport | ( | ) | const |
Definition at line 343 of file lib/client/channel.cpp.
References eq::RenderContext::pvp.
Referenced by applyViewport(), getScreenFrustum(), and outlineViewport().

| const vmml::Vector2i & Channel::getPixelOffset | ( | ) | const |
Get the channel's current position wrt the destination channel.
Note that computing this value from the current viewport and pixel viewport inaccurate because it neglects rounding of the pixel viewport done by the server.
Definition at line 348 of file lib/client/channel.cpp.
References eq::RenderContext::offset.
| const vmml::Frustumf & Channel::getFrustum | ( | ) | const |
Definition at line 368 of file lib/client/channel.cpp.
References eq::RenderContext::frustum.
Referenced by applyFrustum().

| const vmml::Frustumf & Channel::getOrtho | ( | ) | const |
Definition at line 373 of file lib/client/channel.cpp.
References eq::RenderContext::ortho.
Referenced by applyOrtho().

| const Viewport & Channel::getViewport | ( | ) | const |
Definition at line 338 of file lib/client/channel.cpp.
References eq::RenderContext::vp.
| const Range & Channel::getRange | ( | ) | const |
Definition at line 378 of file lib/client/channel.cpp.
References eq::RenderContext::range.
| const Pixel & Channel::getPixel | ( | ) | const |
Definition at line 383 of file lib/client/channel.cpp.
References eq::RenderContext::pixel.
Referenced by getScreenFrustum().

| Eye Channel::getEye | ( | ) | const |
Definition at line 388 of file lib/client/channel.cpp.
References eq::RenderContext::eye.
| const vmml::Matrix4f & Channel::getHeadTransform | ( | ) | const |
Definition at line 393 of file lib/client/channel.cpp.
References eq::RenderContext::headTransform.
Referenced by applyHeadTransform().

| const FrameVector& eq::Channel::getInputFrames | ( | ) | [inline] |
Definition at line 168 of file lib/client/channel.h.
Referenced by frameAssemble().

| const FrameVector& eq::Channel::getOutputFrames | ( | ) | [inline] |
Definition at line 171 of file lib/client/channel.h.
Referenced by frameReadback().

| const vmml::Vector2i & Channel::getScreenOrigin | ( | ) | const |
Definition at line 398 of file lib/client/channel.cpp.
References eq::RenderContext::screenOrigin.
Referenced by getScreenFrustum().

| vmml::Vector2i Channel::getScreenSize | ( | ) | const |
Definition at line 403 of file lib/client/channel.cpp.
References eq::PixelViewport::h, eq::RenderContext::screenSize, and eq::PixelViewport::w.
| vmml::Frustumf Channel::getScreenFrustum | ( | ) | const |
Definition at line 408 of file lib/client/channel.cpp.
References getPixel(), getPixelViewport(), getScreenOrigin(), eq::Pixel::h, eq::PixelViewport::h, eq::Pixel::w, eq::PixelViewport::w, eq::Pixel::x, and eq::Pixel::y.
Referenced by applyScreenFrustum().


| bool 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. |
Definition at line 486 of file lib/client/channel.cpp.
References eq::ConfigEvent::data, eq::net::Object::getID(), getView(), and eq::Config::sendEvent().
Referenced by addStatistic().


| void Channel::drawStatistics | ( | ) | [virtual] |
Draw a statistics overlay.
Definition at line 522 of file lib/client/channel.cpp.
References applyBuffer(), applyViewport(), eq::util::BitmapFont::draw(), eq::Window::getObjectManager(), eq::Window::getPixelViewport(), eq::Config::getStatistics(), eq::PixelViewport::getXEnd(), eq::PixelViewport::getYEnd(), resetAssemblyState(), setupAssemblyState(), eq::PixelViewport::w, eq::PixelViewport::x, and eq::PixelViewport::y.

| void Channel::outlineViewport | ( | ) | [virtual] |
Outlines the current pixel viewport.
Definition at line 736 of file lib/client/channel.cpp.
References getPixelViewport(), eq::PixelViewport::getXEnd(), eq::PixelViewport::getYEnd(), resetAssemblyState(), setupAssemblyState(), eq::PixelViewport::x, and eq::PixelViewport::y.

| void Channel::applyScreenFrustum | ( | ) | const |
Apply a orthographic frustum for the 2D virtual screen.
One unit matches one 2D virtual screen pixel. The frustum is positioned this channel's virtual screen position. The z-range is [-1,1].
Definition at line 470 of file lib/client/channel.cpp.
References getScreenFrustum().

| void eq::Channel::startFrame | ( | const uint32_t | frameNumber | ) | [inline, protected] |
Start a frame by unlocking all child resources.
| frameNumber | the frame to start. |
Definition at line 295 of file lib/client/channel.h.
| void eq::Channel::releaseFrame | ( | const uint32_t | frameNumber | ) | [inline, protected] |
Signal the completion of a frame to the parent.
| frameNumber | the frame to end. |
Definition at line 302 of file lib/client/channel.h.
| void eq::Channel::releaseFrameLocal | ( | const uint32_t | frameNumber | ) | [inline, protected] |
Release the local synchronization of the parent for a frame.
| frameNumber | the frame to release. |
Definition at line 309 of file lib/client/channel.h.
| virtual bool eq::Channel::configInit | ( | const uint32_t | initID | ) | [inline, protected, virtual] |
Initialize this channel.
| initID | the init identifier. |
Definition at line 324 of file lib/client/channel.h.
| virtual void eq::Channel::frameStart | ( | const uint32_t | frameID, | |
| const uint32_t | frameNumber | |||
| ) | [inline, 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. |
Definition at line 341 of file lib/client/channel.h.
| virtual void eq::Channel::frameFinish | ( | const uint32_t | frameID, | |
| const uint32_t | frameNumber | |||
| ) | [inline, 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. |
Definition at line 354 of file lib/client/channel.h.
| virtual void eq::Channel::frameDrawFinish | ( | const uint32_t | frameID, | |
| const uint32_t | frameNumber | |||
| ) | [inline, 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. |
Definition at line 367 of file lib/client/channel.h.
| void Channel::frameClear | ( | const uint32_t | frameID | ) | [protected, virtual] |
Clear the frame buffer.
| frameID | the per-frame identifier. |
Definition at line 213 of file lib/client/channel.cpp.
References applyBuffer(), applyViewport(), and getUniqueColor().

| void Channel::frameDraw | ( | const uint32_t | frameID | ) | [protected, virtual] |
Draw the scene.
| frameID | the per-frame identifier. |
Definition at line 229 of file lib/client/channel.cpp.
References applyBuffer(), applyFrustum(), applyHeadTransform(), and applyViewport().

| void Channel::frameAssemble | ( | const uint32_t | frameID | ) | [protected, virtual] |
Assemble input frames.
| frameID | the per-frame identifier. |
Definition at line 243 of file lib/client/channel.cpp.
References applyBuffer(), applyViewport(), eq::Compositor::assembleFrames(), getInputFrames(), resetAssemblyState(), and setupAssemblyState().

| void Channel::frameReadback | ( | const uint32_t | frameID | ) | [protected, virtual] |
Read back the rendered scene.
| frameID | the per-frame identifier. |
Definition at line 254 of file lib/client/channel.cpp.
References applyBuffer(), applyViewport(), eq::Window::getObjectManager(), getOutputFrames(), resetAssemblyState(), setupAssemblyState(), eq::Frame::startReadback(), and eq::Frame::syncReadback().

| void 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.
Definition at line 277 of file lib/client/channel.cpp.
References eq::Window::getPixelViewport(), eq::PixelViewport::h, eq::PixelViewport::isValid(), and eq::PixelViewport::w.
Referenced by drawStatistics(), frameAssemble(), frameReadback(), and outlineViewport().


| void eq::Channel::setErrorMessage | ( | const std::string & | message | ) | [inline, protected] |
Set a message why the last operation failed.
The message will be transmitted to the originator of the request, for example to Config::init when set from within the configInit method.
| message | the error message. |
Definition at line 425 of file lib/client/channel.h.
0.6 by
1.5.5