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

nvtraverser::Traverser Class Reference

Base class providing an interface for read-write traversing of a given scene graph. More...

#include <Traverser.h>

Inheritance diagram for nvtraverser::Traverser:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

NVSG_API void apply (const nvsg::ViewState *viewState, const nvsg::Scene *scene)
 Start traversing a scene graph.

Protected Member Functions

NVSG_API Traverser (bool readOnly=true)
 Default construction on instantiation.
virtual NVSG_API ~Traverser (void)
 Protected destructor to prevent instantiation of a Traverser.
virtual NVSG_API void doApply (const nvsg::ViewState *viewState, const nvsg::Scene *scene)
 Initiate traversing a given scene graph.
template<typename HandlerType>
void addObjectHandler (unsigned int objectCode, HandlerType handler)
 Add a handler routine for a concrete Object derived object.
void traverseObject (const nvsg::Object *object)
 Start traversing a general object.
template<typename T>
void traverseObject (const nvsg::Object *object, T arg)
 Start traversing a general object.
virtual NVSG_API void handleGeoNode (const nvsg::GeoNode *p)
 Routine to handle a GeoNode while traversing the scene graph.
virtual NVSG_API void handleGroup (const nvsg::Group *p)
 Routine to handle a Group node while traversing the scene graph.
virtual NVSG_API void handleLOD (const nvsg::LOD *p)
 Routine to handle a LOD (Level Of Detail) node while traversing the scene graph.
virtual NVSG_API void handleSwitch (const nvsg::Switch *p)
 Routine to handle a Switch node while traversing the scene graph.
virtual NVSG_API void handleTransform (const nvsg::Transform *p)
 Routine to handle a Transform node while traversing the scene graph.
virtual NVSG_API void handleAnimatedTransform (const nvsg::AnimatedTransform *p)
 Routine to handle a AnimatedTransform node while traversing the scene graph.
virtual NVSG_API void handleDirectedLight (const nvsg::DirectedLight *p)
 Routine to handle a DirectedLight node while traversing the scene graph.
virtual NVSG_API void handlePointLight (const nvsg::PointLight *p)
 Routine to handle a PointLight node while traversing the scene graph.
virtual NVSG_API void handleSpotLight (const nvsg::SpotLight *p)
 Routine to handle a SpotLight node while traversing the scene graph.
virtual NVSG_API void handleQuads (const nvsg::Quads *p)
 Routine to handle a Quads object while traversing the scene graph.
virtual NVSG_API void handleAnimatedQuads (const nvsg::AnimatedQuads *p)
 Routine to handle a AnimatedQuads object while traversing the scene graph.
virtual NVSG_API void handleQuadStrips (const nvsg::QuadStrips *p)
 Routine to handle a QuadStrips object while traversing the scene graph.
virtual NVSG_API void handleTriangles (const nvsg::Triangles *p)
 Routine to handle a Triangles object while traversing the scene graph.
virtual NVSG_API void handleAnimatedTriangles (const nvsg::AnimatedTriangles *p)
 Routine to handle a AnimatedTriangles object while traversing the scene graph.
virtual NVSG_API void handleSkinnedTriangles (const nvsg::SkinnedTriangles *p)
 Routine to handle a SkinnedTriangles object while traversing the scene graph.
virtual NVSG_API void handleTriStrips (const nvsg::TriStrips *p)
 Routine to handle a TriStrips object while traversing the scene graph.
virtual NVSG_API void handleStateSet (const nvsg::StateSet *p)
 Routine to handle a StateSet object while traversing the scene graph.
virtual NVSG_API void handleCgFx (const nvsg::CgFx *p)
 Routine to handle a CgFx attribute while traversing the scene graph.
virtual NVSG_API void handleFaceAttribute (const nvsg::FaceAttribute *p)
 Routine to handle a FaceAttribute attribute while traversing the scene graph.
virtual NVSG_API void handleMaterial (const nvsg::Material *p)
 Routine to handle a Material attribute while traversing the scene graph.
virtual NVSG_API void handleTextureAttribute (const nvsg::TextureAttribute *p)
 Routine to handle a TextureAttribute attribute while traversing the scene graph.
