public class WorldWindow extends GLSurfaceView implements MessageListener
Constructor and Description |
---|
WorldWindow(Context context)
Constructs a WorldWindow associated with the specified application context.
|
WorldWindow(Context context,
AttributeSet attrs)
Constructs a WorldWindow associated with the specified application context and attributes from an XML tag.
|
WorldWindow(Context context,
EGLConfigChooser configChooser)
Constructs a WorldWindow associated with the specified application context and EGL configuration chooser.
|
Modifier and Type | Method and Description |
---|---|
void |
addNavigatorListener(NavigatorListener listener) |
boolean |
cartesianToScreenPoint(double x,
double y,
double z,
PointF result)
Transforms a Cartesian coordinate point to Android screen coordinates.
|
double |
distanceToViewGlobeExtents()
Returns the minimum distance from the globe's surface necessary to make the globe's extents visible in this World
Window.
|
void |
doFrame(long frameTimeNanos) |
boolean |
geographicToScreenPoint(double latitude,
double longitude,
double altitude,
PointF result)
Transforms a geographic position to Android screen coordinates.
|
double |
getFieldOfView() |
FrameController |
getFrameController() |
FrameMetrics |
getFrameMetrics() |
Globe |
getGlobe()
Indicates the planet or celestial object displayed by this WorldWindow.
|
LayerList |
getLayers() |
Navigator |
getNavigator() |
long |
getNavigatorStoppedDelay() |
RenderResourceCache |
getRenderResourceCache() |
Tessellator |
getTessellator() |
double |
getVerticalExaggeration() |
WorldWindowController |
getWorldWindowController() |
void |
onDrawFrame(GL10 unused)
Implements the GLSurfaceView.Renderer.onDrawFrame interface which is called on the GLThread when rendering is
requested.
|
void |
onMessage(java.lang.String name,
java.lang.Object sender,
java.util.Map<java.lang.Object,java.lang.Object> userProperties) |
void |
onPause()
Called when the activity is paused.
|
void |
onResume()
Called when the activity is resumed.
|
void |
onSurfaceChanged(GL10 unused,
int width,
int height)
Implements the GLSurfaceView.Renderer.onSurfaceChanged interface which is called on the GLThread when the window
size changes.
|
void |
onSurfaceCreated(GL10 unused,
EGLConfig config)
Implements the GLSurfaceView.Renderer.onSurfaceChanged interface which is called on the GLThread when the surface
is created.
|
boolean |
onTouchEvent(MotionEvent event) |
PickedObjectList |
pick(float x,
float y)
Determines the WorldWind objects displayed at a screen point.
|
PickedObjectList |
pickShapesInRect(float x,
float y,
float width,
float height)
Determines the WorldWind shapes displayed in a screen rectangle.
|
double |
pixelSizeAtDistance(double distance)
Returns the height of a pixel at a given distance from the eye point.
|
void |
queueEvent(java.lang.Runnable r)
Deprecated.
See Communicating
with the UI Thread instead.
|
boolean |
rayThroughScreenPoint(float x,
float y,
Line result)
Computes a Cartesian coordinate ray that passes through through a screen point.
|
void |
removeNavigatorListener(NavigatorListener listener) |
void |
requestRedraw()
Request that this WorldWindow update its display.
|
void |
requestRender()
Deprecated.
Use
requestRedraw() instead. |
void |
setFieldOfView(double fovyDegrees) |
void |
setFrameController(FrameController frameController) |
void |
setFrameMetrics(FrameMetrics frameMetrics) |
void |
setGlobe(Globe globe)
Sets the planet or celestial object displayed by this WorldWindow.
|
void |
setLayers(LayerList layers) |
void |
setNavigator(Navigator navigator) |
void |
setNavigatorStoppedDelay(long delay,
java.util.concurrent.TimeUnit unit) |
void |
setRenderResourceCache(RenderResourceCache cache) |
void |
setTessellator(Tessellator tessellator) |
void |
setVerticalExaggeration(double verticalExaggeration) |
void |
setWorldWindowController(WorldWindowController controller) |
void |
surfaceCreated(SurfaceHolder holder)
Called immediately after the surface is first created, in which case the WorldWindow instance adds itself as a
listener to the
WorldWind.messageService() . |
void |
surfaceDestroyed(SurfaceHolder holder)
Called immediately before a surface is being destroyed, in which case the WorldWindow instance removes itself
from
WorldWind.messageService() . |
public WorldWindow(Context context)
public WorldWindow(Context context, EGLConfigChooser configChooser)
public WorldWindow(Context context, AttributeSet attrs)
public Globe getGlobe()
WorldWindow's globe is initially configured with the WGS 84 reference ellipsoid.
public void setGlobe(Globe globe)
globe
- the globe to displayjava.lang.IllegalArgumentException
- If the globe is nullpublic Tessellator getTessellator()
public void setTessellator(Tessellator tessellator)
public LayerList getLayers()
public void setLayers(LayerList layers)
public double getVerticalExaggeration()
public void setVerticalExaggeration(double verticalExaggeration)
public double getFieldOfView()
public void setFieldOfView(double fovyDegrees)
public Navigator getNavigator()
public void setNavigator(Navigator navigator)
public void addNavigatorListener(NavigatorListener listener)
public void removeNavigatorListener(NavigatorListener listener)
public long getNavigatorStoppedDelay()
public void setNavigatorStoppedDelay(long delay, java.util.concurrent.TimeUnit unit)
public FrameController getFrameController()
public void setFrameController(FrameController frameController)
public FrameMetrics getFrameMetrics()
public void setFrameMetrics(FrameMetrics frameMetrics)
public WorldWindowController getWorldWindowController()
public void setWorldWindowController(WorldWindowController controller)
public RenderResourceCache getRenderResourceCache()
public void setRenderResourceCache(RenderResourceCache cache)
public PickedObjectList pick(float x, float y)
x
- the screen point's X coordinate in Android screen pixelsy
- the screen point's Y coordinate in Android screen pixelspublic PickedObjectList pickShapesInRect(float x, float y, float width, float height)
x
- the screen rectangle's X coordinate in Android screen pixelsy
- the screen rectangle's Y coordinate in Android screen pixelswidth
- the screen rectangle's width in Android screen pixelsheight
- the screen rectangle's height in Android screen pixelspublic boolean cartesianToScreenPoint(double x, double y, double z, PointF result)
x
- the Cartesian point's x component in metersy
- the Cartesian point's y component in metersz
- the Cartesian point's z component in metersresult
- a pre-allocated PointF
in which to return the screen pointjava.lang.IllegalArgumentException
- If the result is nullpublic boolean geographicToScreenPoint(double latitude, double longitude, double altitude, PointF result)
latitude
- the position's latitude in degreeslongitude
- the position's longitude in degreesaltitude
- the position's altitude in metersresult
- a pre-allocated PointF
in which to return the screen pointjava.lang.IllegalArgumentException
- If the result is nullpublic boolean rayThroughScreenPoint(float x, float y, Line result)
x
- the screen point's X coordinate in Android screen pixelsy
- the screen point's Y coordinate in Android screen pixelsresult
- a pre-allocated Line in which to return the computed rayjava.lang.IllegalArgumentException
- If the result is nullpublic double pixelSizeAtDistance(double distance)
distance
- the distance from the eye point in meterspublic double distanceToViewGlobeExtents()
public void requestRedraw()
public void doFrame(long frameTimeNanos)
@Deprecated public void requestRender()
requestRedraw()
instead.requestRedraw()
instead.@Deprecated public void queueEvent(java.lang.Runnable r)
r
- the runnable to executepublic void onSurfaceCreated(GL10 unused, EGLConfig config)
public void onSurfaceChanged(GL10 unused, int width, int height)
public void onDrawFrame(GL10 unused)
public void surfaceCreated(SurfaceHolder holder)
WorldWind.messageService()
. The WorldWind.messageService is a facility for broadcasting
global redraw requests to active WorldWindows.holder
- the SurfaceHolder whose surface is being createdpublic void surfaceDestroyed(SurfaceHolder holder)
WorldWind.messageService()
. Failure to do so may result in a memory leak this WorldWindow instance
when its owner is release/collected.holder
- the SurfaceHolder whose surface is being destroyedpublic void onPause()
public void onResume()
public boolean onTouchEvent(MotionEvent event)
public void onMessage(java.lang.String name, java.lang.Object sender, java.util.Map<java.lang.Object,java.lang.Object> userProperties)
onMessage
in interface MessageListener