Package ucar.unidata.view.geoloc
Class GlobeDisplay
java.lang.Object
ucar.visad.display.DisplayMaster
ucar.unidata.view.geoloc.NavigatedDisplay
ucar.unidata.view.geoloc.GlobeDisplay
Provides a navigated globe for displaying geolocated data.
 Any displayable data must be able to map to RealType.Latitude,
 RealType.Longitude and/or RealType.Altitude.
- Version:
- $Revision: 1.49 $ $Date: 2007/07/31 15:11:25 $
- Author:
- Don Murray
- 
Nested Class SummaryNested classes/interfaces inherited from class ucar.unidata.view.geoloc.NavigatedDisplayNavigatedDisplay.VerticalMapSet
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic StringBottom View namestatic final doubleEarth Radius (m)static StringEast View namestatic StringNorth View namestatic StringSouth View namestatic StringTop View namestatic StringWest View nameFields inherited from class ucar.unidata.view.geoloc.NavigatedDisplayBOTTOM_VIEW, CLIP_BACK_DEFAULT, CLIP_BACK_PERSPECTIVE, CLIP_FRONT_DEFAULT, CLIP_FRONT_PERSPECTIVE, CURSOR_ALTITUDE, CURSOR_LATITUDE, CURSOR_LONGITUDE, defaultClipDistanceBack, defaultClipDistanceFront, EAST_VIEW, MODE_2D, MODE_2Din3D, MODE_3D, NORTH_VIEW, SOUTH_VIEW, TOP_VIEW, WEST_VIEWFields inherited from class ucar.visad.display.DisplayMasterbehavior, defaultMouseFunctions, log_, POINT_MODE
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new GlobeDisplay.GlobeDisplay(boolean offscreen, Dimension dimension, GraphicsDevice screen) Constructs a new GlobeDisplay.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddKeyboardBehavior(KeyboardBehavior behavior) Add a keyboard behavior for this displayvoidaddVerticalMap(RealType newVertType) Add a new mapping of this type to the vertical coordinatevoidcenterAndZoom(EarthLocation el, Real altitude, double zoomFactor, boolean animated, boolean northUp) Center and zoom to a particular pointvoidIf we are in perspective view then set the clip distance shorterprotected voidHandles a change to the cursor position.protected voidHandles a change to the cursor position.voidenableClipping(boolean clip) Enable clipping of data at the box edgesprotected ScalarMapAccessor method for the ScalarMap for AltitudeAccessor method.Accessor method for the DisplayAltitudeTypeGet the display coordinate system that turns lat/lon/alt to x/y/zAccessor method for the DisplayLatitudeTypeAccessor method for the DisplayLongitudeTypeAccessor method for the DisplayTupleType.getEarthLocation(double x, double y, double z, boolean setZToZeroIfOverhead) Get the EarthLocation of a point in XYZ spaceAccessor method.Get the latlon box of the displayed area.Accessor method.Accessor method.Returns the spatial (XYZ) coordinates of the particular EarthLocationdouble[]getSpatialCoordinates(EarthLocation el, double[] xyz, double altitude) Returns the spatial (XYZ) coordinates of the particular EarthLocationdouble[]getSpatialCoordinatesFromScreen(int x, int y, double zDepth) Get spatial coordinates from screenbooleanDetermine if this MapDisplay can do stereo.Accessor method.javax.media.j3d.ViewgetView()Get the ViewGet the viewpoint earth locationAccessor method.protected voidInitialize the class.static voidtest by running java ucar.unidata.view.geoloc.NavigatedDisplayprotected voidpointerMoved(int x, int y) Handles a change in the position of the mouse-pointer.voidremoveVerticalMap(RealType vertType) Remove a new mapping of this type to the vertical coordinatevoidresetClipDistance(double scale) Zoom in on the displayvoidReset the scale translatescreenToEarthLocation(int x, int y) Get the earth coordinates from the screen coordinatesvoidsetClipDistanceFront(double value) Set the front clip distancevoidsetEyePosition(double position) Method for setting the eye position for a 3D stereo view.voidsetMapArea(ucar.unidata.geoloc.ProjectionRect mapArea) Set the map area to be displayed in the box.voidsetMapProjection(MapProjection mapProjection) Define the map projection using a MapProjection type CoordinateSystem.voidsetPerspectiveView(boolean perspectiveView) Set the view to perspective or parallel if this is a 3D display.voidsetVerticalRange(double min, double max) Set the range of the vertical coordinatevoidsetVerticalRangeUnit(Unit newUnit) Set the Unit of the vertical rangevoidsetView(int view) Set the view for 3D.Methods inherited from class ucar.unidata.view.geoloc.NavigatedDisplayanimateMatrix, animateMatrix, animateMatrix, animateMatrix, applyRotation, center, center, center, center, centerAndZoom, destroy, enableRubberBanding, getAnimationStringOn, getAutoRotate, getBoxVisible, getCenterPoint, getClipDistanceBack, getClipDistanceFront, getCursorAltitude, getCursorLatitude, getCursorLongitude, getDisplayMode, getEarthLocation, getEarthLocation, getEarthLocation, getIsAnimating, getLatLonBox, getLatLonRect, getNavigationToolBar, getNavigationToolBar, getRay, getRayDirection, getRayPositionAtZ, getRotation, getRubberBandBox, getScaledValue, getScalesVisible, getScreenCenter, getScreenCenterBottom, getScreenCenterLeft, getScreenCenterRight, getScreenCenterTop, getScreenCoordinates, getScreenCoordinates, getScreenLowerLeft, getScreenLowerRight, getScreenSidesCoordinates, getScreenUpperLeft, getScreenUpperRight, getSpatialCoordinates, getSpatialCoordinatesFromScreen, getVerticalRange, getVerticalRangeUnit, getVerticalRangeVisible, getVisadBox, init, isClippingEnabled, isPerspectiveView, moveToScreen, moveToScreen, moveToScreen, rotateFaster, rotateSlower, rotateView, rotateView, setAnimationStringOn, setAutoRotate, setBoxVisible, setClipDistanceBack, setCursorAltitude, setCursorLatitude, setCursorLongitude, setCursorStringOn, setForeground, setMapProjection, setPolygonOffset, setPolygonOffsetFactor, setRotateDelay, setRotationMultiplierMatrix, setRubberBandBox, setScalesVisible, setVerticalMapUnit, setVerticalRangeVisible, setView, updateLocationMethods inherited from class ucar.visad.display.DisplayMasteraddDisplayable, 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
- 
Field Details- 
BOTTOM_VIEW_NAMEBottom View name
- 
NORTH_VIEW_NAMENorth View name
- 
EAST_VIEW_NAMEEast View name
- 
TOP_VIEW_NAMETop View name
- 
SOUTH_VIEW_NAMESouth View name
- 
WEST_VIEW_NAMEWest View name
- 
EARTH_RADIUSpublic static final double EARTH_RADIUSEarth Radius (m)- See Also:
 
 
- 
- 
Constructor Details- 
GlobeDisplayConstructs a new GlobeDisplay.- Throws:
- VisADException- Couldn't create necessary VisAD object
- RemoteException- Couldn't create a remote object
 