virtual NVSG_API void handleTextureAttributeItem (const nvsg::TextureAttributeItem *p, size_t tu)
 Routine to handle a TextureAttributeItem object while traversing the scene graph.
virtual NVSG_API void handleJitterCamera (const nvsg::JitterCamera *p, const nvsg::Node *root)
 Routine to handle a JitterCamera object while traversing the scene graph.
virtual NVSG_API void handleParallelCamera (const nvsg::ParallelCamera *p, const nvsg::Node *root)
 Routine to handle a ParallelCamera object while traversing the scene graph.
virtual NVSG_API void handlePerspectiveCamera (const nvsg::PerspectiveCamera *p, const nvsg::Node *root)
 Routine to handle a PerspectiveCamera object while traversing the scene graph.
virtual NVSG_API void handleStereoCamera (const nvsg::StereoCamera *p, const nvsg::Node *root)
 Routine to handle a StereoCamera object while traversing the scene graph.
virtual NVSG_API void handleFramedTrafoAnimation (const nvsg::FramedAnimation< nvmath::Trafo > *p)
 Routine to handle a FramedAnimation<Trafo> object while traversing the scene graph.
virtual NVSG_API void handleFramedVNVectorAnimation (const nvsg::FramedAnimation< nvsg::VNVector > *p)
 Routine to handle a FramedAnimation<VNVector> object while traversing the scene graph.
virtual NVSG_API void handleLinearInterpolatedTrafoAnimation (const nvsg::LinearInterpolatedAnimation< nvmath::Trafo > *p)
 Routine to handle a LinearInterpolatedAnimation<Trafo> object while traversing the scene graph.
virtual NVSG_API void handleLinearInterpolatedVNVectorAnimation (const nvsg::LinearInterpolatedAnimation< nvsg::VNVector > *p)
 Routine to handle a LinearInterpolatedAnimation<VNVector> object while traversing the scene graph.
virtual NVSG_API void handleHighlightBox (const nvsg::HighlightBox *p, const nvsg::GeoSet *geoSet)
 Routine to handle a HighlightBox object while traversing the scene graph.
virtual NVSG_API void handleHighlightEdges (const nvsg::HighlightEdges *p, const nvsg::GeoSet *geoSet)
 Routine to handle a HighlightEdges object while traversing the scene graph.
virtual NVSG_API bool preTraverseRoot (const nvsg::SimpleCamera *p, const nvsg::Node *root)
 This function will be called from the framework immediately before the scene graph is traversed.
virtual NVSG_API void postTraverseRoot (const nvsg::SimpleCamera *p, const nvsg::Node *root)
 This function will be called from the framework immediately after the scene graph has been traversed.
virtual NVSG_API void preTraverseGroup (const nvsg::Group *p)
 This function will be called from the framework immediately before a Group is traversed.
virtual NVSG_API void postTraverseGroup (const nvsg::Group *p)
 This function will be called from the framework immediately after a Group has been traversed.
virtual NVSG_API bool preTraverseDrawable (const nvsg::Drawable *p)
 This function will be called from the framework immediately before a Drawable is traversed.
virtual NVSG_API void traverseLight (const nvsg::LightSource *p)
 This function will be called from the framework when a LightSource node is visited.
template<typename T>
T * beginEdit (const T *obj) const
 Get a writable pointer to a constant object.
template<typename T>
const T * endEdit (const T *obj) const
 End the editing operation on a constant object.

Protected Attributes

std::stack< size_t > m_lodStack
 holds the index of the current LOD level
std::stack< const nvsg::CullData * > m_cullStack
 holds the cull data corresponding to the traversed tree
std::stack< const nvsg::Group * > m_groupStack
 stack of groups just traversing
const nvsg::StateSetm_defaultStateSet
 private copy of the scene's default states
const nvsg::StateSetm_overrideStateSet
 private copy of the scnee's override states

Detailed Description

Base class providing an interface for read-write traversing of a given scene graph.

A traverser serves as a link between a scene graph and a defined operation to be performed on the scene graph. That is, according to a certain scene graph's hierarchy, a traverser iterates over all scene graph components and performes a defined operation for each by means of an overloadable handler routine.

