public class GlobeDisplay extends NavigatedDisplay
NavigatedDisplay.VerticalMapSet
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BOTTOM_VIEW_NAME
Bottom View name
|
static double |
EARTH_RADIUS
Earth Radius (m)
|
static java.lang.String |
EAST_VIEW_NAME
East View name
|
static java.lang.String |
NORTH_VIEW_NAME
North View name
|
static java.lang.String |
SOUTH_VIEW_NAME
South View name
|
static java.lang.String |
TOP_VIEW_NAME
Top View name
|
static java.lang.String |
WEST_VIEW_NAME
West View name
|
BOTTOM_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_VIEW
behavior, defaultMouseFunctions, log_, POINT_MODE
Constructor and Description |
---|
GlobeDisplay()
Constructs a new GlobeDisplay.
|
GlobeDisplay(boolean offscreen,
java.awt.Dimension dimension,
java.awt.GraphicsDevice screen)
Constructs a new GlobeDisplay.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyboardBehavior(visad.KeyboardBehavior behavior)
Add a keyboard behavior for this display
|
void |
addVerticalMap(visad.RealType newVertType)
Add a new mapping of this type to the vertical coordinate
|
void |
centerAndZoom(visad.georef.EarthLocation el,
visad.Real altitude,
double zoomFactor,
boolean animated,
boolean northUp)
Center and zoom to a particular point
|
void |
checkClipDistance()
If we are in perspective view then set the clip distance shorter
|
protected void |
cursorChange()
Handles a change to the cursor position.
|
protected void |
cursorMoved()
Handles a change to the cursor position.
|
void |
enableClipping(boolean clip)
Enable clipping of data at the box edges
|
protected visad.ScalarMap |
getAltitudeMap()
Accessor method for the ScalarMap for Altitude
|
java.lang.String |
getBottomViewName()
Accessor method.
|
visad.DisplayRealType |
getDisplayAltitudeType()
Accessor method for the DisplayAltitudeType
|
visad.CoordinateSystem |
getDisplayCoordinateSystem()
Get the display coordinate system that turns lat/lon/alt to
x/y/z
|
visad.DisplayRealType |
getDisplayLatitudeType()
Accessor method for the DisplayLatitudeType
|
visad.DisplayRealType |
getDisplayLongitudeType()
Accessor method for the DisplayLongitudeType
|
visad.DisplayTupleType |
getDisplayTupleType()
Accessor method for the DisplayTupleType.
|
visad.georef.EarthLocation |
getEarthLocation(double x,
double y,
double z,
boolean setZToZeroIfOverhead)
Get the EarthLocation of a point in XYZ space
|
java.lang.String |
getEastViewName()
Accessor method.
|
java.awt.geom.Rectangle2D.Double |
getLatLonBox()
Get the latlon box of the displayed area.
|
java.lang.String |
getNorthViewName()
Accessor method.
|
java.lang.String |
getSouthViewName()
Accessor method.
|
visad.RealTuple |
getSpatialCoordinates(visad.georef.EarthLocation el)
Returns the spatial (XYZ) coordinates of the particular EarthLocation
|
double[] |
getSpatialCoordinates(visad.georef.EarthLocation el,
double[] xyz,
double altitude)
Returns the spatial (XYZ) coordinates of the particular EarthLocation
|
double[] |
getSpatialCoordinatesFromScreen(int x,
int y,
double zDepth)
Get spatial coordinates from screen
|
boolean |
getStereoAvailable()
Determine if this MapDisplay can do stereo.
|
java.lang.String |
getTopViewName()
Accessor method.
|
javax.media.j3d.View |
getView()
Get the View
|
visad.georef.EarthLocation |
getViewPointEarthLocation()
Get the viewpoint earth location
|
java.lang.String |
getWestViewName()
Accessor method.
|
protected void |
initializeClass()
Initialize the class.
|
static void |
main(java.lang.String[] args)
test by running java ucar.unidata.view.geoloc.NavigatedDisplay
|
protected void |
pointerMoved(int x,
int y)
Handles a change in the position of the mouse-pointer.
|
void |
removeVerticalMap(visad.RealType vertType)
Remove a new mapping of this type to the vertical coordinate
|
void |
resetClipDistance(double scale)
Zoom in on the display
|
void |
resetScaleTranslate()
Reset the scale translate
|
visad.georef.EarthLocation |
screenToEarthLocation(int x,
int y)
Get the earth coordinates from the screen coordinates
|
void |
setClipDistanceFront(double value)
Set the front clip distance
|
void |
setEyePosition(double position)
Method for setting the eye position for a 3D stereo view.
|
void |
setMapArea(ucar.unidata.geoloc.ProjectionRect mapArea)
Set the map area to be displayed in the box.
|
void |
setMapProjection(visad.georef.MapProjection mapProjection)
Define the map projection using a MapProjection type CoordinateSystem.
|
void |
setPerspectiveView(boolean perspectiveView)
Set the view to perspective or parallel if this is a 3D display.
|
void |
setVerticalRange(double min,
double max)
Set the range of the vertical coordinate
|
void |
setVerticalRangeUnit(visad.Unit newUnit)
Set the Unit of the vertical range
|
void |
setView(int view)
Set the view for 3D.
|
animateMatrix, 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, updateLocation
addDisplayable, addDisplayListener, addPropertyChangeListener, addPropertyChangeListener, addScalarMap, addScalarMaps, addVetoableChangeListener, addVetoableChangeListener, buildAnimationSet, dataChange, draw, ensureInactive, equals, finalize, 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
public static java.lang.String BOTTOM_VIEW_NAME
public static java.lang.String NORTH_VIEW_NAME
public static java.lang.String EAST_VIEW_NAME
public static java.lang.String TOP_VIEW_NAME
public static java.lang.String SOUTH_VIEW_NAME
public static java.lang.String WEST_VIEW_NAME
public static final double EARTH_RADIUS
public GlobeDisplay() throws visad.VisADException, java.rmi.RemoteException
visad.VisADException
- Couldn't create necessary VisAD objectjava.rmi.RemoteException
- Couldn't create a remote objectpublic GlobeDisplay(boolean offscreen, java.awt.Dimension dimension, java.awt.GraphicsDevice screen) throws visad.VisADException, java.rmi.RemoteException
offscreen
- true for an offscreen displaydimension
- size of the displayscreen
- screen devicevisad.VisADException
- Couldn't create necessary VisAD objectjava.rmi.RemoteException
- Couldn't create a remote objectprotected void initializeClass() throws visad.VisADException, java.rmi.RemoteException
initializeClass
in class NavigatedDisplay
java.rmi.RemoteException
- Java RMI problemvisad.VisADException
- VisAD problempublic java.lang.String getTopViewName()
getTopViewName
in class NavigatedDisplay
public java.lang.String getBottomViewName()
getBottomViewName
in class NavigatedDisplay
public java.lang.String getNorthViewName()
getNorthViewName
in class NavigatedDisplay
public java.lang.String getEastViewName()
getEastViewName
in class NavigatedDisplay
public java.lang.String getSouthViewName()
getSouthViewName
in class NavigatedDisplay
public java.lang.String getWestViewName()
getWestViewName
in class NavigatedDisplay
public void addKeyboardBehavior(visad.KeyboardBehavior behavior)
addKeyboardBehavior
in class DisplayMaster
behavior
- behavior to addprotected void cursorMoved() throws visad.VisADException, java.rmi.RemoteException
cursorMoved
in class NavigatedDisplay
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public visad.georef.EarthLocation screenToEarthLocation(int x, int y) throws visad.VisADException
screenToEarthLocation
in class NavigatedDisplay
x
- screen x positiony
- screen y positionvisad.VisADException
- problem getting coordinatesprotected void pointerMoved(int x, int y) throws visad.UnitException, visad.VisADException, java.rmi.RemoteException
pointerMoved
in class NavigatedDisplay
x
- x mouse locationy
- y mouse locationjava.rmi.RemoteException
- Java RMI problemvisad.UnitException
- Unit conversion problemvisad.VisADException
- VisAD problempublic void resetClipDistance(double scale)
resetClipDistance
in class NavigatedDisplay
scale
- x zoom factor
( > 1 = zoom in, 1 > zoom > 0 = zoom out). using
2.0 and .5 seems to work well.public void setMapArea(ucar.unidata.geoloc.ProjectionRect mapArea) throws visad.VisADException, java.rmi.RemoteException
setMapArea
in class NavigatedDisplay
mapArea
- ProjectionRect describing the map area to be displayedvisad.VisADException
- invalid navigation or VisAD errorjava.rmi.RemoteException
- Couldn't create a remote objectpublic void setMapProjection(visad.georef.MapProjection mapProjection) throws visad.VisADException, java.rmi.RemoteException
setMapProjection
in class NavigatedDisplay
mapProjection
- map projection coordinate systemvisad.VisADException
- Couldn't create necessary VisAD objectjava.rmi.RemoteException
- Couldn't create a remote objectpublic visad.DisplayRealType getDisplayLatitudeType()
getDisplayLatitudeType
in class NavigatedDisplay
public visad.DisplayRealType getDisplayLongitudeType()
getDisplayLongitudeType
in class NavigatedDisplay
public visad.DisplayRealType getDisplayAltitudeType()
getDisplayAltitudeType
in class NavigatedDisplay
public visad.DisplayTupleType getDisplayTupleType()
protected visad.ScalarMap getAltitudeMap()
getAltitudeMap
in class NavigatedDisplay
protected void cursorChange() throws visad.VisADException, java.rmi.RemoteException
visad.VisADException
- VisAD failure.java.rmi.RemoteException
- Java RMI failure.public void resetScaleTranslate() throws visad.VisADException, java.rmi.RemoteException
resetScaleTranslate
in class NavigatedDisplay
java.rmi.RemoteException
- Java RMI problemvisad.VisADException
- matrix problempublic void setView(int view)
NORTH _________ W | | E E | TOP | A S | MOTTOB| S T |_______| T SOUTH
setView
in class NavigatedDisplay
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 Regionpublic void enableClipping(boolean clip)
enableClipping
in class NavigatedDisplay
clip
- true to turn clipping on, otherwise offpublic javax.media.j3d.View getView()
getView
in class NavigatedDisplay
public void setPerspectiveView(boolean perspectiveView)
setPerspectiveView
in class NavigatedDisplay
perspectiveView
- true for perspective viewpublic visad.georef.EarthLocation getEarthLocation(double x, double y, double z, boolean setZToZeroIfOverhead)
getEarthLocation
in class NavigatedDisplay
x
- x coord.y
- y coord.z
- z coord.setZToZeroIfOverhead
- If in the overhead view then set Z to 0public void centerAndZoom(visad.georef.EarthLocation el, visad.Real altitude, double zoomFactor, boolean animated, boolean northUp) throws visad.VisADException, java.rmi.RemoteException
centerAndZoom
in class NavigatedDisplay
el
- the earth locationaltitude
- the altitudezoomFactor
- zoom factoranimated
- true to animatenorthUp
- rotate so north is upjava.rmi.RemoteException
- Couldn't create a remote objectvisad.VisADException
- Couldn't create necessary VisAD objectpublic double[] getSpatialCoordinatesFromScreen(int x, int y, double zDepth)
getSpatialCoordinatesFromScreen
in class NavigatedDisplay
x
- screen Xy
- screen YzDepth
- the z depthpublic visad.RealTuple getSpatialCoordinates(visad.georef.EarthLocation el)
getSpatialCoordinates
in class NavigatedDisplay
el
- earth location (lat/lon/alt) to translatepublic double[] getSpatialCoordinates(visad.georef.EarthLocation el, double[] xyz, double altitude) throws visad.VisADException, java.rmi.RemoteException
getSpatialCoordinates
in class NavigatedDisplay
el
- earth location (lat/lon/alt) to translatexyz
- Where to put the valuealtitude
- the altitudejava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic void addVerticalMap(visad.RealType newVertType) throws visad.VisADException, java.rmi.RemoteException
addVerticalMap
in class NavigatedDisplay
newVertType
- RealType of mapjava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- VisAD problempublic void removeVerticalMap(visad.RealType vertType) throws visad.VisADException, java.rmi.RemoteException
removeVerticalMap
in class NavigatedDisplay
vertType
- RealType of mapjava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- VisAD problempublic void setVerticalRangeUnit(visad.Unit newUnit) throws visad.VisADException, java.rmi.RemoteException
setVerticalRangeUnit
in class NavigatedDisplay
newUnit
- unit of rangejava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- VisAD problempublic void setVerticalRange(double min, double max) throws visad.VisADException, java.rmi.RemoteException
setVerticalRange
in class NavigatedDisplay
min
- minimum value for vertical axismax
- maximum value for vertical axisjava.rmi.RemoteException
- Java RMI problemvisad.VisADException
- VisAD problempublic boolean getStereoAvailable()
getStereoAvailable
in class DisplayMaster
public void setEyePosition(double position)
setEyePosition
in class DisplayMaster
position
- x position of each eye (left negative, right positive).public java.awt.geom.Rectangle2D.Double getLatLonBox() throws visad.VisADException, java.rmi.RemoteException
getLatLonBox
in class NavigatedDisplay
java.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic visad.CoordinateSystem getDisplayCoordinateSystem()
getDisplayCoordinateSystem
in class NavigatedDisplay
public visad.georef.EarthLocation getViewPointEarthLocation()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- not usedjava.lang.Exception
- problem creating the displaypublic void setClipDistanceFront(double value)
setClipDistanceFront
in class NavigatedDisplay
value
- clip distancepublic void checkClipDistance()