Katana Plug-in APIs 0.1
Public Member Functions

SceneNode Class Reference

#include <SceneNode.h>

List of all members.

Public Member Functions

virtual bool preDraw ()
virtual void draw (FnAttribute::DoubleAttribute projectionMatrix, FnAttribute::DoubleAttribute viewMatrix)
 Draws with the passed matrices and the current global world matrix.
virtual void drawChildren (FnAttribute::DoubleAttribute projectionMatrix, FnAttribute::DoubleAttribute viewMatrix)
 Draws the children of this node.
virtual void pickerDraw (ViewportLayer &layer, GLShaderProgram &pickingShader, FnAttribute::DoubleAttribute projectionMatrix, FnAttribute::DoubleAttribute viewMatrix, std::set< std::string > &ignoreLocations)
 Draws a to the passed GLPicker using the current global world matrix.
virtual void pickerDrawChildren (ViewportLayer &layer, GLShaderProgram &pickingShader, FnAttribute::DoubleAttribute projectionMatrix, FnAttribute::DoubleAttribute viewMatrix, std::set< std::string > &ignoreLocations)
 Draws the node's children to to GLPicker frame buffer.
virtual void postDraw ()
 Reverts draw state changes and pops from the global world matrix.
void addChild (const std::string &name, SceneNode *child)
void removeChild (const std::string &name)
void removeAllChildren ()
 Removes all child nodes.
void setDirty (bool dirty)
 Sets the dirty flag to trigger resources to be reloaded if necessary.
bool isDirty () const
 Returns whether the node is dirty.
void setActive (bool active)
 Sets the active flag to determine whether the node should be drawn.
bool isActive () const
 Returns whether the node is active.
void setDrawable (DrawableMesh *drawable)
 Sets the drawable mesh to be used for this location.
void setAttributes (FnAttribute::GroupAttribute attr)
 Sets the attributes for this location from geolib3 for dirty checks.
void setXform (IMATH_NAMESPACE::M44d xform)
 TODO.
SceneNodegetChild (const std::string &name)
SceneNodegetParent ()
 Returns the parent scene node.
std::string getLocationPath () const
 Returns the scene graph location path that this node is associated with.
void invalidate ()
void invalidateChildren ()
 Invalidate all of the children of this node.
void clearGLResources ()

Detailed Description

This class is used to represent a single scene graph location and provide functionality that is useful for drawing the scene. Each node can have multiple child locations. When a locations data has been changed the node should be marked as dirty. The when dirty locations are encountered during a draw, then any invalid data will be re-initialized.

When a location is closed in Geolib3 the node should be set to inactive and the children invalidated, to release OpenGL resources. This will prevent the children of that node from being drawn, and free up memory.


Member Function Documentation

void SceneNode::addChild ( const std::string &  name,
SceneNode child 
)

Adds a child node with the specified name.

The name can be a posix-style path to allow children to be added deep in the hierarchy from the root node. All intermediate nodes must already exist.

void SceneNode::clearGLResources ( )

Releases any OpenGL resources held by this node and its children. This could be an expensive operation if there are many nodes.

SceneNode* SceneNode::getChild ( const std::string &  name)

Returns the named child node. As with addChild() the name can be a posix-style path.

void SceneNode::invalidate ( )

Invalidate this location and its children. This is used to release the geometry data from memory without, deleting the node tree topology (since Geolib3 doesn't make it easy to reload child locations when a locationOpened event occurs.

virtual bool SceneNode::preDraw ( ) [virtual]

Called before every draw() to ensure the mesh is setup, and to push transforms onto the global world matrix.

Returns true if the node should be drawn.

void SceneNode::removeChild ( const std::string &  name)

Remove the named child node from its parent.

As with addChild() the name can be a posix-style path.


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