The Traverser class offers base functionality for all traversers that intend to provide read-write operations on a given scene graph. For all known and concrete Objects this base class provides a set of overloadable handler routines, each ensuring that all components following the actual object in the graph hierarchy will be traversed correctly. Hence, for derived traversers it is recommended to always call the base implementation of an overloaded handler routine for traversing purposes.

To provide new read-only operations to be applied on known and concrete components or objects arranged in a scene graph, it is sufficient to derive a new traverser from either Traverser or one of its derived traversers, and overload the corresponding handler routines as needed.


Constructor & Destructor Documentation

NVSG_API nvtraverser::Traverser::Traverser bool  readOnly = true  )  [protected]
 

Default construction on instantiation.

The constructor is protected, and hence, a Traverser object cannot be instantiated directly but only by deriving from Traverser.

virtual NVSG_API nvtraverser::Traverser::~Traverser void   )  [protected, virtual]
 

Protected destructor to prevent instantiation of a Traverser.


Member Function Documentation

NVSG_API void nvtraverser::Traverser::apply const nvsg::ViewState viewState,
const nvsg::Scene scene
 

Start traversing a scene graph.

This serves as the main entry point for clients to traverse a certain scene graph. The function waits to gain read access to the Scene object pointed to by scene. If an optional ViewState object is provided, the function also waits to gain read access to the ViewState object pointed to by viewState. After the function gains read access to the Scene object (and the ViewState object, if provided), it calls the protected and overloadable doApply member function to start traversing the corresponding scene graph. After traversing is completed, the function releases the read access to the Scene object and, if provided, the optional ViewState object.

Note:
The behavior is undefined if scene points to an invalid location.
Parameters:
viewState  Specifies an optional ViewState object to be applied prior to traversing the scene graph.
scene  Abstracts the scene graph to be traversed.

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

Initiate traversing a given scene graph.

This overloadable function is called from the traverser's entry point apply . The base implementation first initiates the traversing of the scene's global states, if available. After that the scene itself is traversed. If an optional ViewState ViewState is passed through viewState, it is applied prior to traversing the scene.

Custom traversers may override this function in order to implement initial work to be done before traversing the scene. For derived classes to ensure proper traversing of the scene, it is recommended to always call the base implementation after the initial work has been done.

Parameters:
viewState  Optional ViewState to be applied prior to traversing the scene.
scene  Points to the scene to be traversed.

Reimplemented in WRLLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::AppTraverser, nvtraverser::CondenseTraverser, nvtraverser::CullTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullTraverser, nvtraverser::RayIntersectTraverser, nvtraverser::SearchTraverser, and nvtraverser::TransformUnifyTraverser.

template<typename HandlerType>
void nvtraverser::Traverser::addObjectHandler unsigned int  objectCode,
HandlerType  handler
[inline, protected]
 

Add a handler routine for a concrete Object derived object.

The function registers the handler routine specified by handler to handle a concrete Object that is explicitly identified by objectCode.

A handler routine must be a member function of a Traverser-derived class. It must return void and expect a pointer to the concrete object as a first parameter, and can have one additional (optional) argument of arbitrary type. A handler routine must not have a default argument! If a handler routine is intended to remain overloadable, it should be declared virtual.

Note:
A possibly pre-registered handler routine for the specified object will be overridden by the new handler.
Remarks:
For derived classes intended to provide new operations for known objects arranged in a scene graph, it is strongly recommended not to add new handler routines for a certain known objects but to overload the corresponding handler routines. In this context, we refer to 'known objects' as objects that are known by the Traverser base class and for which a corresponding handler routine is provided.
However, addObjectHandler is indispensible if newly invented objects, and hence, objects that are unknown by the Traverser base class, need to be considered for traversing.
Parameters:
objectCode  Object code to identify an object type at run-time.
handler  Specifies the address of the handler routine.

void nvtraverser::Traverser::traverseObject const nvsg::Object object  )  [inline, protected]
 

Start traversing a general object.

The function first waits to gain read access to the object pointed to by object. After that, it calls the corresponding and overloadable handler routine. After the handler routine returns, the function releases the read access to the object.

