# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::ITrav Class Reference

A base Traversal. More...

#include <mot.h>

Inheritance diagram for NL3D::ITrav:

NLMISC::CRefCount NL3D::ITravScene NL3D::CAnimDetailTrav NL3D::CHrcTrav NL3D::CLightTrav NL3D::ITravCameraScene NL3D::CClipTrav NL3D::CLoadBalancingTrav NL3D::CRenderTrav List of all members.

Public Methods

Object
 ITrav ()
 Constructor. Root Must be created/linked by User via setRoot(). More...

virtual ~ITrav ()
 Destructor. ~ITrav() doesn't delete Root. Root Must be destructed by user. More...

Misc.
virtual IObscreateDefaultObs () const=0
 This method must create a default observer for this traversal. More...

virtual NLMISC::CClassId getClassId () const=0
 This function must return the Unique Ident for this traversal class. More...

virtual void addedToMOT (CMOT *mot)
 Called when this traversal has been added to MOT object. The default does nothing. More...

Graph Methods.
void setRoot (IModel *root)
 Specify a root Model for this traversal (via his IObs). More...

IModelgetRoot () const
 Get the root of the traversal (NULL if not defined). More...

void link (IModel *m1, IModel *m2) const
 Link 2 models via their IObs for this traversal. More...

void unlink (IModel *m1, IModel *m2) const
 Unlink 2 models via their IObs for this traversal. More...

void moveChildren (IModel *parentFrom, IModel *parentTo) const
 make the children of parentFrom unlinked, and become the children of parentTo. More...

void copyChildren (IModel *parentFrom, IModel *parentTo) const
 make the children of parentFrom become the children of parentTo too (may works like moveChildren if children are TreeNode). More...

sint getNumChildren (IModel *m) const
 Get the number of children of the model for this traversal. More...

IModelgetFirstChild (IModel *m) const
 Return the first child of the Model for this traversal. NULL returned if not found. More...

IModelgetNextChild (IModel *m) const
 Return the next child of the Model for this traversal. NULL returned if not found. Unpredictible results if link() / unlink() are made between a getFirstChild() / getNextChild(). More...

sint getNumParents (IModel *m) const
 Get the number of Parents of the model for this traversal. More...

IModelgetFirstParent (IModel *m) const
 Return the first Parent of the Model for this traversal. NULL returned if not found. More...

IModelgetNextParent (IModel *m) const
 Return the next Parent of the Model for this traversal. NULL returned if not found. Unpredictible results if link() / unlink() are made between a getFirstParent() / getNextParent(). More...


Protected Attributes

NLMISC::CRefPtr< IObsRoot

Detailed Description

A base Traversal.

A traversal represent a functionality, something which is be performed on a graph of model. Since, we may have differents graph of models, dependent on the traversal, a traversal maintain rather a graph of observers. But this is invisible for the user, since he calls link() methods with models.

A traversal provide:

DERIVERS RULES: No traverse() method is provided. The deriver may use their own function.
See also:
CMOT IModel IObs
Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 596 of file mot.h.


Constructor & Destructor Documentation

NL3D::ITrav::ITrav   [inline]
 

Constructor. Root Must be created/linked by User via setRoot().

Definition at line 603 of file mot.h.

References Root.

virtual NL3D::ITrav::~ITrav   [inline, virtual]
 

Destructor. ~ITrav() doesn't delete Root. Root Must be destructed by user.

Definition at line 605 of file mot.h.

References Root.


Member Function Documentation

virtual void NL3D::ITrav::addedToMOT CMOT   mot [inline, virtual]
 

Called when this traversal has been added to MOT object. The default does nothing.

Reimplemented in NL3D::ITravScene.

Definition at line 618 of file mot.h.

void NL3D::ITrav::copyChildren IModel   parentFrom,
IModel   parentTo
const
 

make the children of parentFrom become the children of parentTo too (may works like moveChildren if children are TreeNode).

Definition at line 388 of file mot.cpp.

References getFirstChild, getNextChild, and link.

virtual IObs* NL3D::ITrav::createDefaultObs   const [pure virtual]
 

This method must create a default observer for this traversal.

