|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::IObs Class ReferenceA base observer.
More...
#include <mot.h>
Inheritance diagram for NL3D::IObs:
List of all members.
Public Methods |
| IObs () |
virtual | ~IObs () |
| ~IObs() must destroy correclty the father/son links (with call to virtual delChild() delParent()). More...
|
virtual void | init () |
| This is called at the end of createModel(). More...
|
|
BASIC EXTENSION: Although All those methods may be extended, it may be a hard work.
So if an observer just want to choose beetween being a tree Node (which has only one parent) or being a Graph node, it may just implement the isTreeNode() method which return true by default.
ADVANCED EXTENSION: the deriver may implement the way this observer is linked to the traversal graph.
The deriver must use list<> IObs::SonList and IObs::FatherList and set<> IObs::SonMap and IObs::FatherMap in the same way the default implementation use them.
We cut the behavior into two ways: addParent and addChild() (and their respective del*() function). We must do this since some observers may link to sons in a particualr way (Z-list ...), and some others may link to parents in a particular way (such as tree node which want to delete their old parent).
ITrav::link() and ITrav::unlink() will call the correct functions:
o1->addChild(o2); o2->addParent(o1);
If the deriver store the links to sons / fathers in a particular way, it must destroy them in his destructor. NB: in all case, get*() are NOT virtual because of speed consideration.
|
virtual bool | isTreeNode () |
| For standard behavior, just modify this method, to have a TreeNode behavior or a graphNode behavior. Default: true. More...
|
virtual void | addChild (IObs *son) |
| This function SHOULD JUST add son to the son list. If son was already a son, no-op. More...
|
virtual void | delChild (IObs *son) |
| This function SHOULD JUST delete son from the son list. If son is not a son, no-op. More...
|
virtual void | addParent (IObs *father) |
| This function SHOULD JUST add father to the parent list. More...
|
virtual void | delParent (IObs *father) |
| This function SHOULD JUST delete father from the parent list. If father is not a parent, no-op. More...
|
sint | getNumChildren () const |
| Get the number of children. More...
|
IObs * | getFirstChild () const |
| Return the first child of the observer. NULL returned if not found. More...
|
IObs * | getNextChild () const |
| Return the next child of the observer. NULL returned if not found. Unpredictible results if insertions/deletions are made between a getFirstChild() / getNextChild(). More...
|
sint | getNumParents () const |
| Get the number of parent. More...
|
IObs * | getFirstParent () const |
| Return the first parent of the observer. NULL returned if not found. More...
|
IObs * | getNextParent () const |
| Return the next parent of the observer. NULL returned if not found. Unpredictible results if insertions/deletions are made between a getFirstParent() / getNextParent(). More...
|
|
virtual void | traverse (IObs *caller)=0 |
| Traverse this observer. More...
|
|
virtual void | update () |
| This function must update the observer, according to his model's Touch information and the Model data. More...
|
|
void | traverseSons () |
| Do traverse() for all sons of this observer. More...
|
IObs * | getObs (const NLMISC::CClassId &idTrav) const |
| Get the observer for an other view, via IModel. More...
|
Public Attributes |
IModel * | Model |
ITrav * | Trav |
Protected Types |
typedef std::list< IObs * > | TObsList |
typedef TObsList::iterator | ItObsList |
typedef TObsList::const_iterator | ConstItObsList |
typedef std::map< IObs *,
ItObsList > | TObsMap |
typedef TObsMap::iterator | ItObsMap |
Protected Attributes |
TObsList | SonList |
TObsList | FatherList |
TObsMap | SonMap |
TObsMap | FatherMap |
sint | NumFathers |
sint | NumSons |
ConstItObsList | CurSonIt |
ConstItObsList | CurFatherIt |
Detailed Description
A base observer.
An observer is a link beetween a Model and a Traversal. It may implement the behavior of the model for this particular traversal. Only deriver have access to /implement observers. Users don't manipulate observers.
IObs define:
- graph methods to link/unlink to observers. Read carefully this section.
- a notification system (see IModel for an explanation)
- an interface for traversal to traverse() this observer.
DERIVERS RULES:
- Implement the notification system: Just extend update().
- Implement the traverse() method
- Possibly Extend/Modify the graph methods (see isTreeNode(), addParent() ...).
- Possibly Extend/Modify the init() method.
Since Models are created with CMOT::createModel(), an observer is never alone, he always has a Model and a ITrav. -
See also:
-
CMOT IModel ITrav
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 411 of file mot.h.
Member Typedef Documentation
typedef TObsList::const_iterator NL3D::IObs::ConstItObsList [protected]
|
|
typedef TObsList::iterator NL3D::IObs::ItObsList [protected]
|
|
typedef TObsMap::iterator NL3D::IObs::ItObsMap [protected]
|
|
typedef std::list<IObs*> NL3D::IObs::TObsList [protected]
|
|
typedef std::map<IObs *, ItObsList> NL3D::IObs::TObsMap [protected]
|
|
Constructor & Destructor Documentation
|
Definition at line 584 of file mot.cpp.
References CurFatherIt, CurSonIt, FatherList, Model, NumFathers, NumSons, SonList, and Trav.
Referenced by NL3D::IBaseHrcObs::addParent, NL3D::CWaveMakerDetailObs::creator, NL3D::CWaterRenderObs::creator, NL3D::CVegetableBlendLayerRenderObs::creator, NL3D::CVegetableBlendLayerClipObs::creator, NL3D::CTransformShapeLoadBalancingObs::creator, NL3D::CTransformShapeRenderObs::creator, NL3D::CTransformShapeClipObs::creator, NL3D::CTransformLightObs::creator, NL3D::CTransformRenderObs::creator, NL3D::CTransformAnimDetailObs::creator, NL3D::CTransformClipObs::creator, NL3D::CTransformHrcObs::creator, NL3D::CSkipModelRenderObs::creator, NL3D::CSkipModelLightObs::creator, NL3D::CSkipModelLoadBalancingObs::creator, NL3D::CSkipModelAnimDetailObs::creator, NL3D::CSkipModelClipObs::creator, NL3D::CSkipModelHrcObs::creator, NL3D::CSkeletonModelRenderObs::creator, NL3D::CSkeletonModelAnimDetailObs::creator, NL3D::CSegRemanenceAnimDetailObs::creator, NL3D::CRootModelRenderObs::creator, NL3D::CRootModelLightObs::creator, NL3D::CRootModelLoadBalancingObs::creator, NL3D::CRootModelAnimDetailObs::creator, NL3D::CRootModelClipObs::creator, NL3D::CRootModelHrcObs::creator, NL3D::CQuadGridClipClusterClipObs::creator, NL3D::CPointLightModelLightObs::creator, NL3D::CParticleSystemRenderObs::creator, NL3D::CParticleSystemClipObs::creator, NL3D::CParticleSystemDetailObs::creator, NL3D::CMeshMultiLodBalancingObs::creator, NL3D::CMeshMultiLodClipObs::creator, NL3D::CMeshBaseInstanceAnimDetailObs::creator, NL3D::CFlareRenderObs::creator, NL3D::CCoarseMeshClipObs::creator, NL3D::CClusterClipObs::creator, NL3D::CClusterHrcObs::creator, NL3D::IBaseClipObs::forceClip, getFirstChild, getFirstParent, getNextChild, getNextParent, NL3D::CTransformRenderObs::traverse, NL3D::CDefaultLoadBalancingObs::traverse, NL3D::CDefaultHrcObs::traverse, NL3D::CDefaultRenderObs::traverse, NL3D::CDefaultLightObs::traverse, NL3D::CDefaultClipObs::traverse, NL3D::CDefaultAnimDetailObs::traverse, traverseSons, and ~IObs. |
NL3D::IObs::~IObs |
( |
|
) |
[virtual] |
|
Member Function Documentation
void NL3D::IObs::addChild |
( |
IObs * |
son |
) |
[virtual] |
|
void NL3D::IObs::addParent |
( |
IObs * |
father |
) |
[virtual] |
|
void NL3D::IObs::delChild |
( |
IObs * |
son |
) |
[virtual] |
|
void NL3D::IObs::delParent |
( |
IObs * |
father |
) |
[virtual] |
|
IObs* NL3D::IObs::getFirstChild |
( |
|
) |
const [inline] |
|
IObs* NL3D::IObs::getFirstParent |
( |
|
) |
const [inline] |
|
IObs* NL3D::IObs::getNextChild |
( |
|
) |
const [inline] |
|
IObs* NL3D::IObs::getNextParent |
( |
|
) |
const [inline] |
|
sint NL3D::IObs::getNumChildren |
( |
|
) |
const [inline] |
|
|
Get the number of children.
Definition at line 463 of file mot.h.
References NumSons. |
sint NL3D::IObs::getNumParents |
( |
|
) |
const [inline] |
|
virtual void NL3D::IObs::init |
( |
void |
|
) |
[inline, virtual] |
|
|
This is called at the end of createModel().
So the model is correctly constructed and linked to his observers. The default behavior is to do nothing. Warning! all IObs::init() are called BEFORE IModel::initModel().
Reimplemented in NL3D::IBaseAnimDetailObs.
Definition at line 424 of file mot.h. |
virtual bool NL3D::IObs::isTreeNode |
( |
|
) |
[inline, virtual] |
|
|
For standard behavior, just modify this method, to have a TreeNode behavior or a graphNode behavior. Default: true.
Reimplemented in NL3D::IBaseClipObs.
Definition at line 449 of file mot.h.
Referenced by addParent. |
virtual void NL3D::IObs::traverse |
( |
IObs * |
caller |
) |
[pure virtual] |
|
|
Traverse this observer.
This function "justdoit" must do all the traversal thing:
- Get info from caller, and DoIt the observer (completly observer depedent).
- should traverse() his sons (or simply call traverseSons()).
-
Parameters:
-
caller |
the father of the observer which have called traverse(). WARNING: this is NULL, for the ROOT. |
Implemented in NL3D::IBaseAnimDetailObs. |
void NL3D::IObs::traverseSons |
( |
|
) |
[inline] |
|
|
Do traverse() for all sons of this observer.
Definition at line 540 of file mot.h.
References getFirstChild, getNextChild, and IObs.
Referenced by NL3D::CWaveMakerDetailObs::traverse, NL3D::CWaterRenderObs::traverse, NL3D::CTransformClipObs::traverse, NL3D::CTransformHrcObs::traverse, NL3D::CRootModelRenderObs::traverse, NL3D::CRootModelLightObs::traverse, NL3D::CRootModelLoadBalancingObs::traverse, NL3D::CRootModelAnimDetailObs::traverse, NL3D::CRootModelClipObs::traverse, NL3D::CRootModelHrcObs::traverse, NL3D::CQuadGridClipClusterClipObs::traverse, NL3D::CParticleSystemClipObs::traverse, NL3D::CDefaultHrcObs::traverse, NL3D::CFlareRenderObs::traverse, NL3D::CClusterClipObs::traverse, NL3D::CDefaultLightObs::traverse, and NL3D::CDefaultClipObs::traverse. |
virtual void NL3D::IObs::update |
( |
|
) |
[inline, virtual] |
|
|
This function must update the observer, according to his model's Touch information and the Model data.
NB: do not modify here Touch information of the model (because they may be used by other Observers).
The default behavior is to do nothing.
Reimplemented in NL3D::CTransformHrcObs.
Definition at line 531 of file mot.h. |
Member Data Documentation
TObsList NL3D::IObs::FatherList [protected]
|
|
TObsMap NL3D::IObs::FatherMap [protected]
|
|
|
Definition at line 414 of file mot.h.
Referenced by NL3D::CTransformShapeClipObs::clip, NL3D::CMeshMultiLodClipObs::clip, NL3D::CLandscapeClipObs::clip, NL3D::CMeshMultiLodClipObs::forceClip, getObs, NL3D::CLandscapeClipObs::init, NL3D::CParticleSystemClipObs::insertInVisibleList, IObs, NL3D::CSkeletonModelRenderObs::renderCLod, NL3D::CSkeletonModelRenderObs::renderSkins, NL3D::CTransformShapeRenderObs::traverse, NL3D::CTransformLightObs::traverse, NL3D::CTransformClipObs::traverse, NL3D::CSkeletonModelRenderObs::traverse, NL3D::CSkeletonModelAnimDetailObs::traverse, NL3D::CQuadGridClipClusterClipObs::traverse, NL3D::CPointLightModelLightObs::traverse, NL3D::CParticleSystemClipObs::traverse, NL3D::CMeshBaseInstanceAnimDetailObs::traverse, NL3D::CLandscapeRenderObs::traverse, NL3D::CClusterClipObs::traverse, NL3D::CClusterHrcObs::traverse, NL3D::CTransformHrcObs::update, NL3D::CTransformHrcObs::updateClipTravForAncestorSkeleton, and NL3D::CTransformHrcObs::updateWorld. |
sint NL3D::IObs::NumFathers [protected]
|
|
sint NL3D::IObs::NumSons [protected]
|
|
TObsList NL3D::IObs::SonList [protected]
|
|
TObsMap NL3D::IObs::SonMap [protected]
|
|
|
Definition at line 415 of file mot.h.
Referenced by NL3D::CTransformShapeClipObs::clip, NL3D::CLandscapeClipObs::clip, NL3D::IBaseLoadBalancingObs::init, NL3D::CLandscapeClipObs::init, NL3D::CParticleSystemClipObs::insertInVisibleList, IObs, NL3D::CSkeletonModelRenderObs::renderCLod, NL3D::CSkeletonModelRenderObs::renderSkinList, NL3D::CSkeletonModelRenderObs::renderSkins, NL3D::CTransformShapeLoadBalancingObs::traverse, NL3D::CTransformShapeRenderObs::traverse, NL3D::CTransformLightObs::traverse, NL3D::CQuadGridClipClusterClipObs::traverse, NL3D::CPointLightModelLightObs::traverse, NL3D::CParticleSystemClipObs::traverse, NL3D::CMeshMultiLodBalancingObs::traverse, NL3D::CLandscapeRenderObs::traverse, NL3D::CClusterClipObs::traverse, NL3D::CTransformShapeLoadBalancingObs::traversePass0, and NL3D::IBaseClipObs::~IBaseClipObs. |
The documentation for this class was generated from the following files:
|
|