Note:
The behavior is undefined if p points to an invalid location.
Parameters:
object  Points to the object to be traversed.

template<typename T>
void nvtraverser::Traverser::traverseObject const nvsg::Object object,
arg
[inline, protected]
 

Start traversing a general object.

The function first waits to gain read access to the object pointed to by object. After that, it calls the corresponding and overloadable handler routine with the additional argument arg. After the handler routine returns, the function releases the read access to the object.

Note:
The behavior is undefined if p points to an invalid location. The behavior is also undefined if the additional argument doesn't match that of the corresponding handler routine.
Parameters:
object  Points to the object to be traversed.
arg  Specifies an additional argument that will be passed to the handler routine.

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

Routine to handle a GeoNode while traversing the scene graph.

This routine gets called for each GeoNode object that will be visited while traversing the scene graph. The currently visited GeoNode object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited GeoNode object.

Reimplemented in NVBLoadTraverser, WRLLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::AppTraverser, nvtraverser::CondenseTraverser, nvtraverser::CullTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GeoNodeUnifyTraverser, nvtraverser::RayIntersectTraverser, nvtraverser::SearchTraverser, nvtraverser::SmoothTraverser, nvtraverser::StateSetUnifyTraverser, nvtraverser::StrippingTraverser, and nvtraverser::TriangulateTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleGroup const nvsg::Group p  )  [protected, virtual]
 

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

This routine gets called for each Group object that will be visited while traversing the scene graph. The currently visited Group object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Group object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::GroupUnifyTraverser, nvtraverser::IdentityToGroupTraverser, nvtraverser::RayIntersectTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleLOD const nvsg::LOD p  )  [protected, virtual]
 

Routine to handle a LOD (Level Of Detail) node while traversing the scene graph.

This routine gets called for each LOD object that will be visited while traversing the scene graph. The currently visited LOD object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited LOD object.

Reimplemented in NVBLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::ModelViewTraverser, nvtraverser::RayIntersectTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleSwitch const nvsg::Switch p  )  [protected, virtual]
 

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

This routine gets called for each Switch object that will be visited while traversing the scene graph. The currently visited Switch object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Switch object.

Reimplemented in NVBLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::RayIntersectTraverser, and nvtraverser::SearchTraverser.

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

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

This routine gets called for each Transform object that will be visited while traversing the scene graph. The currently visited Transform object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Transform object.

Reimplemented in WRLLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::GLTraverser, nvtraverser::IdentityToGroupTraverser, nvtraverser::ModelViewTraverser, nvtraverser::RayIntersectTraverser, nvtraverser::SearchTraverser, and nvtraverser::TransformUnifyTraverser.

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

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

This routine gets called for each AnimatedTransform object that will be visited while traversing the scene graph. The currently visited AnimatedTransform object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited AnimatedTransform object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::AppTraverser, nvtraverser::IdentityToGroupTraverser, nvtraverser::SearchTraverser, and nvtraverser::TransformUnifyTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleDirectedLight const nvsg::DirectedLight p  )  [protected, virtual]
 

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

This routine gets called for each DirectedLight object that will be visited while traversing the scene graph. The currently visited DirectedLight object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited DirectedLight object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handlePointLight const nvsg::PointLight p  )  [protected, virtual]
 

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

This routine gets called for each PointLight object that will be visited while traversing the scene graph. The currently visited PointLight object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited PointLight object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleSpotLight const nvsg::SpotLight p  )  [protected, virtual]
 

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

This routine gets called for each SpotLight object that will be visited while traversing the scene graph. The currently visited SpotLight object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited SpotLight object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleQuads const nvsg::Quads p  )  [protected, virtual]
 

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

This routine gets called for each Quads object that will be visited while traversing the scene graph. The currently visited Quads object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Quads object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::RayIntersectTraverser, nvtraverser::SearchTraverser, nvtraverser::SmoothTraverser, nvtraverser::StrippingTraverser, and nvtraverser::TriangulateTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleAnimatedQuads const nvsg::AnimatedQuads p  )  [protected, virtual]
 

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

