All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.media.j3d.Node

java.lang.Object
   |
   +----javax.media.j3d.SceneGraphObject
           |
           +----javax.media.j3d.Node

public abstract class Node
extends SceneGraphObject
The Node class provides an abstract class for all Group and Leaf Nodes. It provides a common framework for constructing a Java 3D scene graph, specifically bounding volumes.


Variable Index

 o ALLOW_AUTO_COMPUTE_BOUNDS_READ
Specifies that this Node allows read access to its bounds auto compute information.
 o ALLOW_AUTO_COMPUTE_BOUNDS_WRITE
Specifies that this Node allows write access to its bounds auto compute information.
 o ALLOW_BOUNDS_READ
Specifies that this Node allows read access to its bounds information.
 o ALLOW_BOUNDS_WRITE
Specifies that this Node allows write access to its bounds information.
 o ALLOW_LOCAL_TO_VWORLD_READ
Specifies that this Node allows read access to its local coordinates to virtual world (Vworld) coordinates transform.
 o ALLOW_PICKABLE_READ
Specifies that this Node allows reading its pickability state.
 o ALLOW_PICKABLE_WRITE
Specifies that this Node allows write access its pickability state.
 o ENABLE_PICK_REPORTING
Specifies that this Node will be reported in a SceneGraphPath.

Constructor Index

 o Node()
Constructs and initializes a Node object.

Method Index

 o cloneNode(boolean)
Used to create a new instance of the node.
 o cloneTree()
Duplicates all the nodes of the specified sub-graph.
 o cloneTree(boolean)
Duplicates all the nodes of the specified sub-graph.
 o cloneTree(boolean, boolean)
Duplicates all the nodes of the specified sub-graph.
 o duplicateNode(Node, boolean)
Copies all node information from originalNode into the current node.
 o getBounds()
Returns the bounding object of a node.
 o getBoundsAutoCompute()
Gets the value indicating if the automatic calcuation of geometric bounds of a node is on/off.
 o getLocalToVworld(SceneGraphPath, Transform3D)
Retrieves the local coordinates to virtual world coordinates transform for the particular path in the scene graph ending with this node.
 o getLocalToVworld(Transform3D)
Retrieves the local coordinates to virtual world coordinates transform for this node in the scene graph.
 o getParent()
Retrieves the parent of this Node.
 o getPickable()
Returns true if this Node is pickable, false if it is not pickable.
 o setBounds(Bounds)
Sets the geometric bounds of a node.
 o setBoundsAutoCompute(boolean)
Turns the automatic calcuation of geometric bounds of a node on/off.
 o setPickable(boolean)
When set to true this Node can be Picked.

Variables

 o ENABLE_PICK_REPORTING
 public static final int ENABLE_PICK_REPORTING
Specifies that this Node will be reported in a SceneGraphPath. Default is disabled

See Also:
SceneGraphPath
 o ALLOW_BOUNDS_READ
 public static final int ALLOW_BOUNDS_READ
Specifies that this Node allows read access to its bounds information.

 o ALLOW_BOUNDS_WRITE
 public static final int ALLOW_BOUNDS_WRITE
Specifies that this Node allows write access to its bounds information.

 o ALLOW_PICKABLE_READ
 public static final int ALLOW_PICKABLE_READ
Specifies that this Node allows reading its pickability state.

 o ALLOW_PICKABLE_WRITE
 public static final int ALLOW_PICKABLE_WRITE
Specifies that this Node allows write access its pickability state.

 o ALLOW_AUTO_COMPUTE_BOUNDS_READ
 public static final int ALLOW_AUTO_COMPUTE_BOUNDS_READ
Specifies that this Node allows read access to its bounds auto compute information.

 o ALLOW_AUTO_COMPUTE_BOUNDS_WRITE
 public static final int ALLOW_AUTO_COMPUTE_BOUNDS_WRITE
Specifies that this Node allows write access to its bounds auto compute information.

 o ALLOW_LOCAL_TO_VWORLD_READ
 public static final int ALLOW_LOCAL_TO_VWORLD_READ
Specifies that this Node allows read access to its local coordinates to virtual world (Vworld) coordinates transform.

Constructors

 o Node
 public Node()
Constructs and initializes a Node object.

Methods

 o getParent
 public final Node getParent()
Retrieves the parent of this Node. This method is only valid during the construction of the scene graph.

Returns:
the parent of this node, or null if this node has no parent
Throws: RestrictedAccessException
if this object is part of live or compiled scene graph
 o setBounds
 public final void setBounds(Bounds bounds)
Sets the geometric bounds of a node.

Parameters:
bounds - the bounding object for a node
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getBounds
 public final Bounds getBounds()
Returns the bounding object of a node.

Returns:
the node's bounding object
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o setBoundsAutoCompute
 public final void setBoundsAutoCompute(boolean autoCompute)
Turns the automatic calcuation of geometric bounds of a node on/off.

Parameters:
autoCompute - indicates if the node's bounding object is automatically computed.
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getBoundsAutoCompute
 public final boolean getBoundsAutoCompute()
Gets the value indicating if the automatic calcuation of geometric bounds of a node is on/off.

Returns:
the node's auto compute flag for the geometric bounding object
Throws: CapabilityNotSetException
if appropriate capability is not set and this object is part of live or compiled scene graph
 o getLocalToVworld
 public final void getLocalToVworld(Transform3D t)
Retrieves the local coordinates to virtual world coordinates transform for this node in the scene graph. This is the composite of all transforms in the scene graph from the root down to this node. It is only valid for nodes that are part of a live scene graph.

