NASA World Wind

gov.nasa.worldwind.render
Class DrawContextImpl

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.render.DrawContextImpl
All Implemented Interfaces:
AVList, Disposable, MessageListener, DrawContext, WWObject, PropertyChangeListener, EventListener

public class DrawContextImpl
extends WWObjectImpl
implements DrawContext


Nested Class Summary
protected static class DrawContextImpl.OrderedRenderableEntry
           
 
Field Summary
protected  AnnotationRenderer annotationRenderer
           
protected  Color clearColor
           
protected  ClutterFilter clutterFilter
           
protected  LinkedHashMap<ScreenCredit,Long> credits
           
protected  Layer currentLayer
           
protected  DeclutteringTextRenderer declutteringTextRenderer
           
protected  boolean deepPickingMode
           
static float DEFAULT_DEPTH_OFFSET_FACTOR
           
static float DEFAULT_DEPTH_OFFSET_UNITS
           
protected  long frameTimestamp
           
protected  SurfaceTileRenderer geographicSurfaceTileRenderer
           
protected  GLContext glContext
           
protected  Globe globe
           
protected  GLRuntimeCapabilities glRuntimeCaps
           
protected  GLU glu
           
protected  GpuResourceCache gpuResourceCache
           
protected  boolean isOrderedRenderingMode
           
protected  Model model
           
protected  PickedObjectList objectsInPickRect
          The list of objects intersecting the pick rectangle during the most recent pick traversal.
protected  PriorityQueue<DrawContextImpl.OrderedRenderableEntry> orderedRenderables
           
protected  Queue<OrderedRenderable> orderedSurfaceRenderables
           
protected  Collection<PerformanceStatistic> perFrameStatistics
           
protected  Set<String> perFrameStatisticsKeys
           
protected  PickedObjectList pickedObjects
          The list of objects at the pick point during the most recent pick traversal.
protected  PickPointFrustumList pickFrustumList
           
protected  boolean pickingMode
           
protected  Point pickPoint
          Indicates the current pick point in AWT screen coordinates, or null to indicate that there is no pick point.
protected  Dimension pickPointFrustumDimension
           
protected  Rectangle pickRect
          Indicates the current pick rectangle in AWT screen coordinates, or null to indicate that there is no pick rectangle.
protected  ByteBuffer pixelColors
          Buffer of RGB colors used to read back the framebuffer's colors and store them in client memory.
protected  boolean preRenderMode
           
protected  int redrawRequested
           
protected  Collection<Throwable> renderingExceptions
           
protected  LightingModel standardLighting
           
protected  SectorGeometryList surfaceGeometry
           
protected  Terrain terrain
           
protected  TextRendererCache textRendererCache
           
protected  int uniquePickNumber
           
protected  IntSet uniquePixelColors
          Set of ints used by getPickColorsInRectangle(java.awt.Rectangle, int[]) to identify the unique color codes in the specified rectangle.
protected  double verticalExaggeration
           
protected  View view
           
protected  Position viewportCenterPosition
           
protected  Point viewportCenterScreenPoint
           
protected  Sector visibleSector
           
