visad
Class DataRenderer
- java.lang.Object
-
- visad.DataRenderer
-
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- RendererJ2D, RendererJ3D
public abstract class DataRenderer extends java.lang.Object implements java.lang.CloneableDataRenderer is the VisAD abstract super-class for graphics rendering algorithms. These transform Data objects into 3-D (or 2-D) depictions in a Display window.DataRenderer is not Serializable and should not be copied between JVMs.
-
-
Constructor Summary
Constructors Constructor and Description DataRenderer()construct a DataRenderer
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddException(java.lang.Exception error)add a BadMappingException or UnimplementedException to Vector of Exceptions generated during doAction()voidaddPoint(float[] x)add point for temporary rendering; intended to be over-ridden by graphics-API-specific extensions of DataRendererbooleancheckAction()floatcheckClose(double[] origin, double[] direction)find minimum distance from ray to spatialValues; save index of point with minimum distance in closeIndex; reset lastIndex to -1 (Field domain index of Field range value last modified by drag_direct())voidcheckDirect()set isDirectManipulation = true if this DataRenderer supports direct manipulation for the MathType of its linked Data, and for its ScalarMaps; intended to be over-ridden by extensions of DataRenderervoidclearAVControls()clear all information associated with AnimationControls and ValueControls created by this DataRendererabstract voidclearBranch()clear part of Display scene graph generated by this DataRenderervoidclearExceptions()clear Vector of Exceptions generated during doAction()voidclearScene()clear any scene graph created by this DataRenderer, and clear all instance variablesabstract java.lang.Objectclone()DataShadowcomputeRanges(Data data, ShadowType type, DataShadow shadow)Compute ranges of values for each RealType in DisplayImpl.RealTypeVector.voidconstrainDragPoint(float[] dragPoint)jeffmc: new method that provides a hook so derived classes can easily constrain the position of a drag pointabstract booleandoAction()transform linked Data objects into a scene graph depiction, if any Data object values have changed or relevant Controls have changed; DataRenderers that assume the default implementation of DisplayImpl.doAction can determine whether re-transform is needed by: (get_all_feasible() && (get_any_changed() || get_any_transform_control())) these flags are computed by the default DataRenderer implementation of prepareAction()voiddrag_direct(VisADRay ray, boolean first, int mouseModifiers)modify Data values based on direct manipulation mouse actionsfloat[][]earthToSpatial(float[][] locs, float[] vert)convert (lat, lon) or (lat, lon, other) values to display (x, y, z)float[][]earthToSpatial(float[][] locs, float[] vert, float[][] base_spatial_locs)convert (lat, lon) or (lat, lon, other) values to display (x, y, z)floatfindRayManifoldIntersection(boolean first, double[] origin, double[] direction, DisplayTupleType tuple, int otherindex, float othervalue)find intersection of a ray and a 2-D manifold, using Newton's methodbooleanget_all_feasible()booleanget_any_changed()booleanget_any_transform_control()booleangetBadScale(boolean anyBadMap)DisplayImplgetDisplay()CoordinateSystemgetDisplayCoordinateSystem()DisplayRenderergetDisplayRenderer()intgetEarthDimension()Unit[]getEarthUnits()booleangetEnabled()Returns the visibility of the data being rendered by this instance.java.util.VectorgetExceptionVector()there is no need to over-ride this method, but it may be invoked by DisplayRenderer; gets a clone of exceptionVector to avoid concurrent access by Display threadbooleangetIsDirectManipulation()intgetLastMouseModifiers()int[]getLatLonIndices()floatgetLatLonRange()DataDisplayLinkgetLink()used by ShadowFunctionOrSetType for transform time-out hackDataDisplayLink[]getLinks()booleangetPickCrawlToCursor()floatgetPolygonOffset()floatgetPolygonOffsetFactor()java.util.ArrayList<ControlListener>getProjectionControlListeners()Returns the list of ProjectionControl listeners created by this.double[]getRanges()RealVectorTypegetRealVectorTypes(int index)java.lang.StringgetWhyNotDirect()booleanhasPolygonOffset()booleanisLegalTextureMap()booleanisTransformControl(Control control, DataDisplayLink link)DataRenderer-specific decision about which Controls require re-transform; may be over-ridden by DataRenderer sub-classes; this decision may use some values computed by link.prepareData()abstract ShadowTypemakeShadowFunctionType(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;abstract ShadowTypemakeShadowRealTupleType(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;abstract ShadowTypemakeShadowRealType(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;abstract ShadowTypemakeShadowSetType(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;abstract ShadowTypemakeShadowTextType(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;abstract ShadowTypemakeShadowTupleType(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;DataShadowprepareAction(boolean go, boolean initialize, DataShadow shadow)check if re-transform is needed; if initialize is true then compute ranges for RealTypes and Animation samplingvoidrealCheckDirect()determine if direct manipulation is feasible for the Data objects rendered by this, and for the ScalarMaps linked to the associated DisplayImpl; "returns" its result by calls to setIsDirectManipulation() called by checkDirect() method of DirectManipulationRendererJ2D and DirectManipulationRendererJ3D, basically just to share code between those two classesvoidrelease_direct()called when mouse button is released ending direct manipulation; intended to be over-ridden by DataRenderer extensions that need to act on this eventvoidremoveLink(DataDisplayLink link)WARNING! Do NOT use this routine unless you know what you are doing! remove link from Links[] array when remote connection failsvoidset_all_feasible(boolean b)set flag indicating whether depiction generation is feasible for all linked DatavoidsetDisplay(DisplayImpl d)set DisplayImpl associated with this DataRenderervoidsetDisplayRenderer(DisplayRenderer r)set DisplayRenderer associated with this DataRenderervoidsetEarthSpatialData(ShadowRealTupleType s_d_i, ShadowRealTupleType s_d_o, RealTupleType d_o, Unit[] d_u_o, RealTupleType d_i, CoordinateSystem[] d_c_i, Unit[] d_u_i)save information about relation between earth and display spatial coordinates, IF the arguments do define the relationvoidsetEarthSpatialDisplay(CoordinateSystem coord, DisplayTupleType t, DisplayImpl display, int[] indices, float[] default_values, double[] r)save information from ShadowType.assembleSpatial() about relation between earth and display spatial coordinatesvoidsetHasPolygonOffset(boolean hasPolygonOffset)voidsetIsDirectManipulation(boolean b)set value of isDirectManipulation flag (indicating whether this DataRenderer supports direct manipulation for its MathType and ScalarMaps)voidsetLastMouseModifiers(int mouseModifiers)called by MouseHelper.processEvent() to set LastMouseModifiersvoidsetLatLonIndices(int[] indices)voidsetLinks(DataDisplayLink[] links)set DataDisplayLinks for linked Data, including constructing arrays of booleans associated with DataDisplayLinks; called by setLinks(DataDisplayLink[], DisplayImpl)abstract voidsetLinks(DataDisplayLink[] links, DisplayImpl d)set DataDisplayLinks for linked Data, and set associated DisplayImplvoidsetPickCrawlToCursor(boolean b)set pickCrawlToCursor flag indicating whether Data points being manipulated should "crawl" toward the cursor instead of jumping to it immediatelyvoidsetPolygonOffset(float polygonOffset)voidsetPolygonOffsetFactor(float polygonOffsetFactor)voidsetSpatialValues(float[][] spatial_values)set spatial values for Data depiction; used to detect when direct manipulation mouse selects a point of a Data depictionfloat[][]spatialToEarth(float[][] spatial_locs)convert display (x, y, z) to (lat, lon) or (lat, lon, other) valuesfloat[][]spatialToEarth(float[][] spatial_locs, float[][] base_spatial_locs)convert display (x, y, z) to (lat, lon) or (lat, lon, other) valuesvoidstop_direct()discontinue manipulating Data values for current mouse drag; (this only applies to the current mouse drag and is not a general disable)voidsuppressExceptions(boolean suppress)set a flag indicating whether to suppress Exceptions generated during doAction()voidtoggle(boolean on)Sets the visibility of the data being rendered by this instance.
-
-
-
Method Detail
-
clearExceptions
public void clearExceptions()
clear Vector of Exceptions generated during doAction()
-
suppressExceptions
public void suppressExceptions(boolean suppress)
set a flag indicating whether to suppress Exceptions generated during doAction()
-
addException
public void addException(java.lang.Exception error)
add a BadMappingException or UnimplementedException to Vector of Exceptions generated during doAction()- Parameters:
error- Exception to add
-
getExceptionVector
public java.util.Vector getExceptionVector()
there is no need to over-ride this method, but it may be invoked by DisplayRenderer; gets a clone of exceptionVector to avoid concurrent access by Display thread- Returns:
- a Vector of Strings from the BadMappingExceptions and UnimplementedExceptions generated during the last invocation of this DataRenderer's doAction method;
-
get_all_feasible
public boolean get_all_feasible()
- Returns:
- flag indicating whether depiction generation is feasible for all linked Data
-
get_any_changed
public boolean get_any_changed()
- Returns:
- flag indicating whether any linked Data have changed since last invocation of prepareAction()
-
get_any_transform_control
public boolean get_any_transform_control()
- Returns:
- flag indicating whether any Controls associated with ScalarMaps applying to any linked Data have changed and require re-transform
-
set_all_feasible
public void set_all_feasible(boolean b)
set flag indicating whether depiction generation is feasible for all linked Data- Parameters:
b- value to set in flag
-
setLinks
public abstract void setLinks(DataDisplayLink[] links, DisplayImpl d) throws VisADException
set DataDisplayLinks for linked Data, and set associated DisplayImpl- Parameters:
links- array of DataDisplayLinks to setd- associated DisplayImpl to set- Throws:
VisADException- a VisAD error occurred
-
toggle
public void toggle(boolean on)
Sets the visibility of the data being rendered by this instance.- Parameters:
on- Whether or not to render the data.
-
getEnabled
public boolean getEnabled()
Returns the visibility of the data being rendered by this instance.- Returns:
- Whether or not the data is being rendered.
-
getProjectionControlListeners
public java.util.ArrayList<ControlListener> getProjectionControlListeners()
Returns the list of ProjectionControl listeners created by this. Provides a way to remove listeners from the Control that may only be needed per doTransform.- Returns:
-
setLinks
public void setLinks(DataDisplayLink[] links)
set DataDisplayLinks for linked Data, including constructing arrays of booleans associated with DataDisplayLinks; called by setLinks(DataDisplayLink[], DisplayImpl)- Parameters:
links- array of DataDisplayLinks to set
-
getLinks
public DataDisplayLink[] getLinks()
- Returns:
- an array of DataDisplayLinks to Data objects to be rendered (Data objects are accessed by DataDisplayLink.getData())
-
getDisplay
public DisplayImpl getDisplay()
- Returns:
- DisplayImpl associated with this DataRenderer
-
setDisplay
public void setDisplay(DisplayImpl d)
set DisplayImpl associated with this DataRenderer- Parameters:
d- DisplayImpl to set
-
getDisplayRenderer
public DisplayRenderer getDisplayRenderer()
- Returns:
- associated with this DataRenderer
-
setDisplayRenderer
public void setDisplayRenderer(DisplayRenderer r)
set DisplayRenderer associated with this DataRenderer- Parameters:
r- DisplayRenderer to set
-
checkAction
public boolean checkAction()
- Returns:
- flag indicating whether there is any pending need for re-transform for this DataRenderer
-
prepareAction
public DataShadow prepareAction(boolean go, boolean initialize, DataShadow shadow) throws VisADException, java.rmi.RemoteException
check if re-transform is needed; if initialize is true then compute ranges for RealTypes and Animation sampling- Parameters:
go- flag indicating that re-transform is required for at least one DataRenderer linked to DisplayImplinitialize- flag indicating that initialization (i.e., auto-scaling) is requiredshadow- DataShadow shared by prepareAction() method of all DataRenderers linked to DisplayImpl- Returns:
- DataShadow containing ranges and animation sampling Set (return null if no need for initialization)
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
computeRanges
public DataShadow computeRanges(Data data, ShadowType type, DataShadow shadow) throws VisADException, java.rmi.RemoteException
Compute ranges of values for each RealType in DisplayImpl.RealTypeVector.- Parameters:
data- Data object in which to compute ranges of RealType valuestype- ShadowType generated for MathType of datashadow- DataShadow instance whose contained double[][] array and animation sampling Set are modified according to RealType values in data, and used as return value- Returns:
- DataShadow instance containing double[][] array of RealType ranges, and an animation sampling Set
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
clearBranch
public abstract void clearBranch()
clear part of Display scene graph generated by this DataRenderer
-
doAction
public abstract boolean doAction() throws VisADException, java.rmi.RemoteExceptiontransform linked Data objects into a scene graph depiction, if any Data object values have changed or relevant Controls have changed; DataRenderers that assume the default implementation of DisplayImpl.doAction can determine whether re-transform is needed by: (get_all_feasible() && (get_any_changed() || get_any_transform_control())) these flags are computed by the default DataRenderer implementation of prepareAction()- Returns:
- flag indicating if the transform was done successfully
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
getBadScale
public boolean getBadScale(boolean anyBadMap)
- Returns:
- flag indicating whether initialization (i.e., auto-scale) is needed on next re-transform
-
clearScene
public void clearScene()
clear any scene graph created by this DataRenderer, and clear all instance variables
-
clearAVControls
public void clearAVControls()
clear all information associated with AnimationControls and ValueControls created by this DataRenderer
-
makeShadowFunctionType
public abstract ShadowType makeShadowFunctionType(FunctionType type, DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
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;- Parameters:
type- FunctionType that returned ShadowType will shadowlink- DataDisplayLink linking Data to be depictedparent- parent in ShadowType tree structure- Returns:
- constructed ShadowType
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
makeShadowRealTupleType
public abstract ShadowType makeShadowRealTupleType(RealTupleType type, DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
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;- Parameters:
type- FunctionType that returned ShadowType will shadowlink- DataDisplayLink linking Data to be depictedparent- parent in ShadowType tree structure- Returns:
- constructed ShadowType
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
makeShadowRealType
public abstract ShadowType makeShadowRealType(RealType type, DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
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;- Parameters:
type- FunctionType that returned ShadowType will shadowlink- DataDisplayLink linking Data to be depictedparent- parent in ShadowType tree structure- Returns:
- constructed ShadowType
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
makeShadowSetType
public abstract ShadowType makeShadowSetType(SetType type, DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
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;- Parameters:
type- FunctionType that returned ShadowType will shadowlink- DataDisplayLink linking Data to be depictedparent- parent in ShadowType tree structure- Returns:
- constructed ShadowType
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
makeShadowTextType
public abstract ShadowType makeShadowTextType(TextType type, DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
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;- Parameters:
type- FunctionType that returned ShadowType will shadowlink- DataDisplayLink linking Data to be depictedparent- parent in ShadowType tree structure- Returns:
- constructed ShadowType
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
makeShadowTupleType
public abstract ShadowType makeShadowTupleType(TupleType type, DataDisplayLink link, ShadowType parent) throws VisADException, java.rmi.RemoteException
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;- Parameters:
type- FunctionType that returned ShadowType will shadowlink- DataDisplayLink linking Data to be depictedparent- parent in ShadowType tree structure- Returns:
- constructed ShadowType
- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
isTransformControl
public boolean isTransformControl(Control control, DataDisplayLink link)
DataRenderer-specific decision about which Controls require re-transform; may be over-ridden by DataRenderer sub-classes; this decision may use some values computed by link.prepareData()- Parameters:
control- Control being judged whether it needs re-transformlink- DataDisplayLink possibly involved in decision- Returns:
- flag indicating whether re-transform is needed
-
getLink
public DataDisplayLink getLink()
used by ShadowFunctionOrSetType for transform time-out hack- Returns:
- single DataDisplayLink (over-ridden by sub-classes)
-
isLegalTextureMap
public boolean isLegalTextureMap()
- Returns:
- flag indicating whether texture mapping is legal for this DataRenderer
-
getRealVectorTypes
public RealVectorType getRealVectorTypes(int index)
- Parameters:
index- 0 or 1 for flow1 and flow2- Returns:
- RealVectorType (extends RealTupleType) mapped to flow1 or flow2 (values will be either data_in, data_out or null)
-
getLatLonIndices
public int[] getLatLonIndices()
- Returns:
- indices of RealType.Latitude and RealType.Longitude in data_in, data_out, or just spatial value array
-
setLatLonIndices
public void setLatLonIndices(int[] indices)
- Parameters:
indices- indices of RealType.Latitude and RealType.Longitude in data_in, data_out, or just spatial value array
-
getEarthDimension
public int getEarthDimension()
- Returns:
- earth dimension, either 2, 3 or -1 (for none)
-
getEarthUnits
public Unit[] getEarthUnits()
- Returns:
- Units of earth coordinates used in Data
-
getLatLonRange
public float getLatLonRange()
- Returns:
- maximum of display ranges of latitude and longitude
-
earthToSpatial
public float[][] earthToSpatial(float[][] locs, float[] vert) throws VisADExceptionconvert (lat, lon) or (lat, lon, other) values to display (x, y, z)- Parameters:
locs- (lat, lon) or (lat, lon, other) coordinatesvert- vertical flow component (if non-null, used to adjust non-lat/lon spatial_locs- Returns:
- display (x, y, z) coordinates
- Throws:
VisADException- a VisAD error occurred
-
earthToSpatial
public float[][] earthToSpatial(float[][] locs, float[] vert, float[][] base_spatial_locs) throws VisADExceptionconvert (lat, lon) or (lat, lon, other) values to display (x, y, z)- Parameters:
locs- (lat, lon) or (lat, lon, other) coordinatesvert- vertical flow component (if non-null, used to adjust non-lat/lon spatial_locsbase_spatial_locs- saved spatial_locs argument from spatialToEarth() call used to fill in any null members of return array- Returns:
- display (x, y, z) coordinates
- Throws:
VisADException- a VisAD error occurred
-
spatialToEarth
public float[][] spatialToEarth(float[][] spatial_locs) throws VisADExceptionconvert display (x, y, z) to (lat, lon) or (lat, lon, other) values- Parameters:
spatial_locs- display (x, y, z) coordinates- Returns:
- (lat, lon) or (lat, lon, other) coordinates
- Throws:
VisADException- a VisAD error occurred
-
spatialToEarth
public float[][] spatialToEarth(float[][] spatial_locs, float[][] base_spatial_locs) throws VisADExceptionconvert display (x, y, z) to (lat, lon) or (lat, lon, other) values- Parameters:
spatial_locs- display (x, y, z) coordinatesbase_spatial_locs- float[3][] array used to return member arrays of spatial_locs argument- Returns:
- (lat, lon) or (lat, lon, other) coordinates
- Throws:
VisADException- a VisAD error occurred
-
setEarthSpatialData
public void setEarthSpatialData(ShadowRealTupleType s_d_i, ShadowRealTupleType s_d_o, RealTupleType d_o, Unit[] d_u_o, RealTupleType d_i, CoordinateSystem[] d_c_i, Unit[] d_u_i) throws VisADException
save information about relation between earth and display spatial coordinates, IF the arguments do define the relation- Parameters:
s_d_i- candidate shadow_data_in (Shadow of RealTupleType with reference in Data)s_d_o- candidate shadow_data_out (Shadow of reference RealTupleType in Data)d_o- candidate data_out (reference RealTupleType in Data)d_u_o- candidate data_units_out (Units of reference RealTupleType in Data)d_i- candidate data_in (RealTupleType with reference in Data)d_c_i- candidate data_coord_in (CoordinateSystems relating data_in to data_out)d_u_i- candidate data_units_in (Units of RealTupleType with reference in Data)- Throws:
VisADException- a VisAD error occurred
-
getRanges
public double[] getRanges()
- Returns:
- array of normalized (i.e., max = 1.0) ranges for spatial ScalarMaps, for flow adjustment
-
getDisplayCoordinateSystem
public CoordinateSystem getDisplayCoordinateSystem()
- Returns:
- CoordinateSystem for spatial DisplayTupleType (null if DisplaySpatialCartesianTuple)
-
setEarthSpatialDisplay
public void setEarthSpatialDisplay(CoordinateSystem coord, DisplayTupleType t, DisplayImpl display, int[] indices, float[] default_values, double[] r) throws VisADException
save information from ShadowType.assembleSpatial() about relation between earth and display spatial coordinates- Parameters:
coord- CoordinateSystem for spatial DisplayTupleType (null if DisplaySpatialCartesianTuple)t- spatial DisplayTupleTypedisplay- the DisplayImplindices- indices in display_values array for 3 spatial coordinatesdefault_values- default values for 3 spatial coordinatesr- double[3] array of normalized (i.e., max = 1.0) ranges for spatial ScalarMaps, for flow adjustment- Throws:
VisADException- a VisAD error occurred
-
realCheckDirect
public void realCheckDirect() throws VisADException, java.rmi.RemoteExceptiondetermine if direct manipulation is feasible for the Data objects rendered by this, and for the ScalarMaps linked to the associated DisplayImpl; "returns" its result by calls to setIsDirectManipulation() called by checkDirect() method of DirectManipulationRendererJ2D and DirectManipulationRendererJ3D, basically just to share code between those two classes- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
getWhyNotDirect
public java.lang.String getWhyNotDirect()
- Returns:
- String with reason MathType and ScalarMaps do not qualify for direct manipulation
-
setSpatialValues
public void setSpatialValues(float[][] spatial_values)
set spatial values for Data depiction; used to detect when direct manipulation mouse selects a point of a Data depiction- Parameters:
spatial_values- float[3][number_of_points] of 3-D locations of depiction points
-
checkClose
public float checkClose(double[] origin, double[] direction)find minimum distance from ray to spatialValues; save index of point with minimum distance in closeIndex; reset lastIndex to -1 (Field domain index of Field range value last modified by drag_direct())- Parameters:
origin- 3-D origin of raydirection- 3-D direction of ray- Returns:
- minimum distance of ray to any point in spatialValues (spatial values for Data depiction)
-
release_direct
public void release_direct()
called when mouse button is released ending direct manipulation; intended to be over-ridden by DataRenderer extensions that need to act on this event
-
stop_direct
public void stop_direct()
discontinue manipulating Data values for current mouse drag; (this only applies to the current mouse drag and is not a general disable)
-
getLastMouseModifiers
public int getLastMouseModifiers()
- Returns:
- value of InputEvent.getModifiers() from most recent direct manipulation mouse click
-
setLastMouseModifiers
public void setLastMouseModifiers(int mouseModifiers)
called by MouseHelper.processEvent() to set LastMouseModifiers- Parameters:
mouseModifiers- value of InputEvent.getModifiers() from last direct manipulation mouse click
-
drag_direct
public void drag_direct(VisADRay ray, boolean first, int mouseModifiers)
modify Data values based on direct manipulation mouse actions- Parameters:
ray- 3-D graphics coordinates of ray corresponding to mouse screen locationfirst- flag if this is first call (for MouseEvent.MOUSE_PRESSED, not for MouseEvent.MOUSE_DRAGGED)mouseModifiers- value of InputEvent.getModifiers() from most recent direct manipulation mouse click
-
constrainDragPoint
public void constrainDragPoint(float[] dragPoint)
jeffmc: new method that provides a hook so derived classes can easily constrain the position of a drag point- Parameters:
dragPoint- The position of the drag point
-
addPoint
public void addPoint(float[] x) throws VisADExceptionadd point for temporary rendering; intended to be over-ridden by graphics-API-specific extensions of DataRenderer- Parameters:
x- 3-D graphics coordinates of point to render- Throws:
VisADException- a VisAD error occurred
-
checkDirect
public void checkDirect() throws VisADException, java.rmi.RemoteExceptionset isDirectManipulation = true if this DataRenderer supports direct manipulation for the MathType of its linked Data, and for its ScalarMaps; intended to be over-ridden by extensions of DataRenderer- Throws:
VisADException- a VisAD error occurredjava.rmi.RemoteException- an RMI error occurred
-
setIsDirectManipulation
public void setIsDirectManipulation(boolean b)
set value of isDirectManipulation flag (indicating whether this DataRenderer supports direct manipulation for its MathType and ScalarMaps)- Parameters:
b- value to set in isDirectManipulation
-
getIsDirectManipulation
public boolean getIsDirectManipulation()
- Returns:
- value of isDirectManipulation flag (indicating whether this DataRenderer supports direct manipulation for its MathType and ScalarMaps)
-
setPickCrawlToCursor
public void setPickCrawlToCursor(boolean b)
set pickCrawlToCursor flag indicating whether Data points being manipulated should "crawl" toward the cursor instead of jumping to it immediately- Parameters:
b- value to set in pickCrawlToCursor
-
getPickCrawlToCursor
public boolean getPickCrawlToCursor()
- Returns:
- pickCrawlToCursor flag indicating whether Data points being manipulated should "crawl" toward the cursor instead of jumping to it immediately
-
findRayManifoldIntersection
public float findRayManifoldIntersection(boolean first, double[] origin, double[] direction, DisplayTupleType tuple, int otherindex, float othervalue) throws VisADExceptionfind intersection of a ray and a 2-D manifold, using Newton's method- Parameters:
first- flag requesting to generate a first guess ray position by brute force searchorigin- 3-D graphics coordinates of ray origindirection- 3-D graphics coordinates of ray directiontuple- spatial DisplayTupleType used to define 2-D manifold (manifold is defined by fixing value of one component of 3-D tuple)otherindex- index of tuple component to be fixedothervalue- value at which to fix otherindex tuple component- Returns:
- parameter of point along ray of ray-manifold intersection (point = origin + parameter * direction)
- Throws:
VisADException- a VisAD error occurred
-
removeLink
public void removeLink(DataDisplayLink link)
WARNING! Do NOT use this routine unless you know what you are doing! remove link from Links[] array when remote connection fails- Parameters:
link- DataDisplayLink to remove
-
clone
public abstract java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Returns:
- a copy of this DataRenderer
- Throws:
java.lang.CloneNotSupportedException
-
hasPolygonOffset
public boolean hasPolygonOffset()
-
setHasPolygonOffset
public void setHasPolygonOffset(boolean hasPolygonOffset)
-
getPolygonOffset
public float getPolygonOffset()
-
setPolygonOffset
public void setPolygonOffset(float polygonOffset)
-
getPolygonOffsetFactor
public float getPolygonOffsetFactor()
-
setPolygonOffsetFactor
public void setPolygonOffsetFactor(float polygonOffsetFactor)
-
-
DMelt 3.0 © DataMelt by jWork.ORG