This routine gets called for each AnimatedQuads object that will be visited while traversing the scene graph. The currently visited AnimatedQuads object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited AnimatedQuads object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::AppTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, nvtraverser::SmoothTraverser, nvtraverser::StrippingTraverser, and nvtraverser::TriangulateTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleQuadStrips const nvsg::QuadStrips p  )  [protected, virtual]
 

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

This routine gets called for each QuadStrips object that will be visited while traversing the scene graph. The currently visited QuadStrips object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited QuadStrips object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::RayIntersectTraverser, nvtraverser::SearchTraverser, nvtraverser::SmoothTraverser, and nvtraverser::TriangulateTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleTriangles const nvsg::Triangles p  )  [protected, virtual]
 

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

This routine gets called for each Triangles object that will be visited while traversing the scene graph. The currently visited Triangles object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Triangles object.

Reimplemented in NVBLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::RayIntersectTraverser, nvtraverser::SearchTraverser, nvtraverser::SmoothTraverser, and nvtraverser::StrippingTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleAnimatedTriangles const nvsg::AnimatedTriangles p  )  [protected, virtual]
 

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

This routine gets called for each AnimatedTriangles object that will be visited while traversing the scene graph. The currently visited AnimatedTriangles object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited AnimatedTriangles object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::AppTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, nvtraverser::SmoothTraverser, and nvtraverser::StrippingTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleSkinnedTriangles const nvsg::SkinnedTriangles p  )  [protected, virtual]
 

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

This routine gets called for each SkinnedTriangles object that will be visited while traversing the scene graph. The currently visited SkinnedTriangles object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited SkinnedTriangles object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::AppTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, nvtraverser::SmoothTraverser, and nvtraverser::StrippingTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleTriStrips const nvsg::TriStrips p  )  [protected, virtual]
 

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

This routine gets called for each TriStrips object that will be visited while traversing the scene graph. The currently visited TriStrips object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited TriStrips object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::CullTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::RayIntersectTraverser, nvtraverser::SearchTraverser, and nvtraverser::SmoothTraverser.

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

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

This routine gets called for each StateSet object that will be visited while traversing the scene graph. The currently visited StateSet object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited StateSet object.

Reimplemented in NVBLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::DrawableUnifyTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, and nvtraverser::StateSetUnifyTraverser.

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

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

This routine gets called for each CgFx object that will be visited while traversing the scene graph. The currently visited CgFx object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited CgFx object.

Reimplemented in NVBLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::AppTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, and nvtraverser::StateSetUnifyTraverser.

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

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

This routine gets called for each FaceAttribute object that will be visited while traversing the scene graph. The currently visited FaceAttribute object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited FaceAttribute object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, and nvtraverser::StateSetUnifyTraverser.

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

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

This routine gets called for each Material object that will be visited while traversing the scene graph. The currently visited Material object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Material object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, and nvtraverser::StateSetUnifyTraverser.

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

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

This routine gets called for each TextureAttribute object that will be visited while traversing the scene graph. The currently visited TextureAttribute object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited TextureAttribute object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, nvtraverser::SearchTraverser, and nvtraverser::StateSetUnifyTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleTextureAttributeItem const nvsg::TextureAttributeItem p,
size_t  tu
[protected, virtual]
 

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

This routine gets called for each TextureAttributeItem object that will be visited while traversing the scene graph. The currently visited TextureAttributeItem object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited TextureAttributeItem object.
tu  Specifies the zero based index of the texture unit to bind the item to.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, and nvtraverser::StateSetUnifyTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleJitterCamera const nvsg::JitterCamera p,
const nvsg::Node root
[protected, virtual]
 

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

This routine gets called for each JitterCamera object that will be visited while traversing the scene graph. The currently visited JitterCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited JitterCamera object.
root  If valid, points to the root node to be traversed with the actual camera settings.

Reimplemented in NVBLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleParallelCamera const nvsg::ParallelCamera p,
const nvsg::Node root
[protected, virtual]
 

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

