org.xith3d.scenegraph.traversal.impl
Class SGUtils

java.lang.Object
  extended by org.xith3d.scenegraph.traversal.impl.SGUtils

public class SGUtils
extends java.lang.Object

Various useful static methods manipulate the scenegraph.


Constructor Summary
SGUtils()
           
 
Method Summary
static Shape3D findFirstShape(Group group)
          Finds the first Shape3D in the scenegraph
static int getPolygonCount(Group group)
          Returns the count of polygons in the (subgroup of the) scenegraph.
static int getPolygonCount(Node node)
          Returns the count of polygons in the (subgroup of the) scenegraph.
static void setAllAppearances(Group group, Appearance app)
          Traverses the scenegraph and applies an Appearance to all Nodes
static void setAllMaterials(Group group, Material mat)
          Traverses the scenegraph and applies a Material to all Nodes
static void setAllPickable(Group group, boolean pickable)
          Traverses the scenegraph and sets the pickable flag on all Nodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SGUtils

public SGUtils()
Method Detail

getPolygonCount

public static int getPolygonCount(Node node)
Returns the count of polygons in the (subgroup of the) scenegraph.

Parameters:
node - the node to search : could be a link or a group
Returns:
the count of polygons

getPolygonCount

public static int getPolygonCount(Group group)
Returns the count of polygons in the (subgroup of the) scenegraph.

Parameters:
group - the subgroup to search
Returns:
the count of polygons

findFirstShape

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

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

setAllAppearances

public static void setAllAppearances(Group group,
                                     Appearance app)
Traverses the scenegraph and applies an Appearance to all Nodes

Parameters:
group - the group to search
app - the Appearance to apply to all nodes in the group

setAllMaterials

public static void setAllMaterials(Group group,
                                   Material mat)
Traverses the scenegraph and applies a Material to all Nodes

Parameters:
group - the group to search
mat - the Material to apply to all nodes in the group

setAllPickable

public static void setAllPickable(Group group,
                                  boolean pickable)
Traverses the scenegraph and sets the pickable flag on all Nodes

Parameters:
group - the group to search
pickable - the value to set the pickable flag to