eq::Channel Class Reference

#include <channel.h>

Inheritance diagram for eq::Channel:

Inheritance graph
[legend]
Collaboration diagram for eq::Channel:

Collaboration graph
[legend]

List of all members.


Detailed Description

A channel represents a two-dimensional viewport within a Window.

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
WindowgetWindow () const
PipegetPipe () const
NodegetNode () const
ConfiggetConfig () 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 ViewgetView () 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 ColorMaskgetDrawBufferMask () const
const PixelViewportgetPixelViewport () 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 ViewportgetViewport () const
const RangegetRange () const
const PixelgetPixel () 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.

Member Function Documentation

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.

Returns:
the extended OpenGL function table for the channel's OpenGL context.

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.

Parameters:
visitor the visitor.
Returns:
the result of the visitor traversal.

Definition at line 78 of file lib/client/channel.h.

References eq::ChannelVisitor::visit().

Referenced by eq::Window::accept().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the caller graph for this function:

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.

Returns:
the channel's view, or 0 if it does not have a view.

Definition at line 106 of file lib/client/channel.h.

Referenced by processEvent().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

uint32_t Channel::getDrawBuffer (  )  const

Returns:
the channel's current draw buffer.

Definition at line 353 of file lib/client/channel.cpp.

References eq::RenderContext::buffer.

Referenced by applyBuffer().

Here is the caller graph for this function:

uint32_t Channel::getReadBuffer (  )  const

Returns:
the channel's current read buffer.

Definition at line 358 of file lib/client/channel.cpp.

References eq::RenderContext::buffer.

Referenced by applyBuffer().

Here is the caller graph for this function:

const ColorMask & Channel::getDrawBufferMask (  )  const

Returns:
the channel's current color mask for drawing.

Definition at line 363 of file lib/client/channel.cpp.

References eq::RenderContext::drawBufferMask.

Referenced by applyColorMask(), and eq::Compositor::setupStencilBuffer().

Here is the caller graph for this function:

const PixelViewport & Channel::getPixelViewport (  )  const

Returns:
the channel's current pixel viewport.

Definition at line 343 of file lib/client/channel.cpp.

References eq::RenderContext::pvp.

Referenced by applyViewport(), getScreenFrustum(), and outlineViewport().

Here is the caller graph for this function:

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.

Returns:
the channel's current position wrt the destination channel.

Definition at line 348 of file lib/client/channel.cpp.

References eq::RenderContext::offset.

const vmml::Frustumf & Channel::getFrustum (  )  const

Returns:
the perspectivefrustum for the current rendering task.

Definition at line 368 of file lib/client/channel.cpp.

References eq::RenderContext::frustum.

Referenced by applyFrustum().

Here is the caller graph for this function:

const vmml::Frustumf & Channel::getOrtho (  )  const

Returns:
the orthographics frustum for the current rendering task.

Definition at line 373 of file lib/client/channel.cpp.

References eq::RenderContext::ortho.

Referenced by applyOrtho().

Here is the caller graph for this function:

const Viewport & Channel::getViewport (  )  const

Returns:
the fractional viewport wrt the destination.

Definition at line 338 of file lib/client/channel.cpp.

References eq::RenderContext::vp.

const Range & Channel::getRange (  )  const

Returns:
the database range for the current rendering task.

Definition at line 378 of file lib/client/channel.cpp.

References eq::RenderContext::range.

const Pixel & Channel::getPixel (  )  const

Returns:
the pixel decomposition for the current rendering task.

Definition at line 383 of file lib/client/channel.cpp.

References eq::RenderContext::pixel.

Referenced by getScreenFrustum().

Here is the caller graph for this function:

Eye Channel::getEye (  )  const

Returns:
the currently rendered eye pass.

Definition at line 388 of file lib/client/channel.cpp.

References eq::RenderContext::eye.

const vmml::Matrix4f & Channel::getHeadTransform (  )  const

Returns:
the view transformation to position and orient the view frustum.

Definition at line 393 of file lib/client/channel.cpp.

References eq::RenderContext::headTransform.

Referenced by applyHeadTransform().

Here is the caller graph for this function:

const FrameVector& eq::Channel::getInputFrames (  )  [inline]

Returns:
the list of input frames, used from frameAssemble().

Definition at line 168 of file lib/client/channel.h.

Referenced by frameAssemble().

Here is the caller graph for this function:

const FrameVector& eq::Channel::getOutputFrames (  )  [inline]

Returns:
the list of output frames, used from frameReadback().

Definition at line 171 of file lib/client/channel.h.

Referenced by frameReadback().

Here is the caller graph for this function:

const vmml::Vector2i & Channel::getScreenOrigin (  )  const

Returns:
the position of this channel wrt the 2D virtual screen.

Definition at line 398 of file lib/client/channel.cpp.

References eq::RenderContext::screenOrigin.

Referenced by getScreenFrustum().

Here is the caller graph for this function:

vmml::Vector2i Channel::getScreenSize (  )  const

Returns:
the size of the 2D virtual screen.

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

Returns:
the 2D orthographic frustum for the 2D virtual screen.
See also:
getScreenOrigin, getPixelViewport, getPixel

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Parameters:
event the received event.
Returns:
true when the event was handled, false if not.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void Channel::drawStatistics (  )  [virtual]

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

void eq::Channel::startFrame ( const uint32_t  frameNumber  )  [inline, protected]

Start a frame by unlocking all child resources.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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().

Parameters:
frameID the per-frame identifier.
frameNumber the frame to start.
See also:
Config::beginFrame()

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().

Parameters:
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.

Parameters:
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.

Parameters:
frameID the per-frame identifier.

Definition at line 213 of file lib/client/channel.cpp.

References applyBuffer(), applyViewport(), and getUniqueColor().

Here is the call graph for this function:

void Channel::frameDraw ( const uint32_t  frameID  )  [protected, virtual]

Draw the scene.

Parameters:
frameID the per-frame identifier.

Definition at line 229 of file lib/client/channel.cpp.

References applyBuffer(), applyFrustum(), applyHeadTransform(), and applyViewport().

Here is the call graph for this function:

void Channel::frameAssemble ( const uint32_t  frameID  )  [protected, virtual]

Assemble input frames.

Parameters:
frameID the per-frame identifier.
See also:
getInputFrames

Definition at line 243 of file lib/client/channel.cpp.

References applyBuffer(), applyViewport(), eq::Compositor::assembleFrames(), getInputFrames(), resetAssemblyState(), and setupAssemblyState().

Here is the call graph for this function:

void Channel::frameReadback ( const uint32_t  frameID  )  [protected, virtual]

Read back the rendered scene.

Parameters:
frameID the per-frame identifier.
See also:
getOutputFrames

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
message the error message.

Definition at line 425 of file lib/client/channel.h.


The documentation for this class was generated from the following files:
Generated on Sat Dec 6 12:01:44 2008 for Equalizer 0.6 by  doxygen 1.5.5