|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::IModel Class ReferenceA base model.
More...
#include <mot.h>
Inheritance diagram for NL3D::IModel
[legend]Collaboration diagram for NL3D::IModel:
[legend]List of all members.
Detailed Description
A base model.
A model is the base structure for any node. The user directly manipulates Models implemented by the deriver.
The deriver must implement a notification system so observers can know if they must update themselves. This is done with a NLMISC::CBitSet TouchObs. Deriver may add Additional flags, or additional info which may serves just as hint, to not compute everything (eg: vertex interval...). In CMOT::validateModels(), for each model, do:
- update() the model.
- if the model is dirty:
DERIVERS RULES:
- Possibly Add his own TDirty state (see TDirty and TouchObs), and resize TouchObs (see IModel()).
- Implement the notification system (see update()/cleanTouch()), as descripted above.
The deriver may choose how to foul() himself: either automatic (on any mutator function), or by user (which may call a foul function). -
See also:
-
CMOT IObs ITrav
-
Author(s):
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 328 of file mot.h.
Member Typedef Documentation
Member Enumeration Documentation
enum NL3D::IModel::TDirty
|
|
|
The Dirty states.
Derived models may add flags with similar enum. The first enum element must begin at CBaseClass::Last (where CBaseClass is the base class), so falg compatibility is maintained. -
Enumeration values:
-
Reimplemented in NL3D::CTransform.
Definition at line 357 of file mot.h. |
Constructor & Destructor Documentation
NL3D::IModel::IModel (
|
) [protected]
|
|
|
Init a model.
The user must create a Model only with CMOT::createModel(). This is required since, CMOT::createModel() create observers for his traversals and link them to this created model.
The deriver should do a TouchObs.resize(Last) , to ensure he resize the BitSet correctly. The dervier should keep/declare ctor and dtor protected, to avoid user error (new and delete).
Definition at line 433 of file mot.cpp. |
NL3D::IModel::~IModel (
|
) [protected, virtual]
|
|
|
Destrutor.
Model's observers are deleted automatically. The user must delete a Model only with CMOT::deleteModel(). This ensure that model validity is correct during the life of CMOT.
The dervier should keep/declare ctor and dtor protected, to avoid user error (new and delete).
Definition at line 440 of file mot.cpp. |
Member Function Documentation
void NL3D::IModel::cleanTouch (
|
) [inline, protected, virtual]
|
|
|
This function must clean the Touch information of the model (called by CMOT::validateModels()) It is called AFTER his observers are validated according to him.
This function Must :
- call BaseClass::cleanTouch() (eg: IModel::cleanTouch()).
- maybe clean other Touch information (vertex intervals...).
NB: Touch bits are leared in validateModels().
The default behavior is just to clear flags of TouchObs, which may be sufficient, except if you have special touch information (eg: a vertex interval).
Definition at line 421 of file mot.h. |
void NL3D::IModel::foul (
|
uint flag ) [inline]
|
|
|
The derived model should call foul() in update() or other mutator functions.
Definition at line 365 of file mot.h. |
|
Get an observer according to his Traversal Id. NULL, if not found.
Definition at line 450 of file mot.cpp. |
void NL3D::IModel::update (
|
) [inline, protected, virtual]
|
|
|
This function must update the model (called by CMOT::validateModels()), and foul() necessary flags.
Must :
- call BaseClass::update() (eg: IModel::update()).
- test if something is different (eg: animation modification). update Model information (eg compute new Matrix).
- foul() good bits. (eg: foul(TransformDirty)).
- maybe set other Touch information (vertex intervals...).
The default behavior is to do nothing.
NB: Touch information is reseted after observers validation in CMOT::validateModels(), using Model::cleanTouch()
Reimplemented in NL3D::CCamera, and NL3D::CTransform.
Definition at line 405 of file mot.h. |
void NL3D::IModel::validate (
|
)
|
|
|
check if the model is modified, and if yes, update him and his observers.
Definition at line 469 of file mot.cpp. |
Friends And Related Function Documentation
Member Data Documentation
IObs * NL3D::IModel::LastObs [mutable, protected]
|
|
CObsMap NL3D::IModel::Observers [protected]
|
|
|
TouchObs say what part of the model has changed, so Observers can deal with this in Obs::update().
Definition at line 363 of file mot.h. |
The documentation for this class was generated from the following files:
|
|