Aviatrix3D
2.0 Beta 2

org.j3d.aviatrix3d
Class SceneGraphPath

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphPath

public class SceneGraphPath
extends java.lang.Object

Representation of a path of nodes through the scene graph.

Version:
$Revision: 1.10 $
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, javax.vecmath.Matrix4f iMat)
          Create a new path with the given nodes from the array as the base path definition.
 
Method Summary
 void getInverseTransform(javax.vecmath.Matrix4f mat)
          Get the transformation matrix from the terminal node to the root of the path.
 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, javax.vecmath.Matrix4f iMat)
          Set the scene graph path to the new value.
 void updatePath(PickTarget[] picks, int num, javax.vecmath.Matrix4f mat, javax.vecmath.Matrix4f iMat)
          Set the scene graph path to the new value from a set of PickTarget instances.
 
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,
                      javax.vecmath.Matrix4f iMat)
               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
mat - The transformation matrix from the root to the local node
iMat - The transformation matrix from the local node to the root
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,
                       javax.vecmath.Matrix4f iMat)
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
mat - The transformation matrix from the root to the local node
iMat - The transformation matrix from the local node to the root

updatePath

public void updatePath(PickTarget[] picks,
                       int num,
                       javax.vecmath.Matrix4f mat,
                       javax.vecmath.Matrix4f iMat)
Set the scene graph path to the new value from a set of PickTarget instances. 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:
picks - The list of pick targets to copy
num - The number of nodes to copy from the array
mat - The transformation matrix from the root to the local node
iMat - The transformation matrix from the local node to the root

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 no matrix has been set, this will return the zero matrix.

Parameters:
mat - The matrix to copy the values into

getInverseTransform

public void getInverseTransform(javax.vecmath.Matrix4f mat)
Get the transformation matrix from the terminal node to the root of the path. If no matrix has been set, this will return the zero matrix.

Parameters:
mat - The matrix to copy the values into

Aviatrix3D
2.0 Beta 2

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