visad.bom
Class CurveManipulationRendererJ3D

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

public class CurveManipulationRendererJ3D
extends DirectManipulationRendererJ3D

CurveManipulationRendererJ3D is the VisAD class for direct manipulation rendering of curves under Java2D, where curves are represented by UnionSets of Gridded2DSets with manifold dimension = 2


Field Summary
 
Fields inherited from class visad.DataRenderer
enabled, pickCrawlToCursor
 
Constructor Summary
CurveManipulationRendererJ3D()
          Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to two of (XAxis, YAxis, ZAxis).
CurveManipulationRendererJ3D(int mmm, int mmv)
          Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to two of (XAxis, YAxis, ZAxis).
CurveManipulationRendererJ3D(int mmm, int mmv, boolean oo)
          Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to two of (XAxis, YAxis, ZAxis).
 
Method Summary
 void addPoint(float[] x)
          Add a point to the data.
 float checkClose(double[] origin, double[] direction)
          Find minimum distance from ray to spatialValues.
 void checkDirect()
          Check whether direct manipulation is possible for this Renderer.
 Object clone()
          Clone this renderer.
 void drag_direct(VisADRay ray, boolean first, int mouseModifiers)
          This method is called when direct manipulation is occuring.
 String getWhyNotDirect()
          Get the error messages on why direct manipulation is not possible.
static void main(String[] args)
          test CurveManipulationRendererJ3D
 ShadowType makeShadowSetType(SetType type, DataDisplayLink link, ShadowType parent)
          Create a ShadowType based on the SetType
 void release_direct()
          Mouse button released, ending direct manipulation.
 void setGreedy(boolean greedy)
           
 void setSpatialValues(float[][] spatial_values)
          Set spatialValues from ShadowType.doTransform.
 void stop_direct()
          Stop direct manipulation.
 
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, 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, getDisplayCoordinateSystem, getDisplayRenderer, getEarthDimension, getEarthUnits, getEnabled, getExceptionVector, getIsDirectManipulation, getLastMouseModifiers, getLatLonIndices, getLatLonRange, getLink, getLinks, getPickCrawlToCursor, getRanges, getRealVectorTypes, isTransformControl, prepareAction, realCheckDirect, removeLink, set_all_feasible, setDisplay, setDisplayRenderer, setEarthSpatialData, setEarthSpatialDisplay, setIsDirectManipulation, setLastMouseModifiers, setLatLonIndices, setLinks, setPickCrawlToCursor, spatialToEarth, spatialToEarth, suppressExceptions
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurveManipulationRendererJ3D

public CurveManipulationRendererJ3D()
Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to two of (XAxis, YAxis, ZAxis).


CurveManipulationRendererJ3D

public CurveManipulationRendererJ3D(int mmm,
                                    int mmv)
Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to two of (XAxis, YAxis, ZAxis). 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
mmv - mouse mask to check.

CurveManipulationRendererJ3D

public CurveManipulationRendererJ3D(int mmm,
                                    int mmv,
                                    boolean oo)
Construct a DataRenderer that supports direct manipulation of representations of curves by UnionSets of Gridded2DSets with manifold dimension = 2; the Set's domain RealTypes must be mapped to two of (XAxis, YAxis, ZAxis). 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
mmv - mouse mask to check.
oo - if true, only one curve should exist at any one time.
Method Detail

makeShadowSetType

public ShadowType makeShadowSetType(SetType type,
                                    DataDisplayLink link,
                                    ShadowType parent)
                             throws VisADException,
                                    RemoteException
Create a ShadowType based on the SetType

Overrides:
makeShadowSetType in class RendererJ3D
Parameters:
type - SetType of UnionSet.
link - DataDisplayLink for DataReference
parent - Parent ShadowType
Returns:
constructed ShadowType
Throws:
VisADException - problem creating a VisAD object
RemoteException - problem creating a remote object

checkDirect

public void checkDirect()
                 throws VisADException,
                        RemoteException
Check whether direct manipulation is possible for this Renderer. Set appropriate error conditions if not possible.

Overrides:
checkDirect in class DirectManipulationRendererJ3D
Throws:
VisADException - problem accessing information
RemoteException - problem accessing information for remote objects

getWhyNotDirect

public String getWhyNotDirect()
Get the error messages on why direct manipulation is not possible.

Overrides:
getWhyNotDirect in class DataRenderer
Returns:
error messages.

addPoint

public void addPoint(float[] x)
              throws VisADException
Add a point to the data. Not used, but may be needed for performance.

Overrides:
addPoint in class DirectManipulationRendererJ3D
Parameters:
x - point to add.
Throws:
VisADException - error occured.

setSpatialValues

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

Overrides:
setSpatialValues in class DataRenderer
Parameters:
spatial_values - spatial values.

checkClose

public float checkClose(double[] origin,
                        double[] direction)
Find minimum distance from ray to spatialValues.

Overrides:
checkClose in class DataRenderer
Parameters:
origin - origin of ray
direction - direction of the ray
Returns:
miniumum distance from ray to spatial values

setGreedy

public void setGreedy(boolean greedy)

release_direct

public void release_direct()
Mouse button released, ending direct manipulation. Does nothing now, may need to do this for performance.

Overrides:
release_direct in class DataRenderer

stop_direct

public void stop_direct()
Stop direct manipulation.

Overrides:
stop_direct in class DataRenderer

drag_direct

public void drag_direct(VisADRay ray,
                        boolean first,
                        int mouseModifiers)
This method is called when direct manipulation is occuring. This adds points to the Gridded2DSet that comprises the current line being drawn.

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

clone

public Object clone()
Clone this renderer.

Overrides:
clone in class DirectManipulationRendererJ3D
Returns:
new Renderer with same parameters.

main

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

Throws:
VisADException
RemoteException