protected  SectorVisibilityTree visibleSectors
           
 
Constructor Summary
DrawContextImpl()
           
 
Method Summary
 void addObjectInPickRectangle(PickedObject pickedObject)
          Adds the specified picked object to the current list of objects intersecting the pick rectangle.
 void addOrderedRenderable(OrderedRenderable orderedRenderable)
          Adds an OrderedRenderable to the draw context's ordered renderable list.
 void addOrderedRenderable(OrderedRenderable orderedRenderable, boolean isBehind)
          Adds an OrderedRenderable to the draw context's ordered renderable list, optionally indicating that the draw context should treat the specified ordered renderable as behind other ordered renderables.
 void addOrderedSurfaceRenderable(OrderedRenderable orderedRenderable)
          Adds an OrderedRenderable to the draw context's ordered surface renderable queue.
 void addPickedObject(PickedObject pickedObject)
          Adds the specified picked object to the list of objects at the pick point.
 void addPickedObjects(PickedObjectList pickedObjects)
          Adds a list of picked objects to the current list of objects at the pick point.
 void addPickPointFrustum()
          Creates a frustum around the current pick point and adds it to the current list of pick frustums.
 void addPickRectangleFrustum()
          Creates a frustum containing the current pick rectangle and adds it to the current list of pick frustums.
 void addRenderingException(Throwable t)
          Adds the specified Throwable to this DrawContext's collection of rendering exceptions.
 void addScreenCredit(ScreenCredit credit)
          Adds a screen-credit icon to display.
 void applyClutterFilter()
          Filter overlapping text from the ordered renderable list.
 void beginStandardLighting()
          Enables the current standard lighting model.
 Vec4 computePointFromPosition(Position position, int altitudeMode)
          Computes a Cartesian point from a specified geographic position, applying a specified altitude mode.
 Vec4 computeTerrainPoint(Angle lat, Angle lon, double offset)
          Compute a model-coordinate point on the terrain.
 void disablePickingMode()
          Specifies that the scene controller has ended its pick traversal.
 void dispose()
          Free internal resources held by this draw context.
 void drawNormals(float length, FloatBuffer vBuf, FloatBuffer nBuf)
          This is a diagnostic method to display normal vectors.
 void drawOutlinedShape(OutlinedShape renderer, Object shape)
          Performs a multi-pass rendering technique to ensure that outlines around filled shapes are drawn correctly when blending or ant-aliasing is performed, and that filled portions of the shape resolve depth-buffer fighting with shapes previously drawn in favor of the current shape.
 void drawUnitQuad()
          Draws a quadrilateral using the current OpenGL state.
 void drawUnitQuad(TextureCoords texCoords)
          Draws a quadrilateral using the current OpenGL state and specified texture coordinates.
 void drawUnitQuadOutline()
          Draws a quadrilateral outline using the current OpenGL state.
 void enablePickingMode()
          Specifies that the scene controller is beginning its pick traversal.
 void endStandardLighting()
          Pops the OpenGL state previously established by DrawContext.beginStandardLighting().
 AnnotationRenderer getAnnotationRenderer()
          Returns the draw context's annotation renderer, typically used by annotations that are not contained in an AnnotationLayer.
 Color getClearColor()
          Returns the WorldWindow's background color.
 ClutterFilter getClutterFilter()
          Returns the current clutter filter.
 Layer getCurrentLayer()
          Returns the current-layer.
 DeclutteringTextRenderer getDeclutteringTextRenderer()
          Returns the draw context's decluttering text renderer.
 int getDrawableHeight()
          Indicates the height in pixels of the drawing target associated with this DrawContext.
 int getDrawableWidth()
          Indicates the width in pixels of the drawing target associated with this DrawContext.
 long getFrameTimeStamp()
          Returns the time stamp corresponding to the beginning of a pre-render, pick, render sequence.
 SurfaceTileRenderer getGeographicSurfaceTileRenderer()
          Returns this draw context's surface tile renderer.
 GL getGL()
          Retrieves the current javax.media.opengl.GL.
 GLContext getGLContext()
          Retrieves this DrawContexts javax.media.opengl.GLContext.
 GLDrawable getGLDrawable()
          Retrieves the current javax.media.opengl.GLDrawable.
 Globe getGlobe()
          Retrieves the current Globe, which may be null.
 GLRuntimeCapabilities getGLRuntimeCapabilities()
          Returns the GLRuntimeCapabilities associated with this DrawContext.
 GLU getGLU()
          Retrieves the current javax.media.opengl.glu.GLU.
 GpuResourceCache getGpuResourceCache()
          Returns the GPU resource cache used by this draw context.
 LayerList getLayers()
          Retrieves a list containing all the current layers.
 Model getModel()
          Retrieves the current Model, which may be null.
 PickedObjectList getObjectsInPickRectangle()
          Returns the list of objects intersecting the pick rectangle during the most recent pick traversal.
 Queue<OrderedRenderable> getOrderedSurfaceRenderables()
          Returns the draw context's ordered surface renderable queue.
 Collection<PerformanceStatistic> getPerFrameStatistics()
          Returns the performance statistics that are gathered during each frame.
 Set<String> getPerFrameStatisticsKeys()
          Indicates the statistics that are monitored for each frame.
 int getPickColorAtPoint(Point point)
          Returns the framebuffer RGB color for a point in AWT screen coordinates, formatted as a pick color code.
 int[] getPickColorsInRectangle(Rectangle rectangle, int[] minAndMaxColorCodes)
          Returns an array of the unique framebuffer RGB colors within a rectangle in AWT screen coordinates, formatted as pick color codes.
 PickedObjectList getPickedObjects()
          Returns the list of objects at the pick point during the most recent pick traversal.
 PickPointFrustumList getPickFrustums()
          Gets the FrustumList containing all the current Pick Frustums
 Point getPickPoint()
          Returns the current pick point in AWT screen coordinates.
 Dimension getPickPointFrustumDimension()
          Gets the dimension of the current Pick Point Frustum
 Rectangle getPickRectangle()
          Returns the current pick rectangle in AWT screen coordinates.
 Vec4 getPointOnTerrain(Angle latitude, Angle longitude)
          Computes a location's Cartesian point on the currently visible terrain.
 int getRedrawRequested()
          Indicates whether a new frame should be generated by the SceneController.
 Collection<Throwable> getRenderingExceptions()
          Gets the rendering exceptions associated with this DrawContext as a Collection of Throwable objects.
 Map<ScreenCredit,Long> getScreenCredits()
          Returns the screen credits currently held and displayed by this draw context.
 LightingModel getStandardLightingModel()
          Returns the current model used for standard lighting.
 SectorGeometryList getSurfaceGeometry()
          Retrieves a list of all the sectors rendered so far this frame.
 Terrain getTerrain()
          Returns a Terrain object that uses the current sector geometry or the current globe to compute surface points.
 TextRendererCache getTextRendererCache()
          Returns this draw context's text-renderer cache.
 GpuResourceCache getTextureCache()
          Returns the GPU resource cache for this draw context.
 Color getUniquePickColor()
          Returns a unique color to serve as a pick identifier during picking.
 double getVerticalExaggeration()
          Retrieves the current vertical exaggeration.
 View getView()
          Retrieves the current View, which may be null.
 Position getViewportCenterPosition()
          Indicates the geographic coordinates of the point on the terrain at the current viewport's center.
 Point getViewportCenterScreenPoint()
          Indicates the screen-coordinate point of the current viewport's center.
 Sector getVisibleSector()
          Retrieves a Sector which is at least as large as the current visible sector.
 List<Sector> getVisibleSectors(double[] resolutions, long timeLimit, Sector sector)
          Returns the visible sectors at one of several specified resolutions within a specified search sector.
 void initialize(GLContext glContext)
          Initializes this DrawContext.
 boolean isDeepPickingEnabled()
          Indicates whether all items under cursor are picked.
 boolean isOrderedRenderingMode()
          Indicates whether the SceneController is currently rendering the draw context's OrderedRenderables.
 boolean isPickingMode()
          Indicates whether the scene controller is currently picking.
 boolean isPreRenderMode()
          Indicates whether the scene controller is currently pre-rendering.
 boolean isSmall(Extent extent, int numPixels)
          Indicates whether a specified extent is smaller than a specified number of pixels for the current view.
 OrderedRenderable peekOrderedRenderables()
          Returns the next OrderedRenderable on the ordered-renderable priority queue but does not remove it from the queue.
 OrderedRenderable pollOrderedRenderables()
          Returns the next OrderedRenderable on the ordered-renderable priority queue and removes it from the queue.
 void popProjectionOffest()
          Removes the current projection matrix offset added by DrawContext.pushProjectionOffest(Double).
 void pushProjectionOffest(Double offset)
          Modifies the current projection matrix to slightly offset subsequently drawn objects toward or away from the eye point.
 void restoreDefaultBlending()
          Restores the current OpenGL context's blending state to its default.
 void restoreDefaultCurrentColor()
          Restores the current OpenGL context's current color to its default.
 void restoreDefaultDepthTesting()
          Restores the current OpenGL context's depth testing state to its default.
 void setAnnotationRenderer(AnnotationRenderer ar)
          Since Annotations are Renderables, they can be exist outside an AnnotationLayer, in which case they are responsible for rendering themselves.
 void setClutterFilter(ClutterFilter filter)
          Specifies the clutter filter to use.
 void setCurrentLayer(Layer layer)
          Sets the current-layer field to the specified layer or null.
 void setDeepPickingEnabled(boolean tf)
          Specifies whether all items under the cursor are picked.
 void setFrameTimeStamp(long frameTimeStamp)
          Specifies the time stamp corresponding to the beginning of a pre-render, pick, render sequence.
 void setGLContext(GLContext glContext)
          Assigns this DrawContext a new javax.media.opengl.GLContext.
 void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
          Sets the GLRuntimeCapabilities associated with this DrawContext to the specified parameter.
 void setGpuResourceCache(GpuResourceCache gpuResourceCache)
          Specifies the GPU resource cache for this draw context.
 void setModel(Model model)
          Assign a new Model.
 void setOrderedRenderingMode(boolean tf)
          Called by the SceneController to indicate whether it is currently drawing the draw context's OrderedRenderables.
 void setPerFrameStatistic(String key, String displayName, Object value)
          Specifies a performance statistic that's assigned for each frame.
 void setPerFrameStatistics(Collection<PerformanceStatistic> stats)
          Specifies a collection of per-frame performance statistics.
 void setPerFrameStatisticsKeys(Set<String> statKeys, Collection<PerformanceStatistic> stats)
          Specifies the performance statistics that are monitored during each frame.
 void setPickPoint(Point pickPoint)
          Specifies the current pick point in AWT screen coordinates, or null to indicate that there is no pick point.
 void setPickPointFrustumDimension(Dimension dim)
          Set the size (in pixels) of the pick point frustum at the near plane.
 void setPickRectangle(Rectangle pickRect)
          Specifies the current pick rectangle in AWT screen coordinates, or null to indicate that there is no pick rectangle.
 void setPreRenderMode(boolean preRenderMode)
          Specifies whether the scene controller is pre-rendering.
 void setRedrawRequested(int redrawRequested)
          Requests that a new frame should be generated by the SceneController.
 void setRenderingExceptions(Collection<Throwable> exceptions)
          Sets the rendering exceptions associated with this DrawContext to the specified Collection of Throwable objects.
 void setStandardLightingModel(LightingModel standardLighting)
          Specifies the lighting model used for standard lighting.
 void setSurfaceGeometry(SectorGeometryList surfaceGeometry)
          Specifies the current surface geometry.
 void setTextRendererCache(TextRendererCache textRendererCache)
          Specifies this context's text renderer cache.
 void setVerticalExaggeration(double verticalExaggeration)
          Sets the vertical exaggeration.
 void setView(View view)
          Assigns a new View.
 void setViewportCenterPosition(Position viewportCenterPosition)
          Specifies the geographic coordinates of the point on the terrain at the current viewport's center.
 void setViewportCenterScreenPoint(Point viewportCenterScreenPoint)
          Specifies the screen-coordinate point of the current viewport's center.
 void setVisibleSector(Sector s)
          Sets the visible Sector.
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
 

