|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CMOT Class ReferenceA composant server, and a traversal container.
More...
#include <mot.h>
Inheritance diagram for NL3D::CMOT
[legend]Collaboration diagram for NL3D::CMOT:
[legend]List of all members.
Detailed Description
A composant server, and a traversal container.
Register models and observers globally to the program with static registerModel() and registerObs(). This should be done at the begining of the program.
Before using a CMOT object, Add any traversals you want to support to your scene via addTrav().
Then, you can create any model for this scene with createModel(). The model will be valid for this scene only, since it has only the observers of scene's traversals. -
See also:
-
IModel IObs ITrav
-
Author(s):
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 159 of file mot.h.
Constructor & Destructor Documentation
Member Function Documentation
void NL3D::CMOT::addTrav (
|
ITrav * v )
|
|
|
Register a traversal and add it to the scene.
This is done by CSene object, and not globally. Hence, we can have different scene, which doesn't support the same traversals. Undefined result are excepted if you put two or more traversals of the same type in a scene. -
Parameters:
-
v
|
the traversal to be added. CMOT will never delete it (so the user should do). v->getId() must be the Unique ID of this traversal class. |
Reimplemented in NL3D::CScene.
Definition at line 102 of file mot.cpp. |
|
Create a model according to his type id.
Model must has been previously registered via registerModel(). This function create all necessary observers, according to the traversals registered with addTrav(), and registerObs(). If a model has no osberver specified for a given traversal Trav, then the father's one will be created. If no ancestor has defined an observer for this traversal, then Trav->createDefaultObs() is taken.
Then, this function attach those observers to the model.
Then, This function attach this model to the Root of all traversals (if not NULL).
Model are deleted with the CMOT::deleteModel() or with CMOT::release() which delete all models ans traversals. NB: Since CMOT own the model, model MUST NOT be used with SmartPtrs (but CRefPtr always work...). -
Parameters:
-
idModel
|
the Unique Id of the Model |
-
Returns:
-
a valid model of the required type. NULL, if not found.
-
See also:
-
deleteModel()
Definition at line 145 of file mot.cpp. |
void NL3D::CMOT::deleteModel (
|
IModel * model )
|
|
|
Delete a model via his pointer.
The model is automatically unlinked from all other model in all traversals, and his observers are automatically destroyed.
Once a model is deleted, all pointer to him should have been deleted.
Definition at line 195 of file mot.cpp. |
|
Get a traversal via its class id.
-
Parameters:
-
idTrav
|
the Trav Unique Id. |
-
Returns:
-
the traversal. NULL, if not found.
Definition at line 115 of file mot.cpp. |
|
Register a model, indicating from which he derive.
By default, model's observer are those of his father (idModelBase). -
Parameters:
-
idModel
|
the Unique Id of the registered model |
idModelBase
|
the Unique Id of the base calss of the registered model |
creator
|
the function which create the registered model. |
Definition at line 51 of file mot.cpp. |
|
Register an observer, for a given traversal and a given model.
If an observer was previously specified for the couple Trav/Model, he is replaced. -
Parameters:
-
idTrav
|
the Unique Id of the observer's traversal |
idModel
|
the Unique Id of the observer's model |
creator
|
the function which create the registered observer. |
Definition at line 67 of file mot.cpp. |
void NL3D::CMOT::release (
|
void )
|
|
|
release all the models and all the traversals created/registred.
Remind that Models are deleted, but not Traversals, since CMOT do not own traversals.
Reimplemented in NL3D::CScene.
Definition at line 128 of file mot.cpp. |
void NL3D::CMOT::validateModels (
|
)
|
|
|
Validate all models and observers.
All dirty models are cleaned, and so their observers. This should be called, before any ITrav traversal.
Definition at line 209 of file mot.cpp. |
Member Data Documentation
std::set< IModel *> NL3D::CMOT::Models [private]
|
|
std::vector< CTravEntry > NL3D::CMOT::Traversals [private]
|
|
The documentation for this class was generated from the following files:
|
|