camera3d.test
Class NodeTester

java.lang.Object
  extended bycamera3d.test.NodeTester

public class NodeTester
extends java.lang.Object

An utility class to help with debugging of scene graphs. It encapsulates the basic Java3D and GUI structures, providing an access point for plugging in new nodes.

Author:
Fabio Roberto de Miranda, Carlos da Silva dos Santos

Constructor Summary
NodeTester()
          Creates a new NodeTester that runs in its own window.
NodeTester(boolean isStandalone)
          Creates a new NodeTester that runs in its own window.
 
Method Summary
 void add(javax.media.j3d.Node n)
          Adds a node to the scene graph
 void cleanup()
           
 javax.media.j3d.Canvas3D getCanvas3D()
          Returns the Canvas3D into which the scene will be rendered.
 javax.swing.JFrame getFrame()
          Returns the frame that contains this object, if it has been created as standalone.
 javax.media.j3d.TransformGroup getNodeTG()
          Returns the TransformGroup under which are attached the new Nodes.
 javax.media.j3d.BranchGroup getRootBG()
          Returns the root BranchGroup of this object's scenegraph.
 void setBackgroundColor(javax.vecmath.Color3f color)
          Sets the background color for the virtual scene.
 void setViewTransform(javax.media.j3d.Transform3D viewT3D)
          Sets the transformation of the View objects which is associated with this NodeTester.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeTester

public NodeTester()
Creates a new NodeTester that runs in its own window.


NodeTester

public NodeTester(boolean isStandalone)
Creates a new NodeTester that runs in its own window.

Parameters:
isStandalone - if true, the NodeTester will be created inside its own frame, otherwise no frame will be created now and the NodeTester's Canvas3D can later be added to another window.
Method Detail

getNodeTG

public javax.media.j3d.TransformGroup getNodeTG()
Returns the TransformGroup under which are attached the new Nodes.


getRootBG

public javax.media.j3d.BranchGroup getRootBG()
Returns the root BranchGroup of this object's scenegraph.


getCanvas3D

public javax.media.j3d.Canvas3D getCanvas3D()
Returns the Canvas3D into which the scene will be rendered.


setViewTransform

public void setViewTransform(javax.media.j3d.Transform3D viewT3D)
Sets the transformation of the View objects which is associated with this NodeTester.

Parameters:
viewT3D - the new value of the view transform.

cleanup

public void cleanup()

getFrame

public javax.swing.JFrame getFrame()
Returns the frame that contains this object, if it has been created as standalone.

Throws:
java.lang.IllegalStateException - if the object was not created as standalone.

add

public void add(javax.media.j3d.Node n)
Adds a node to the scene graph


setBackgroundColor

public void setBackgroundColor(javax.vecmath.Color3f color)
Sets the background color for the virtual scene.



Copyright © 2001-2003 F.R. Miranda, C.S. Santos, J.E. Kogler Jr.. All Rights Reserved.