Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.util
Class ScenePrinter

java.lang.Object
  extended by org.j3d.renderer.aviatrix3d.util.ScenePrinter
All Implemented Interfaces:
SceneGraphTraversalObserver

public class ScenePrinter
extends java.lang.Object
implements SceneGraphTraversalObserver

Utility class that allows printing of a scene graph, with options to control what is printed.

By default, the printer only shows the basic graph structure. Options all you to print out extra information. Fully qualified class names are printed out, but the option exists to just use the class name only.

Version:
$Revision: 1.5 $
Author:
Justin Couch

Constructor Summary
ScenePrinter()
          Create a new printer with all flags turned off.
 
Method Summary
 void dumpGraph(SceneGraphObject root)
          Print the scene graph from the given root node.
 void enableBoundsPrinting(boolean state)
          Set the flag for printing the bounds information.
 void enableChildCountPrinting(boolean state)
          Set the flag for printing the child count of groups.
 void enableDashPrinting(boolean state)
          Set the flag for the alternate indenting scheme, that uses dashes instead of spaces for each level of intent.
 void enableHashCodePrinting(boolean state)
          Set the flag for printing the hash code information.
 void enablePickMaskPrinting(boolean state)
          Set the flag for printing the pick mask information.
 void enableTransformMatrixPrinting(boolean state)
          Set the flag for printing out the transformation matrix of any encountered transform groups.
 boolean isBoundsPrintingEnabled()
          Check to see the current state of the bounds printing flag.
 boolean isChildCountPrintingEnabled()
          Check to see the current state of the child count printing flag.
 boolean isDashPrintingEnabled()
          Check to see the current state of the alternate indent printing flag.
 boolean isHashCodePrintingEnabled()
          Check to see the current state of the hash code printing flag.
 boolean isPickMaskPrintingEnabled()
          Check to see the current state of the pick mask printing flag.
 boolean isShortNamesEnabled()
          Check to see the current state of the alternate indent printing flag.
 boolean isTransformMatrixPrintingEnabled()
          Check to see the current state of the transform matrix printing flag.
 void observedNode(SceneGraphObject parent, SceneGraphObject child, boolean shared, int depth)
          Notification of a scene graph object that has been traversed in the scene.
 void printShortNames(boolean state)
          Set the flag for printing out just the class name rather than the fully-qualified class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScenePrinter

public ScenePrinter()
Create a new printer with all flags turned off.

Method Detail

observedNode

public void observedNode(SceneGraphObject parent,
                         SceneGraphObject child,
                         boolean shared,
                         int depth)
Notification of a scene graph object that has been traversed in the scene.

Specified by:
observedNode in interface SceneGraphTraversalObserver
Parameters:
parent - The parent node of this node
child - The child node that is being observed
shared - true if the object reference has already been traversed and this is beyond the first reference
depth - The depth of traversal from the top of the tree. Starts at 0 for top.

dumpGraph

public void dumpGraph(SceneGraphObject root)
Print the scene graph from the given root node.

Parameters:
root - The root of the scene graph to print from

enableBoundsPrinting

public void enableBoundsPrinting(boolean state)
Set the flag for printing the bounds information. If this is on, the bounds will be printed along with the node class name.

Parameters:
state - true to enable printing out of bounding box information

isBoundsPrintingEnabled

public boolean isBoundsPrintingEnabled()
Check to see the current state of the bounds printing flag.

Returns:
true if bounds printing is enabled

enableHashCodePrinting

public void enableHashCodePrinting(boolean state)
Set the flag for printing the hash code information. If this is on, the hash code will be printed along with the node class name.

Parameters:
state - true to enable printing out of bounding box information

isHashCodePrintingEnabled

public boolean isHashCodePrintingEnabled()
Check to see the current state of the hash code printing flag.

Returns:
true if hash code printing is enabled

enablePickMaskPrinting

public void enablePickMaskPrinting(boolean state)
Set the flag for printing the pick mask information. If this is on, the pick mask will be printed along with the node class name. The mask will be printed in Hexidecimal notation.

Parameters:
state - true to enable printing out of the pick mask

isPickMaskPrintingEnabled

public boolean isPickMaskPrintingEnabled()
Check to see the current state of the pick mask printing flag.

Returns:
true if pick mask printing is enabled

enableChildCountPrinting

public void enableChildCountPrinting(boolean state)
Set the flag for printing the child count of groups. If this is on, the number of children a group contains will be printed along with the node class name.

Parameters:
state - true to enable printing out the number of children

isChildCountPrintingEnabled

public boolean isChildCountPrintingEnabled()
Check to see the current state of the child count printing flag.

Returns:
true if child count printing is enabled

enableDashPrinting

public void enableDashPrinting(boolean state)
Set the flag for the alternate indenting scheme, that uses dashes instead of spaces for each level of intent.

Parameters:
state - true to enable printing dashes rather than spaces

isDashPrintingEnabled

public boolean isDashPrintingEnabled()
Check to see the current state of the alternate indent printing flag.

Returns:
true if dash printing is enabled

printShortNames

public void printShortNames(boolean state)
Set the flag for printing out just the class name rather than the fully-qualified class name.

Parameters:
state - true to enable printing dashes rather than spaces

isShortNamesEnabled

public boolean isShortNamesEnabled()
Check to see the current state of the alternate indent printing flag.

Returns:
true if dash printing is enabled

enableTransformMatrixPrinting

public void enableTransformMatrixPrinting(boolean state)
Set the flag for printing out the transformation matrix of any encountered transform groups.

Parameters:
state - true to enable printing out of matrix information

isTransformMatrixPrintingEnabled

public boolean isTransformMatrixPrintingEnabled()
Check to see the current state of the transform matrix printing flag.

Returns:
true if matrix printing is enabled

Aviatrix3D
2.1.0

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