- 
GlobeDisplaypublic GlobeDisplay(boolean offscreen, Dimension dimension, GraphicsDevice screen) throws VisADException, RemoteException Constructs a new GlobeDisplay.- Parameters:
- offscreen- true for an offscreen display
- dimension- size of the display
- screen- screen device
- Throws:
- VisADException- Couldn't create necessary VisAD object
- RemoteException- Couldn't create a remote object
 
 
- 
- 
Method Details- 
initializeClassInitialize the class.- Overrides:
- initializeClassin class- NavigatedDisplay
- Throws:
- RemoteException- Java RMI problem
- VisADException- VisAD problem
 
- 
getTopViewNameAccessor method.- Overrides:
- getTopViewNamein class- NavigatedDisplay
- Returns:
- name for this view
 
- 
getBottomViewNameAccessor method.- Overrides:
- getBottomViewNamein class- NavigatedDisplay
- Returns:
- name for this view
 
- 
getNorthViewNameAccessor method.- Overrides:
- getNorthViewNamein class- NavigatedDisplay
- Returns:
- name for this view
 
- 
getEastViewNameAccessor method.- Overrides:
- getEastViewNamein class- NavigatedDisplay
- Returns:
- name for this view
 
- 
getSouthViewNameAccessor method.- Overrides:
- getSouthViewNamein class- NavigatedDisplay
- Returns:
- name for this view
 
- 
getWestViewNameAccessor method.- Overrides:
- getWestViewNamein class- NavigatedDisplay
- Returns:
- name for this view
 
- 
addKeyboardBehaviorAdd a keyboard behavior for this display- Overrides:
- addKeyboardBehaviorin class- DisplayMaster
- Parameters:
- behavior- behavior to add
 
- 
cursorMovedHandles a change to the cursor position.- Overrides:
- cursorMovedin class- NavigatedDisplay
- Throws:
- VisADException- VisAD failure.
- RemoteException- Java RMI failure.
 