Parameters:
t - the object that will receive the local coordinates to Vworld coordinates transform.
Throws: RestrictedAccessException
if the node is not part of a live scene graph
Throws: CapabilityNotSetException
if appropriate capability is not set and this node is part of live scene graph
Throws: IllegalSharingException
if the node is a descendant of a SharedGroup node.
 o getLocalToVworld
 public final void getLocalToVworld(SceneGraphPath path,
                                    Transform3D t)
Retrieves the local coordinates to virtual world coordinates transform for the particular path in the scene graph ending with this node. This is the composite of all transforms in the scene graph from the root down to this node via the specified Link nodes. It is only valid for nodes that are part of a live scene graph.

Parameters:
path - the specific path from the node to the Locale
t - the object that will receive the local coordinates to Vworld coordinates transform.
Throws: RestrictedAccessException
if the node is not part of a live scene graph
Throws: CapabilityNotSetException
if appropriate capability is not set and this node is part of live scene graph
Throws: IllegalArgumentException
if the specified path does not contain a valid Locale, or if the last node in the path is different from this node
 o cloneTree
 public Node cloneTree()
Duplicates all the nodes of the specified sub-graph. For Group Nodes the group node is duplicated via a call to cloneNode and then cloneTree is called for each child node. For Leaf Nodes, component data can either be duplicated or be made a reference to the original data. Leaf Node cloneTree behavior is determined by the duplicateOnCloneTree flag found in every Leaf Node's component data class and by the forceDuplicate paramter.

Returns:
a reference to the cloned sub-graph.
Throws: DanglingReferenceException
When a dangling reference is discovered during the cloneTree operation.
See Also:
setDuplicateOnCloneTree
 o cloneTree
 public Node cloneTree(boolean forceDuplicate)
Duplicates all the nodes of the specified sub-graph. For Group Nodes the group node is duplicated via a call to cloneNode and then cloneTree is called for each child node. For Leaf Nodes, component data can either be duplicated or be made a reference to the original data. Leaf Node cloneTree behavior is determined by the duplicateOnCloneTree flag found in every Leaf Node's component data class and by the forceDuplicate paramter.

Parameters:
forceDuplicate - when set to true, causes the duplicateOnCloneTree flag to be ignored. When false, the value of each node's duplicateOnCloneTree determines whether data is duplicated or copied.
Returns:
a reference to the cloned scene graph.
Throws: DanglingReferenceException
When a dangling reference is discovered during the cloneTree operation.
See Also:
setDuplicateOnCloneTree
 o cloneTree
 public Node cloneTree(boolean forceDuplicate,
                       boolean allowDanglingReference)
Duplicates all the nodes of the specified sub-graph. For Group Nodes the group node is duplicated via a call to cloneNode and then cloneTree is called for each child node. For Leaf Nodes, component data can either be duplicated or be made a reference to the original data. Leaf Node cloneTree behavior is determined by the duplicateOnCloneTree flag found in every Leaf Node's component data class and by the forceDuplicate paramter.

Parameters:
forceDuplicate - when set to true, causes the duplicateOnCloneTree flag to be ignored. When false, the value of each node's duplicateOnCloneTree determines whether data is duplicated or copied.
allowDanglingReferences - when set to true allows the cloneTree method to complete even whan a dangling reference is discovered. When this parameter is false a DanglingReferenceException is generated as soon as cloneTree detects this situation.
Returns:
a reference to the cloned scene graph.
Throws: DanglingReferenceException
When a dangling reference is discovered during the cloneTree operation and the allowDanglingReference parameter is false.
See Also:
setDuplicateOnCloneTree
 o cloneNode
 public Node cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. This routine is called by cloneTree to duplicate the current node. cloneNode should be overridden by any user subclassed objects. All subclasses must have their cloneNode method consist of the following lines:

     public Node cloneNode(boolean forceDuplicate) {
         UserSubClass usc = new UserSubClass();
         usc.duplicateNode(this, forceDuplicate);
         return usc;
     }
 

Parameters:
forceDuplicate - when set to true, causes the duplicateOnCloneTree flag to be ignored. When false, the value of each node's duplicateOnCloneTree variable determines whether NodeComponent data is duplicated or copied.
See Also:
cloneTree, duplicateNode, setDuplicateOnCloneTree
 o duplicateNode
 public void duplicateNode(Node originalNode,
                           boolean forceDuplicate)
Copies all node information from originalNode into the current node. This method is called from the cloneNode method which is, in turn, called by the cloneTree method.

For any NodeComponent objects contained by the object being duplicated, each NodeComponent object's duplicateOnCloneTree value is used to determine whether the NodeComponent should be duplicated in the new node or if just a reference to the current node should be placed in the new node. This flag can be overridden by setting the forceDuplicate parameter in the cloneTree method to true.

Parameters:
originalNode - the original node to duplicate.
forceDuplicate - when set to true, causes the duplicateOnCloneTree flag to be ignored. When false, the value of each node's duplicateOnCloneTree variable determines whether NodeComponent data is duplicated or copied.
Overrides:
duplicateNode in class SceneGraphObject
See Also:
cloneTree, cloneNode, setDuplicateOnCloneTree
 o setPickable
 public void setPickable(boolean pickable)
When set to true this Node can be Picked. Setting to false indicates that this node and it's children are ALL unpickable.

Parameters:
pickable - Indicates if this node should be pickable or not
 o getPickable
 public boolean getPickable()
Returns true if this Node is pickable, false if it is not pickable.


All Packages  Class Hierarchy  This Package  Previous  Next  Index