#include <sceneengine.h>
Public Member Functions | |
| SceneEngine () | |
| ~SceneEngine () | |
| Destructor. | |
| Block * | GetBlock (void *ae) |
| void * | GetApplicationElement (Block *block) |
| void | CreateRelationship (Block *sb, void *ae) |
| void | InitBlocks (Block *block) |
| Please add comments here. | |
| void | SetIDToBlock (Block *block, int &id) |
| Please add comments here. | |
| void | SetBlockIDs () |
| Please add comments here. | |
| void | DestroyBlockLoadData () |
| Please add comments here. | |
| void | DeleteScene () |
| void | LoadBlocks (SceneLoad *scene_load) |
| Loads Binary Data. | |
| bool | SaveBlock (Block *block, SceneSave *scene_save) |
| Savess Binary Data. | |
| void | InitScene () |
| void | ResetScene () |
| int | SaveScene (const char *filename) |
| int | LoadScene (const char *filename) |
| int | MergeScene (const char *filename) |
| void | SetParentPointer (Node *node) |
| Status | SetParent (Node *parent_node, Node *child_node) |
| ScEng::Node * | CreateEmptyNode (GMT::Point3F position, const char *name) |
| ScEng::Node * | CreateEmptyNode (GMT::Matrix3F tm, const char *name) |
| void | UpdateDataTables (Block *block) |
| void | CallPostLoad (Block *block) |
| void | UpdateDataTables () |
| void | EnumBlock (Block *block, int &id, std::vector< Block * > &scene_blocks) |
| void | EnumBlocks (std::vector< Block * > &scene_blocks) |
| void | EvaluateNode (Node *node, int time) |
| void | EvaluateScene (int time, bool force_eval_all=false) |
| bool | ApplyModifierToNodes (std::vector< Node * > nodes, Modifier *mod) |
| void | GetAllChildrenNodes (Node *parent_node, std::vector< Node * > &all_nodes) |
| void | GetAllSceneNodes (std::vector< Node * > &all_nodes) |
| void | CleanObjectsHistory () |
| Cleans all the object_history of the nodes. | |
| void | SceneEngine::ReevaluateAllNodes (int t) |
Static Public Member Functions | |
| static void | DestroyFactories () |
| static void | StateRecorderInit () |
| Initializes that State Recorder by creating a new state_recorder. | |
| static void | StateRecorderDelete () |
| Deletes the State Recorder. | |
| static void | StateRecorderBegin () |
| Begins a new state_level in the state_recorder stack. | |
| static void | StateRecorderPut (StateContainer *obj) |
| Puts a container in the current state_level in the state_recorder stack. | |
| static void | StateRecorderRestore () |
| Restores the condition to the current stack_container. | |
| static void | StateRecorderCancel () |
| Cancels the current state_level and empties it. | |
| static bool | StateRecorderIsHolding () |
| static void | StateRecorderAccept (char *szLevelname) |
| Closes the current stack_level and sets the visible name for the undo-redo command. | |
| static bool | StateRecorderCanUndo () |
| static bool | StateRecorderCanRedo () |
| |
| static void | StateRecorderUndo () |
| Undoes the current stack_level. | |
| static void | StateRecorderRedo () |
| Redoes the next stack_level. | |
| static void | StateRecorderClear () |
| Removes all state containers from the stack. | |
Public Attributes | |
| std::vector< AppRelationships > | relationships |
| Please add comments here. | |
| std::vector< BlockLoadData * > | scload_blocks |
| Please add comments here. | |
| MainScene * | main_scene |
| Please add comments here. | |
| int | num_save_blocks |
| Please add comments here. | |
| int | num_load_blocks |
| Please add comments here. | |
Static Public Attributes | |
| static Log | log |
| The log for writing output to a text file. | |
| static std::vector< BlockFactory * > | block_factories |
| Please add comments here. | |
| static StateRecorder * | state_recorder |
Please add comments here
| ScEng::SceneEngine::SceneEngine | ( | ) |
Constructor The SceneEngine constructor doesn't initialise the scene. The main_scene element is set to NULL. This because the developer can either load a file, which loads all the blocks, including main_scene, or create a new scene from scratch. If you need to create a new scene, call SceneEngine::InitSceneEngine right after creating your scene.
| Block * ScEng::SceneEngine::GetBlock | ( | void * | ae | ) |
Returns a specific Block Searchs in the relationships array a Block related with the specified appliaction element.
| ae | the pointer to the application element |
| void * ScEng::SceneEngine::GetApplicationElement | ( | Block * | block | ) |
Returns a specific application element Searchs in the relationships array an appliaction element related with the specified Block.
| block | the pointer to the Block |
| void ScEng::SceneEngine::CreateRelationship | ( | Block * | sb, | |
| void * | ae | |||
| ) |
| static void ScEng::SceneEngine::DestroyFactories | ( | ) | [inline, static] |
This static method deletes all the factories. It should be called only at the end of the session when the application is shutting down.
| void ScEng::SceneEngine::DeleteScene | ( | ) |
Deletes the main scene. Note. This method removes all the blocks in SceneEngine starting from main_scene, but it doesn't delete the SceneEngine instance itself. The developer still have to do that himself.
| void ScEng::SceneEngine::InitScene | ( | ) |
Initializes the scene This function creates a new main_scene and assigns a Node called "Main Node" to the main_node of the scene.
| void ScEng::SceneEngine::ResetScene | ( | ) |
Resets the scene This function creates a new main_scene and assigns a Node called "Main Node" to the main_node of the scene.
| int ScEng::SceneEngine::SaveScene | ( | const char * | filename | ) |
Saves the scene to a file
| filename | the name for the file where the scene info will be stored |
| int ScEng::SceneEngine::LoadScene | ( | const char * | filename | ) |
Loads a scene from a file This method deletes the current scene and loads a new scene from file.
| filename | the name for the file where the scene is stored |
| int ScEng::SceneEngine::MergeScene | ( | const char * | filename | ) |
Merges a scene from a file into the current scene This method loads a scene from a file but without deleting the current scene.
| filename | the name for the file where the scene is stored |
| void ScEng::SceneEngine::SetParentPointer | ( | Node * | node | ) |
Fills all the parent pointers in all the children nodes below this node
| node | the parent node. All the children nodes below this one get their parent pointer set. |
Sets parent_node as the hierarchy parent for child_node This method also removes child_node from the children vector of any other block it has as parent
| Node * ScEng::SceneEngine::CreateEmptyNode | ( | GMT::Point3F | position, | |
| const char * | name | |||
| ) |
Creates an NULL node (no object) in the given position and with the given name.
| position | The position where the node is created. | |
| name | The name of the created node. |
| Node * ScEng::SceneEngine::CreateEmptyNode | ( | GMT::Matrix3F | tm, | |
| const char * | name | |||
| ) |
Creates an NULL node (no object) in the given transform space and with the given name.
| tm | The transformation matrix of the created node. | |
| name | The name of the created node. |
| void ScEng::SceneEngine::UpdateDataTables | ( | Block * | block | ) |
Updates all the data tables below and including the block.
The parent block from which the update process is gonna be started.
| void ScEng::SceneEngine::CallPostLoad | ( | Block * | block | ) |
Recursive method that traverses all the blocks in the scene calling Block::PostLoad. This method is called on the blocks in order from top to bottom of the DAG
| void ScEng::SceneEngine::UpdateDataTables | ( | ) |
Updates all the data tables in the scene.
Starts the Update process from main_scene.
| void ScEng::SceneEngine::EnumBlock | ( | Block * | block, | |
| int & | id, | |||
| std::vector< Block * > & | scene_blocks | |||
| ) |
Fills the scene_blocks vector with all the blocks that are dependencies of the given block.
Starts the Update process from main_scene.
| void ScEng::SceneEngine::EnumBlocks | ( | std::vector< Block * > & | scene_blocks | ) |
Fills the scene_blocks vector with all the blocks in the scene.
Starts the Update process from main_scene.
| void ScEng::SceneEngine::EvaluateNode | ( | Node * | node, | |
| int | time | |||
| ) |
Evaluates the node to have the most updated version.
| node | The node to be evaluated. | |
| time | The time at which the scene is evaluated. |
| void ScEng::SceneEngine::EvaluateScene | ( | int | time, | |
| bool | force_eval_all = false | |||
| ) |
Evaluates all nodes and blocks in the scene to have the most updated version.
| time | The time at which the scene is evaluated. | |
| force_eval_all | If true, all nodes and blocks are rebuilt again, everything is processed. |
| bool ScEng::SceneEngine::ApplyModifierToNodes | ( | std::vector< Node * > | nodes, | |
| Modifier * | mod | |||
| ) |
Applies a modifier to a node.
| nodes | The nodes that get the modifier applied. | |
| mod | The modifier to be applied to the node. return Returns true if the modifier was applied to the node, false if it wasn't applied. If the modifier was not applied to the node, then the caller of this function must delete the modifier. If the modifier was applied, SceneEngine takes control of that modifier and the caller cannot delete it. |
| void ScEng::SceneEngine::GetAllChildrenNodes | ( | Node * | parent_node, | |
| std::vector< Node * > & | all_nodes | |||
| ) |
Returns in the all_nodes table all the nodes that are descendants of the parent node.
The parent_node is not included in the all_nodes vector, only its descendants.
| parent_node,: | The node whose all descendats this function returns. | |
| all_nodes,: | A vector where all descendants nodes are returned. |
| void ScEng::SceneEngine::GetAllSceneNodes | ( | std::vector< Node * > & | all_nodes | ) |
Returns in the all_nodes table all the nodes in the scene.
| all_nodes,: | A vector where all the nodes are returned. |
| void ScEng::SceneEngine::SceneEngine::ReevaluateAllNodes | ( | int | t | ) |
Reevaluates all the nodes at the time t.
| t | the time at which all nodes will be evaluated. |
| bool ScEng::SceneEngine::StateRecorderIsHolding | ( | ) | [static] |
| bool ScEng::SceneEngine::StateRecorderCanUndo | ( | ) | [static] |
StateRecorder * ScEng::SceneEngine::state_recorder [static] |
The undo-redo system is implemented using this class. This is a static member and only gets initialized (new) using StateRecorderInit()
1.5.1-p1