ork::SceneNode Class Reference
[scenegraph]

A scene graph node. More...

#include <SceneNode.h>

Inheritance diagram for ork::SceneNode:
ork::Object

List of all members.

Public Types

typedef SetIterator< string > FlagIterator
 An iterator to iterate over a set of flags.
typedef MapIterator< string,
ptr< Value > > 
ValueIterator
 An iterator to iterate over a map of Value.
typedef MapIterator< string,
ptr< Module > > 
ModuleIterator
 An iterator to iterate over a map of Module.
typedef MapIterator< string,
ptr< MeshBuffers > > 
MeshIterator
 An iterator to iterate over a map of Mesh.
typedef MapIterator< string,
ptr< Object > > 
FieldIterator
 An iterator to iterate over a map of SceneNode fields.
typedef MapIterator< string,
ptr< Method > > 
MethodIterator
 An iterator to iterate over a map of SceneNode Method.

Public Member Functions

 SceneNode ()
 Creates an empty SceneNode.
virtual ~SceneNode ()
 Deletes this SceneNode.
ptr< SceneManagergetOwner ()
 Returns the SceneManager that manages the scene graph to which this node belongs.
mat4d getLocalToParent ()
 Returns the transformation from this node to its parent node.
void setLocalToParent (const mat4d &t)
 Sets the transformation from this node to its parent node.
mat4d getLocalToWorld ()
 Returns the transformation from this node to the root node.
mat4d getWorldToLocal ()
 Returns the transformation from the root node to this node.
mat4d getLocalToCamera ()
 Returns the transformation from this node to the camera node.
mat4d getLocalToScreen ()
 Returns the tranformation from this node to the screen.
box3d getLocalBounds ()
 Returns the bounding box of this node in local coordinates.
void setLocalBounds (const box3d &bounds)
 Sets the bounding box of this node in local coordinates.
box3d getWorldBounds ()
 Returns the bounding box of this node in world coordinates.
vec3d getWorldPos ()
 Returns the origin of the local reference frame in world coordinates.
FlagIterator getFlags ()
 Returns the flags of this node.
bool hasFlag (const string &flag)
 Returns true is this node has the given flag.
void addFlag (const string &flag)
 Adds the given flag to the flags of this node.
void removeFlag (const string &flag)
 Removes the given flag from the flags of this node.
ValueIterator getValues ()
 Returns the values of this node.
ptr< ValuegetValue (const string &name)
 Returns the value of this node whose local name is given.
void addValue (ptr< Value > value)
 Adds a value to this node under the given local name.
void removeValue (const string &name)
 Removes the value whose local name is given from this node.
ModuleIterator getModules ()
 Returns the modules of this node.
ptr< ModulegetModule (const string &name)
 Returns the module of this node whose local name is given.
void addModule (const string &name, ptr< Module > s)
 Adds a module to this node under the given local name.
void removeModule (const string &name)
 Removes the module whose local name is given from this node.
MeshIterator getMeshes ()
 Returns the meshes of this node.
ptr< MeshBuffersgetMesh (const string &name)
 Returns the mesh of this node whose local name is given.
void addMesh (const string &name, ptr< MeshBuffers > m)
 Adds a mesh to this node under the given local name.
void removeMesh (const string &name)
 Removes the mesh whose local name is given from this node.
FieldIterator getFields ()
 Returns the fields of this node.
ptr< ObjectgetField (const string &name)
 Returns the field of this node whose name is given.
void addField (const string &name, ptr< Object > f)
 Adds a field to this node under the given name.
void removeField (const string &name)
 Removes the field whose name is given from this node.
MethodIterator getMethods ()
 Returns the methods of this node.
ptr< MethodgetMethod (const string &name)
 Returns the method of this node whose name is given.
void addMethod (const string &name, ptr< Method > m)
 Adds a method to this node under the given name.
void removeMethod (const string &name)
 Removes the method whose name is given from this node.
unsigned int getChildrenCount ()
 Returns the number of child node of this node.
ptr< SceneNodegetChild (unsigned int index)
 Returns the child node of this node whose index is given.
void addChild (ptr< SceneNode > child)
 Adds a child node to this node.
void removeChild (unsigned int index)
 Removes a child node from this node.

Public Attributes

bool isVisible
 True if this scene node is visible, false otherwise.

Protected Member Functions

void swap (ptr< SceneNode > n)
 Swaps this scene node with the given one.

Detailed Description

A scene graph node.

A scene graph is a tree of generic scene nodes, where each node can be seen as an object with a state (fields) and a behavior (methods). The state is made of a reference frame (relatively to the parent node), some meshes, modules and uniforms (that can reference textures), and any other user defined values. The behavior is made of methods, completely defined by the user by combining basic tasks (draw a mesh, set a projection matrix, etc) with control structures (sequences, loops, etc).


Member Typedef Documentation

An iterator to iterate over a map of SceneNode fields.

An iterator to iterate over a set of flags.

An iterator to iterate over a map of Mesh.

An iterator to iterate over a map of SceneNode Method.

An iterator to iterate over a map of Module.

An iterator to iterate over a map of Value.


Constructor & Destructor Documentation

ork::SceneNode::SceneNode (  ) 

Creates an empty SceneNode.

virtual ork::SceneNode::~SceneNode (  )  [virtual]

Deletes this SceneNode.


Member Function Documentation

void ork::SceneNode::addChild ( ptr< SceneNode child  ) 

Adds a child node to this node.

