#include <channel.h>


Public Types | |
| enum | Drawable { FBO_NONE = EQ_BIT_NONE, FBO_COLOR = EQ_BIT1, FBO_DEPTH = EQ_BIT2, FBO_STENCIL = EQ_BIT3 } |
| The drawable format defining the components used as an alternate drawable for this cannel. More... | |
Public Member Functions | |
| Channel (Window *parent) | |
| Constructs a new channel. | |
| virtual | ~Channel () |
| Destructs the channel. | |
Data Access | |
| Window * | getWindow () |
| const Window * | getWindow () const |
| Pipe * | getPipe () |
| const Pipe * | getPipe () const |
| Node * | getNode () |
| const Node * | getNode () const |
| Config * | getConfig () |
| const Config * | getConfig () const |
| ServerPtr | getServer () |
| Window::ObjectManager * | getObjectManager () |
| GLEWContext * | glewGetContext () |
| Get the GLEW context for this channel. | |
| const GLEWContext * | glewGetContext () const |
| const std::string & | getName () const |
| uint32_t | getTasks () const |
| Return the set of tasks this channel might execute in the worst case. | |
| VisitorResult | 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 Vector3ub & | getUniqueColor () const |
| Return a stable, unique color for this channel. | |
| const View * | getView () |
| Get the channel's view. | |
| const View * | getNativeView () |
| 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 Vector2i & | getPixelOffset () const |
| Get the channel's current position wrt the destination channel. | |
| const Frustumf & | getFrustum () const |
| const Frustumf & | getOrtho () const |
| const Viewport & | getViewport () const |
| const Range & | getRange () const |
| const Pixel & | getPixel () const |
| const Zoom & | getZoom () const |
| Eye | getEye () const |
| const Matrix4f & | getHeadTransform () const |
| const FrameVector & | getInputFrames () |
| const FrameVector & | getOutputFrames () |
| Frustumf | getScreenFrustum () const |
| Returns an orthographic frustum for 2D operations on the view. | |
| const PixelViewport & | getNativePixelViewPort () const |
| get the channel's native (drawable) pixel viewport. | |
| const Vector4i & | getOverdraw () const |
| void | setMaxSize (const Vector2i &size) |
| uint32_t | getTaskID () const |
| FrameBufferObject * | getFrameBufferObject () |
| get the FBO used as an alternate frame buffer. | |
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 () |
| 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. | |
| void | applyScreenFrustum () const |
| Apply a orthographic frustum for pixel-based 2D operations. | |
| virtual void | applyHeadTransform () const |
| Apply the modeling transformation to position and orient the view frustum. | |
| virtual void | applyFrameBufferObject () |
| Apply the current alternate frame buffer. | |
| 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. | |
Protected Member Functions | |
| void | attachToSession (const uint32_t id, const uint32_t instanceID, net::Session *session) |
| Called when object is attached to session. | |
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. | |
| void | bindFrameBuffer () |
| Rebind the current alternate rendering buffer. | |
| 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 | frameViewStart (const uint32_t frameID) |
| Start updating a destination channel. | |
| virtual void | frameViewFinish (const uint32_t frameID) |
| Finish updating a destination channel. | |
| virtual void | setupAssemblyState () |
| Setup the OpenGL state for a readback or assemble operation. | |
| virtual void | resetAssemblyState () |
| Reset the OpenGL state after an assembly operation. | |
Error information. | |
| void | setErrorMessage (const std::string &message) |
| Set a message why the last operation failed. | |
Friends | |
| class | Window |
Attributes | |
| enum | IAttribute { IATTR_HINT_STATISTICS, IATTR_HINT_SENDTOKEN, IATTR_FILL1, IATTR_FILL2, IATTR_ALL } |
| int32_t | getIAttribute (const IAttribute attr) const |
| static const std::string & | getIAttributeString (const IAttribute attr) |
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 46 of file lib/client/channel.h.
The drawable format defining the components used as an alternate drawable for this cannel.
| FBO_COLOR | Use FBO color attachment. |
| FBO_DEPTH | Use FBO depth attachment. |
| FBO_STENCIL | Use FBO stencil attachment. |
Definition at line 54 of file lib/client/channel.h.
| Channel::Channel | ( | Window * | parent | ) |
Constructs a new channel.
Reimplemented in eqPly::Channel.
Definition at line 60 of file lib/client/channel.cpp.
References eq::Window::_addChannel(), and EQINFO.

| Channel::~Channel | ( | ) | [virtual] |
Destructs the channel.
Reimplemented in eqPly::Channel.
Definition at line 75 of file lib/client/channel.cpp.
References eq::Window::_removeChannel(), and EQINFO.

