org.xith3d.scenegraph.traversal.impl
Class ShapeFinder

java.lang.Object
  extended by org.xith3d.scenegraph.traversal.impl.ShapeFinder
All Implemented Interfaces:
TraversalCallback

public final class ShapeFinder
extends java.lang.Object
implements TraversalCallback

Traverses the scenegraph and finds shapes.


Method Summary
static java.util.List<Shape3D> findAllShapes(GroupNode group)
          Finds all Shape3Ds in the scenegraph
static Shape3D findFirstShape(GroupNode group)
          Finds the first Shape3D in the scenegraph
 boolean traversalCheckGroup(GroupNode group)
          This method is called for each Group in the traversal.
 boolean traversalOperation(Node node)
          This method is called for each Node in the traversed Group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

traversalCheckGroup

public boolean traversalCheckGroup(GroupNode group)
Description copied from interface: TraversalCallback
This method is called for each Group in the traversal. It must return true to be further traversed (and its children)

Specified by:
traversalCheckGroup in interface TraversalCallback
Parameters:
group - the Group to be checked
Returns:
if false the traversal is not stopped, but the children are not further traversed

traversalOperation

public boolean traversalOperation(Node node)
Description copied from interface: TraversalCallback
This method is called for each Node in the traversed Group. It implements the operation to be done for the Nodes.

Specified by:
traversalOperation in interface TraversalCallback
Parameters:
node - the current Node in the traversal
Returns:
if false, the traversal is stopped after this node

findFirstShape

public static Shape3D findFirstShape(GroupNode group)
Finds the first Shape3D in the scenegraph

Parameters:
group - the group to search
Returns:
the found Shape3D

findAllShapes

public static java.util.List<Shape3D> findAllShapes(GroupNode group)
Finds all Shape3Ds in the scenegraph

Parameters:
group - the group to search
Returns:
the found Shape3Ds