visad.bom
Class PickManipulationRendererJ3D

java.lang.Object
  extended by visad.DataRenderer
      extended by visad.java3d.RendererJ3D
          extended by visad.java3d.DirectManipulationRendererJ3D
              extended by visad.bom.PickManipulationRendererJ3D
All Implemented Interfaces:
Cloneable

public class PickManipulationRendererJ3D
extends DirectManipulationRendererJ3D

PickManipulationRendererJ3D is the VisAD class for picking data in 3D.


Field Summary
 
Fields inherited from class visad.DataRenderer
enabled, pickCrawlToCursor
 
Constructor Summary
PickManipulationRendererJ3D()
          Default constructor
PickManipulationRendererJ3D(int mmm, int mmv)
          Construct a new PickManipulationRenderer using the mouseModifiers supplied.
 
Method Summary
 void addPoint(float[] x)
          Add a point.
 float checkClose(double[] origin, double[] direction)
          Check if ray intersects sub-manifold.
 void checkDirect()
          Check if direct manipulation is possible.
 Object clone()
           
 void drag_direct(VisADRay ray, boolean first, int mouseModifiers)
          Actual workhorse method of manipulation renderer.
 int getCloseIndex()
          Return the index of the closes point.
 CoordinateSystem getDisplayCoordinateSystem()
          Get the CoordinateSystem for the display side.
 String getWhyNotDirect()
          If direct manipulation is not possible, get the error message explaining why.
static void main(String[] args)
          test PickManipulationRendererJ3D
 void setSpatialValues(float[][] spatial_values)
          Set spatialValues from ShadowType.doTransform
 
Methods inherited from class visad.java3d.DirectManipulationRendererJ3D
clearScene, doTransform, isLegalTextureMap, setBranch, setLinks
 
Methods inherited from class visad.java3d.RendererJ3D
clearBranch, doAction, flush, getBranch, makeShadowFunctionType, makeShadowRealTupleType, makeShadowRealType, makeShadowSetType, makeShadowTextType, makeShadowTupleType, setBranchEarly, toggle
 
Methods inherited from class visad.DataRenderer
addException, checkAction, clearAVControls, clearExceptions, computeRanges, constrainDragPoint, earthToSpatial, earthToSpatial, findRayManifoldIntersection, get_all_feasible, get_any_changed, get_any_transform_control, getBadScale, getDisplay, getDisplayRenderer, getEarthDimension, getEarthUnits, getEnabled, getExceptionVector, getIsDirectManipulation, getLastMouseModifiers, getLatLonIndices, getLatLonRange, getLink, getLinks, getPickCrawlToCursor, getRanges, getRealVectorTypes, isTransformControl, prepareAction, realCheckDirect, release_direct, removeLink, set_all_feasible, setDisplay, setDisplayRenderer, setEarthSpatialData, setEarthSpatialDisplay, setIsDirectManipulation, setLastMouseModifiers, setLatLonIndices, setLinks, setPickCrawlToCursor, spatialToEarth, spatialToEarth, stop_direct, suppressExceptions
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PickManipulationRendererJ3D

public PickManipulationRendererJ3D()
Default constructor


PickManipulationRendererJ3D

public PickManipulationRendererJ3D(int mmm,
                                   int mmv)
Construct a new PickManipulationRenderer using the mouseModifiers supplied. mmm and mmv determine whehter SHIFT or CTRL keys are required - This is needed since this is a greedy DirectManipulationRenderer that will grab any right mouse click (that intersects its 2-D sub-manifold).

Parameters:
mmm - mouse modifiers mask.
mmv - mouse modifiers value.
Method Detail

checkDirect

public void checkDirect()
                 throws VisADException,
                        RemoteException
Check if direct manipulation is possible.

Overrides:
checkDirect in class DirectManipulationRendererJ3D
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

getWhyNotDirect

public String getWhyNotDirect()
If direct manipulation is not possible, get the error message explaining why.

Overrides:
getWhyNotDirect in class DataRenderer
Returns:
error message. Will be null if no errors.

addPoint

public void addPoint(float[] x)
              throws VisADException
Add a point. a no-op at this point.

Overrides:
addPoint in class DirectManipulationRendererJ3D
Parameters:
x - point value.
Throws:
VisADException - a VisAD error occurred

getDisplayCoordinateSystem

public CoordinateSystem getDisplayCoordinateSystem()
Get the CoordinateSystem for the display side.

Overrides:
getDisplayCoordinateSystem in class DataRenderer
Returns:
null for this DataRenderer

setSpatialValues

public void setSpatialValues(float[][] spatial_values)
Set spatialValues from ShadowType.doTransform

Overrides:
setSpatialValues in class DataRenderer
Parameters:
spatial_values - X, Y, Z values

checkClose

public float checkClose(double[] origin,
                        double[] direction)
Check if ray intersects sub-manifold.

Overrides:
checkClose in class DataRenderer
Parameters:
origin - x,y,z values of the ray
direction - x,y,z values of the ray?
Returns:
distance from the spatial values.

getCloseIndex

public int getCloseIndex()
Return the index of the closes point.

Returns:
index of closest point

drag_direct

public void drag_direct(VisADRay ray,
                        boolean first,
                        int mouseModifiers)
Actual workhorse method of manipulation renderer. It's what gets called when the click is done.

Overrides:
drag_direct in class DataRenderer
Parameters:
ray - ray of point where click is.
first - if this is the first time.
mouseModifiers - modifiers used with the mouse.

clone

public Object clone()
Overrides:
clone in class DirectManipulationRendererJ3D
Returns:
a copy of this DataRenderer

main

public static void main(String[] args)
                 throws VisADException,
                        RemoteException
test PickManipulationRendererJ3D

Throws:
VisADException
RemoteException