Field Detail

annotationRenderer

protected AnnotationRenderer annotationRenderer

clearColor

protected Color clearColor

clutterFilter

protected ClutterFilter clutterFilter

credits

protected LinkedHashMap<ScreenCredit,Long> credits

currentLayer

protected Layer currentLayer

declutteringTextRenderer

protected DeclutteringTextRenderer declutteringTextRenderer

deepPickingMode

protected boolean deepPickingMode

DEFAULT_DEPTH_OFFSET_FACTOR

public static final float DEFAULT_DEPTH_OFFSET_FACTOR
See Also:
Constant Field Values

DEFAULT_DEPTH_OFFSET_UNITS

public static final float DEFAULT_DEPTH_OFFSET_UNITS
See Also:
Constant Field Values

frameTimestamp

protected long frameTimestamp

geographicSurfaceTileRenderer

protected SurfaceTileRenderer geographicSurfaceTileRenderer

glContext

protected GLContext glContext

globe

protected Globe globe

glRuntimeCaps

protected GLRuntimeCapabilities glRuntimeCaps

glu

protected GLU glu

gpuResourceCache

protected GpuResourceCache gpuResourceCache

isOrderedRenderingMode

protected boolean isOrderedRenderingMode

model

protected Model model

objectsInPickRect

protected PickedObjectList objectsInPickRect
The list of objects intersecting the pick rectangle during the most recent pick traversal. Initialized to an empty PickedObjectList.


orderedRenderables

protected PriorityQueue<DrawContextImpl.OrderedRenderableEntry> orderedRenderables

orderedSurfaceRenderables

protected Queue<OrderedRenderable> orderedSurfaceRenderables

perFrameStatistics

protected Collection<PerformanceStatistic> perFrameStatistics

perFrameStatisticsKeys

protected Set<String> perFrameStatisticsKeys

pickedObjects

protected PickedObjectList pickedObjects
The list of objects at the pick point during the most recent pick traversal. Initialized to an empty PickedObjectList.


pickFrustumList

protected PickPointFrustumList pickFrustumList

pickingMode

protected boolean pickingMode

pickPoint

protected Point pickPoint
Indicates the current pick point in AWT screen coordinates, or null to indicate that there is no pick point. Initially null.


pickPointFrustumDimension

protected Dimension pickPointFrustumDimension

pickRect

protected Rectangle pickRect
Indicates the current pick rectangle in AWT screen coordinates, or null to indicate that there is no pick rectangle. Initially null.


pixelColors

protected ByteBuffer pixelColors
Buffer of RGB colors used to read back the framebuffer's colors and store them in client memory.


preRenderMode

protected boolean preRenderMode

redrawRequested

protected int redrawRequested

renderingExceptions

protected Collection<Throwable> renderingExceptions

standardLighting

protected LightingModel standardLighting

surfaceGeometry

protected SectorGeometryList surfaceGeometry

terrain

protected Terrain terrain

textRendererCache

protected TextRendererCache textRendererCache

uniquePickNumber

protected int uniquePickNumber

uniquePixelColors

protected IntSet uniquePixelColors
Set of ints used by getPickColorsInRectangle(java.awt.Rectangle, int[]) to identify the unique color codes in the specified rectangle. This consolidates duplicate colors to a single entry. We use IntSet to achieve constant time insertion, and to reduce overhead associated associated with storing integer primitives in a HashSet.


verticalExaggeration

protected double verticalExaggeration

view

protected View view

viewportCenterPosition

protected Position viewportCenterPosition

viewportCenterScreenPoint

protected Point viewportCenterScreenPoint

visibleSector

protected Sector visibleSector

visibleSectors

protected SectorVisibilityTree visibleSectors
Constructor Detail

DrawContextImpl

public DrawContextImpl()
Method Detail

addObjectInPickRectangle

public void addObjectInPickRectangle(PickedObject pickedObject)
Description copied from interface: DrawContext
Adds the specified picked object to the current list of objects intersecting the pick rectangle. This list can be accessed by calling DrawContext.getObjectsInPickRectangle().

Specified by:
addObjectInPickRectangle in interface DrawContext
Parameters:
pickedObject - the object to add.

addOrderedRenderable

public void addOrderedRenderable(OrderedRenderable orderedRenderable)
Description copied from interface: DrawContext
Adds an OrderedRenderable to the draw context's ordered renderable list.

Specified by:
addOrderedRenderable in interface DrawContext
Parameters:
orderedRenderable - the ordered renderable to add.

addOrderedRenderable

public void addOrderedRenderable(OrderedRenderable orderedRenderable,
                                 boolean isBehind)
Adds an OrderedRenderable to the draw context's ordered renderable list, optionally indicating that the draw context should treat the specified ordered renderable as behind other ordered renderables. If isBehind is true, the draw context treats the specified ordered renderable as though it is behind all other ordered renderables and ignores the ordered renderable's eye distance. If multiple ordered renderables are added with isBehind specified as true, those ordered renderables are drawn according to the order in which they are added.

Specified by:
addOrderedRenderable in interface DrawContext
Parameters:
orderedRenderable - the ordered renderable to add.
isBehind - true to specify that the ordered renderable is behind all other ordered renderables, or false to interpret the ordered renderable according to its eye distance.

addOrderedSurfaceRenderable

public void addOrderedSurfaceRenderable(OrderedRenderable orderedRenderable)
Adds an OrderedRenderable to the draw context's ordered surface renderable queue. This queue is populated during layer rendering with objects to render on the terrain surface, and is processed immediately after layer rendering.

Specified by:
addOrderedSurfaceRenderable in interface DrawContext
Parameters:
orderedRenderable - the ordered renderable to add.

addPickedObject

public void addPickedObject(PickedObject pickedObject)
Description copied from interface: DrawContext
Adds the specified picked object to the list of objects at the pick point. This list can be accessed by calling DrawContext.getPickedObjects().

Specified by:
addPickedObject in interface DrawContext
Parameters:
pickedObject - the object to add.

addPickedObjects

public void addPickedObjects(PickedObjectList pickedObjects)
Description copied from interface: DrawContext
Adds a list of picked objects to the current list of objects at the pick point. This list can be accessed by calling DrawContext.getPickedObjects().

Specified by:
addPickedObjects in interface DrawContext
Parameters:
pickedObjects - the list to add.

addPickPointFrustum

public void addPickPointFrustum()
Description copied from interface: DrawContext
Creates a frustum around the current pick point and adds it to the current list of pick frustums. The frustum's dimension is specified by calling DrawContext.setPickPointFrustumDimension(java.awt.Dimension).

This does nothing if the current pick point is null.

Specified by:
addPickPointFrustum in interface DrawContext

addPickRectangleFrustum

public void addPickRectangleFrustum()
Description copied from interface: DrawContext
Creates a frustum containing the current pick rectangle and adds it to the current list of pick frustums.

