Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvtraverser::TransformUnifyTraverser Class Reference

Traverser that unifies identical Transforms. More...

#include <TransformUnifyTraverser.h>

Inheritance diagram for nvtraverser::TransformUnifyTraverser:

Inheritance graph
[legend]
Collaboration diagram for nvtraverser::TransformUnifyTraverser:

Collaboration graph
[legend]
List of all members.

Public Methods

NVSG_API TransformUnifyTraverser (void)
 Constructor. More...

NVSG_API bool getIgnoreNames (void) const
 Get the 'ignore names' flag. More...

NVSG_API void setIgnoreNames (bool ignore)
 Set the 'ignore names' flags. More...


Protected Methods

virtual NVSG_API ~TransformUnifyTraverser (void)
 Protected destructor to prevent instantiation of a StateSetUnifyTraverser on stack. More...

virtual NVSG_API void doApply (const nvsg::ViewState *viewState, const nvsg::Scene *scene)
 doApply override. More...

virtual NVSG_API void handleTransform (const nvsg::Transform *p)
 Routine to handle a Transform node while traversing the scene graph. More...

virtual NVSG_API void handleAnimatedTransform (const nvsg::AnimatedTransform *p)
 Routine to handle a AnimatedTransform node while traversing the scene graph. More...

virtual NVSG_API void preTraverseGroup (const nvsg::Group *p)
 This function will be called from the framework immediately before a Group is to be traversed. More...

virtual NVSG_API void postTraverseGroup (const nvsg::Group *p)
 This function will be called from the framework immediately after a Group has been traversed. More...


Detailed Description

Traverser that unifies identical Transforms.

Identical Transforms (only siblings!) are recognized and their children are gathered beneath a single Transform. This way, redundant objects are removed, thereby reducing storage space as well as run time.

Note:
When there is a LightSource inbetween of some Transform nodes, unifying is not allowed (and therefore not performed) across this LightSource.


Constructor & Destructor Documentation

NVSG_API nvtraverser::TransformUnifyTraverser::TransformUnifyTraverser void   
 

Constructor.

virtual NVSG_API nvtraverser::TransformUnifyTraverser::~TransformUnifyTraverser void    [protected, virtual]
 

Protected destructor to prevent instantiation of a StateSetUnifyTraverser on stack.


Member Function Documentation

bool nvtraverser::TransformUnifyTraverser::getIgnoreNames void    const [inline]
 

Get the 'ignore names' flag.

If the 'ignore names' flag is set, the names of the Transforms are ignored.

Returns:
true if the names will be ignored, otherwise false

void nvtraverser::TransformUnifyTraverser::setIgnoreNames bool    ignore [inline]
 

Set the 'ignore names' flags.

If the 'ignore names' flag is set, the names of the Transforms are ignored.

Parameters:
ignore  set true to ignore names on comparison

virtual NVSG_API void nvtraverser::TransformUnifyTraverser::doApply const nvsg::ViewState   viewState,
const nvsg::Scene   scene
[protected, virtual]
 

doApply override.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::TransformUnifyTraverser::handleTransform const nvsg::Transform   p [protected, virtual]
 

Routine to handle a Transform node while traversing the scene graph.

This handler compares the Transform p with previously encountered Transforms. If it is identical to one of them all it's children are moved to that other Transform and p is marked for deletion.

Parameters:
p  Points to the currently visited Transform object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::TransformUnifyTraverser::handleAnimatedTransform const nvsg::AnimatedTransform   p [protected, virtual]
 

Routine to handle a AnimatedTransform node while traversing the scene graph.

This handler compares the AnimatedTransform p with previously encountered AnimatedTransforms. If it is identical to one of them all it's children are moved to that AnimatedTransform and p is marked for deletion.

Parameters:
p  Points to the currently visited AnimatedTransform object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::TransformUnifyTraverser::preTraverseGroup const nvsg::Group   p [protected, virtual]
 

This function will be called from the framework immediately before a Group is to be traversed.

Remarks:
Custom traversers can override this function for any tasks that need to be done immediately before the Group pointed to by p is traversed.
Parameters:
p  Points to the Group that will be traversed immediately after this call.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::TransformUnifyTraverser::postTraverseGroup const nvsg::Group   p [protected, virtual]
 

This function will be called from the framework immediately after a Group has been traversed.

Remarks:
Custom traversers can override this function for any tasks that need to be done immediately after the Group pointed to by p has been traversed.
Parameters:
p  Points to the Group that was traversed immediately before this call.

Reimplemented from nvtraverser::Traverser.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:41 2005 for NVSGSDK by NVIDIA