public abstract class DataRenderer extends Object implements Cloneable
DataRenderer is not Serializable and should not be copied between JVMs.
Modifier and Type | Field and Description |
---|---|
protected boolean |
enabled
flag for visibility of Data depictions
|
protected boolean |
pickCrawlToCursor
flag indicating whether points affected by direct manipulation should
"crawl" toward the cursor instead of jumping to it immediately.
|
Constructor and Description |
---|
DataRenderer()
construct a DataRenderer
|
Modifier and Type | Method and Description |
---|---|
void |
addException(Exception error)
add a BadMappingException or UnimplementedException to
Vector of Exceptions generated during doAction()
|
void |
addPoint(float[] x)
add point for temporary rendering; intended to be
over-ridden by graphics-API-specific extensions of
DataRenderer
|
boolean |
checkAction() |
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())
|
void |
checkDirect()
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
DataRenderer
|
void |
clearAVControls()
clear all information associated with AnimationControls
and ValueControls created by this DataRenderer
|
abstract void |
clearBranch()
clear part of Display scene graph generated by this DataRenderer
|
void |
clearExceptions()
clear Vector of Exceptions generated during doAction()
|
void |
clearScene()
clear any scene graph created by this DataRenderer, and
clear all instance variables
|
abstract Object |
clone() |
DataShadow |
computeRanges(Data data,
ShadowType type,
DataShadow shadow)
Compute ranges of values for each RealType in
DisplayImpl.RealTypeVector.
|
void |
constrainDragPoint(float[] dragPoint)
jeffmc: new method that provides a hook so derived classes can easily constrain the position of a drag point
|
abstract boolean |
doAction()
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()
|
void |
drag_direct(VisADRay ray,
boolean first,
int mouseModifiers)
modify Data values based on direct manipulation mouse actions
|
float[][] |
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)
|
float |
findRayManifoldIntersection(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 method
|
boolean |
get_all_feasible() |
boolean |
get_any_changed() |
boolean |
get_any_transform_control() |
boolean |
getBadScale(boolean anyBadMap) |
DisplayImpl |
getDisplay() |
CoordinateSystem |
getDisplayCoordinateSystem() |
DisplayRenderer |
getDisplayRenderer() |
int |
getEarthDimension() |
Unit[] |
getEarthUnits() |
boolean |
getEnabled()
Returns the visibility of the data being rendered by this instance.
|
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
|
boolean |
getIsDirectManipulation() |
int |
getLastMouseModifiers() |
int[] |
getLatLonIndices() |
float |
getLatLonRange() |
DataDisplayLink |
getLink()
used by ShadowFunctionOrSetType for transform time-out hack
|
DataDisplayLink[] |
getLinks() |
boolean |
getPickCrawlToCursor() |
float |
getPolygonOffset() |
float |
getPolygonOffsetFactor() |
ArrayList<ControlListener> |
getProjectionControlListeners()
Returns the list of ProjectionControl listeners created by this.
|
double[] |
getRanges() |
RealVectorType |
getRealVectorTypes(int index) |
String |
getWhyNotDirect() |
boolean |
hasPolygonOffset() |
boolean |
isLegalTextureMap() |
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()
|
abstract 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;
|
abstract 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;
|
abstract 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;
|
abstract 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;
|
abstract 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;
|
abstract 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;
|
DataShadow |
prepareAction(boolean go,
boolean initialize,
DataShadow shadow)
check if re-transform is needed; if initialize is true then
compute ranges for RealTypes and Animation sampling
|
void |
realCheckDirect()
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 classes
|
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
|
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
|
void |
set_all_feasible(boolean b)
set flag indicating whether depiction generation is feasible
for all linked Data
|
void |
setDisplay(DisplayImpl d)
set DisplayImpl associated with this DataRenderer
|
void |
setDisplayRenderer(DisplayRenderer r)
set DisplayRenderer associated with this DataRenderer
|
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)
save information about relation between earth and display
spatial coordinates, IF the arguments do define the relation
|
void |
setEarthSpatialDisplay(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 coordinates
|
void |
setHasPolygonOffset(boolean hasPolygonOffset) |
void |
setIsDirectManipulation(boolean b)
set value of isDirectManipulation flag (indicating whether this
DataRenderer supports direct manipulation for its MathType and
ScalarMaps)
|
void |
setLastMouseModifiers(int mouseModifiers)
called by MouseHelper.processEvent() to set LastMouseModifiers
|
void |
setLatLonIndices(int[] indices) |
void |
setLinks(DataDisplayLink[] links)
set DataDisplayLinks for linked Data, including constructing
arrays of booleans associated with DataDisplayLinks; called by
setLinks(DataDisplayLink[], DisplayImpl)
|
abstract void |
setLinks(DataDisplayLink[] links,
DisplayImpl d)
set DataDisplayLinks for linked Data, and set associated DisplayImpl
|
void |
setPickCrawlToCursor(boolean b)
set pickCrawlToCursor flag indicating whether Data points being
manipulated should "crawl" toward the cursor instead of jumping
to it immediately
|
void |
setPolygonOffset(float polygonOffset) |
void |
setPolygonOffsetFactor(float polygonOffsetFactor) |
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
|
float[][] |
spatialToEarth(float[][] spatial_locs)
convert display (x, y, z) to (lat, lon) or (lat, lon, other) values
|
float[][] |
spatialToEarth(float[][] spatial_locs,
float[][] base_spatial_locs)
convert display (x, y, z) to (lat, lon) or (lat, lon, other) values
|
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)
|
void |
suppressExceptions(boolean suppress)
set a flag indicating whether to suppress Exceptions
generated during doAction()
|
void |
toggle(boolean on)
Sets the visibility of the data being rendered by this instance.
|
protected boolean enabled
protected boolean pickCrawlToCursor
public void clearExceptions()
public void suppressExceptions(boolean suppress)
public void addException(Exception error)
error
- Exception to addpublic Vector getExceptionVector()
public boolean get_all_feasible()
public boolean get_any_changed()
public boolean get_any_transform_control()
public void set_all_feasible(boolean b)
b
- value to set in flagpublic abstract void setLinks(DataDisplayLink[] links, DisplayImpl d) throws VisADException
links
- array of DataDisplayLinks to setd
- associated DisplayImpl to setVisADException
- a VisAD error occurredpublic void toggle(boolean on)
on
- Whether or not to render the data.public boolean getEnabled()
public ArrayList<ControlListener> getProjectionControlListeners()
public void setLinks(DataDisplayLink[] links)
links
- array of DataDisplayLinks to setpublic DataDisplayLink[] getLinks()
public DisplayImpl getDisplay()
public void setDisplay(DisplayImpl d)
d
- DisplayImpl to setpublic DisplayRenderer getDisplayRenderer()
public void setDisplayRenderer(DisplayRenderer r)
r
- DisplayRenderer to setpublic boolean checkAction()
public DataShadow prepareAction(boolean go, boolean initialize, DataShadow shadow) throws VisADException, RemoteException
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 DisplayImplVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic DataShadow computeRanges(Data data, ShadowType type, DataShadow shadow) throws VisADException, RemoteException
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 valueVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic abstract void clearBranch()
public abstract boolean doAction() throws VisADException, RemoteException
VisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic boolean getBadScale(boolean anyBadMap)
public void clearScene()
public void clearAVControls()
public abstract ShadowType makeShadowFunctionType(FunctionType type, DataDisplayLink link, ShadowType parent) throws VisADException, RemoteException
type
- FunctionType that returned ShadowType will shadowlink
- DataDisplayLink linking Data to be depictedparent
- parent in ShadowType tree structureVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic abstract ShadowType makeShadowRealTupleType(RealTupleType type, DataDisplayLink link, ShadowType parent) throws VisADException, RemoteException
type
- FunctionType that returned ShadowType will shadowlink
- DataDisplayLink linking Data to be depictedparent
- parent in ShadowType tree structureVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic abstract ShadowType makeShadowRealType(RealType type, DataDisplayLink link, ShadowType parent) throws VisADException, RemoteException
type
- FunctionType that returned ShadowType will shadowlink
- DataDisplayLink linking Data to be depictedparent
- parent in ShadowType tree structureVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic abstract ShadowType makeShadowSetType(SetType type, DataDisplayLink link, ShadowType parent) throws VisADException, RemoteException
type
- FunctionType that returned ShadowType will shadowlink
- DataDisplayLink linking Data to be depictedparent
- parent in ShadowType tree structureVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic abstract ShadowType makeShadowTextType(TextType type, DataDisplayLink link, ShadowType parent) throws VisADException, RemoteException
type
- FunctionType that returned ShadowType will shadowlink
- DataDisplayLink linking Data to be depictedparent
- parent in ShadowType tree structureVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic abstract ShadowType makeShadowTupleType(TupleType type, DataDisplayLink link, ShadowType parent) throws VisADException, RemoteException
type
- FunctionType that returned ShadowType will shadowlink
- DataDisplayLink linking Data to be depictedparent
- parent in ShadowType tree structureVisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic boolean isTransformControl(Control control, DataDisplayLink link)
control
- Control being judged whether it needs re-transformlink
- DataDisplayLink possibly involved in decisionpublic DataDisplayLink getLink()
public boolean isLegalTextureMap()
public RealVectorType getRealVectorTypes(int index)
index
- 0 or 1 for flow1 and flow2public int[] getLatLonIndices()
public void setLatLonIndices(int[] indices)
indices
- indices of RealType.Latitude and RealType.Longitude
in data_in, data_out, or just spatial value arraypublic int getEarthDimension()
public Unit[] getEarthUnits()
public float getLatLonRange()
public float[][] earthToSpatial(float[][] locs, float[] vert) throws VisADException
locs
- (lat, lon) or (lat, lon, other) coordinatesvert
- vertical flow component (if non-null, used to
adjust non-lat/lon spatial_locsVisADException
- a VisAD error occurredpublic float[][] earthToSpatial(float[][] locs, float[] vert, float[][] base_spatial_locs) throws VisADException
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 arrayVisADException
- a VisAD error occurredpublic float[][] spatialToEarth(float[][] spatial_locs) throws VisADException
spatial_locs
- display (x, y, z) coordinatesVisADException
- a VisAD error occurredpublic float[][] spatialToEarth(float[][] spatial_locs, float[][] base_spatial_locs) throws VisADException
spatial_locs
- display (x, y, z) coordinatesbase_spatial_locs
- float[3][] array used to return member
arrays of spatial_locs argumentVisADException
- a VisAD error occurredpublic 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
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)VisADException
- a VisAD error occurredpublic double[] getRanges()
public CoordinateSystem getDisplayCoordinateSystem()
public void setEarthSpatialDisplay(CoordinateSystem coord, DisplayTupleType t, DisplayImpl display, int[] indices, float[] default_values, double[] r) throws VisADException
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 adjustmentVisADException
- a VisAD error occurredpublic void realCheckDirect() throws VisADException, RemoteException
VisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic String getWhyNotDirect()
public void setSpatialValues(float[][] spatial_values)
spatial_values
- float[3][number_of_points] of 3-D locations
of depiction pointspublic float checkClose(double[] origin, double[] direction)
origin
- 3-D origin of raydirection
- 3-D direction of raypublic void release_direct()
public void stop_direct()
public int getLastMouseModifiers()
public void setLastMouseModifiers(int mouseModifiers)
mouseModifiers
- value of InputEvent.getModifiers() from
last direct manipulation mouse clickpublic void drag_direct(VisADRay ray, boolean first, int mouseModifiers)
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 clickpublic void constrainDragPoint(float[] dragPoint)
dragPoint
- The position of the drag pointpublic void addPoint(float[] x) throws VisADException
x
- 3-D graphics coordinates of point to renderVisADException
- a VisAD error occurredpublic void checkDirect() throws VisADException, RemoteException
VisADException
- a VisAD error occurredRemoteException
- an RMI error occurredpublic void setIsDirectManipulation(boolean b)
b
- value to set in isDirectManipulationpublic boolean getIsDirectManipulation()
public void setPickCrawlToCursor(boolean b)
b
- value to set in pickCrawlToCursorpublic boolean getPickCrawlToCursor()
public float findRayManifoldIntersection(boolean first, double[] origin, double[] direction, DisplayTupleType tuple, int otherindex, float othervalue) throws VisADException
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 componentVisADException
- a VisAD error occurredpublic void removeLink(DataDisplayLink link)
link
- DataDisplayLink to removepublic abstract Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public boolean hasPolygonOffset()
public void setHasPolygonOffset(boolean hasPolygonOffset)
public float getPolygonOffset()
public void setPolygonOffset(float polygonOffset)
public float getPolygonOffsetFactor()
public void setPolygonOffsetFactor(float polygonOffsetFactor)
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.