org.xith3d.scenegraph.traversal.impl
Class PolygonCounter

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

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

Traverses the scenegraph and counts all polygons.


Method Summary
static int getPolygonCount(GroupNode group)
          Counts the number of vertices in the traversed Group.
 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

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

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

getPolygonCount

public static int getPolygonCount(GroupNode group)
Counts the number of vertices in the traversed Group.

Parameters:
group - the group to search
Returns:
the number of vertices