Package ucar.unidata.view.geoloc
Class MapProjectionDisplayJ3D
java.lang.Object
ucar.visad.display.DisplayMaster
ucar.unidata.view.geoloc.NavigatedDisplay
ucar.unidata.view.geoloc.MapProjectionDisplay
ucar.unidata.view.geoloc.MapProjectionDisplayJ3D
Provides a navigated VisAD DisplayImpl for displaying data.
The Projection or MapProjection provides the transformation from
lat/lon space to xy space. There are two modes that can be used
with this display - MODE_3D (Java 3D) and MODE_2Din3D (2D in Java 3D).
Performance is better in Java 3D modes. In the 3D
mode, RealType.Altitude is mapped to the display Z axis.
Any displayable data must be able to map to RealType.Latitude, RealType.Longitude and/or RealType.Altitude.
This Display also supports a RubberBandBox in Java 3D for panning and zooming.
- Version:
- $Revision: 1.36 $ $Date: 2007/07/31 15:11:25 $
- Author:
- Don Murray
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.unidata.view.geoloc.MapProjectionDisplay
MapProjectionDisplay.MapProjection3DAdapter
Nested classes/interfaces inherited from class ucar.unidata.view.geoloc.NavigatedDisplay
NavigatedDisplay.VerticalMapSet
-
Field Summary
Fields inherited from class ucar.unidata.view.geoloc.MapProjectionDisplay
CURSOR_BEARING, CURSOR_BEARING_TYPE, CURSOR_RANGE, CURSOR_RANGE_TYPE, force2D
Fields inherited from class ucar.unidata.view.geoloc.NavigatedDisplay
BOTTOM_VIEW, BOTTOM_VIEW_NAME, CLIP_BACK_DEFAULT, CLIP_BACK_PERSPECTIVE, CLIP_FRONT_DEFAULT, CLIP_FRONT_PERSPECTIVE, CURSOR_ALTITUDE, CURSOR_LATITUDE, CURSOR_LONGITUDE, defaultClipDistanceBack, defaultClipDistanceFront, EAST_VIEW, EAST_VIEW_NAME, MODE_2D, MODE_2Din3D, MODE_3D, NORTH_VIEW, NORTH_VIEW_NAME, SOUTH_VIEW, SOUTH_VIEW_NAME, TOP_VIEW, TOP_VIEW_NAME, WEST_VIEW, WEST_VIEW_NAME
Fields inherited from class ucar.visad.display.DisplayMaster
behavior, defaultMouseFunctions, POINT_MODE
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the default instance.MapProjectionDisplayJ3D
(int mode) Constructs an instance with a LatLonProjection with the specified mode.MapProjectionDisplayJ3D
(ucar.unidata.geoloc.ProjectionImpl projection, int mode) Constructs an instance with the specified Projection and mode.MapProjectionDisplayJ3D
(MapProjection projection, int mode) Constructs an instance with the specified MapProjection CoordinateSystem and mode.MapProjectionDisplayJ3D
(MapProjection projection, int mode, boolean offscreen, Dimension dimension) ctorMapProjectionDisplayJ3D
(MapProjection projection, int mode, boolean offscreen, Dimension dimension, GraphicsDevice screen) ctor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addKeyboardBehavior
(KeyboardBehavior behavior) Add a keyboard behavior to this displayvoid
void
enableClipping
(boolean clip) Enable clipping of data at the box edges.boolean
Determine if this MapDisplay can do stereo..javax.media.j3d.View
getView()
Get the Viewprotected void
Set up the display called by constructorboolean
Get the view to perspective or parallel..void
setClipDistanceBack
(double value) Set the ClipDistanceBack property.void
setClipDistanceFront
(double value) Set the ClipDistanceFront property.void
setEyePosition
(double position) Method for setting the eye position for a 3D stereo view.void
setPerspectiveView
(boolean perspectiveView) Set the view to perspective or parallel if this is a 3D display..void
setView
(int view) Set the view for 3D.Methods inherited from class ucar.unidata.view.geoloc.MapProjectionDisplay
addVerticalMap, cursorMoved, destroy, getAltitudeMap, getCursorBearing, getCursorRange, getDisplayAltitudeType, getDisplayCoordinateSystem, getDisplayLatitudeType, getDisplayLongitudeType, getEarthLocation, getInstance, getInstance, getInstance, getInstance, getLatScaleInfo, getLonScaleInfo, getMapProjection, getSpatialCoordinates, getSpatialCoordinates, getVerticalRange, getVertScaleInfo, init, main, makeDefaultMapProjection, pointerMoved, removeVerticalMap, scaleVerticalValues, setCursorBearing, setCursorRange, setLatScaleInfo, setLonScaleInfo, setMapArea, setMapProjection, setMapProjection, setMapProjection, setMapRegion, setVerticalRange, setVerticalRangeUnit, setVertScaleInfo, updateLocation
Methods inherited from class ucar.unidata.view.geoloc.NavigatedDisplay
animateMatrix, animateMatrix, animateMatrix, animateMatrix, applyRotation, center, center, center, center, centerAndZoom, centerAndZoom, enableRubberBanding, getAnimationStringOn, getAutoRotate, getBottomViewName, getBoxVisible, getCenterPoint, getClipDistanceBack, getClipDistanceFront, getCursorAltitude, getCursorLatitude, getCursorLongitude, getDisplayMode, getEarthLocation, getEarthLocation, getEarthLocation, getEastViewName, getIsAnimating, getLatLonBox, getLatLonBox, getLatLonRect, getNavigationToolBar, getNavigationToolBar, getNorthViewName, getRay, getRayDirection, getRayPositionAtZ, getRotation, getRubberBandBox, getScaledValue, getScalesVisible, getScreenCenter, getScreenCenterBottom, getScreenCenterLeft, getScreenCenterRight, getScreenCenterTop, getScreenCoordinates, getScreenCoordinates, getScreenLowerLeft, getScreenLowerRight, getScreenSidesCoordinates, getScreenUpperLeft, getScreenUpperRight, getSouthViewName, getSpatialCoordinates, getSpatialCoordinatesFromScreen, getSpatialCoordinatesFromScreen, getTopViewName, getVerticalRangeUnit, getVerticalRangeVisible, getVisadBox, getWestViewName, init, isClippingEnabled, moveToScreen, moveToScreen, moveToScreen, resetClipDistance, resetScaleTranslate, rotateFaster, rotateSlower, rotateView, rotateView, screenToEarthLocation, setAnimationStringOn, setAutoRotate, setBoxVisible, setCursorAltitude, setCursorLatitude, setCursorLongitude, setCursorStringOn, setForeground, setPolygonOffset, setPolygonOffsetFactor, setRotateDelay, setRotationMultiplierMatrix, setRubberBandBox, setScalesVisible, setVerticalMapUnit, setVerticalRangeVisible, setView
Methods inherited from class ucar.visad.display.DisplayMaster
addDisplayable, addDisplayListener, addPropertyChangeListener, addPropertyChangeListener, addScalarMap, addScalarMaps, addVetoableChangeListener, addVetoableChangeListener, buildAnimationSet, dataChange, draw, ensureInactive, equals, firePropertyChange, firePropertyChange, getAnimationSetFromDisplayables, getAnimationStringVisible, getBackground, getComponent, getDestroyed, getDisplay, getDisplayableCount, getDisplayables, getDisplayables, getDisplayAspect, getDisplayComponent, getDisplayScale, getForeground, getImage, getMouseBehavior, getMouseFunctionMap, getOffscreenDimension, getProjectionMatrix, getSavedProjectionMatrix, getScale, getScreenBounds, getWaitMessageVisible, handleMouseWheelMoved, hashCode, indexOf, init, is3D, isActive, isPointMode, printMatrix, printMe, rebuild, rebuildDisplay, reDisplayAll, removeDisplayable, removeDisplayables, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, removeScalarMaps, removeVetoableChangeListener, removeVetoableChangeListener, replaceScalarMap, reScale, resetMouseFunctions, resetProjection, rotate, rotateX, rotateY, rotateZ, saveCurrentDisplay, saveCurrentDisplay, saveCurrentDisplay, saveProjection, setActive, setAnimation, setAnimationStringVisible, setBackground, setDefaultMouseFunctions, setDisplayables, setDisplayables, setDisplayActive, setDisplayAspect, setDisplayInactive, setKeyboardBehavior, setKeyboardEventMap, setKeyboardEventMap, setMouseFunctions, setOffscreenDimension, setPointMode, setProjectionMatrix, setRebuildNecessary, setWaitMessageVisible, setWheelEventMap, translate, zoom, zoom
-
Constructor Details
-
MapProjectionDisplayJ3D
Constructs the default instance. The default instance is based on a LatLonProjection in 3D mode where Z is mapped to Altitude.- Throws:
VisADException
- Couldn't create necessary VisAD objectRemoteException
- Couldn't create a remote object
-
MapProjectionDisplayJ3D
Constructs an instance with a LatLonProjection with the specified mode.- Parameters:
mode
- mode for display (MODE_3D, MODE_2Din3D)- Throws:
VisADException
- Couldn't create necessary VisAD objectRemoteException
- Couldn't create a remote object
-
MapProjectionDisplayJ3D
public MapProjectionDisplayJ3D(ucar.unidata.geoloc.ProjectionImpl projection, int mode) throws VisADException, RemoteException Constructs an instance with the specified Projection and mode.- Parameters:
projection
- map projectionmode
- mode for display (MODE_3D, MODE_2Din3D)- Throws:
VisADException
- Couldn't create necessary VisAD objectRemoteException
- Couldn't create a remote object
-
MapProjectionDisplayJ3D
public MapProjectionDisplayJ3D(MapProjection projection, int mode) throws VisADException, RemoteException Constructs an instance with the specified MapProjection CoordinateSystem and mode.- Parameters:
projection
- map projection CSmode
- mode for display (MODE_3D, MODE_2Din3D)- Throws:
VisADException
- Couldn't create necessary VisAD objectRemoteException
- Couldn't create a remote object
-
MapProjectionDisplayJ3D
public MapProjectionDisplayJ3D(MapProjection projection, int mode, boolean offscreen, Dimension dimension) throws VisADException, RemoteException ctor- Parameters:
projection
- The projection to usemode
- 3D/2D modeoffscreen
- Are we in offscreen modedimension
- Size of offscreen image- Throws:
RemoteException
- On badnessVisADException
- On badness
-
MapProjectionDisplayJ3D
public MapProjectionDisplayJ3D(MapProjection projection, int mode, boolean offscreen, Dimension dimension, GraphicsDevice screen) throws VisADException, RemoteException ctor- Parameters:
projection
- The projection to usemode
- 3D/2D modeoffscreen
- Are we in offscreen modedimension
- Size of offscreen imagescreen
- Graphics device to create on- Throws:
RemoteException
- On badnessVisADException
- On badness
-
-
Method Details
-
initializeClass
Set up the display called by constructor- Overrides:
initializeClass
in classMapProjectionDisplay
- Throws:
RemoteException
VisADException
-
addKeyboardBehavior
Add a keyboard behavior to this display- Specified by:
addKeyboardBehavior
in classMapProjectionDisplay
- Parameters:
behavior
- behavior to add
-
enableClipping
public void enableClipping(boolean clip) Enable clipping of data at the box edges.- Overrides:
enableClipping
in classNavigatedDisplay
- Parameters:
clip
- true to turn clipping on, otherwise off
-
getView
public javax.media.j3d.View getView()Description copied from class:NavigatedDisplay
Get the View- Overrides:
getView
in classNavigatedDisplay
- Returns:
- the View
-
setPerspectiveView
public void setPerspectiveView(boolean perspectiveView) Set the view to perspective or parallel if this is a 3D display..- Overrides:
setPerspectiveView
in classNavigatedDisplay
- Parameters:
perspectiveView
- true for perspective view
-
isPerspectiveView
public boolean isPerspectiveView()Get the view to perspective or parallel..- Overrides:
isPerspectiveView
in classNavigatedDisplay
- Returns:
- true if perpsective view (MODE_3D only)
-
setView
public void setView(int view) Set the view for 3D. The views are based on the original display as follows:NORTH _________ W | | E E | | A S | | S T |_______| T SOUTH
- Overrides:
setView
in classMapProjectionDisplay
- Parameters:
view
- one of the static view fields (NORTH_VIEW, SOUTH_VIEW, .. etc).
-
getStereoAvailable
public boolean getStereoAvailable()Determine if this MapDisplay can do stereo..- Overrides:
getStereoAvailable
in classDisplayMaster
- Returns:
- true if the graphics device can do stereo
-
setEyePosition
public void setEyePosition(double position) Method for setting the eye position for a 3D stereo view.- Overrides:
setEyePosition
in classDisplayMaster
- Parameters:
position
- x position of each eye (left negative, right positive).
-
setClipDistanceFront
public void setClipDistanceFront(double value) Description copied from class:NavigatedDisplay
Set the ClipDistanceFront property.- Overrides:
setClipDistanceFront
in classNavigatedDisplay
- Parameters:
value
- The new value for ClipDistanceFront
-
setClipDistanceBack
public void setClipDistanceBack(double value) Description copied from class:NavigatedDisplay
Set the ClipDistanceBack property.- Overrides:
setClipDistanceBack
in classNavigatedDisplay
- Parameters:
value
- The new value for ClipDistanceBack
-
checkClipDistance
public void checkClipDistance()
-