This does nothing if the current pick rectangle is null.

Specified by:
addPickRectangleFrustum in interface DrawContext

addRenderingException

public void addRenderingException(Throwable t)
Description copied from interface: DrawContext
Adds the specified Throwable to this DrawContext's collection of rendering exceptions. If this DrawContext's collection is null, the specified Throwable is ignored and calling this method is benign.

Specified by:
addRenderingException in interface DrawContext
Parameters:
t - the rendering exception to add as a Throwable.

addScreenCredit

public void addScreenCredit(ScreenCredit credit)
Description copied from interface: DrawContext
Adds a screen-credit icon to display.

Specified by:
addScreenCredit in interface DrawContext
Parameters:
credit - the screen credit to display.

applyClutterFilter

public void applyClutterFilter()
Description copied from interface: DrawContext
Filter overlapping text from the ordered renderable list.

Specified by:
applyClutterFilter in interface DrawContext

beginStandardLighting

public void beginStandardLighting()
Description copied from interface: DrawContext
Enables the current standard lighting model. DrawContext.endStandardLighting() must be called when rendering of the current shape is complete.

Specified by:
beginStandardLighting in interface DrawContext
See Also:
DrawContext.setStandardLightingModel(LightingModel), DrawContext.endStandardLighting()

computePointFromPosition

public Vec4 computePointFromPosition(Position position,
                                     int altitudeMode)
Description copied from interface: DrawContext
Computes a Cartesian point from a specified geographic position, applying a specified altitude mode.

Specified by:
computePointFromPosition in interface DrawContext
Parameters:
position - the position to convert.
altitudeMode - the altitude mode.
Returns:
the Cartesian point corresponding to the specified position and this context's current globe or terrain.

computeTerrainPoint

public Vec4 computeTerrainPoint(Angle lat,
                                Angle lon,
                                double offset)
Description copied from interface: DrawContext
Compute a model-coordinate point on the terrain.

Specified by:
computeTerrainPoint in interface DrawContext
Parameters:
lat - the point's latitude.
lon - the point's longitude.
offset - an distance in meters to place the point above or below the terrain.
Returns:
a model-coordinate point offset the specified amount from the current terrain.

disablePickingMode

public void disablePickingMode()
Description copied from interface: DrawContext
Specifies that the scene controller has ended its pick traversal.

Specified by:
disablePickingMode in interface DrawContext

dispose

public void dispose()
Free internal resources held by this draw context. A GL context must be current when this method is called.

Specified by:
dispose in interface Disposable
Throws:
GLException - - If an OpenGL context is not current when this method is called.

drawNormals

public void drawNormals(float length,
                        FloatBuffer vBuf,
                        FloatBuffer nBuf)
Description copied from interface: DrawContext
This is a diagnostic method to display normal vectors.

Specified by:
drawNormals in interface DrawContext
Parameters:
length - the length to draw the vectors, in meters.
vBuf - a vertex buffer. If null, no vectors are drawn.
nBuf - a buffer of normal vectors corresponding to the vertex buffer. If null, no vectors are drawn.

drawOutlinedShape

public void drawOutlinedShape(OutlinedShape renderer,
                              Object shape)
Description copied from interface: DrawContext
Performs a multi-pass rendering technique to ensure that outlines around filled shapes are drawn correctly when blending or ant-aliasing is performed, and that filled portions of the shape resolve depth-buffer fighting with shapes previously drawn in favor of the current shape.

Specified by:
drawOutlinedShape in interface DrawContext
Parameters:
renderer - an object implementing the OutlinedShape interface for the shape.
shape - the shape to render.
See Also:
OutlinedShape

drawUnitQuad

public void drawUnitQuad()
Description copied from interface: DrawContext
Draws a quadrilateral using the current OpenGL state. The quadrilateral points are (0, 0), (1, 0), (1, 1), (0, 1).

Specified by:
drawUnitQuad in interface DrawContext

drawUnitQuad

public void drawUnitQuad(TextureCoords texCoords)
Description copied from interface: DrawContext
Draws a quadrilateral using the current OpenGL state and specified texture coordinates. The quadrilateral points are (0, 0), (1, 0), (1, 1), (0, 1).

Specified by:
drawUnitQuad in interface DrawContext
Parameters:
texCoords - texture coordinates to assign to each quadrilateral vertex.

drawUnitQuadOutline

public void drawUnitQuadOutline()
Description copied from interface: DrawContext
Draws a quadrilateral outline using the current OpenGL state. The quadrilateral points are (0, 0), (1, 0), (1, 1), (0, 1).

Specified by:
drawUnitQuadOutline in interface DrawContext

enablePickingMode

public void enablePickingMode()
Description copied from interface: DrawContext
Specifies that the scene controller is beginning its pick traversal.

Specified by:
enablePickingMode in interface DrawContext

endStandardLighting

public void endStandardLighting()
Description copied from interface: DrawContext
Pops the OpenGL state previously established by DrawContext.beginStandardLighting().

Specified by:
endStandardLighting in interface DrawContext

getAnnotationRenderer

public AnnotationRenderer getAnnotationRenderer()
Description copied from interface: DrawContext
Returns the draw context's annotation renderer, typically used by annotations that are not contained in an AnnotationLayer.

Specified by:
getAnnotationRenderer in interface DrawContext
Returns:
the annotation renderer.

getClearColor

public Color getClearColor()
Description copied from interface: DrawContext
Returns the WorldWindow's background color.

Specified by:
getClearColor in interface DrawContext
Returns:
the WorldWindow's background color.

getClutterFilter

public ClutterFilter getClutterFilter()
Description copied from interface: DrawContext
Returns the current clutter filter.

Specified by:
getClutterFilter in interface DrawContext
Returns:
the current clutter filter.

getCurrentLayer

public Layer getCurrentLayer()
Description copied from interface: DrawContext
Returns the current-layer. The field is informative only and enables layer contents to determine their containing layer.

Specified by:
getCurrentLayer in interface DrawContext
Returns:
the current layer, or null if no layer is current.

getDeclutteringTextRenderer

public DeclutteringTextRenderer getDeclutteringTextRenderer()
Description copied from interface: DrawContext
Returns the draw context's decluttering text renderer.

Specified by:
getDeclutteringTextRenderer in interface DrawContext
Returns:
the decluttering text renderer.

getDrawableHeight

public final int getDrawableHeight()
Description copied from interface: DrawContext
Indicates the height in pixels of the drawing target associated with this DrawContext. The returned height is potentially different from the GL viewport height. If this DrawContext is associated with a GLJPanel, the returned height is the power-of-two ceiling of the viewport, and is therefore almost always larger than the GL viewport height.

The GL viewport dimensions can be accessed by calling getView().getViewport() on this DrawContext.

Specified by:
getDrawableHeight in interface DrawContext
Returns:
the height of the drawing target associated with this DrawContext, in pixels.

getDrawableWidth

public final int getDrawableWidth()
Description copied from interface: DrawContext
Indicates the width in pixels of the drawing target associated with this DrawContext. The returned width is potentially different from the GL viewport width. If this DrawContext is associated with a GLJPanel, the returned width is the power-of-two ceiling of the viewport, and is therefore almost always larger than the GL viewport width.

The GL viewport dimensions can be accessed by calling getView().getViewport() on this DrawContext.