| GLEWContext * Channel::glewGetContext | ( | ) |
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 161 of file lib/client/channel.cpp.
References eq::Window::glewGetContext().

| const std::string& eq::Channel::getName | ( | ) | const [inline] |
| uint32_t eq::Channel::getTasks | ( | ) | const [inline] |
Return the set of tasks this channel might execute in the worst case.
It is not guaranteed that all the tasks will be actually executed during rendering.
Definition at line 115 of file lib/client/channel.h.
| VisitorResult Channel::accept | ( | ChannelVisitor & | visitor | ) |
Traverse this channel and all children using a channel visitor.
| visitor | the visitor. |
Definition at line 172 of file lib/client/channel.cpp.
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 322 of file lib/client/channel.cpp.
References eq::RenderContext::frustum, eq::base::RefPtr< T >::get(), eq::RenderContext::ortho, and eq::net::Object::send().
Referenced by eqPly::Channel::configInit().


| const Vector3ub& eq::Channel::getUniqueColor | ( | ) | const [inline] |
Return a stable, unique color for this channel.
Definition at line 139 of file lib/client/channel.h.
Referenced by eqPly::Channel::frameClear(), frameClear(), and eqPly::Channel::frameDraw().

| const View * Channel::getView | ( | ) |
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 native view. During rendering operations, the view of the current destination channel, i.e., the channel this channel is rendering for, is returned.
Definition at line 603 of file lib/client/channel.cpp.
References eq::Pipe::getView(), and eq::RenderContext::view.
Referenced by eqPly::Channel::frameClear().


| const View * Channel::getNativeView | ( | ) |
Definition at line 609 of file lib/client/channel.cpp.
References eq::Pipe::getView(), and eq::RenderContext::view.

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

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

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

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

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

| const 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 is inaccurate because it neglects rounding of the pixel viewport done by the server.
Definition at line 510 of file lib/client/channel.cpp.
References eq::RenderContext::offset.
| const Frustumf & Channel::getFrustum | ( | ) | const |
Definition at line 530 of file lib/client/channel.cpp.
References eq::RenderContext::frustum.
Referenced by applyFrustum().

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

| const Viewport & Channel::getViewport | ( | ) | const |
Definition at line 500 of file lib/client/channel.cpp.
References eq::RenderContext::vp.
Referenced by getScreenFrustum().

| const Range & Channel::getRange | ( | ) | const |
Definition at line 540 of file lib/client/channel.cpp.
References eq::RenderContext::range.
| const Pixel & Channel::getPixel | ( | ) | const |
Definition at line 545 of file lib/client/channel.cpp.
References eq::RenderContext::pixel.
Referenced by getScreenFrustum().

| const Zoom & Channel::getZoom | ( | ) | const |
Definition at line 550 of file lib/client/channel.cpp.
References eq::RenderContext::zoom.
| Eye Channel::getEye | ( | ) | const |
Definition at line 555 of file lib/client/channel.cpp.
References eq::RenderContext::eye.
| const Matrix4f & Channel::getHeadTransform | ( | ) | const |
Definition at line 560 of file lib/client/channel.cpp.
References eq::RenderContext::headTransform.
Referenced by applyHeadTransform().

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

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

| Frustumf 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.
Definition at line 565 of file lib/client/channel.cpp.
References getPixel(), getPixelViewport(), getViewport(), eq::PixelViewport::getXEnd(), eq::PixelViewport::getYEnd(), eq::Viewport::h, eq::PixelViewport::h, eq::Viewport::w, eq::PixelViewport::w, eq::Viewport::x, eq::PixelViewport::x, eq::Viewport::y, and eq::PixelViewport::y.
Referenced by applyScreenFrustum().


| const Vector4i & Channel::getOverdraw | ( | ) | const |
For internal use only.
Undocumented - may not be supported in the future
Definition at line 582 of file lib/client/channel.cpp.
References eq::RenderContext::overdraw.
| void Channel::setMaxSize | ( | const Vector2i & | size | ) |
For internal use only.
Undocumented - may not be supported in the future
Definition at line 587 of file lib/client/channel.cpp.
| uint32_t Channel::getTaskID | ( | ) | const |
For internal use only.
Undocumented - may not be supported in the future
Definition at line 593 of file lib/client/channel.cpp.
References eq::RenderContext::taskID.
| void Channel::applyScreenFrustum | ( | ) | const |
Apply a orthographic frustum for pixel-based 2D operations.
One unit in the frustum corresponds to one pixel on the screen. The frustum is position wrt the canvas.
Definition at line 691 of file lib/client/channel.cpp.
References EQVERB, and getScreenFrustum().

