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

nvtraverser::StateSetUnifyTraverser Class Reference

Traverser that unifies identical StateSets. More...

#include <StateSetUnifyTraverser.h>

Inheritance diagram for nvtraverser::StateSetUnifyTraverser:

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

Collaboration graph
[legend]
List of all members.

Public Methods

NVSG_API StateSetUnifyTraverser (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 ~StateSetUnifyTraverser (void)
 Protected destructor to prevent instantiation of a StateSetUnifyTraverser on stack. More...

virtual NVSG_API void handleCgFx (const nvsg::CgFx *p)
 Routine to handle a CgFx object while traversing the scene graph. More...

virtual NVSG_API void handleGeoNode (const nvsg::GeoNode *p)
 Routine to handle a GeoNode object while traversing the scene graph. More...

virtual NVSG_API void handleFaceAttribute (const nvsg::FaceAttribute *p)
 Routine to handle a FaceAttribute object while traversing the scene graph. More...

virtual NVSG_API void handleMaterial (const nvsg::Material *p)
 Routine to handle a Material object while traversing the scene graph. More...

virtual NVSG_API void handleStateSet (const nvsg::StateSet *p)
 Routine to handle a StateSet object while traversing the scene graph. More...

virtual NVSG_API void handleTextureAttribute (const nvsg::TextureAttribute *p)
 Routine to handle a TextureAttribute object while traversing the scene graph. More...

virtual NVSG_API void handleTextureAttributeItem (const nvsg::TextureAttributeItem *p, size_t textureUnit)
 Routine to handle a TextureAttributeItem object while traversing the scene graph. More...


Detailed Description

Traverser that unifies identical StateSets.

Identical StateSets are recognized and linked to the same one. Identical StateAttributes are recognized and linked to the same one. This way, redundant objects are removed, thereby reducing storage space as well as run time.


Constructor & Destructor Documentation

NVSG_API nvtraverser::StateSetUnifyTraverser::StateSetUnifyTraverser void   
 

Constructor.

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

Protected destructor to prevent instantiation of a StateSetUnifyTraverser on stack.


Member Function Documentation

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

Get the 'ignore names' flag.

If the 'ignore names' flag is set, on comparing StateSets and StateAttributes their names are ignored.

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

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

Set the 'ignore names' flags.

If the 'ignore names' flag is set, on comparing StateSets and StateAttributes their names are ignored.

Parameters:
ignore  set true to ignore names on comparision

virtual NVSG_API void nvtraverser::StateSetUnifyTraverser::handleCgFx const nvsg::CgFx   p [protected, virtual]
 

Routine to handle a CgFx object while traversing the scene graph.

After traversing the CgFx p, this handler compares it to the other previously encountered CgFx objects. If there is another identical CgFx object, p is marked to be replaced by that in the handleStateSet routine.

Parameters:
p  Points to the currently visited CgFx object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::StateSetUnifyTraverser::handleGeoNode const nvsg::GeoNode   p [protected, virtual]
 

Routine to handle a GeoNode object while traversing the scene graph.

After traversing the GeoNode \ p, this handler replaces all StateSet objects in it's geometries that have been marked for replacement in the handleStateSet routine.

Parameters:
p  Points to the currently visited GeoNode object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::StateSetUnifyTraverser::handleFaceAttribute const nvsg::FaceAttribute   p [protected, virtual]
 

Routine to handle a FaceAttribute object while traversing the scene graph.

After traversing the FaceAttribute p, this handler compares it to the other previously encountered FaceAttribute objects. If there is another identical FaceAttribute object, p is marked to be replaced by that in the handleStateSet routine.

Parameters:
p  Points to the currently visited FaceAttribute object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::StateSetUnifyTraverser::handleMaterial const nvsg::Material   p [protected, virtual]
 

Routine to handle a Material object while traversing the scene graph.

After traversing the Material p, this handler compares it to the other previously encountered Material objects. If there is another identical Material object, p is marked to be replaced by that in the handleStateSet routine.

Parameters:
p  Points to the currently visited Material object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::StateSetUnifyTraverser::handleStateSet const nvsg::StateSet   p [protected, virtual]
 

Routine to handle a StateSet object while traversing the scene graph.

After traversing the StateSet p, this handler replaces a CgFx, Material, FaceAttribute, and TextureAttribute, that has been marked for replacement in the corresponding handler. Then p is compared to the other previously encountered StateSet objects. If there is another identical StateSet object, p is marked to be replaced by that in the handleGeoNode routine.

Parameters:
p  Points to the currently visited StateSet object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::StateSetUnifyTraverser::handleTextureAttribute const nvsg::TextureAttribute   p [protected, virtual]
 

Routine to handle a TextureAttribute object while traversing the scene graph.

After traversing the TextureAttribute p, this handler all it's TextureAttributeItems, that has been marked for replacement in the handleTextureAttributeItem routine. Then p is compared to the other previously encountered TextureAttribute objects. If there is another identical TextureAttribute object, p is marked to be replaced by that in the handleSateSet routine.

Parameters:
p  Points to the currently visited TextureAttribute object.

Reimplemented from nvtraverser::Traverser.

virtual NVSG_API void nvtraverser::StateSetUnifyTraverser::handleTextureAttributeItem const nvsg::TextureAttributeItem   p,
size_t    textureUnit
[protected, virtual]
 

Routine to handle a TextureAttributeItem object while traversing the scene graph.

After traversing the TextureAttributeItem p, this handler compares it to the other previously encountered TextureAttributeItem objects. If there is another identical TextureAttributeItem object, p is marked to be replaced by that in the handleTextureAttribute routine.

Parameters:
p  Points to the currently visited TextureAttributeItem object.
textureUnit  Texture unit to use with this TextureAttributeItem

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