Specified by:
getDrawableWidth in interface DrawContext
Returns:
the width of the drawing target associated with this DrawContext, in pixels.

getFrameTimeStamp

public long getFrameTimeStamp()
Description copied from interface: DrawContext
Returns the time stamp corresponding to the beginning of a pre-render, pick, render sequence. The stamp remains constant across these three operations so that called objects may avoid recomputing the same values during each of the calls in the sequence.

Specified by:
getFrameTimeStamp in interface DrawContext
Returns:
the frame time stamp. See System.currentTimeMillis() for its numerical meaning.

getGeographicSurfaceTileRenderer

public SurfaceTileRenderer getGeographicSurfaceTileRenderer()
Description copied from interface: DrawContext
Returns this draw context's surface tile renderer.

Specified by:
getGeographicSurfaceTileRenderer in interface DrawContext
Returns:
this draw context's surface tile renderer.s

getGL

public final GL getGL()
Description copied from interface: DrawContext
Retrieves the current javax.media.opengl.GL. A GL or GLU is required for all graphical rendering in World Wind.

Specified by:
getGL in interface DrawContext
Returns:
the current GL if available, null otherwise

getGLContext

public final GLContext getGLContext()
Description copied from interface: DrawContext
Retrieves this DrawContexts javax.media.opengl.GLContext. If this method returns null, then there are potentially no active GLContexts and rendering should be aborted.

Specified by:
getGLContext in interface DrawContext
Returns:
this DrawContexts javax.media.opengl.GLContext.

getGLDrawable

public final GLDrawable getGLDrawable()
Description copied from interface: DrawContext
Retrieves the current javax.media.opengl.GLDrawable. A GLDrawable can be used to create a GLContext, which can then be used for rendering.

Specified by:
getGLDrawable in interface DrawContext
Returns:
the current GLDrawable, null if none available

getGlobe

public final Globe getGlobe()
Description copied from interface: DrawContext
Retrieves the current Globe, which may be null.

Specified by:
getGlobe in interface DrawContext
Returns:
the current Globe, which may be null

getGLRuntimeCapabilities

public GLRuntimeCapabilities getGLRuntimeCapabilities()
Description copied from interface: DrawContext
Returns the GLRuntimeCapabilities associated with this DrawContext.

Specified by:
getGLRuntimeCapabilities in interface DrawContext
Returns:
this DrawContext's associated GLRuntimeCapabilities.

getGLU

public final GLU getGLU()
Description copied from interface: DrawContext
Retrieves the current javax.media.opengl.glu.GLU. A GLU or GL is required for all graphical rendering in World Wind.

Specified by:
getGLU in interface DrawContext
Returns:
the current GLU if available, null otherwise

getGpuResourceCache

public GpuResourceCache getGpuResourceCache()
Description copied from interface: DrawContext
Returns the GPU resource cache used by this draw context.

Specified by:
getGpuResourceCache in interface DrawContext
Returns:
the GPU resource cache used by this draw context.

getLayers

public final LayerList getLayers()
Description copied from interface: DrawContext
Retrieves a list containing all the current layers. No guarantee is made about the order of the layers.

Specified by:
getLayers in interface DrawContext
Returns:
a LayerList containing all the current layers

getModel

public final Model getModel()
Description copied from interface: DrawContext
Retrieves the current Model, which may be null.

Specified by:
getModel in interface DrawContext
Returns:
the current Model, which may be null

getObjectsInPickRectangle

public PickedObjectList getObjectsInPickRectangle()
Description copied from interface: DrawContext
Returns the list of objects intersecting the pick rectangle during the most recent pick traversal. The returned list is empty if nothing intersects the pick rectangle, or if the pick rectangle is null.

Specified by:
getObjectsInPickRectangle in interface DrawContext
Returns:
the list of picked objects.

getOrderedSurfaceRenderables

public Queue<OrderedRenderable> getOrderedSurfaceRenderables()
Returns the draw context's ordered surface renderable queue. This queue is populated during layer rendering with objects to render on the terrain surface, and is processed immediately after layer rendering.

Specified by:
getOrderedSurfaceRenderables in interface DrawContext
Returns:
the draw context's ordered surface renderable queue.

getPerFrameStatistics

public Collection<PerformanceStatistic> getPerFrameStatistics()
Description copied from interface: DrawContext
Returns the performance statistics that are gathered during each frame.

Specified by:
getPerFrameStatistics in interface DrawContext
Returns:
the performance statistics that are gathered during each frame.

getPerFrameStatisticsKeys

public Set<String> getPerFrameStatisticsKeys()
Description copied from interface: DrawContext
Indicates the statistics that are monitored for each frame.

Specified by:
getPerFrameStatisticsKeys in interface DrawContext
Returns:
the keys of the statistics monitored for each frame.

getPickColorAtPoint

public int getPickColorAtPoint(Point point)
Returns the framebuffer RGB color for a point in AWT screen coordinates, formatted as a pick color code. The red, green, and blue components are each stored as an 8-bit unsigned integer, and packed into bits 0-23 of the returned integer as follows: bits 16-23 are red, bits 8-15 are green, and bits 0-7 are blue. This format is consistent with the RGB integers used to create the pick colors in getUniquePickColor.

This returns 0 if the point contains the clear color, or is outside this draw context's drawable area.

Specified by:
getPickColorAtPoint in interface DrawContext
Parameters:
point - the point to return a color for, in AWT screen coordinates.
Returns:
the RGB color corresponding to the specified point.

getPickColorsInRectangle

public int[] getPickColorsInRectangle(Rectangle rectangle,
                                      int[] minAndMaxColorCodes)
Returns an array of the unique framebuffer RGB colors within a rectangle in AWT screen coordinates, formatted as pick color codes. The red, green, and blue components are each stored as an 8-bit unsigned integer, and packed into bits 0-23 of the returned integers as follows: bits 16-23 are red, bits 8-15 are green, and bits 0-7 are blue. This format is consistent with the RGB integers used to create the pick colors in getUniquePickColor.

The returned array contains one entry for each unique color. Points in the rectangle that contain the clear color or are outside this draw context's drawable area are ignored. This returns null if the specified rectangle is empty, or contains only the clear color.

The minAndMaxColorCodes parameter limits the unique colors that this method returns to the specified range. The minimum color must be stored in array index 0, and the maximum color must be stored in array index 1. These values can be used to specify a small range of colors relative to the framebuffer contents, effectively culling the colors that must be considered by this method and the caller. When specified, these integers must be formatted exactly as the integers this method returns.

Specified by:
getPickColorsInRectangle in interface DrawContext
Parameters:
rectangle - the rectangle to return unique colors for, in AWT screen coordinates.
minAndMaxColorCodes - an two element array representing the minimum and maximum RGB colors to return. May be null to specify that all color codes must be returned.
Returns:
the unique RGB colors corresponding to the specified rectangle, or null if the rectangle is empty or the rectangle contains only the clear color.

getPickedObjects

public PickedObjectList getPickedObjects()
Description copied from interface: DrawContext
Returns the list of objects at the pick point during the most recent pick traversal. The returned list is empty if nothing is at the pick point, or if the pick point is null.

Specified by:
getPickedObjects in interface DrawContext
Returns:
the list of picked objects.

getPickFrustums

public PickPointFrustumList getPickFrustums()
Description copied from interface: DrawContext
Gets the FrustumList containing all the current Pick Frustums

Specified by:
getPickFrustums in interface DrawContext
Returns:
FrustumList of Pick Frustums

