org.jdesktop.wonderland.client.jme.utils.traverser
Class TreeScan

java.lang.Object
  extended by org.jdesktop.wonderland.client.jme.utils.traverser.TreeScan

public class TreeScan
extends java.lang.Object


Constructor Summary
TreeScan()
           
 
Method Summary
static void findNode(com.jme.scene.Spatial treeRoot, java.lang.Class[] nodeClasses, ProcessNodeInterface processor, boolean onlyEnabledSwitchChildren, boolean sharedGroupsOnce)
          Traverse the SceneGraph starting at node treeRoot.
static void findNode(com.jme.scene.Spatial treeRoot, java.lang.Class nodeClass, ProcessNodeInterface processor, boolean onlyEnabledSwitchChildren, boolean sharedGroupsOnce)
          Traverse the SceneGraph starting at node treeRoot.
static void findNode(com.jme.scene.Spatial treeRoot, ProcessNodeInterface processor)
          Traverse the graph visiting all nodes that subclass SceneElement and all switch and shared groups
static java.lang.Class getClass(java.lang.String str)
          Conveniance method to return a Class given the full Class name without throwing ClassNotFoundException If the class is not available an error message is displayed and a runtime exception thrown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeScan

public TreeScan()
Method Detail

findNode

public static void findNode(com.jme.scene.Spatial treeRoot,
                            java.lang.Class nodeClass,
                            ProcessNodeInterface processor,
                            boolean onlyEnabledSwitchChildren,
                            boolean sharedGroupsOnce)
Traverse the SceneGraph starting at node treeRoot. Every time a node of class nodeClass is found call processNode method in processor.

Parameters:
treeRoot - The root of the SceneGraph to search
nodeClass - The class of the node(s) to search for
processor - The class containing the processNode method which will be called every time the correct nodeClass is found in the Scene Graph.
onlyEnabledSwitchChildren - when true only recurse into Switch children which are enabled
sharedGroupsOnce - when true only process SharedGroups once, regardless how many Links refer to them
Throws:
CapabilityNotSetException - If the node is live or compiled and the scene graph contains groups without ALLOW_CHILDREN_READ capability

findNode

public static void findNode(com.jme.scene.Spatial treeRoot,
                            ProcessNodeInterface processor)
Traverse the graph visiting all nodes that subclass SceneElement and all switch and shared groups

Parameters:
treeRoot -
processor -

findNode

public static void findNode(com.jme.scene.Spatial treeRoot,
                            java.lang.Class[] nodeClasses,
                            ProcessNodeInterface processor,
                            boolean onlyEnabledSwitchChildren,
                            boolean sharedGroupsOnce)
Traverse the SceneGraph starting at node treeRoot. Every time a node of class nodeClass is found call processNode method in processor.

Parameters:
treeRoot - The root of the SceneGraph to search
nodeClasses - The list of classes of the node(s) to search for
processor - The class containing the processNode method which will be called every time the correct nodeClass is found in the Scene Graph.
onlyEnabledSwitchChildren - when true only recurse into Switch children which are enabled
sharedGroupsOnce - when true only process SharedGroups once, regardless how many Links refer to them
Throws:
CapabilityNotSetException - If the node is live or compiled and the scene graph contains groups without ALLOW_CHILDREN_READ capability

getClass

public static java.lang.Class getClass(java.lang.String str)
Conveniance method to return a Class given the full Class name without throwing ClassNotFoundException If the class is not available an error message is displayed and a runtime exception thrown



Open Wonderland - http://openwonderland.org