| 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 707 of file lib/client/channel.cpp.
References eq::Event::CHANNEL_RESIZE, eq::ConfigEvent::data, eq::ResizeEvent::dh, eq::ResizeEvent::dw, EQWARN, eq::ResizeEvent::h, eq::net::ObjectVersion::id, eq::Event::originator, eq::Event::resize, eq::Config::sendEvent(), eq::Event::STATISTIC, eq::Event::type, eq::RenderContext::view, eq::Event::VIEW_RESIZE, and eq::ResizeEvent::w.
Referenced by addStatistic().


| void Channel::drawStatistics | ( | ) | [virtual] |
Draw a statistics overlay.
Definition at line 766 of file lib/client/channel.cpp.
References applyBuffer(), applyViewport(), eq::util::BitmapFont::draw(), eq::Window::drawFPS(), eq::Statistic::endTime, EQ_MAX, EQ_MIN, eq::Window::Window::ObjectManager::getDefaultFont(), eq::Window::getPixelViewport(), eq::Config::getStatistics(), eq::PixelViewport::getXEnd(), eq::PixelViewport::getYEnd(), eq::Statistic::idleTime, eq::Statistic::ratio, resetAssemblyState(), eq::Statistic::resourceName, setupAssemblyState(), eq::Statistic::startTime, eq::Statistic::totalTime, eq::Statistic::type, eq::PixelViewport::w, eq::PixelViewport::x, and eq::PixelViewport::y.

| void Channel::outlineViewport | ( | ) | [virtual] |
Outlines the current pixel viewport.
Definition at line 1069 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::attachToSession | ( | const uint32_t | id, | |
| const uint32_t | instanceID, | |||
| net::Session * | session | |||
| ) | [protected, virtual] |
Called when object is attached to session.
For internal use only.
Reimplemented from eq::net::Object.
Definition at line 81 of file lib/client/channel.cpp.
References eq::Window::getPipeThreadQueue(), and eq::net::Dispatcher::registerCommand().

| 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 372 of file lib/client/channel.h.
Referenced by frameStart().

| 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 379 of file lib/client/channel.h.
Referenced by frameFinish().

| 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 386 of file lib/client/channel.h.
Referenced by frameDrawFinish().

| bool Channel::configInit | ( | const uint32_t | initID | ) | [protected, virtual] |
Initialize this channel.
| initID | the init identifier. |
Reimplemented in eqPly::Channel.
Definition at line 183 of file lib/client/channel.cpp.
Referenced by eqPly::Channel::configInit().

| 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 423 of file lib/client/channel.h.
References startFrame().

| 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 436 of file lib/client/channel.h.
References releaseFrame().

| 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 449 of file lib/client/channel.h.
References releaseFrameLocal().

| void Channel::frameClear | ( | const uint32_t | frameID | ) | [protected, virtual] |
Clear the frame buffer.
| frameID | the per-frame identifier. |
Reimplemented in eqPly::Channel.
Definition at line 362 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. |
Reimplemented in eqPly::Channel.
Definition at line 378 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 392 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. |
Reimplemented in eqPly::Channel.
Definition at line 403 of file lib/client/channel.cpp.
References applyBuffer(), applyViewport(), eq::Window::getColorType(), getOutputFrames(), resetAssemblyState(), eq::Frame::setColorType(), setupAssemblyState(), eq::Frame::startReadback(), and eq::Frame::syncReadback().

| virtual void eq::Channel::frameViewStart | ( | const uint32_t | frameID | ) | [inline, protected, virtual] |
Start updating a destination channel.
Called on each destination channel, e.g., channels which are defined by a view/segment intersection, updating a part of a display.
| frameID | the per-frame identifier. |
Definition at line 491 of file lib/client/channel.h.
| virtual void eq::Channel::frameViewFinish | ( | const uint32_t | frameID | ) | [inline, protected, virtual] |
Finish updating a destination channel.
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.
Definition at line 501 of file lib/client/channel.h.
| 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 427 of file lib/client/channel.cpp.
References EQERROR, eq::Window::getPixelViewport(), eq::FrameBufferObject::getPixelViewport(), eq::PixelViewport::h, eq::PixelViewport::hasArea(), and eq::PixelViewport::w.
Referenced by drawStatistics(), frameAssemble(), frameReadback(), and outlineViewport().


| void Channel::setErrorMessage | ( | const std::string & | message | ) | [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 489 of file lib/client/channel.cpp.
0.9 by
1.5.8