getPickPoint

public Point getPickPoint()
Description copied from interface: DrawContext
Returns the current pick point in AWT screen coordinates.

Specified by:
getPickPoint in interface DrawContext
Returns:
the current pick point, or null if no pick point is available.
See Also:
DrawContext.setPickPoint(java.awt.Point)

getPickPointFrustumDimension

public Dimension getPickPointFrustumDimension()
Description copied from interface: DrawContext
Gets the dimension of the current Pick Point Frustum

Specified by:
getPickPointFrustumDimension in interface DrawContext
Returns:
the dimension of the current Pick Point Frustum

getPickRectangle

public Rectangle getPickRectangle()
Description copied from interface: DrawContext
Returns the current pick rectangle in AWT screen coordinates.

Specified by:
getPickRectangle in interface DrawContext
Returns:
the current pick rectangle, or null if no pick rectangle is current.
See Also:
DrawContext.setPickRectangle(java.awt.Rectangle)

getPointOnTerrain

public Vec4 getPointOnTerrain(Angle latitude,
                              Angle longitude)
Description copied from interface: DrawContext
Computes a location's Cartesian point on the currently visible terrain.

Specified by:
getPointOnTerrain in interface DrawContext
Parameters:
latitude - the location's latitude.
longitude - the location's longitude.
Returns:
the location's corresponding Cartesian point, or null if the location is not currently visible.

getRedrawRequested

public int getRedrawRequested()
Description copied from interface: DrawContext
Indicates whether a new frame should be generated by the SceneController.

Specified by:
getRedrawRequested in interface DrawContext
Returns:
the delay in milliseconds if a redraw has been requested, otherwise 0.

getRenderingExceptions

public Collection<Throwable> getRenderingExceptions()
Description copied from interface: DrawContext
Gets the rendering exceptions associated with this DrawContext as a Collection of Throwable objects. If non-null, the returned Collection is used as the data structure that accumulates rendering exceptions passed to this DrawContext in DrawContext.addRenderingException(Throwable). A null collection indicates this DrawContext does not accumulate rendering exceptions.

Specified by:
getRenderingExceptions in interface DrawContext
Returns:
the Collection used to accumulate rendering exceptions, or null if this DrawContext does not accumulate rendering exceptions.

getScreenCredits

public Map<ScreenCredit,Long> getScreenCredits()
Description copied from interface: DrawContext
Returns the screen credits currently held and displayed by this draw context.

Specified by:
getScreenCredits in interface DrawContext
Returns:
the screen credits currently held by this draw context.

getStandardLightingModel

public LightingModel getStandardLightingModel()
Description copied from interface: DrawContext
Returns the current model used for standard lighting.

Specified by:
getStandardLightingModel in interface DrawContext
Returns:
the current standard lighting model, or null if no model is defined.

getSurfaceGeometry

public SectorGeometryList getSurfaceGeometry()
Description copied from interface: DrawContext
Retrieves a list of all the sectors rendered so far this frame.

Specified by:
getSurfaceGeometry in interface DrawContext
Returns:
a SectorGeometryList containing every SectorGeometry rendered so far this render pass.

getTerrain

public Terrain getTerrain()
Description copied from interface: DrawContext
Returns a Terrain object that uses the current sector geometry or the current globe to compute surface points.

Specified by:
getTerrain in interface DrawContext
Returns:
a terrain object for computing surface points and intersections.

getTextRendererCache

public TextRendererCache getTextRendererCache()
Description copied from interface: DrawContext
Returns this draw context's text-renderer cache.

Specified by:
getTextRendererCache in interface DrawContext
Returns:
this context's text renderer cache.

getTextureCache

public GpuResourceCache getTextureCache()
Description copied from interface: DrawContext
Returns the GPU resource cache for this draw context. This method returns the same value as DrawContext.getGpuResourceCache().

Specified by:
getTextureCache in interface DrawContext
Returns:
the GPU resource cache for this draw context.
See Also:
DrawContext.getGpuResourceCache()

getUniquePickColor

public Color getUniquePickColor()
Description copied from interface: DrawContext
Returns a unique color to serve as a pick identifier during picking.

Specified by:
getUniquePickColor in interface DrawContext
Returns:
a unique pick color

getVerticalExaggeration

public final double getVerticalExaggeration()
Description copied from interface: DrawContext
Retrieves the current vertical exaggeration. Vertical exaggeration affects the appearance of areas with varied elevation. A vertical exaggeration of zero creates a surface which exactly fits the shape of the underlying Globe. A vertical exaggeration of 3 will create mountains and valleys which are three times as high/deep as they really are.

Specified by:
getVerticalExaggeration in interface DrawContext
Returns:
the current vertical exaggeration

getView

public final View getView()
Description copied from interface: DrawContext
Retrieves the current View, which may be null.

Specified by:
getView in interface DrawContext
Returns:
the current View, which may be null

getViewportCenterPosition

public Position getViewportCenterPosition()
Description copied from interface: DrawContext
Indicates the geographic coordinates of the point on the terrain at the current viewport's center.

Specified by:
getViewportCenterPosition in interface DrawContext
Returns:
the geographic coordinates of the current viewport's center. Returns null if the globe's surface is not under the viewport's center point.

getViewportCenterScreenPoint

public Point getViewportCenterScreenPoint()
Description copied from interface: DrawContext
Indicates the screen-coordinate point of the current viewport's center.

Specified by:
getViewportCenterScreenPoint in interface DrawContext
Returns:
the screen-coordinate point of the current viewport's center.

getVisibleSector

public final Sector getVisibleSector()
Description copied from interface: DrawContext
Retrieves a Sector which is at least as large as the current visible sector. The value returned is the value passed to SetVisibleSector. This method may return null.

Specified by:
getVisibleSector in interface DrawContext
Returns:
a Sector at least the size of the current visible sector, null if unavailable

getVisibleSectors

public List<Sector> getVisibleSectors(double[] resolutions,
                                      long timeLimit,
                                      Sector sector)
Description copied from interface: DrawContext
Returns the visible sectors at one of several specified resolutions within a specified search sector. Several sectors resolutions may be specified along with a time limit. The best resolution that can be determined within the time limit is returned.

Adherence to the time limit is not precise. The limit is checked only between full searches at each resolution. The search may take more than the specified time, but will terminate if no time is left before starting a higher-resolution search.

Specified by:
getVisibleSectors in interface DrawContext
Parameters:
resolutions - the resolutions of the sectors to return, in latitude.
timeLimit - the amount of time, in milliseconds, to allow for searching.
sector - the sector to decompose into visible sectors.
Returns:
the visible sectors at the best resolution achievable given the time limit. The actual resolution can be determined by examining the delta-latitude value of any of the returned sectors.

initialize

public final void initialize(GLContext glContext)
Description copied from interface: DrawContext
Initializes this DrawContext. This method should be called at the beginning of each frame to prepare the DrawContext for the coming render pass.

Specified by:
initialize in interface DrawContext
Parameters:
glContext - the javax.media.opengl.GLContext to use for this render pass

isDeepPickingEnabled

public boolean isDeepPickingEnabled()
Description copied from interface: DrawContext
Indicates whether all items under cursor are picked.

Specified by:
isDeepPickingEnabled in interface DrawContext
Returns:
true if all items under the cursor are picked, otherwise false

isOrderedRenderingMode

