anl.aida.viz3d
Class StackItem2

java.lang.Object
  extended by anl.aida.viz3d.VSpatial
      extended by anl.aida.viz3d.StackItem2
All Implemented Interfaces:
java.lang.Comparable<StackItem2>

public class StackItem2
extends VSpatial
implements java.lang.Comparable<StackItem2>

An item in a StackDisplay.


Field Summary
private  StackDrawable2 drawable
           
private  long index
           
private static float MAX_ROT
           
private static float MAX_X
           
private static float MAX_Z
           
private  float rotation
           
private  float x
           
private  float xOff
           
private  float z
           
private  float zOff
           
 
Fields inherited from class anl.aida.viz3d.VSpatial
appearence, boundingSphere, clientMap, dirty, id, localRotation, localScale, localTrans, parent, visible, worldRotation, worldScale, worldTrans
 
Constructor Summary
StackItem2(StackDrawable2 drawable, long index)
           
 
Method Summary
 int compareTo(StackItem2 o)
           
protected  void doDraw(javax.media.opengl.GL gl)
          Does the actual drawing.
protected  BoundingSphere doGetBoundingSphere()
          Gets the actual bounding sphere.
 void draw(javax.media.opengl.GL gl)
          Draws this StackItem.
 BoundingSphere getBoundingSphere()
          Gets this VSpatial's BoundingSphere in the world frame.
 BoundingSphere getLocalBoundingSphere()
          Gets this VSpatial's BoundingSphere in its local frame.
 long getSortingIndex()
          Gets an index for this StackItem that can be used to sort this item with respect to other items.
 void intersects(javax.vecmath.Point3f rayOrigin, javax.vecmath.Vector3f rayDirection, Accumulator accumulator)
          Performs an intersection these on this VSpatial with the specified ray.
 boolean isMoving()
          Gets whether or not this slice is currently moving.
protected  void markAsDirty()
           
 boolean moveOff()
          Moves this StackItem off the stack.
 boolean moveOn()
          Moves this StackItem onto the stack.
 void putOffStack()
          Puts this StackItem completely off the stack.
 void putOnStack()
          Puts this StackItem completely on the stack.
 void setOffsets(float xOff, float zOff)
          Sets the offsets for this StackItem.
 void stackPosition(int index, int stackSize)
          Notifies this StackItem of its position in the stack prior to drawing.
 java.lang.String toString()
           
 void updateWorldTransformation()
           
 
Methods inherited from class anl.aida.viz3d.VSpatial
getMaterialAppearence, getParent, getProperty, getTranslation, getWorldToLocalTransform, isVisible, percolateDirtyUp, putProperty, rotate, rotate, scale, setMaterialAppearence, setParent, setVisible, transform, translate, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_X

private static float MAX_X

MAX_Z

private static float MAX_Z

MAX_ROT

private static float MAX_ROT

rotation

private float rotation

x

private float x

z

private float z

xOff

private float xOff

zOff

private float zOff

drawable

private StackDrawable2 drawable

index

private long index
Constructor Detail

StackItem2

public StackItem2(StackDrawable2 drawable,
                  long index)
Parameters:
item -
Method Detail

stackPosition

public void stackPosition(int index,
                          int stackSize)
Notifies this StackItem of its position in the stack prior to drawing. If the index is -1, then this StackItem is off the stack. Index 0 is the top of the stack.

Parameters:
index - the index of this StackItem in the stack
stackSize - the current size of the stack

getSortingIndex

public long getSortingIndex()
Gets an index for this StackItem that can be used to sort this item with respect to other items.

Returns:
an sorting index for this StackItem

putOffStack

public void putOffStack()
Puts this StackItem completely off the stack.


putOnStack

public void putOnStack()
Puts this StackItem completely on the stack.


isMoving

public boolean isMoving()
Gets whether or not this slice is currently moving. A moving StackItem is neither fully on or off the stack.

Returns:
whether or not this slice is currently moving.

moveOff

public boolean moveOff()
Moves this StackItem off the stack.

Returns:
true if this item is completely off the stack and will move no further, otherwise false.

setOffsets

public void setOffsets(float xOff,
                       float zOff)
Sets the offsets for this StackItem.

Parameters:
xOff - the x offset
zOff - the y offset

moveOn

public boolean moveOn()
Moves this StackItem onto the stack.

Returns:
true if this item is completely on the stack and will move no further, otherwise false.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

draw

public void draw(javax.media.opengl.GL gl)
Draws this StackItem.

Overrides:
draw in class VSpatial
Parameters:
gl -
zOff - the z offset for this StackItem
xOff - the x offset for this StackItem

updateWorldTransformation

public void updateWorldTransformation()
Overrides:
updateWorldTransformation in class VSpatial

doDraw

protected void doDraw(javax.media.opengl.GL gl)
Description copied from class: VSpatial
Does the actual drawing.

Specified by:
doDraw in class VSpatial

markAsDirty

protected void markAsDirty()
Overrides:
markAsDirty in class VSpatial

getBoundingSphere

public BoundingSphere getBoundingSphere()
Description copied from class: VSpatial
Gets this VSpatial's BoundingSphere in the world frame.

Overrides:
getBoundingSphere in class VSpatial
Returns:
this VSpatial's BoundingSphere in the world frame.

doGetBoundingSphere

protected BoundingSphere doGetBoundingSphere()
Description copied from class: VSpatial
Gets the actual bounding sphere. This is called by getBoundingSphere once the worldTransforms have been updated.

Overrides:
doGetBoundingSphere in class VSpatial
Returns:
this VSpatial's BoundingSphere.

getLocalBoundingSphere

public BoundingSphere getLocalBoundingSphere()
Description copied from class: VSpatial
Gets this VSpatial's BoundingSphere in its local frame.

Overrides:
getLocalBoundingSphere in class VSpatial
Returns:
this VSpatial's BoundingSphere in its local frame.

intersects

public void intersects(javax.vecmath.Point3f rayOrigin,
                       javax.vecmath.Vector3f rayDirection,
                       Accumulator accumulator)
Description copied from class: VSpatial
Performs an intersection these on this VSpatial with the specified ray. If the intersection passes, this VSpatial should be added to the Accumulator.

Specified by:
intersects in class VSpatial
Parameters:
rayOrigin - the ray's origin
rayDirection - the ray's direction
accumulator - the accumulator to add the VSpatial to

compareTo

public int compareTo(StackItem2 o)
Specified by:
compareTo in interface java.lang.Comparable<StackItem2>