Parameters:
child a child node.
void ork::SceneNode::addField ( const string &  name,
ptr< Object f 
)

Adds a field to this node under the given name.

Parameters:
name the field name.
f the field value.
void ork::SceneNode::addFlag ( const string &  flag  ) 

Adds the given flag to the flags of this node.

Parameters:
flag the flag to be added to this node.
void ork::SceneNode::addMesh ( const string &  name,
ptr< MeshBuffers m 
)

Adds a mesh to this node under the given local name.

Parameters:
name a local name.
m a MeshBuffers.
void ork::SceneNode::addMethod ( const string &  name,
ptr< Method m 
)

Adds a method to this node under the given name.

Parameters:
name the method name.
m the method.
void ork::SceneNode::addModule ( const string &  name,
ptr< Module s 
)

Adds a module to this node under the given local name.

Parameters:
name a local name.
s a Module.
void ork::SceneNode::addValue ( ptr< Value value  ) 

Adds a value to this node under the given local name.

Parameters:
value a value.
ptr<SceneNode> ork::SceneNode::getChild ( unsigned int  index  ) 

Returns the child node of this node whose index is given.

Parameters:
index a child node index between 0 and getChildrenCount - 1.
unsigned int ork::SceneNode::getChildrenCount (  ) 

Returns the number of child node of this node.

ptr<Object> ork::SceneNode::getField ( const string &  name  ) 

Returns the field of this node whose name is given.

Parameters:
name the name of a field.
FieldIterator ork::SceneNode::getFields (  ) 

Returns the fields of this node.

FlagIterator ork::SceneNode::getFlags (  ) 

Returns the flags of this node.

box3d ork::SceneNode::getLocalBounds (  ) 

Returns the bounding box of this node in local coordinates.

mat4d ork::SceneNode::getLocalToCamera (  ) 

Returns the transformation from this node to the camera node.

mat4d ork::SceneNode::getLocalToParent (  ) 

Returns the transformation from this node to its parent node.

mat4d ork::SceneNode::getLocalToScreen (  ) 

Returns the tranformation from this node to the screen.

This is the transformation from this node to the camera node, followed by the transformation from the camera space to the screen space (defined by the cameraToScreen mat4 uniform of the camera node).

mat4d ork::SceneNode::getLocalToWorld (  ) 

Returns the transformation from this node to the root node.

ptr<MeshBuffers> ork::SceneNode::getMesh ( const string &  name  ) 

Returns the mesh of this node whose local name is given.

Parameters:
name the local name of a mesh.
MeshIterator ork::SceneNode::getMeshes (  ) 

Returns the meshes of this node.

ptr<Method> ork::SceneNode::getMethod ( const string &  name  ) 

Returns the method of this node whose name is given.

Parameters:
name the name of a method.
MethodIterator ork::SceneNode::getMethods (  ) 

Returns the methods of this node.

ptr<Module> ork::SceneNode::getModule ( const string &  name  ) 

Returns the module of this node whose local name is given.

Parameters:
name the local name of a module.
ModuleIterator ork::SceneNode::getModules (  ) 

Returns the modules of this node.

ptr<SceneManager> ork::SceneNode::getOwner (  ) 

Returns the SceneManager that manages the scene graph to which this node belongs.

ptr<Value> ork::SceneNode::getValue ( const string &  name  ) 

Returns the value of this node whose local name is given.

Parameters:
name the local name of a value.
ValueIterator ork::SceneNode::getValues (  ) 

Returns the values of this node.

box3d ork::SceneNode::getWorldBounds (  ) 

Returns the bounding box of this node in world coordinates.

vec3d ork::SceneNode::getWorldPos (  ) 

Returns the origin of the local reference frame in world coordinates.

mat4d ork::SceneNode::getWorldToLocal (  ) 

Returns the transformation from the root node to this node.

bool ork::SceneNode::hasFlag ( const string &  flag  ) 

Returns true is this node has the given flag.

Parameters:
flag a flag.
void ork::SceneNode::removeChild ( unsigned int  index  ) 

Removes a child node from this node.

Parameters:
index a child node index between 0 and getChildrenCount - 1.
void ork::SceneNode::removeField ( const string &  name  ) 

Removes the field whose name is given from this node.

Parameters:
name the name of the field.
void ork::SceneNode::removeFlag ( const string &  flag  ) 

Removes the given flag from the flags of this node.

Parameters:
flag the flag to be removed from this node.
void ork::SceneNode::removeMesh ( const string &  name  ) 

Removes the mesh whose local name is given from this node.

Parameters:
name the local name of the mesh.
void ork::SceneNode::removeMethod ( const string &  name  ) 

Removes the method whose name is given from this node.

Parameters:
name the name of the method.
void ork::SceneNode::removeModule ( const string &  name  ) 

Removes the module whose local name is given from this node.

Parameters:
name the local name of the module.
void ork::SceneNode::removeValue ( const string &  name  ) 

Removes the value whose local name is given from this node.

Parameters:
name the local name of the value.
void ork::SceneNode::setLocalBounds ( const box3d bounds  ) 

Sets the bounding box of this node in local coordinates.

void ork::SceneNode::setLocalToParent ( const mat4d t  ) 

Sets the transformation from this node to its parent node.

Parameters:
t the new localToParent transformation.
void ork::SceneNode::swap ( ptr< SceneNode n  )  [protected]

Swaps this scene node with the given one.


Member Data Documentation

True if this scene node is visible, false otherwise.


Generated on Mon Oct 18 09:36:11 2010 for ork by  doxygen 1.6.1