This routine gets called for each ParallelCamera object that will be visited while traversing the scene graph. The currently visited ParallelCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited ParallelCamera object.
root  If valid, points to the root node to be traversed with the actual camera settings.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::ModelViewTraverser, nvtraverser::RenderTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handlePerspectiveCamera const nvsg::PerspectiveCamera p,
const nvsg::Node root
[protected, virtual]
 

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

This routine gets called for each PerspectiveCamera object that will be visited while traversing the scene graph. The currently visited PerspectiveCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited PerspectiveCamera object.
root  If valid, points to the root node to be traversed with the actual camera settings.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::ModelViewTraverser, nvtraverser::RenderTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleStereoCamera const nvsg::StereoCamera p,
const nvsg::Node root
[protected, virtual]
 

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

This routine gets called for each StereoCamera object that will be visited while traversing the scene graph. The currently visited StereoCamera object is pointed to by p. If the root node pointed to by root is valid (that is, root is not a null pointer), this function traverses the root node after the camera settings have been evaluated. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited StereoCamera object.
root  If valid, points to the root node to be traversed with the actual camera settings.

Reimplemented in NVBLoadTraverser, NBFSaveTraverser, NVSGSaveTraverser, nvtraverser::GLTraverser, nvtraverser::OcclusionCullGLTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleFramedTrafoAnimation const nvsg::FramedAnimation< nvmath::Trafo > *  p  )  [protected, virtual]
 

Routine to handle a FramedAnimation<Trafo> object while traversing the scene graph.

This routine gets called for each FramedAnimation<Trafo> object that will be visited while traversing the scene graph. The currently visited FramedAnimation<Trafo> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Animation object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleFramedVNVectorAnimation const nvsg::FramedAnimation< nvsg::VNVector > *  p  )  [protected, virtual]
 

Routine to handle a FramedAnimation<VNVector> object while traversing the scene graph.

This routine gets called for each FramedAnimation<VNVector> object that will be visited while traversing the scene graph. The currently visited FramedAnimation<VNVector> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Animation object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleLinearInterpolatedTrafoAnimation const nvsg::LinearInterpolatedAnimation< nvmath::Trafo > *  p  )  [protected, virtual]
 

Routine to handle a LinearInterpolatedAnimation<Trafo> object while traversing the scene graph.

This routine gets called for each LinearInterpolatedAnimation<Trafo> object that will be visited while traversing the sc ene graph. The currently visited LinearInterpolatedAnimation<Trafo> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Animation object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleLinearInterpolatedVNVectorAnimation const nvsg::LinearInterpolatedAnimation< nvsg::VNVector > *  p  )  [protected, virtual]
 

Routine to handle a LinearInterpolatedAnimation<VNVector> object while traversing the scene graph.

This routine gets called for each LinearInterpolatedAnimation<VNVector> object that will be visited while traversing the scene graph. The currently visited LinearInterpolatedAnimation<VNVector> object is pointed to by p. The base implementation ensures that all underlying components will be traversed in a correct way. For derived classes, it is recommended to always call the base implementation for traversing purposes.

Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited Animation object.

Reimplemented in NBFSaveTraverser, NVSGSaveTraverser, and nvtraverser::SearchTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleHighlightBox const nvsg::HighlightBox p,
const nvsg::GeoSet geoSet
[protected, virtual]
 

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

This routine gets called for each HighlightBox object that will be visited while traversing the scene graph. The currently visited Highlight object is pointed to by p.

Remarks:
A HighlighBox always is attached to its corresponding GeoSet object as a HighlightObject .
Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited HighlightBox object.
geoSet  Points to the corresponding GeoSet object.

Reimplemented in nvtraverser::AppTraverser, nvtraverser::GLTraverser, and nvtraverser::OcclusionCullGLTraverser.

virtual NVSG_API void nvtraverser::Traverser::handleHighlightEdges const nvsg::HighlightEdges p,
const nvsg::GeoSet geoSet
[protected, virtual]
 

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

This routine gets called for each HighlightEdges object that will be visited while traversing the scene graph. The currently visited Highlight object is pointed to by p.

