j3d.org Aviatrix3D

org.j3d.aviatrix3d
Class SceneGraphPath

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphPath

public class SceneGraphPath
extends java.lang.Object

Representation of a path of nodes through the scene graph.

Version:
$Revision: 1.6 $
Author:
Justin Couch

Constructor Summary
SceneGraphPath()
          Create a new path instance with a pre-allocated set of storage space internally.
SceneGraphPath(int initialSize)
          Create a new path instance with a pre-allocated set of storage space internally.
SceneGraphPath(Node[] nodes, int num, javax.vecmath.Matrix4f mat)
          Create a new path with the given nodes from the array as the base path definition.
 
Method Summary
 Node getNode(int pos)
          Get a single node at the given index position.
 int getNodeCount()
          Get the number of valid items in the path.
 Node[] getNodes()
          Get the raw list of path items from the internal array.
 Node getTerminalNode()
          Get the leaf node at the end of the path.
 void getTransform(javax.vecmath.Matrix4f mat)
          Get the transformation matrix from the root of the path the to the terminal node.
 void updatePath(Node[] nodes, int num, javax.vecmath.Matrix4f mat)
          Set the scene graph path to the new value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneGraphPath

public SceneGraphPath()
Create a new path instance with a pre-allocated set of storage space internally.


SceneGraphPath

public SceneGraphPath(int initialSize)
Create a new path instance with a pre-allocated set of storage space internally.

Parameters:
initialSize - number of items to create
Throws:
java.lang.IllegalArgumentException - if the number is < 1

SceneGraphPath

public SceneGraphPath(Node[] nodes,
                      int num,
                      javax.vecmath.Matrix4f mat)
               throws java.lang.IllegalArgumentException
Create a new path with the given nodes from the array as the base path definition.

Parameters:
nodes - The list of nodes to copy
num - The number of nodes to copy from the array
Throws:
java.lang.IllegalArgumentException - The last node is not a Leaf
Method Detail

updatePath

public void updatePath(Node[] nodes,
                       int num,
                       javax.vecmath.Matrix4f mat)
Set the scene graph path to the new value. Invalidates the current matrix and another will need to be calculated. The final item in the path must be an instance of a leaf node. If not, an exception is generated.

Parameters:
nodes - The list of nodes to copy
num - The number of nodes to copy from the array

getTerminalNode

public Node getTerminalNode()
Get the leaf node at the end of the path.


getNode

public Node getNode(int pos)
             throws java.lang.ArrayIndexOutOfBoundsException
Get a single node at the given index position. If the index is greater than the number of nodes found in the path, then generate an exception.

Parameters:
pos - The index of the node in the path
Returns:
The node instance at that position
Throws:
java.lang.ArrayIndexOutOfBoundsException - The index was out of range

getNodes

public Node[] getNodes()
Get the raw list of path items from the internal array. The array may be longer than the number of valid nodes, so make sure to get the length as well.


getNodeCount

public int getNodeCount()
Get the number of valid items in the path.

Returns:
The number of valid items.

getTransform

public void getTransform(javax.vecmath.Matrix4f mat)
Get the transformation matrix from the root of the path the to the terminal node. If

Parameters:
mat - The matrix to copy the values into

j3d.org Aviatrix3D

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