public boolean isOrderedRenderingMode()
Description copied from interface: DrawContext
Indicates whether the SceneController is currently rendering the draw context's OrderedRenderables. When the this method returns false during a call to an ordered renderable's Renderable.render(DrawContext) method, the ordered renderable should add itself to the draw context via DrawContext.addOrderedRenderable(OrderedRenderable) rather than draw it. When this method returns true during a call to its render method, the ordered renderable should draw itself.

Specified by:
isOrderedRenderingMode in interface DrawContext
Returns:
true if the scene controller is currently rendering its ordered renderables, otherwise false.

isPickingMode

public boolean isPickingMode()
Description copied from interface: DrawContext
Indicates whether the scene controller is currently picking.

Specified by:
isPickingMode in interface DrawContext
Returns:
true if the scene controller is picking, otherwise false

isPreRenderMode

public boolean isPreRenderMode()
Description copied from interface: DrawContext
Indicates whether the scene controller is currently pre-rendering.

Specified by:
isPreRenderMode in interface DrawContext
Returns:
true if pre-rendering, otherwise false.
See Also:
PreRenderable

isSmall

public boolean isSmall(Extent extent,
                       int numPixels)
Description copied from interface: DrawContext
Indicates whether a specified extent is smaller than a specified number of pixels for the current view.

Specified by:
isSmall in interface DrawContext
Parameters:
extent - the extent to test. May be null, in which case this method returns false.
numPixels - the number of pixels at and below which the extent is considered too small.
Returns:
true if the projected extent is smaller than the specified number of pixels, otherwise false.

peekOrderedRenderables

public OrderedRenderable peekOrderedRenderables()
Description copied from interface: DrawContext
Returns the next OrderedRenderable on the ordered-renderable priority queue but does not remove it from the queue.

Specified by:
peekOrderedRenderables in interface DrawContext
Returns:
the next ordered renderable, or null if there are no more ordered renderables on the queue.

pollOrderedRenderables

public OrderedRenderable pollOrderedRenderables()
Description copied from interface: DrawContext
Returns the next OrderedRenderable on the ordered-renderable priority queue and removes it from the queue.

Specified by:
pollOrderedRenderables in interface DrawContext
Returns:
the next ordered renderable, or null if there are no more ordered renderables on the queue.

popProjectionOffest

public void popProjectionOffest()
Description copied from interface: DrawContext
Removes the current projection matrix offset added by DrawContext.pushProjectionOffest(Double).

Specified by:
popProjectionOffest in interface DrawContext
See Also:
DrawContext.pushProjectionOffest(Double)

pushProjectionOffest

public void pushProjectionOffest(Double offset)
Description copied from interface: DrawContext
Modifies the current projection matrix to slightly offset subsequently drawn objects toward or away from the eye point. This gives those objects visual priority over objects at the same or nearly the same position. After the objects are drawn, call DrawContext.popProjectionOffest() to cancel the effect for subsequently drawn objects.

Note: This capability is meant to be applied only within a single Renderable. It is not intended as a means to offset a whole Renderable or collection of Renderables.

See "Mathematics for Game Programming and 3D Computer Graphics, 2 ed." by Eric Lengyel, Section 9.1, "Depth Value Offset" for a description of this technique.

Specified by:
pushProjectionOffest in interface DrawContext
Parameters:
offset - a reference to an offset value, typically near 1.0, or null to request use of the default value. Values less than 1.0 pull objects toward the eye point, values greater than 1.0 push objects away from the eye point. The default value is 0.99.
See Also:
DrawContext.popProjectionOffest()

restoreDefaultBlending

public void restoreDefaultBlending()
Description copied from interface: DrawContext
Restores the current OpenGL context's blending state to its default.

Specified by:
restoreDefaultBlending in interface DrawContext

restoreDefaultCurrentColor

public void restoreDefaultCurrentColor()
Description copied from interface: DrawContext
Restores the current OpenGL context's current color to its default.

Specified by:
restoreDefaultCurrentColor in interface DrawContext

restoreDefaultDepthTesting

public void restoreDefaultDepthTesting()
Description copied from interface: DrawContext
Restores the current OpenGL context's depth testing state to its default.

Specified by:
restoreDefaultDepthTesting in interface DrawContext

setAnnotationRenderer

public void setAnnotationRenderer(AnnotationRenderer ar)
Description copied from interface: DrawContext
Since Annotations are Renderables, they can be exist outside an AnnotationLayer, in which case they are responsible for rendering themselves. The draw context's annotation renderer provides an active renderer for that purpose.

Specified by:
setAnnotationRenderer in interface DrawContext
Parameters:
ar - the new annotation renderer for the draw context.

setClutterFilter

public void setClutterFilter(ClutterFilter filter)
Description copied from interface: DrawContext
Specifies the clutter filter to use. May be null to indicate no decluttering.

Specified by:
setClutterFilter in interface DrawContext
Parameters:
filter - the clutter filter.

setCurrentLayer

public void setCurrentLayer(Layer layer)
Description copied from interface: DrawContext
Sets the current-layer field to the specified layer or null. The field is informative only and enables layer contents to determine their containing layer.

Specified by:
setCurrentLayer in interface DrawContext
Parameters:
layer - the current layer or null.

setDeepPickingEnabled

public void setDeepPickingEnabled(boolean tf)
Description copied from interface: DrawContext
Specifies whether all items under the cursor are picked.

Specified by:
setDeepPickingEnabled in interface DrawContext
Parameters:
tf - true to pick all objects under the cursor

setFrameTimeStamp

public void setFrameTimeStamp(long frameTimeStamp)
Description copied from interface: DrawContext
Specifies the time stamp corresponding to the beginning of a pre-render, pick, render sequence. The stamp must remain constant across these three operations so that called objects may avoid recomputing the same values during each of the calls in the sequence.

Specified by:
setFrameTimeStamp in interface DrawContext
Parameters:
frameTimeStamp - the frame time stamp. See System.currentTimeMillis() for its numerical meaning.

setGLContext

public final void setGLContext(GLContext glContext)
Description copied from interface: DrawContext
Assigns this DrawContext a new javax.media.opengl.GLContext. May throw a NullPointerException if glContext is null.

Specified by:
setGLContext in interface DrawContext
Parameters:
glContext - the new javax.media.opengl.GLContext

setGLRuntimeCapabilities

public void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
Description copied from interface: DrawContext
Sets the GLRuntimeCapabilities associated with this DrawContext to the specified parameter.

Specified by:
setGLRuntimeCapabilities in interface DrawContext
Parameters:
capabilities - the GLRuntimeCapabilities to be associated with this DrawContext.

setGpuResourceCache

public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
Description copied from interface: DrawContext
Specifies the GPU resource cache for this draw context.

Specified by:
setGpuResourceCache in interface DrawContext
Parameters:
gpuResourceCache - the GPU resource cache for this draw context.

setModel

public final void setModel(Model model)
Description copied from interface: DrawContext
Assign a new Model. Some layers cannot function properly with a null Model. It is recommended that the Model is never set to null during a normal render pass.

Specified by:
setModel in interface DrawContext
Parameters:
model - the new Model

setOrderedRenderingMode

public void setOrderedRenderingMode(boolean tf)
Description copied from interface: DrawContext
Called by the SceneController to indicate whether it is currently drawing the draw context's OrderedRenderables. See DrawContext.isOrderedRenderingMode() for more information.

