visad.bio
Class PlaneSelector

java.lang.Object
  extended by visad.bio.PlaneSelector
Direct Known Subclasses:
AlignmentPlane, ArbitrarySlice

public class PlaneSelector
extends java.lang.Object

PlaneSelector maintains a data structure of three endpoints that can be manipulated by the user to specify an arbitrary plane in 3-D.


Field Summary
protected  RealType btype
          Real type mappings for the plane.
protected  CellImpl cell
          Computation cell for linking plane with endpoints.
protected  DisplayImpl display
          Associated display.
protected  RealTupleType domain
          Math type for domain and range tuples.
protected  RealType gtype
          Real type mappings for the plane.
protected  FlatField lines
          Perimeter lines for the plane.
protected  double[][] lineValues
          Color values for plane outline points.
protected  java.util.Vector listeners
          List of PlaneListeners to notify when plane changes.
protected  Gridded3DSet plane
          Semi-transparent planar slice.
protected  RealTupleType range
          Math type for domain and range tuples.
protected  DataReferenceImpl[] refs
          Data references for the endpoints and linked plane.
protected  DataRenderer[] renderers
          Data renderers for the endpoints and linked plane.
protected  RealType rtype
          Real type mappings for the plane.
protected  boolean visible
          Flag for whether selection plane is visible.
protected  double x1
          Starting coordinates for plane's endpoints.
protected  double x2
          Starting coordinates for plane's endpoints.
protected  double x3
          Starting coordinates for plane's endpoints.
protected  RealType xtype
          Real type mappings for the plane.
protected  double y1
          Starting coordinates for plane's endpoints.
protected  double y2
          Starting coordinates for plane's endpoints.
protected  double y3
          Starting coordinates for plane's endpoints.
protected  RealType ytype
          Real type mappings for the plane.
protected  double z1
          Starting coordinates for plane's endpoints.
protected  double z2
          Starting coordinates for plane's endpoints.
protected  double z3
          Starting coordinates for plane's endpoints.
protected  RealType ztype
          Real type mappings for the plane.
 
Constructor Summary
PlaneSelector(DisplayImpl display)
          Constructs a plane selector.
 
Method Summary
 void addListener(PlaneListener l)
          Adds a PlaneListener to be notified when plane changes.
protected  boolean computePlane(RealTuple[] tuple)
          Computes the appropriate plane from the current endpoints.
 void init(RealType xtype, RealType ytype, RealType ztype, RealType rtype, RealType gtype, RealType btype, java.awt.Color[] lineColors, java.awt.Color planeColor, double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
          Adds the plane selector to its display, with the given colors and starting endpoint coordinates.
 boolean isVisible()
          Gets whether the plane selector is visible.
protected  void notifyListeners()
          Notifies all PlaneListeners that plane has changed.
protected  boolean refresh()
          Refreshes the plane data from its endpoint locations.
 void removeListener(PlaneListener l)
          Removes a PlaneListener.
protected  void setData(int i, double[] vals)
          Moves the given reference point.
 void toggle(boolean visible)
          Toggles the plane selector's visibility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display

protected DisplayImpl display
Associated display.


refs

protected DataReferenceImpl[] refs
Data references for the endpoints and linked plane.


renderers

protected DataRenderer[] renderers
Data renderers for the endpoints and linked plane.


cell

protected CellImpl cell
Computation cell for linking plane with endpoints.


xtype

protected RealType xtype
Real type mappings for the plane.


ytype

protected RealType ytype
Real type mappings for the plane.


ztype

protected RealType ztype
Real type mappings for the plane.


rtype

protected RealType rtype
Real type mappings for the plane.


gtype

protected RealType gtype
Real type mappings for the plane.


btype

protected RealType btype
Real type mappings for the plane.


domain

protected RealTupleType domain
Math type for domain and range tuples.


range

protected RealTupleType range
Math type for domain and range tuples.


x1

protected double x1
Starting coordinates for plane's endpoints.


y1

protected double y1
Starting coordinates for plane's endpoints.


z1

protected double z1
Starting coordinates for plane's endpoints.


x2

protected double x2
Starting coordinates for plane's endpoints.


y2

protected double y2
Starting coordinates for plane's endpoints.


z2

protected double z2
Starting coordinates for plane's endpoints.


x3

protected double x3
Starting coordinates for plane's endpoints.


y3

protected double y3
Starting coordinates for plane's endpoints.


z3

protected double z3
Starting coordinates for plane's endpoints.


visible

protected boolean visible
Flag for whether selection plane is visible.


lineValues

protected double[][] lineValues
Color values for plane outline points.


lines

protected FlatField lines
Perimeter lines for the plane.


plane

protected Gridded3DSet plane
Semi-transparent planar slice.


listeners

protected java.util.Vector listeners
List of PlaneListeners to notify when plane changes.

Constructor Detail

PlaneSelector

public PlaneSelector(DisplayImpl display)
Constructs a plane selector.

Method Detail

toggle

public void toggle(boolean visible)
Toggles the plane selector's visibility.


init

public void init(RealType xtype,
                 RealType ytype,
                 RealType ztype,
                 RealType rtype,
                 RealType gtype,
                 RealType btype,
                 java.awt.Color[] lineColors,
                 java.awt.Color planeColor,
                 double x1,
                 double y1,
                 double z1,
                 double x2,
                 double y2,
                 double z2,
                 double x3,
                 double y3,
                 double z3)
          throws VisADException,
                 java.rmi.RemoteException
Adds the plane selector to its display, with the given colors and starting endpoint coordinates.

Throws:
VisADException
java.rmi.RemoteException

addListener

public void addListener(PlaneListener l)
Adds a PlaneListener to be notified when plane changes.


removeListener

public void removeListener(PlaneListener l)
Removes a PlaneListener.


isVisible

public boolean isVisible()
Gets whether the plane selector is visible.


refresh

protected boolean refresh()
Refreshes the plane data from its endpoint locations.


computePlane

protected boolean computePlane(RealTuple[] tuple)
                        throws VisADException,
                               java.rmi.RemoteException
Computes the appropriate plane from the current endpoints.

Throws:
VisADException
java.rmi.RemoteException

setData

protected void setData(int i,
                       double[] vals)
Moves the given reference point.


notifyListeners

protected void notifyListeners()
Notifies all PlaneListeners that plane has changed.