|
|
|
|
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:
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:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 258 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 301 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 464 of file mot.cpp.
References _NextModelToValidate, _OwnerMot, _PrecModelToValidate, Last, LastClassId, LastObs, NLMISC::CBitSet::resize, and TouchObs.
Referenced by NL3D::CSkeletonModel::bindSkin, NL3D::CWaveMakerModel::creator, NL3D::CWaterModel::creator, NL3D::CVegetableBlendLayerModel::creator, NL3D::CTransformShape::creator, NL3D::CTransform::creator, NL3D::CSkipModel::creator, NL3D::CSkeletonModel::creator, NL3D::CSegRemanence::creator, NL3D::CRootModel::creator, NL3D::CQuadGridClipCluster::creator, NL3D::CPointLightModel::creator, NL3D::CParticleSystemModel::creator, NL3D::CMeshMultiLodInstance::creator, NL3D::CMeshMRMInstance::creator, NL3D::CMeshInstance::creator, NL3D::CMeshBaseInstance::creator, NL3D::CLandscapeModel::creator, NL3D::CFlareModel::creator, NL3D::CCoarseMeshManager::creator, NL3D::CCluster::creator, and NL3D::CCamera::creator. |
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 475 of file mot.cpp.
References Observers, and unlinkFromValidateList. |
Member Function Documentation
virtual 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 373 of file mot.h.
References NLMISC::CBitSet::clearAll.
Referenced by validate. |
void NL3D::IModel::foul |
( |
uint |
flag |
) |
[inline] |
|
|
Get an observer according to his Traversal Id. NULL, if not found.
Definition at line 489 of file mot.cpp.
References LastClassId, LastObs, and Observers.
Referenced by NL3D::CCluster::getClipObs, NL3D::CTransform::getLoadBalancingGroup, NL3D::CParticleSystemModel::getWorldMatrix, NL3D::CVegetableBlendLayerModel::initModel, NL3D::CTransform::initModel, NL3D::CSkeletonModel::initModel, NL3D::CPointLightModel::initModel, NL3D::CSegRemanence::samplePos, and NL3D::CTransform::setLoadBalancingGroup. |
virtual void NL3D::IModel::initModel |
( |
|
) |
[inline, protected, virtual] |
|
|
Extra init for a model.
this method is called by the framework at the very end of CMOT::createModel() Warning! if the model is a CTransformShape, then when initModel() is called, Shape and other related member/setup of IShape::createInstance() are not yet done (because createModel() is called at the begining in createInstance()).
Because initModel() is called at the very end, deriver could implement anything like creating other models, but not deleting this model...
Default behavior is to do nothing.
Reimplemented in NL3D::CLandscapeModel.
Definition at line 281 of file mot.h. |
void NL3D::IModel::linkToValidateList |
( |
|
) |
[protected] |
|
void NL3D::IModel::unlinkFromValidateList |
( |
|
) |
[protected] |
|
virtual 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.
Definition at line 357 of file mot.h.
Referenced by validate. |
void NL3D::IModel::validate |
( |
|
) |
|
|
Friends And Related Function Documentation
friend class CMOT [friend]
|
|
friend class IObs [friend]
|
|
friend class ITrav [friend]
|
|
Member Data Documentation
IModel* NL3D::IModel::_NextModelToValidate [protected]
|
|
CMOT* NL3D::IModel::_OwnerMot [protected]
|
|
IModel* NL3D::IModel::_PrecModelToValidate [protected]
|
|
IObs* NL3D::IModel::LastObs [protected]
|
|
CObsMap NL3D::IModel::Observers [protected]
|
|
The documentation for this class was generated from the following files:
|
|