NASA World Wind

gov.nasa.worldwind.ogc.collada.impl
Class ColladaTraversalContext

java.lang.Object
  extended by gov.nasa.worldwind.ogc.collada.impl.ColladaTraversalContext

public class ColladaTraversalContext
extends Object

Context to keep track of state while a COLLADA document is traversed. The traversal context keeps track of the transform matrix stack that determines how COLLADA nodes are rendered.


Field Summary
protected  Stack<Matrix> matrixStack
          Transform matrix stack.
 
Constructor Summary
ColladaTraversalContext()
          Create a new traversal context.
 
Method Summary
 void initialize()
          Reset the context so that it may be used for a fresh traversal.
 void multiplyMatrix(Matrix m)
          Multiply the matrix at the top of the stack with another matrix.
 Matrix peekMatrix()
          Returns the matrix at the top of the matrix stack, but does not modify the stack.
 Matrix popMatrix()
          Removes the matrix at the top of the matrix stack.
 void pushMatrix()
          Clone the matrix at the top of the matrix stack and push the clone onto the stack.
 void pushMatrix(Matrix m)
          Push a matrix onto the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrixStack

protected Stack<Matrix> matrixStack
Transform matrix stack.

Constructor Detail

ColladaTraversalContext

public ColladaTraversalContext()
Create a new traversal context. The traversal matrix stack initially contains one element: the identity matrix.

Method Detail

initialize

public void initialize()
Reset the context so that it may be used for a fresh traversal.


multiplyMatrix

public void multiplyMatrix(Matrix m)
Multiply the matrix at the top of the stack with another matrix. The product becomes the new top matrix.

Parameters:
m - Matrix to multiply. Multiplication is performed as top * m.

peekMatrix

public Matrix peekMatrix()
Returns the matrix at the top of the matrix stack, but does not modify the stack.

Returns:
The matrix at the top of the matrix stack.

popMatrix

public Matrix popMatrix()
Removes the matrix at the top of the matrix stack.

Returns:
The matrix that was at the top of the stack.

pushMatrix

public void pushMatrix()
Clone the matrix at the top of the matrix stack and push the clone onto the stack.


pushMatrix

public void pushMatrix(Matrix m)
Push a matrix onto the stack.

Parameters:
m - Matrix to add to the stack. This matrix becomes the new top matrix.

NASA World Wind