- 
screenToEarthLocationGet the earth coordinates from the screen coordinates- Overrides:
- screenToEarthLocationin class- NavigatedDisplay
- Parameters:
- x- screen x position
- y- screen y position
- Returns:
- corresponding earth location
- Throws:
- VisADException- problem getting coordinates
 
- 
pointerMovedHandles a change in the position of the mouse-pointer. For this implementation, it will only list the- Overrides:
- pointerMovedin class- NavigatedDisplay
- Parameters:
- x- x mouse location
- y- y mouse location
- Throws:
- RemoteException- Java RMI problem
- UnitException- Unit conversion problem
- VisADException- VisAD problem
 
- 
resetClipDistancepublic void resetClipDistance(double scale) Zoom in on the display- Overrides:
- resetClipDistancein class- NavigatedDisplay
- Parameters:
- scale- x zoom factor ( > 1 = zoom in, 1 > zoom > 0 = zoom out). using 2.0 and .5 seems to work well.
 
- 
setMapAreapublic void setMapArea(ucar.unidata.geoloc.ProjectionRect mapArea) throws VisADException, RemoteException Set the map area to be displayed in the box. Does nothing at this point.- Overrides:
- setMapAreain class- NavigatedDisplay
- Parameters:
- mapArea- ProjectionRect describing the map area to be displayed
- Throws:
- VisADException- invalid navigation or VisAD error
- RemoteException- Couldn't create a remote object
 
- 
setMapProjectionDefine the map projection using a MapProjection type CoordinateSystem. Implementation will be subclass dependent.- Specified by:
- setMapProjectionin class- NavigatedDisplay
- Parameters:
- mapProjection- map projection coordinate system
- Throws:
- VisADException- Couldn't create necessary VisAD object
- RemoteException- Couldn't create a remote object
 
- 
getDisplayLatitudeTypeAccessor method for the DisplayLatitudeType- Specified by:
- getDisplayLatitudeTypein class- NavigatedDisplay
- Returns:
- DisplayRealType for Latitude mapping
 
- 
getDisplayLongitudeTypeAccessor method for the DisplayLongitudeType- Specified by:
- getDisplayLongitudeTypein class- NavigatedDisplay
- Returns:
- DisplayRealType for Longitude mapping
 
- 
getDisplayAltitudeTypeAccessor method for the DisplayAltitudeType- Specified by:
- getDisplayAltitudeTypein class- NavigatedDisplay
- Returns:
- DisplayRealType for Altitude mapping
 
- 
getDisplayTupleTypeAccessor method for the DisplayTupleType.- Returns:
- the tuple of DisplayRealTypes
 
- 
getAltitudeMapAccessor method for the ScalarMap for Altitude- Specified by:
- getAltitudeMapin class- NavigatedDisplay
- Returns:
- the altitude ScalarMap
 
- 
cursorChangeHandles a change to the cursor position.- Throws:
- VisADException- VisAD failure.
- RemoteException- Java RMI failure.
 
- 
resetScaleTranslateReset the scale translate- Overrides:
- resetScaleTranslatein class- NavigatedDisplay
- Throws:
- RemoteException- Java RMI problem
- VisADException- matrix problem
 
- 
setViewpublic void setView(int view) Set the view for 3D. The views are based on the original display as follows:NORTH _________ W | | E E | TOP | A S | MOTTOB| S T |_______| T SOUTH- Specified by:
- setViewin class- NavigatedDisplay
- Parameters:
- view- one of the static view fields (NORTH_VIEW, SOUTH_VIEW, .. etc). In this display, NORTH is the Western Hemisphere, SOUTH is the Eastern Hemisphere, EAST is the Pacific region and WEST is the Atlantic Region
 
- 
enableClippingpublic void enableClipping(boolean clip) Enable clipping of data at the box edges- Overrides:
- enableClippingin class- NavigatedDisplay
- Parameters:
- clip- true to turn clipping on, otherwise off
 
- 
getViewpublic javax.media.j3d.View getView()Get the View- Overrides:
- getViewin class- NavigatedDisplay
- Returns:
- the View
 
- 
setPerspectiveViewpublic void setPerspectiveView(boolean perspectiveView) Set the view to perspective or parallel if this is a 3D display.- Overrides:
- setPerspectiveViewin class- NavigatedDisplay
- Parameters:
- perspectiveView- true for perspective view
 
- 
getEarthLocationGet the EarthLocation of a point in XYZ space- Specified by:
- getEarthLocationin class- NavigatedDisplay
- Parameters:
- x- x coord.
- y- y coord.
- z- z coord.
- setZToZeroIfOverhead- If in the overhead view then set Z to 0
- Returns:
- point in lat/lon/alt space.
 
- 
centerAndZoompublic void centerAndZoom(EarthLocation el, Real altitude, double zoomFactor, boolean animated, boolean northUp) throws VisADException, RemoteException Center and zoom to a particular point- Overrides:
- centerAndZoomin class- NavigatedDisplay
- Parameters:
- el- the earth location
- altitude- the altitude
- zoomFactor- zoom factor
- animated- true to animate
- northUp- rotate so north is up
- Throws:
- RemoteException- Couldn't create a remote object
- VisADException- Couldn't create necessary VisAD object
 
- 
getSpatialCoordinatesFromScreenpublic double[] getSpatialCoordinatesFromScreen(int x, int y, double zDepth) Get spatial coordinates from screen- Overrides:
- getSpatialCoordinatesFromScreenin class- NavigatedDisplay
- Parameters:
- x- screen X
- y- screen Y
- zDepth- the z depth
- Returns:
- the coordinates
 
- 
getSpatialCoordinatesReturns the spatial (XYZ) coordinates of the particular EarthLocation- Specified by:
- getSpatialCoordinatesin class- NavigatedDisplay
- Parameters:
- el- earth location (lat/lon/alt) to translate
- Returns:
- RealTuple of display coordinates.
 
- 
getSpatialCoordinatespublic double[] getSpatialCoordinates(EarthLocation el, double[] xyz, double altitude) throws VisADException, RemoteException Returns the spatial (XYZ) coordinates of the particular EarthLocation- Specified by:
- getSpatialCoordinatesin class- NavigatedDisplay
- Parameters:
- el- earth location (lat/lon/alt) to translate
- xyz- Where to put the value
- altitude- the altitude
- Returns:
- The xyz array
- Throws:
- RemoteException- On badness
- VisADException- On badness
 
- 
addVerticalMapAdd a new mapping of this type to the vertical coordinate- Overrides:
- addVerticalMapin class- NavigatedDisplay
- Parameters:
- newVertType- RealType of map
- Throws:
- RemoteException- Java RMI problem
- VisADException- VisAD problem
 
- 
removeVerticalMapRemove a new mapping of this type to the vertical coordinate- Overrides:
- removeVerticalMapin class- NavigatedDisplay
- Parameters:
- vertType- RealType of map
- Throws:
- RemoteException- Java RMI problem
- VisADException- VisAD problem
 
- 
setVerticalRangeUnitSet the Unit of the vertical range- Overrides:
- setVerticalRangeUnitin class- NavigatedDisplay
- Parameters:
- newUnit- unit of range
- Throws:
- RemoteException- Java RMI problem
- VisADException- VisAD problem
 
- 
setVerticalRangeSet the range of the vertical coordinate- Overrides:
- setVerticalRangein class- NavigatedDisplay
- Parameters:
- min- minimum value for vertical axis
- max- maximum value for vertical axis
- Throws:
- RemoteException- Java RMI problem
- VisADException- VisAD problem
 
- 
getStereoAvailablepublic boolean getStereoAvailable()Determine if this MapDisplay can do stereo.- Overrides:
- getStereoAvailablein class- DisplayMaster
- Returns:
- true if the graphics device can do stereo
 
- 
setEyePositionpublic void setEyePosition(double position) Method for setting the eye position for a 3D stereo view.- Overrides:
- setEyePositionin class- DisplayMaster
- Parameters:
- position- x position of each eye (left negative, right positive).
 
- 
getLatLonBoxGet the latlon box of the displayed area. This checks to see if the globe is sort of fully zoomed out. If it is then it returns an earth spanning bbox- Overrides:
- getLatLonBoxin class- NavigatedDisplay
- Returns:
- lat lon box or null if it can't be determined
- Throws:
- RemoteException- On badness
- VisADException- On badness
 
- 
getDisplayCoordinateSystemGet the display coordinate system that turns lat/lon/alt to x/y/z- Overrides:
- getDisplayCoordinateSystemin class- NavigatedDisplay
- Returns:
- the coordinate system (may be null)
 
- 
getViewPointEarthLocationGet the viewpoint earth location- Returns:
- the location
 
- 
maintest by running java ucar.unidata.view.geoloc.NavigatedDisplay- Parameters:
- args- not used
- Throws:
- Exception- problem creating the display
 
- 
setClipDistanceFrontpublic void setClipDistanceFront(double value) Set the front clip distance- Overrides:
- setClipDistanceFrontin class- NavigatedDisplay
- Parameters:
- value- clip distance
 
- 
checkClipDistancepublic void checkClipDistance()If we are in perspective view then set the clip distance shorter
 
-