visad.java3d
Class RendererJ3D

java.lang.Object
  extended byvisad.DataRenderer
      extended byvisad.java3d.RendererJ3D
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DefaultRendererJ3D, DirectManipulationRendererJ3D

public abstract class RendererJ3D
extends DataRenderer

RendererJ3D is the VisAD abstract super-class for graphics rendering algorithms under Java3D. These transform Data objects into 3-D (or 2-D) depictions in a Display window.

RendererJ3D is not Serializable and should not be copied between JVMs.


Field Summary
(package private)  javax.media.j3d.BranchGroup[] branches
           
(package private)  boolean[] branchNonEmpty
           
(package private)  javax.media.j3d.Switch sw
          switch is parent of any BranchGroups created by this
(package private)  boolean[] switchFlags
           
(package private)  javax.media.j3d.BranchGroup swParent
          parent of sw for 'detach'
 
Fields inherited from class visad.DataRenderer
enabled, pickCrawlToCursor
 
Constructor Summary
RendererJ3D()
           
 
Method Summary
(package private) abstract  void addSwitch(DisplayRendererJ3D displayRenderer, javax.media.j3d.BranchGroup branch)
           
 void clearBranch()
          clear part of Display scene graph generated by this DataRenderer
 void clearScene()
          clear any scene graph created by this DataRenderer, and clear all instance variables
 boolean doAction()
          re-transform if needed; return false if not done
abstract  javax.media.j3d.BranchGroup doTransform()
          create a BranchGroup scene graph for Data in links; this can put Behavior objects in the scene graph for DataRenderer classes that implement direct manipulation widgets; may reduce work by only changing scene graph for Data and Controls that have changed: 1.
 void flush(javax.media.j3d.Group branch)
           
 javax.media.j3d.BranchGroup getBranch()
           
 ShadowType makeShadowFunctionType(FunctionType type, DataDisplayLink link, ShadowType parent)
          factory method for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowFunctionType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;
 ShadowType makeShadowRealTupleType(RealTupleType type, DataDisplayLink link, ShadowType parent)
          factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowRealTupleType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;
 ShadowType makeShadowRealType(RealType type, DataDisplayLink link, ShadowType parent)
          factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowRealType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;
 ShadowType makeShadowSetType(SetType type, DataDisplayLink link, ShadowType parent)
          factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowSetType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;
 ShadowType makeShadowTextType(TextType type, DataDisplayLink link, ShadowType parent)
          factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowTextType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;
 ShadowType makeShadowTupleType(TupleType type, DataDisplayLink link, ShadowType parent)
          factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowTupleType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;
 void setBranchEarly(javax.media.j3d.BranchGroup branch)
           
 void setLinks(DataDisplayLink[] links, DisplayImpl d)
          set DataDisplayLinks for linked Data, and set associated DisplayImpl
 void toggle(boolean on)
          Sets the visibility of the data being rendered by this instance.
 
Methods inherited from class visad.DataRenderer
addException, addPoint, checkAction, checkClose, checkDirect, clearAVControls, clearExceptions, clone, computeRanges, drag_direct, 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, getWhyNotDirect, isLegalTextureMap, isTransformControl, prepareAction, realCheckDirect, release_direct, removeLink, set_all_feasible, setDisplay, setDisplayRenderer, setEarthSpatialData, setEarthSpatialDisplay, setIsDirectManipulation, setLastMouseModifiers, setLatLonIndices, setLinks, setPickCrawlToCursor, setSpatialValues, spatialToEarth, spatialToEarth, stop_direct, suppressExceptions
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sw

javax.media.j3d.Switch sw
switch is parent of any BranchGroups created by this


swParent

javax.media.j3d.BranchGroup swParent
parent of sw for 'detach'


branches

javax.media.j3d.BranchGroup[] branches

switchFlags

boolean[] switchFlags

branchNonEmpty

boolean[] branchNonEmpty
Constructor Detail

RendererJ3D

public RendererJ3D()
Method Detail

setLinks

public void setLinks(DataDisplayLink[] links,
                     DisplayImpl d)
              throws VisADException
Description copied from class: DataRenderer
set DataDisplayLinks for linked Data, and set associated DisplayImpl

Specified by:
setLinks in class DataRenderer
Parameters:
links - array of DataDisplayLinks to set
Throws:
VisADException - a VisAD error occurred

toggle

public void toggle(boolean on)
Description copied from class: DataRenderer
Sets the visibility of the data being rendered by this instance.

Overrides:
toggle in class DataRenderer
Parameters:
on - Whether or not to render the data.

makeShadowFunctionType

public ShadowType makeShadowFunctionType(FunctionType type,
                                         DataDisplayLink link,
                                         ShadowType parent)
                                  throws VisADException,
                                         RemoteException
Description copied from class: DataRenderer
factory method for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowFunctionType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;

