# 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

Inheritance graph
[legend]
Collaboration diagram for NL3D::ITrav:

Collaboration graph
[legend]
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.

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(s):
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 595 of file mot.h.


Constructor & Destructor Documentation

NL3D::ITrav::ITrav ( ) [inline]
 

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

Definition at line 602 of file mot.h.

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

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

Definition at line 604 of file mot.h.


Member Function Documentation

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 370 of file mot.cpp.

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.

Reimplemented in NL3D::CAnimDetailTrav, NL3D::CClipTrav, NL3D::CHrcTrav, NL3D::CLightTrav, and NL3D::CRenderTrav.

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

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

Reimplemented in NL3D::CAnimDetailTrav, NL3D::CClipTrav, NL3D::CHrcTrav, NL3D::CLightTrav, and NL3D::CRenderTrav.

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 391 of file mot.cpp.

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 410 of file mot.cpp.

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 397 of file mot.cpp.

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 416 of file mot.cpp.

sint NL3D::ITrav::getNumChildren ( IModel * m ) const
 

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

Definition at line 385 of file mot.cpp.

sint NL3D::ITrav::getNumParents ( IModel * m ) const
 

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

Definition at line 404 of file mot.cpp.

IModel * NL3D::ITrav::getRoot ( ) const
 

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

Definition at line 290 of file mot.cpp.

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 299 of file mot.cpp.

void NL3D::ITrav::moveChildren ( IModel * parentFrom,
IModel * parentTo ) const
 

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

Definition at line 356 of file mot.cpp.

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 282 of file mot.cpp.

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 327 of file mot.cpp.


Member Data Documentation

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

Definition at line 670 of file mot.h.


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