#include <node.h>
Inheritance diagram for ScEng::Node:

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) |
| Block * | GetDependency (int id) |
| std::string | GetDependencyName (int id) |
| Gets the name for the specified dependency. | |
| void | SetObject (Object *_object) |
| Object * | GetNodeObject () |
| Returns the Object for this node. | |
| void | SetMaterial (Block *material) |
| Material * | GetMaterial () |
| 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) |
| Node * | GetChild (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. | |
| Block * | Clone () |
| 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) |
| Node * | Clone (int method, bool clone_children=false) |
Public Attributes | |
| GMT::Color | color |
| The color for this node. | |
| Node * | parent |
| 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 |
| BlockVector * | children |
| An array for the childs of this node. | |
| Object * | object |
| Please add comments here. | |
| Matrix3FController * | node_prs |
| The node´s TM. | |
| Material * | node_mtl |
| The node´s material. | |
| NodeTransform * | node_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 |
Enum DEPENDENCIES Enums the differents types of dependency for this class
| 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
| ScEng::Node::Node | ( | bool | create_dependencies | ) |
Constructor Sets all pointers to NULL
| std::string ScEng::Node::GetClassName | ( | ) | [virtual] |
| 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.
| id | the id for the dependency | |
| dependency | the dependency out |
enum DEPENDENCIES
Implements ScEng::Block.
| Block * ScEng::Node::GetDependency | ( | int | id | ) | [virtual] |
Returns a specific dependency
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
enum DEPENDENCIES
Implements ScEng::Block.
| void ScEng::Node::SetObject | ( | Object * | _object | ) |
Sets the Object for this node Sets the object using MakeDependencyByID
| object | the Object to be set |
| void ScEng::Node::SetMaterial | ( | Block * | material | ) |
Sets the material to this node Sets the material using MakeDependencyByID
| material | the Material to be set |
| void ScEng::Node::SetChild | ( | int | i_ch, | |
| Node * | child_node | |||
| ) |
Sets a Child Sets a child using MakeDependencyByID
| i_ch | the id for the child | |
| child_node | the child to be set |
| 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
| 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.
| 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.
| 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.
| time | the time when this Node is evaluated |
| 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.
| 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.
| 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. |
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.
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.
1.5.1-p1