Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.util
Class SceneGraphTraverser

java.lang.Object
  extended by org.j3d.renderer.aviatrix3d.util.SceneGraphTraverser

public class SceneGraphTraverser
extends java.lang.Object

Utility class that traverses an Aviatrix3D scene graph, reporting values to the end user through the use of the SceneGraphTraversalObserver.

Version:
$Revision: 2.1 $
Author:
Justin Couch

Constructor Summary
SceneGraphTraverser()
          Create a new traverser ready to go.
 
Method Summary
 void reset()
          Clear the use map.
 void setErrorReporter(org.j3d.util.ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the script code can be reported in a nice, pretty fashion.
 void setObserver(SceneGraphTraversalObserver obs)
          Set the detailObs to be used.
 void traverseGraph(SceneGraphObject source)
          Traverse the given scene graph now.
 void traverseGraph(SceneGraphObject parent, SceneGraphObject source)
          Traverse the given scene graph now with the option of providing an explicit, parent reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneGraphTraverser

public SceneGraphTraverser()
Create a new traverser ready to go.

Method Detail

setErrorReporter

public void setErrorReporter(org.j3d.util.ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

setObserver

public void setObserver(SceneGraphTraversalObserver obs)
Set the detailObs to be used. If an detailObs is already set, it is replaced by the new one. A value of null will clear the current detailObs.

Parameters:
obs - The new detailObs reference to use

traverseGraph

public void traverseGraph(SceneGraphObject source)
                   throws java.lang.IllegalStateException
Traverse the given scene graph now. If the call is currently in progress then this will issue an exception. Any node can be used as the root node. If no detailObs is set, this method returns immediately. This method is equivalent to calling traverseGraph(null, source);.

Parameters:
source - The root of the scene graph to traverse
Throws:
java.lang.IllegalStateException - Attempt to call this method while it is currently traversing a scene graph

traverseGraph

public void traverseGraph(SceneGraphObject parent,
                          SceneGraphObject source)
                   throws java.lang.IllegalStateException
Traverse the given scene graph now with the option of providing an explicit, parent reference. If the call is currently in progress then this will issue an exception. Any node can be used as the root node. If no observer is set or the source is null, this method returns immediately.

A explicit root may be provided for various reasons. The most common would be for loading externprotos where the root of the traversed graph is actually going to be in a separate file and scene graph structure from where we are starting this traversal from.

Parameters:
source - The root of the scene graph to traverse
Throws:
java.lang.IllegalStateException - Attempt to call this method while it is currently traversing a scene graph

reset

public void reset()
Clear the use map. This will not be cleared between traversal calls


Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org