Katana Plug-in APIs 0.1
Public Member Functions | Static Public Member Functions

BallLayer Class Reference

Inheritance diagram for BallLayer:
Foundry::Katana::ViewerAPI::ViewportLayer Foundry::Katana::ViewerAPI::ViewportLayerPluginBase

List of all members.

Public Member Functions

void setup ()
 Initializes the GL components of the ViewportLayer.
void cleanup ()
 Cleans up the ViewportLayer resources.
void draw ()
 Draws the scene.
void pickerDraw (unsigned int x, unsigned int y, unsigned int w, unsigned int h, const PickedAttrsMap &ignoreAttrs)
 Draws an ID pass to be used by the optional internal picking.
bool usesPickingOnHover ()
 Tells if the layer picks objects when the mouse is hovering them.
void resize (unsigned int width, unsigned int height)
 Processes viewport resizing.
void freeze ()
 Freezes the ViewportLayer when the viewport widget is hidden.
void thaw ()
 Thaws the ViewportLayer when the viewport widget is shown.

Static Public Member Functions

static ViewportLayercreate ()
 Returns a new instance of BallLayer.

Member Function Documentation

void BallLayer::cleanup ( ) [inline, virtual]

Cleans up the ViewportLayer resources.

Called when a ViewportLayer is removed by the ViewerDelegate.

Implements Foundry::Katana::ViewerAPI::ViewportLayer.

void BallLayer::draw ( ) [virtual]

Draws the scene.

Called when the scene needs to be drawn in the correct GL context. In a non-GL renderer the generated image should be drawn in the GL framebuffer in order to be displayed. This will be also propagated through the ViewerLayers of this ViewportLayer.

This function is exposed in the ViewportLayer Python class.

Implements Foundry::Katana::ViewerAPI::ViewportLayer.

void BallLayer::freeze ( ) [inline, virtual]

Freezes the ViewportLayer when the viewport widget is hidden.

Allows the ViewportLayer to freeze its activities when the viewport is not visible. This allows the ViewerDelegate to stop any kind of unecessary processing that might happen during that time.

Implements Foundry::Katana::ViewerAPI::ViewportLayer.

void BallLayer::pickerDraw ( unsigned int  x,
unsigned int  y,
unsigned int  w,
unsigned int  h,
const PickedAttrsMap ignoreAttrs 
) [virtual]

Draws an ID pass to be used by the optional internal picking.

This allows this layer to make use of the internal ID framebuffer pass technique provided to the Viewport and ViewportLayers. This function should draw all the pickable objects into the current GL framebuffer using an ID color. Inside this function each pickable object has to be registered using addPickableObject(), which will return a FnPickId. This id can be converted into a color using pickIdToColor() (see FnPickingTypes.h), the objects should be rendered without any kind of antialiasing and with that flat color, so that they cover their pickable pixels.

This will be called by Katana if customPick() returns false or if it is not implemented.

This function receives a list of Attributes that refer to pickable objects to be ignored in this render. This is internally used to do a multi-pass id render for deep picking, in which an onion peeling technique is used to detect all the occluded objects. On each iteration this function should not render the objects that were detected in previous iterations. These Attributes correspond to the ones passed previously to addPickableObject().

Parameters:
xThe region origin X component in viewport pixels.
yThe region origin Y component in viewport pixels.
wThe region width in viewport pixels.
hThe region height in viewport pixels.
ignoreAttrsMap that contains information about the objects that should not be rendered here. PickedAttrsMap has the same public interface as std::map<FnPickId, FnAttributes::Attribute>.

Reimplemented from Foundry::Katana::ViewerAPI::ViewportLayer.

void BallLayer::resize ( unsigned int  width,
unsigned int  height 
) [virtual]

Processes viewport resizing.

Called when the viewport widget is resized. This can be extended by sub-clases to accomodate viewport size changes in the renderer.

Implements Foundry::Katana::ViewerAPI::ViewportLayer.

void BallLayer::setup ( ) [virtual]

Initializes the GL components of the ViewportLayer.

Called when a ViewportLayer is created. It runs inside the correct GL context. Can be used to initialize anything GL related. For example, in the case of an OpenGL renderer this function should set up any required OpenGL context rendering flags, defining display lists, etc.

This function is exposed in the Viewport Python class.

Implements Foundry::Katana::ViewerAPI::ViewportLayer.

void BallLayer::thaw ( ) [inline, virtual]

Thaws the ViewportLayer when the viewport widget is shown.

Allows the ViewportLayer to restart its activities when the viewport becomes visible. This restarts the activities paused by freeze().

This function is exposed in the Viewport Python class.

Implements Foundry::Katana::ViewerAPI::ViewportLayer.

bool BallLayer::usesPickingOnHover ( ) [inline]

Tells if the layer picks objects when the mouse is hovering them.

This returns the value passed to the ViewportLayer's constructor argument usePickingOnHover. This leads to pickerDraw() to be called right after any draw() call, so that each frame produces the correct pickable IDs pass internall. This will not happen if customPick() is implemented and returns true.

Reimplemented from Foundry::Katana::ViewerAPI::ViewportLayer.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator