public abstract class DisplayRendererJ3D extends DisplayRenderer implements RendererSourceListener
DisplayRendererJ3D
is the VisAD abstract super-class for
background and metadata rendering algorithms. These complement
depictions of Data
objects created by
DataRenderer
objects.
DisplayRendererJ3D
also manages the overall relation of
DataRenderer
output to Java3D and manages the scene graph.
It creates the binding between Control
objects and scene
graph Behavior
objects for direct manipulation of
Control
objects.
DisplayRendererJ3D
is not Serializable
and
should not be copied between JVMs.
Constructor and Description |
---|
DisplayRendererJ3D() |
Modifier and Type | Method and Description |
---|---|
void |
addDirectManipulationSceneGraphComponent(Group group,
DirectManipulationRendererJ3D renderer) |
void |
addKeyboardBehavior(KeyboardBehaviorJ3D behavior)
Add a
KeyboardBehavior for keyboard control of rotation,
translation and zoom. |
void |
addLockedSceneGraphComponent(Group group) |
void |
addLockedSceneGraphComponent(Group group,
boolean initWithProj) |
void |
addSceneGraphComponent(Group group) |
boolean |
anyDirects()
Check to see if there are any
DirectManipulationRenderer s
in this display. |
void |
clearScale(AxisScale axisScale)
Remove a particular scale being rendered.
|
void |
clearScales()
Remove all the scales being rendered.
|
void |
clearScene(DataRenderer renderer) |
void |
controlChanged(ControlEvent evt)
Update internal values from those in the
RendererControl . |
BranchGroup |
createBasicSceneGraph(View v,
TransformGroup vpt,
VisADCanvasJ3D c,
MouseBehaviorJ3D m)
Deprecated.
use createBasicSceneGraph(View v, TransformGroup vpt,
VisADCanvasJ3D c, MouseBehaviorJ3D m, ColoringAttributes bc,
ColoringAttributes cc)
instead
|
BranchGroup |
createBasicSceneGraph(View v,
TransformGroup vpt,
VisADCanvasJ3D c,
MouseBehaviorJ3D m,
ColoringAttributes bc,
ColoringAttributes cc)
Create scene graph root, if none exists, with Transform
and direct manipulation root.
|
abstract BranchGroup |
createSceneGraph(View v,
TransformGroup vpt,
VisADCanvasJ3D c)
Create scene graph root, if none exists, with Transform
and direct manipulation root;
create special graphics (e.g., 3-D box, SkewT background),
any lights, any user interface embedded in scene.
|
void |
depth_cursor(VisADRay ray)
set a VisADRay along which to drag cursor in depth (in and out
of screen)
|
void |
destroy() |
void |
drag_cursor(VisADRay ray,
boolean first)
drag cursor parallel to plane of screen
|
void |
drag_depth(float diff)
drag cursor in depth (in and out of screen)
|
void |
drawCursorStringVector(VisADCanvasJ3D canvas)
Whenever
cursorOn or directOn is true,
display Strings in cursorStringVector. |
DataRenderer |
findDirect(VisADRay ray,
int mouseModifiers)
Find the
DataRenderer that is closest to the ray and
uses the specified mouse modifiers for direct manipulation. |
BranchGroup |
getBoxOnBranch() |
VisADCanvasJ3D |
getCanvas()
Get the canvas for this renderer
|
double[] |
getCursor()
Get the cusor location.
|
BranchGroup |
getCursorOnBranch() |
BufferedImage |
getImage()
Capture the display rendition as an image.
|
KeyboardBehavior |
getKeyboardBehavior()
Get the
KeyboardBehavior associated with this renderer. |
MouseBehavior |
getMouseBehavior()
Get the
MouseBehavior associated with this renderer. |
BranchGroup |
getRoot() |
int |
getTextureHeightMax() |
int |
getTextureWidthMax() |
TransformGroup |
getTrans() |
View |
getView() |
TransformGroup |
getViewTrans() |
void |
initControl(RendererControl ctl)
Internal method used to initialize newly created
RendererControl with current renderer settings
before it is actually connected to the renderer. |
boolean |
legalDataRenderer(DataRenderer renderer)
Check if the
DataRenderer in question is legal for this
DisplayRenderer |
Control |
makeControl(ScalarMap map)
Factory for constructing a subclass of
Control
appropriate for the graphics API and for this
DisplayRenderer ; invoked by ScalarMap
when it is addMap() ed to a Display . |
DataRenderer |
makeDefaultRenderer()
Create the default
DataRenderer for this type of
DisplayRenderer |
void |
render_trigger()
trigger the graphics API to render the scene graph to the screen;
intended to be over-ridden by graphics-API-specific extensions of
DisplayRenderer
|
void |
rendererDeleted(DataRenderer renderer) |
void |
setClip(int plane,
boolean enable,
float a,
float b,
float c,
float d)
Define a clipping plane in (XAxis, YAxis, ZAxis) space.
|
void |
setCursorLoc(float x,
float y,
float z)
Set the cursor location
|
void |
setCursorOn(boolean on)
Toggle the cursor in the display
|
void |
setDirectOn(boolean on)
Set the flag for direct manipulation
|
void |
setDisplay(DisplayImpl dpy)
Specify
DisplayImpl to be rendered. |
void |
setLineWidth(float width) |
void |
setScale(AxisScale axisScale)
Set the scale for the appropriate axis.
|
void |
setScale(int axis,
int axis_ordinal,
VisADLineArray array,
float[] scale_color)
Set the scale for the appropriate axis.
|
void |
setScale(int axis,
int axis_ordinal,
VisADLineArray array,
VisADTriangleArray labels,
float[] scale_color)
Set the scale for the appropriate axis.
|
void |
setScaleOn(boolean on)
Set the scales on.
|
static void |
setSceneGraphObjectName(SceneGraphObject obj,
String name)
Set the name of a
SceneGraphObject . |
void |
setTransform3D(Transform3D t) |
void |
setWaitFlag(boolean b)
Set the wait flag to the specified value.
|
void |
updateLockedTrans(double[] matrix) |
getAnimationString, getAnimationStringVisible, getBoxOn, getCursorColor, getCursorStringVector, getCursorStringVectorUnconditional, getDirectAxisValue, getDirectAxisValue, getDisplay, getMode2D, getPickThreshhold, getRendererControl, getRotateAboutCenter, getScaleRotation, getWaitFlag, getWaitMessageVisible, legalDisplayScalar, prepareAction, setAnimationString, setAnimationStringVisible, setBackgroundColor, setBackgroundColor, setBoxAspect, setBoxColor, setBoxColor, setBoxOn, setCursorColor, setCursorColor, setCursorStringOn, setCursorStringVector, setCursorStringVector, setForegroundColor, setForegroundColor, setPickThreshhold, setRotateAboutCenter, setScaleRotation, setWaitMessageVisible
public static void setSceneGraphObjectName(SceneGraphObject obj, String name)
SceneGraphObject
.
If SceneGraphObject
does not have a setName
(J3D pre v1.4) this is a no-op.name
- public void destroy()
public void setDisplay(DisplayImpl dpy) throws VisADException
DisplayImpl
to be rendered.setDisplay
in class DisplayRenderer
dpy
- Display
to render.VisADException
- If a DisplayImpl
has already
been specified.public View getView()
public TransformGroup getViewTrans()
public VisADCanvasJ3D getCanvas()
VisADCanvasJ3D
that this renderer uses.public BufferedImage getImage()
getImage
in class DisplayRenderer
public BranchGroup getRoot()
public void initControl(RendererControl ctl)
RendererControl
with current renderer settings
before it is actually connected to the renderer. This
means that changes will not generate MonitorEvent
s.initControl
in class DisplayRenderer
ctl
- RendererControl to initializepublic void controlChanged(ControlEvent evt)
RendererControl
.controlChanged
in interface ControlListener
evt
- ControlEvent
generated by a change to the
RendererControl
public TransformGroup getTrans()
public BranchGroup getCursorOnBranch()
public BranchGroup getBoxOnBranch()
public void setCursorOn(boolean on)
setCursorOn
in class DisplayRenderer
on
- true to display the cursor, false to hide it.public void setDirectOn(boolean on)
setDirectOn
in class DisplayRenderer
on
- true for enabling direct manipulation, false to disablepublic abstract BranchGroup createSceneGraph(View v, TransformGroup vpt, VisADCanvasJ3D c)
v
- vpt
- c
- public BranchGroup createBasicSceneGraph(View v, TransformGroup vpt, VisADCanvasJ3D c, MouseBehaviorJ3D m)
public BranchGroup createBasicSceneGraph(View v, TransformGroup vpt, VisADCanvasJ3D c, MouseBehaviorJ3D m, ColoringAttributes bc, ColoringAttributes cc)
v
- vpt
- c
- m
- public void setClip(int plane, boolean enable, float a, float b, float c, float d) throws VisADException
aX + bY + cZ + d <= 0
Example useage:
To clip to the usual VisAD cube (i.e., x, y and z values in the range -1.0 to +1.0) (see Test35.java), call:DisplayRendererJ3D dr = (DisplayRendererJ3D) display.getDisplayRenderer(); dr.setClip(0, true, 1.0f, 0.0f, 0.0f, -1.01f); // X_POS face dr.setClip(1, true, -1.0f, 0.0f, 0.0f, -1.01f); // X_NEG face dr.setClip(2, true, 0.0f, 1.0f, 0.0f, -1.01f); // Y_POS face dr.setClip(3, true, 0.0f, -1.0f, 0.0f, -1.01f); // Y_NEG face dr.setClip(4, true, 0.0f, 0.0f, 1.0f, -1.01f); // Z_POS face dr.setClip(5, true, 0.0f, 0.0f, -1.0f, -1.01f); // Z_NEG faceNote: d value is slightly less than -1.0 so items in the plane are not clipped.
plane
- plane number must be in (0, ..., 5)).enable
- true to enable clipping on this plane, false to disablea
- x coefficentb
- y coefficentc
- z coefficentd
- constantVisADException
- illegal plane argument or
unsupported (< 1.2) version of Java 3Dpublic MouseBehavior getMouseBehavior()
MouseBehavior
associated with this renderer.getMouseBehavior
in class DisplayRenderer
MouseBehavior
used by this renderer to handle
mouse events.public KeyboardBehavior getKeyboardBehavior()
KeyboardBehavior
associated with this renderer.KeyboardBehavior
used by this renderer to handle
mouse events.public void addSceneGraphComponent(Group group)
public void addLockedSceneGraphComponent(Group group)
public void addLockedSceneGraphComponent(Group group, boolean initWithProj)
public void updateLockedTrans(double[] matrix)
public void addDirectManipulationSceneGraphComponent(Group group, DirectManipulationRendererJ3D renderer)
public void clearScene(DataRenderer renderer)
public double[] getCursor()
getCursor
in class DisplayRenderer
public void depth_cursor(VisADRay ray)
DisplayRenderer
depth_cursor
in class DisplayRenderer
ray
- VisADRay to setpublic void drag_depth(float diff)
DisplayRenderer
drag_depth
in class DisplayRenderer
diff
- amount to move cursor in depth (0.0 corresponds
to no movement)public void drag_cursor(VisADRay ray, boolean first)
DisplayRenderer
drag_cursor
in class DisplayRenderer
ray
- VisADRay that goes through new cursor locationfirst
- true to indicate this is first call to drag_cursor()
for this dragpublic void setCursorLoc(float x, float y, float z)
x
- x locationy
- y locationz
- z locationpublic void drawCursorStringVector(VisADCanvasJ3D canvas)
cursorOn
or directOn
is true,
display Strings in cursorStringVector.canvas
- public DataRenderer findDirect(VisADRay ray, int mouseModifiers)
DataRenderer
that is closest to the ray and
uses the specified mouse modifiers for direct manipulation.findDirect
in class DisplayRenderer
ray
- position to checkmouseModifiers
- modifiers for mouse clickspublic boolean anyDirects()
DirectManipulationRenderer
s
in this display.anyDirects
in class DisplayRenderer
public void setScaleOn(boolean on)
setScaleOn
in class DisplayRenderer
on
- turn on if true, otherwise turn them offpublic void setScale(AxisScale axisScale) throws VisADException
setScale
in class DisplayRenderer
axisScale
- AxisScale for this scaleVisADException
- couldn't set the scalepublic void setScale(int axis, int axis_ordinal, VisADLineArray array, float[] scale_color) throws VisADException
setScale
in class DisplayRenderer
axis
- axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)axis_ordinal
- position along the axisarray
- VisADLineArray
representing the scale plotscale_color
- array (dim 3) representing the red, green and blue
color values.VisADException
- couldn't set the scalepublic void setScale(int axis, int axis_ordinal, VisADLineArray array, VisADTriangleArray labels, float[] scale_color) throws VisADException
setScale
in class DisplayRenderer
axis
- axis for this scale (0 = XAxis, 1 = YAxis, 2 = ZAxis)axis_ordinal
- position along the axisarray
- VisADLineArray
representing the scale plotlabels
- VisADTriangleArray
representing the labels
created using a font (can be null)scale_color
- array (dim 3) representing the red, green and blue
color values.VisADException
- couldn't set the scalepublic void clearScales()
clearScales
in class DisplayRenderer
public void clearScale(AxisScale axisScale)
clearScale
in class DisplayRenderer
axisScale
- AxisScale to removepublic void setTransform3D(Transform3D t)
public Control makeControl(ScalarMap map)
Control
appropriate for the graphics API and for this
DisplayRenderer
; invoked by ScalarMap
when it is addMap()
ed to a Display
.makeControl
in class DisplayRenderer
map
- The ScalarMap
for which a Control
should be built.Control
.public DataRenderer makeDefaultRenderer()
DataRenderer
for this type of
DisplayRenderer
makeDefaultRenderer
in class DisplayRenderer
public boolean legalDataRenderer(DataRenderer renderer)
DataRenderer
in question is legal for this
DisplayRenderer
legalDataRenderer
in class DisplayRenderer
renderer
- DataRenderer
to checkRendererJ3D
public void rendererDeleted(DataRenderer renderer)
rendererDeleted
in interface RendererSourceListener
public void setLineWidth(float width)
public void addKeyboardBehavior(KeyboardBehaviorJ3D behavior)
KeyboardBehavior
for keyboard control of rotation,
translation and zoom.behavior
- keyboard behavior to addpublic void render_trigger()
DisplayRenderer
render_trigger
in class DisplayRenderer
public void setWaitFlag(boolean b)
DisplayRenderer
Display
.) DisplayEvent.WAIT_ON and
DisplayEvent.WAIT_OFF events are fired based on value of b.setWaitFlag
in class DisplayRenderer
b
- Boolean value to which wait flag is set.public int getTextureWidthMax()
getTextureWidthMax
in class DisplayRenderer
public int getTextureHeightMax()
getTextureHeightMax
in class DisplayRenderer
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.