Any model which doesn't provide (by registerObs() or by inheritance) an observer for this view will be linked with this default observer.

Implemented in NL3D::CAnimDetailTrav.

virtual NLMISC::CClassId NL3D::ITrav::getClassId   const [pure virtual]
 

This function must return the Unique Ident for this traversal class.

Implemented in NL3D::CAnimDetailTrav.

Referenced by getFirstChild, getFirstParent, getNextChild, getNextParent, getNumChildren, getNumParents, link, setRoot, and unlink.

IModel * NL3D::ITrav::getFirstChild IModel   m const
 

Return the first child of the Model for this traversal. NULL returned if not found.

Definition at line 409 of file mot.cpp.

References getClassId.

Referenced by copyChildren, and moveChildren.

IModel * NL3D::ITrav::getFirstParent IModel   m const
 

Return the first Parent of the Model for this traversal. NULL returned if not found.

Definition at line 434 of file mot.cpp.

References getClassId.

Referenced by NL3D::CClipTrav::traverse.

IModel * NL3D::ITrav::getNextChild IModel   m const
 

Return the next child of the Model for this traversal. NULL returned if not found. Unpredictible results if link() / unlink() are made between a getFirstChild() / getNextChild().

Definition at line 418 of file mot.cpp.

References getClassId.

Referenced by copyChildren, and moveChildren.

IModel * NL3D::ITrav::getNextParent IModel   m const
 

Return the next Parent of the Model for this traversal. NULL returned if not found. Unpredictible results if link() / unlink() are made between a getFirstParent() / getNextParent().

Definition at line 444 of file mot.cpp.

References getClassId.

Referenced by NL3D::CClipTrav::traverse.

sint NL3D::ITrav::getNumChildren IModel   m const
 

Get the number of children of the model for this traversal.

Definition at line 403 of file mot.cpp.

References getClassId.

sint NL3D::ITrav::getNumParents IModel   m const
 

Get the number of Parents of the model for this traversal.

Definition at line 428 of file mot.cpp.

References getClassId.

IModel * NL3D::ITrav::getRoot   const
 

Get the root of the traversal (NULL if not defined).

Definition at line 308 of file mot.cpp.

References Root.

void NL3D::ITrav::link IModel   m1,
IModel   m2
const
 

Link 2 models via their IObs for this traversal.

m2 becomes a child of m1. If m1==NULL, m2 will be linked to the Root of this traversal (or do nothing if this one is NULL). if m2 was already a son of m1, no-op.

Definition at line 317 of file mot.cpp.

References getClassId, nlassert, and Root.

Referenced by copyChildren, moveChildren, and NL3D::CClipTrav::traverse.

void NL3D::ITrav::moveChildren IModel   parentFrom,
IModel   parentTo
const
 

make the children of parentFrom unlinked, and become the children of parentTo.

Definition at line 374 of file mot.cpp.

References getFirstChild, getNextChild, link, and unlink.

void NL3D::ITrav::setRoot IModel   root
 

Specify a root Model for this traversal (via his IObs).

The model must be created with a valid/final CMOT. CMOT::createModel() will don't link the model if a traversal in the CMOT object has not specified a root.
ITrav::link(NULL, ...) will assert, if no root defined.

You may specify a NULL root (this may lead to a disabled traversal).

Definition at line 300 of file mot.cpp.

References getClassId, and Root.

void NL3D::ITrav::unlink IModel   m1,
IModel   m2
const
 

Unlink 2 models via their IObs for this traversal.

If m1==NULL, m2 will be unlinked from the Root of this traversal (or do nothing if this one is NULL). if m2 was not a son of m1, no-op.

Definition at line 345 of file mot.cpp.

References getClassId, nlassert, and Root.

Referenced by moveChildren, and NL3D::CClipTrav::traverse.


Member Data Documentation

NLMISC::CRefPtr<IObs> NL3D::ITrav::Root [protected]
 

Definition at line 673 of file mot.h.

Referenced by getRoot, ITrav, link, setRoot, NL3D::CRenderTrav::traverse, NL3D::CHrcTrav::traverse, NL3D::CClipTrav::traverse, unlink, and ~ITrav.


The documentation for this class was generated from the following files: