ScEng::Node Class Reference

#include <node.h>

Inheritance diagram for ScEng::Node:

ScEng::Block List of all members.

Public Types

enum  DEPENDENCIES { ,
  NODE_PRS_DEPENDENCY, NODE_MATERIAL_DEPENDENCY, NODE_CHILDREN_DEPENDENCY, NODE_TRANSFORM_DEPENDENCY,
  NUM_DEPENDENCIES
}
enum  FLAGS { SEL = (1<<0), HIDDEN = (1<<1), USER_FLAGS = (1<<16) }

Public Member Functions

std::string GetClassName ()
BlockType GetBlockType ()
 Virtual function.
 Node (bool create_dependencies)
 ~Node ()
 Destructor.
int NumDependencies ()
void SetDependency (int id, Block *dependency)
BlockGetDependency (int id)
std::string GetDependencyName (int id)
 Gets the name for the specified dependency.
void SetObject (Object *_object)
ObjectGetNodeObject ()
 Returns the Object for this node.
void SetMaterial (Block *material)
MaterialGetMaterial ()
 Returns the material for this node.
void SetNumberOfChildren (int num_children)
 Sets the number of childs.
int GetNumberOfChildren ()
 Returns the number of childs.
void SetChild (int i_ch, Node *child_node)
NodeGetChild (int i_ch)
 Returns the specified child.
Status AddChild (Node *child_node)
 Adds the child_node to the children vector.
Status RemoveChild (Node *child_node)
 Removes the child_node from the children vector.
BlockClone ()
 Creates a duplicate of this block and all its depenedencies.
int Save (SceneSave *scene_save)
 Saves the info for this class.
int Load (SceneLoad *scene_load)
 Saves the info for this class.
int PostLoad ()
void DeleteThis ()
 Deletes this class.
void ActionBegin (int time, int action)
void ActionEnd (int time, int action)
void Update (int time)
GMT::Matrix3F GetAbsoluteTM (int time)
 Pleas add comments here.
void GetDecendants (std::vector< Node * > &nodes)
 Please add comments here.
void Evaluate (int time)
void CleanObjectHistory ()
void DependancyChanged (Block *dependancy, unsigned int message=0, unsigned int parameters=0)
NodeClone (int method, bool clone_children=false)

Public Attributes

GMT::Color color
 The color for this node.
Nodeparent
 A pointer for the parent of this node.
ObjectState os
 The final object representation is stored in this ObjectState.
ObjectHistory object_history
bool delete_history
BlockVectorchildren
 An array for the childs of this node.
Objectobject
 Please add comments here.
Matrix3FControllernode_prs
 The node´s TM.
Materialnode_mtl
 The node´s material.
NodeTransformnode_transform
 The node´s transform block. This block holds this node's PRS, and also a dependency to this node's parent's transform.

Static Public Attributes

static BlockType block_type

Detailed Description

The node class Please add comments here


Member Enumeration Documentation

enum ScEng::Node::DEPENDENCIES

Enum DEPENDENCIES Enums the differents types of dependency for this class

Enumerator:
NODE_PRS_DEPENDENCY  An Object dependency id.
NODE_MATERIAL_DEPENDENCY  DEPRECATED : Since 2007-08-21 the NodeTransform holds the prs. This is still here to keep compatibility with old scenes.
NODE_CHILDREN_DEPENDENCY  The material dependency id.
NODE_TRANSFORM_DEPENDENCY  The Children BlockVector dependency id.
NUM_DEPENDENCIES  The NodeTransform dependency id.

enum ScEng::Node::FLAGS

Enum FLAGS Enum all the possible states for this TriUVWMesh

Enumerator:
SEL  This is a selected vertex
HIDDEN  This is a hidden vertex
USER_FLAGS  User flags


Constructor & Destructor Documentation

ScEng::Node::Node ( bool  create_dependencies  ) 

Constructor Sets all pointers to NULL


Member Function Documentation

std::string ScEng::Node::GetClassName (  )  [virtual]

Returns the name for this class

Returns:
Returns "Node"

Implements ScEng::Block.

int ScEng::Node::NumDependencies (  )  [virtual]

Returns the number of dependencies return Returns NODE_NUM_FIXED_DEPENDENCYS plus the number of childs for this node

Implements ScEng::Block.

void ScEng::Node::SetDependency ( int  id,
Block dependency 
) [virtual]

Sets a Dependency Sets the dependency depending the id.

Implements ScEng::Block.

Block * ScEng::Node::GetDependency ( int  id  )  [virtual]

Returns a specific dependency

Returns:
If the id is equal to NODE_OBJECT_DEPENDENCY returns the object of this node

If the id is equal to NODE_PRS_DEPENDENCY returns the node_prs

If the id is equal to NODE_MATERIAL_DEPENDENCY returns the node_mtl

If the id is great than NODE_NUM_FIXED_DEPENDENCYS returns a child for this node

See also:
Block* SetDependency(int id, Block *dependency)

enum DEPENDENCIES

Implements ScEng::Block.

void ScEng::Node::SetObject ( Object _object  ) 

Sets the Object for this node Sets the object using MakeDependencyByID

Parameters:
object the Object to be set
See also:
Block::MakeDependencyByID

void ScEng::Node::SetMaterial ( Block material  ) 

Sets the material to this node Sets the material using MakeDependencyByID

Parameters:
material the Material to be set
See also:
Block::MakeDependencyByID

void ScEng::Node::SetChild ( int  i_ch,
Node child_node 
)

Sets a Child Sets a child using MakeDependencyByID

Parameters:
i_ch the id for the child
child_node the child to be set
See also:
Block::MakeDependencyByID

int ScEng::Node::PostLoad (  )  [virtual]

This virtual method is called after the scene has been loaded and the dependencies has been set. This method allows the blocks to perform any action when the scene is completely valid

Reimplemented from ScEng::Block.

void ScEng::Node::ActionBegin ( int  time,
int  action 
) [inline, virtual]

Informs the block that an action will begin

Parameters:
time the time at which the action begins. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::Node::ActionEnd ( int  time,
int  action 
) [inline, virtual]

Informs the block that an action will end.

Parameters:
time the time at which the action ends. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::Node::Update ( int  time  )  [inline, virtual]

Informs the block that it needs to update its data. For example, texture and material blocks usually move all their animated parameters from the data_table to int or float variables. This is specially useful when rendering, so there is no need to interpolate a data_value every time.

Parameters:
time the time at which the block needs to update its data.

Reimplemented from ScEng::Block.

void ScEng::Node::Evaluate ( int  time  ) 

Evaluates the node. If this node has an ModifiedObject, this function builds the final version of this object.

Parameters:
time the time when this Node is evaluated
See also:
ObjectHistory

void ScEng::Node::CleanObjectHistory (  ) 

This method cleans all the object history, reverting the base objects to their original state and setting the os.obj if needed.

void ScEng::Node::DependancyChanged ( Block dependancy,
unsigned int  message = 0,
unsigned int  parameters = 0 
) [virtual]

A block receives this message when one of its dependencies has changed.

Parameters:
dependency The dependancy that changed
message A message about the change

Reimplemented from ScEng::Block.

Node * ScEng::Node::Clone ( int  method,
bool  clone_children = false 
)

Clones this node.

Parameters:
method The method of this clone:</ br> Node::CLONE_COPY (0): clones this node's object and material as an independent copy</ br> Node::CLONE_INSTANCE (1): clones this node's object and material as an instance
clone_children If true, clones all the children.


Member Data Documentation

BlockType ScEng::Node::block_type [static]

The type of this block BlockType Node::block_type( BlockType::NODE, 0x00200000, 0x00000000 )

ObjectHistory ScEng::Node::object_history

The history of the object, this is all the steps and modifications it went through while being evaluated, is stored in this ObjectHistory.

bool ScEng::Node::delete_history

After the node is evaluated the history can be deleted. Deleting the history makes sense for nodes whose objects don't change along the scene scope.


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 10:49:22 2007 for SceneEngine by  doxygen 1.5.1-p1