Specified by:
makeShadowFunctionType in class DataRenderer
Parameters:
type - FunctionType that returned ShadowType will shadow
link - DataDisplayLink linking Data to be depicted
parent - parent in ShadowType tree structure
Returns:
constructed ShadowType
Throws:
RemoteException - an RMI error occurred
VisADException - a VisAD error occurred

makeShadowRealTupleType

public ShadowType makeShadowRealTupleType(RealTupleType type,
                                          DataDisplayLink link,
                                          ShadowType parent)
                                   throws VisADException,
                                          RemoteException
Description copied from class: DataRenderer
factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowRealTupleType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;

Specified by:
makeShadowRealTupleType in class DataRenderer
Parameters:
type - FunctionType that returned ShadowType will shadow
link - DataDisplayLink linking Data to be depicted
parent - parent in ShadowType tree structure
Returns:
constructed ShadowType
Throws:
RemoteException - an RMI error occurred
VisADException - a VisAD error occurred

makeShadowRealType

public ShadowType makeShadowRealType(RealType type,
                                     DataDisplayLink link,
                                     ShadowType parent)
                              throws VisADException,
                                     RemoteException
Description copied from class: DataRenderer
factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowRealType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;

Specified by:
makeShadowRealType in class DataRenderer
Parameters:
type - FunctionType that returned ShadowType will shadow
link - DataDisplayLink linking Data to be depicted
parent - parent in ShadowType tree structure
Returns:
constructed ShadowType
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

makeShadowSetType

public ShadowType makeShadowSetType(SetType type,
                                    DataDisplayLink link,
                                    ShadowType parent)
                             throws VisADException,
                                    RemoteException
Description copied from class: DataRenderer
factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowSetType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;

Specified by:
makeShadowSetType in class DataRenderer
Parameters:
type - FunctionType that returned ShadowType will shadow
link - DataDisplayLink linking Data to be depicted
parent - parent in ShadowType tree structure
Returns:
constructed ShadowType
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

makeShadowTextType

public ShadowType makeShadowTextType(TextType type,
                                     DataDisplayLink link,
                                     ShadowType parent)
                              throws VisADException,
                                     RemoteException
Description copied from class: DataRenderer
factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowTextType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;

Specified by:
makeShadowTextType in class DataRenderer
Parameters:
type - FunctionType that returned ShadowType will shadow
link - DataDisplayLink linking Data to be depicted
parent - parent in ShadowType tree structure
Returns:
constructed ShadowType
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

makeShadowTupleType

public ShadowType makeShadowTupleType(TupleType type,
                                      DataDisplayLink link,
                                      ShadowType parent)
                               throws VisADException,
                                      RemoteException
Description copied from class: DataRenderer
factory for constructing a subclass of ShadowType appropriate for the graphics API, that also adapts ShadowTupleType; ShadowType trees are constructed that 'shadow' the MathType trees of Data to be depicted, via recursive calls to buildShadowType() methods of MathType sub-classes, to DataRenderer.makeShadow*Type() methods, to Shadow*Type constructors, then back to buildShadowType() methods; the recursive call chain is initiated by DataDisplayLink.prepareData() calls to buildShadowType() methods of MathType sub-classes;

Specified by:
makeShadowTupleType in class DataRenderer
Parameters:
type - FunctionType that returned ShadowType will shadow
link - DataDisplayLink linking Data to be depicted
parent - parent in ShadowType tree structure
Returns:
constructed ShadowType
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

addSwitch

abstract void addSwitch(DisplayRendererJ3D displayRenderer,
                        javax.media.j3d.BranchGroup branch)

doAction

public boolean doAction()
                 throws VisADException,
                        RemoteException
re-transform if needed; return false if not done

Specified by:
doAction in class DataRenderer
Returns:
flag indicating if the transform was done successfully
Throws:
RemoteException - an RMI error occurred
VisADException - a VisAD error occurred

getBranch

public javax.media.j3d.BranchGroup getBranch()

setBranchEarly

public void setBranchEarly(javax.media.j3d.BranchGroup branch)

clearBranch

public void clearBranch()
Description copied from class: DataRenderer
clear part of Display scene graph generated by this DataRenderer

Specified by:
clearBranch in class DataRenderer

flush

public void flush(javax.media.j3d.Group branch)

clearScene

public void clearScene()
Description copied from class: DataRenderer
clear any scene graph created by this DataRenderer, and clear all instance variables

Overrides:
clearScene in class DataRenderer

doTransform

public abstract javax.media.j3d.BranchGroup doTransform()
                                                 throws VisADException,
                                                        RemoteException
create a BranchGroup scene graph for Data in links; this can put Behavior objects in the scene graph for DataRenderer classes that implement direct manipulation widgets; may reduce work by only changing scene graph for Data and Controls that have changed: 1. use boolean[] changed to determine which Data objects have changed 2. if Data has not changed, then use Control.checkTicks loop like in prepareAction to determine which Control-s have changed

Throws:
VisADException
RemoteException