Specified by:
setOrderedRenderingMode in interface DrawContext
Parameters:
tf - true if ordered renderables are being drawn, false if ordered renderables are only being accumulated.

setPerFrameStatistic

public void setPerFrameStatistic(String key,
                                 String displayName,
                                 Object value)
Description copied from interface: DrawContext
Specifies a performance statistic that's assigned for each frame. Use this method to update the value of a specific statistic.

Specified by:
setPerFrameStatistic in interface DrawContext
Parameters:
key - the key identifying the statistic to monitor.
displayName - the name to use when displaying this statistic.
value - the statistic's value. May be null.
See Also:
DrawContext.setPerFrameStatistics(java.util.Collection)

setPerFrameStatistics

public void setPerFrameStatistics(Collection<PerformanceStatistic> stats)
Description copied from interface: DrawContext
Specifies a collection of per-frame performance statistics. Use this method to update a group of statistics.

Specified by:
setPerFrameStatistics in interface DrawContext
Parameters:
stats - the statistic keys and their associated values.
See Also:
DrawContext.setPerFrameStatistic(String, String, Object)

setPerFrameStatisticsKeys

public void setPerFrameStatisticsKeys(Set<String> statKeys,
                                      Collection<PerformanceStatistic> stats)
Description copied from interface: DrawContext
Specifies the performance statistics that are monitored during each frame. Both arguments to this method may be null. If either is null then statistics are not gathered.

Specified by:
setPerFrameStatisticsKeys in interface DrawContext
Parameters:
statKeys - the keys identifying the statistics to monitor.
stats - a list in which the statistics are placed as they're monitored.

setPickPoint

public void setPickPoint(Point pickPoint)
Description copied from interface: DrawContext
Specifies the current pick point in AWT screen coordinates, or null to indicate that there is no pick point. During each pick traversal, layers determine if their contents are drawn at the pick point. If so, layers add each unique picked object to a PickedObjectList on this draw context by calling DrawContext.addPickedObject(gov.nasa.worldwind.pick.PickedObject). This list can be accessed by calling DrawContext.getPickedObjects().

If the pick point is null, the pick point is ignored during each pick traversal, and the list of objects returned by getPickedObjects is empty.

Specified by:
setPickPoint in interface DrawContext
Parameters:
pickPoint - the current pick point, or null to specify that there is no pick point.

setPickPointFrustumDimension

public void setPickPointFrustumDimension(Dimension dim)
Description copied from interface: DrawContext
Set the size (in pixels) of the pick point frustum at the near plane.

Specified by:
setPickPointFrustumDimension in interface DrawContext
Parameters:
dim - dimension of pick point frustum

setPickRectangle

public void setPickRectangle(Rectangle pickRect)
Description copied from interface: DrawContext
Specifies the current pick rectangle in AWT screen coordinates, or null to indicate that there is no pick rectangle. During each pick traversal, layers determine if their contents intersect the pick rectangle. If so, layers add each unique picked object to a PickedObjectList on this draw context by calling DrawContext.addObjectInPickRectangle(gov.nasa.worldwind.pick.PickedObject). This is list can be accessed by calling DrawContext.getObjectsInPickRectangle().

If the pick rectangle is null, the pick rectangle is ignored during each pick traversal, and the list of objects returned by getObjectsInPickRectangle is empty.

Specified by:
setPickRectangle in interface DrawContext
Parameters:
pickRect - the current pick rectangle, or null to specify that there is no pick rectangle.

setPreRenderMode

public void setPreRenderMode(boolean preRenderMode)
Description copied from interface: DrawContext
Specifies whether the scene controller is pre-rendering.

Specified by:
setPreRenderMode in interface DrawContext
Parameters:
preRenderMode - true to indicate pre-rendering, otherwise false.
See Also:
PreRenderable

setRedrawRequested

public void setRedrawRequested(int redrawRequested)
Description copied from interface: DrawContext
Requests that a new frame should be generated by the SceneController.

Specified by:
setRedrawRequested in interface DrawContext
Parameters:
redrawRequested - a delay in milliseconds if a redraw is requested, otherwise 0.

setRenderingExceptions

public void setRenderingExceptions(Collection<Throwable> exceptions)
Description copied from interface: DrawContext
Sets the rendering exceptions associated with this DrawContext to the specified Collection of Throwable objects. If non-null, the specified Collection is used as the data structure that accumulates rendering exceptions passed to this DrawContext in DrawContext.addRenderingException(Throwable). A null collection indicates this DrawContext should not accumulate rendering exceptions.

Specified by:
setRenderingExceptions in interface DrawContext
Parameters:
exceptions - the Collection of exceptions to be used to accumulate rendering exceptions, or null to disable accumulation of rendering exception.

setStandardLightingModel

public void setStandardLightingModel(LightingModel standardLighting)
Description copied from interface: DrawContext
Specifies the lighting model used for standard lighting.

Specified by:
setStandardLightingModel in interface DrawContext
Parameters:
standardLighting - the lighting model to use for standard lighting, or null to disable standard lighting.

setSurfaceGeometry

public void setSurfaceGeometry(SectorGeometryList surfaceGeometry)
Description copied from interface: DrawContext
Specifies the current surface geometry.

Specified by:
setSurfaceGeometry in interface DrawContext
Parameters:
surfaceGeometry - the surface geometry to make current. May be null, indicating no surface geometry.

setTextRendererCache

public void setTextRendererCache(TextRendererCache textRendererCache)
Description copied from interface: DrawContext
Specifies this context's text renderer cache.

Specified by:
setTextRendererCache in interface DrawContext
Parameters:
textRendererCache - the context's text renderer cache.

setVerticalExaggeration

public final void setVerticalExaggeration(double verticalExaggeration)
Description copied from interface: DrawContext
Sets the vertical exaggeration. Vertical exaggeration affects the appearance of areas with varied elevation. A vertical exaggeration of zero creates a surface which exactly fits the shape of the underlying Globe. A vertical exaggeration of 3 will create mountains and valleys which are three times as high/deep as they really are.

Specified by:
setVerticalExaggeration in interface DrawContext
Parameters:
verticalExaggeration - the new vertical exaggeration.

setView

public final void setView(View view)
Description copied from interface: DrawContext
Assigns a new View. Some layers cannot function properly with a null View. It is recommended that the View is never set to null during a normal render pass.

Specified by:
setView in interface DrawContext
Parameters:
view - the enw View

setViewportCenterPosition

public void setViewportCenterPosition(Position viewportCenterPosition)
Description copied from interface: DrawContext
Specifies the geographic coordinates of the point on the terrain at the current viewport's center.

Specified by:
setViewportCenterPosition in interface DrawContext
Parameters:
viewportCenterPosition - the geographic coordinates of the current viewport's center. May be null.

setViewportCenterScreenPoint

public void setViewportCenterScreenPoint(Point viewportCenterScreenPoint)
Description copied from interface: DrawContext
Specifies the screen-coordinate point of the current viewport's center.

Specified by:
setViewportCenterScreenPoint in interface DrawContext
Parameters:
viewportCenterScreenPoint - the screen-coordinate point of the current viewport's center.

setVisibleSector

public final void setVisibleSector(Sector s)
Description copied from interface: DrawContext
Sets the visible Sector. The new visible sector must completely encompass the Sector which is visible on the display.

Specified by:
setVisibleSector in interface DrawContext
Parameters:
s - the new visible Sector

NASA World Wind