Remarks:
A HighlighEdges always is attached to its corresponding GeoSet object as a HighlightObject .
Note:
: The behavior is undefined if p points to an invalid location.
Parameters:
p  Points to the currently visited HighlightEdges object.
geoSet  Points to the corresponding GeoSet object.

Reimplemented in nvtraverser::GLTraverser, and nvtraverser::OcclusionCullGLTraverser.

virtual NVSG_API bool nvtraverser::Traverser::preTraverseRoot const nvsg::SimpleCamera p,
const nvsg::Node root
[protected, virtual]
 

This function will be called from the framework immediately before the scene graph is traversed.

If the function returns false, further traversing will be skipped.

Remarks:
Custom traversers can override this function for any tasks that need to be done immediately before the scene graph is traversed.
Parameters:
p  Camera that will be applied while traversing the scene graph.
root  Root node to start traversing from.

Reimplemented in nvtraverser::FrustumCullTraverser, nvtraverser::GLTraverser, nvtraverser::ModelViewTraverser, and nvtraverser::OcclusionCullGLTraverser.

virtual NVSG_API void nvtraverser::Traverser::postTraverseRoot const nvsg::SimpleCamera p,
const nvsg::Node root
[protected, virtual]
 

This function will be called from the framework immediately after the scene graph has been traversed.

remarks Custom traversers can override this function for any tasks that need to be done immediately after the scene graph has been traversed.

Parameters:
p  Camera that was applied while traversing the scene graph.
root  Root node were traversing has been started from.

Reimplemented in nvtraverser::OcclusionCullGLTraverser.

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

This function will be called from the framework immediately before a Group is 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 in nvtraverser::GeoNodeUnifyTraverser, nvtraverser::GroupUnifyTraverser, and nvtraverser::TransformUnifyTraverser.

virtual NVSG_API void nvtraverser::Traverser::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 in nvtraverser::GeoNodeUnifyTraverser, nvtraverser::GroupUnifyTraverser, nvtraverser::RenderTraverser, and nvtraverser::TransformUnifyTraverser.

virtual NVSG_API bool nvtraverser::Traverser::preTraverseDrawable const nvsg::Drawable p  )  [protected, virtual]
 

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

If the function returns false, further traversing will be skipped.

Remarks:
Custom traversers can override this function for any tasks that need to be done immediately before the Drawable is traversed.
Parameters:
p  Drawable that is going to be traversed

Reimplemented in nvtraverser::GLTraverser.

virtual NVSG_API void nvtraverser::Traverser::traverseLight const nvsg::LightSource p  )  [protected, virtual]
 

This function will be called from the framework when a LightSource node is visited.

remarks Custom traversers can override this function for special tasks that need to be performed when visiting a LightSource node.

Parameters:
p  Points to the currently visited LightSource node.

Reimplemented in nvtraverser::AppTraverser, nvtraverser::CullTraverser, and nvtraverser::RenderTraverser.

template<typename T>
T* nvtraverser::Traverser::beginEdit const T *  obj  )  const [inline, protected]
 

Get a writable pointer to a constant object.

While traversing, all modifications of objects have to be embraced by beginEdit/endEdit.

Returns:
A non-constant pointer to the object.
Parameters:
obj  object to get a non-constant pointer to

template<typename T>
const T* nvtraverser::Traverser::endEdit const T *  obj  )  const [inline, protected]
 

End the editing operation on a constant object.

While traversing, all modifications of objects have to be embraced by beginEdit/endEdit.

Returns:
A constant pointer to the object.
Parameters:
obj  object to end editing operations on


Member Data Documentation

std::stack<size_t> nvtraverser::Traverser::m_lodStack [protected]
 

holds the index of the current LOD level

std::stack<const nvsg::CullData *> nvtraverser::Traverser::m_cullStack [protected]
 

holds the cull data corresponding to the traversed tree

std::stack<const nvsg::Group *> nvtraverser::Traverser::m_groupStack [protected]
 

stack of groups just traversing

const nvsg::StateSet* nvtraverser::Traverser::m_defaultStateSet [protected]
 

private copy of the scene's default states

const nvsg::StateSet* nvtraverser::Traverser::m_overrideStateSet [protected]
 

private copy of the scnee's override states


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