edu.mines.jtk.sgl
Class AxisAlignedPanel

java.lang.Object
  extended by edu.mines.jtk.sgl.Node
      extended by edu.mines.jtk.sgl.AxisAlignedPanel
Direct Known Subclasses:
ImagePanel

public abstract class AxisAlignedPanel
extends Node

An axis-aligned panel is a special child of an axis-aligned frame. Nodes that draw themselves in an axis-aligned frame typically extend this abstract class, which handles some node responsibilities, such as picking and computing the node's bounding sphere.

Version:
2006.06.01
Author:
Dave Hale, Colorado School of Mines

Constructor Summary
AxisAlignedPanel()
          Constructs a panel with null frame.
AxisAlignedPanel(AxisAlignedFrame frame)
          Constructs a panel with specified frame.
 
Method Summary
protected  BoundingSphere computeBoundingSphere(boolean finite)
          Computes the bounding sphere for this panel.
 BoxConstraint getBoxConstraint()
          Gets the box constraint for this panel.
 AxisAlignedFrame getFrame()
          Gets the frame for this panel.
 void pick(PickContext pc)
          Picks this panel.
 void setFrame(AxisAlignedFrame frame)
          Sets the frame for this panel.
 
Methods inherited from class edu.mines.jtk.sgl.Node
countParents, cull, cullApply, cullBegin, cullEnd, dirtyBoundingSphere, dirtyDraw, draw, drawApply, drawBegin, drawEnd, getAttributeBits, getBoundingSphere, getParents, getWorld, isSelected, pickApply, pickBegin, pickEnd, selectedChanged, setSelected, setStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisAlignedPanel

public AxisAlignedPanel()
Constructs a panel with null frame.


AxisAlignedPanel

public AxisAlignedPanel(AxisAlignedFrame frame)
Constructs a panel with specified frame.

Parameters:
frame - the frame.
Method Detail

getFrame

public AxisAlignedFrame getFrame()
Gets the frame for this panel.

Returns:
the frame; null, if none.

setFrame

public void setFrame(AxisAlignedFrame frame)
Sets the frame for this panel. If the frame is not null and this panel has a non-null constraint, then this method sets the constraint of its frame accordingly.

Parameters:
frame - the frame; null, if none.

getBoxConstraint

public BoxConstraint getBoxConstraint()
Gets the box constraint for this panel. This implementation simply returns null, for no constraint. Panels that extend this class may override this method to return a more appropriate constraint.

Returns:
the box constraint; null, if none.

pick

public void pick(PickContext pc)
Picks this panel. This implementation delegates picking to its frame; or; if not in a frame, this implementation does nothing.

Panels that extend this class and that precisely fill their quad frame when drawn may simply inherit this implementation.

Overrides:
pick in class Node
Parameters:
pc - the pick context.

computeBoundingSphere

protected BoundingSphere computeBoundingSphere(boolean finite)
Computes the bounding sphere for this panel. This implementation delegates this computation to its frame; or, if not in a frame, this implementation returns an empty bounding sphere.

Panels that extend this class typically inherit this implementation, but may of course override it as necessary.

Overrides:
computeBoundingSphere in class Node
Parameters:
finite - true, to force bounding sphere to be finite.
Returns:
the computed bounding sphere.