public interface DrawContext extends WWObject, Disposable
Modifier and Type | Method and Description |
---|---|
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(java.lang.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 |
drawNormals(float length,
java.nio.FloatBuffer vBuf,
java.nio.FloatBuffer nBuf)
This is a diagnostic method to display normal vectors.
|
void |
drawOutlinedShape(OutlinedShape renderer,
java.lang.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
beginStandardLighting() . |
AnnotationRenderer |
getAnnotationRenderer()
Returns the draw context's annotation renderer, typically used by annotations that are not contained in an
AnnotationLayer . |
java.awt.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
DrawContext s 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.
|
java.util.Queue<OrderedRenderable> |
getOrderedSurfaceRenderables()
Returns the draw context's ordered surface renderable queue.
|
java.util.Collection<PerformanceStatistic> |
getPerFrameStatistics()
Returns the performance statistics that are gathered during each frame.
|
java.util.Set<java.lang.String> |
getPerFrameStatisticsKeys()
Indicates the statistics that are monitored for each frame.
|
int |
getPickColorAtPoint(java.awt.Point point)
Returns the framebuffer RGB color for a point in AWT screen coordinates, formatted as a pick color code.
|
int[] |
getPickColorsInRectangle(java.awt.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
|
java.awt.Point |
getPickPoint()
Returns the current pick point in AWT screen coordinates.
|
java.awt.Dimension |
getPickPointFrustumDimension()
Gets the dimension of the current Pick Point Frustum
|
java.awt.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 . |
java.util.Collection<java.lang.Throwable> |
getRenderingExceptions()
Gets the rendering exceptions associated with this DrawContext as a
Collection of Throwable objects. |
java.util.Map<ScreenCredit,java.lang.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.
|
java.awt.Color |
getUniquePickColor()
Returns a unique color to serve as a pick identifier during picking.
|
java.awt.Color |
getUniquePickColorRange(int count)
Returns a range of unique colors to serve as pick identifiers 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.
|
java.awt.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. |
java.util.List<Sector> |
getVisibleSectors(double[] resolutions,
long timeLimit,
Sector searchSector)
Returns the visible sectors at one of several specified resolutions within a specified search sector.
|
void |
initialize(GLContext glContext)
Initializes this
DrawContext . |
boolean |
is2DGlobe() |
boolean |
isContinuous2DGlobe() |
boolean |
isDeepPickingEnabled()
Indicates whether all items under cursor are picked.
|
boolean |
isOrderedRenderingMode()
Indicates whether the
SceneController is currently rendering the draw context's OrderedRenderable s. |
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
pushProjectionOffest(Double) . |
void |
pushProjectionOffest(java.lang.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 annotationRenderer)
Since
Annotation s are Renderable s, 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 OrderedRenderable s. |
void |
setPerFrameStatistic(java.lang.String key,
java.lang.String displayName,
java.lang.Object statistic)
Specifies a performance statistic that's assigned for each frame.
|
void |
setPerFrameStatistics(java.util.Collection<PerformanceStatistic> stats)
Specifies a collection of per-frame performance statistics.
|
void |
setPerFrameStatisticsKeys(java.util.Set<java.lang.String> statKeys,
java.util.Collection<PerformanceStatistic> stats)
Specifies the performance statistics that are monitored during each frame.
|
void |
setPickPoint(java.awt.Point pickPoint)
Specifies the current pick point in AWT screen coordinates, or
null to indicate that there is no
pick point. |
void |
setPickPointFrustumDimension(java.awt.Dimension dim)
Set the size (in pixels) of the pick point frustum at the near plane.
|
void |
setPickRectangle(java.awt.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(java.util.Collection<java.lang.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(java.awt.Point viewportCenterPoint)
Specifies the screen-coordinate point of the current viewport's center.
|
void |
setVisibleSector(Sector s)
Sets the visible
Sector . |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
dispose
void addObjectInPickRectangle(PickedObject pickedObject)
getObjectsInPickRectangle()
.pickedObject
- the object to add.java.lang.IllegalArgumentException
- if pickedObject is null
.void addOrderedRenderable(OrderedRenderable orderedRenderable)
OrderedRenderable
to the draw context's ordered renderable list.orderedRenderable
- the ordered renderable to add.java.lang.IllegalArgumentException
- if the ordered renderable is null.void addOrderedRenderable(OrderedRenderable orderedRenderable, boolean isBehind)
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.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.void addOrderedSurfaceRenderable(OrderedRenderable orderedRenderable)
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.orderedRenderable
- the ordered renderable to add.void addPickedObject(PickedObject pickedObject)
getPickedObjects()
.pickedObject
- the object to add.java.lang.IllegalArgumentException
- if pickedObject is null
.void addPickedObjects(PickedObjectList pickedObjects)
getPickedObjects()
.pickedObjects
- the list to add.java.lang.IllegalArgumentException
- if pickedObjects is null
.void addPickPointFrustum()
setPickPointFrustumDimension(java.awt.Dimension)
.
This does nothing if the current pick point is null
.void addPickRectangleFrustum()
null
.void addRenderingException(java.lang.Throwable t)
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.t
- the rendering exception to add as a Throwable
.java.lang.IllegalArgumentException
- if the Throwable is null.void addScreenCredit(ScreenCredit credit)
credit
- the screen credit to display.java.lang.IllegalArgumentException
- if the credit is null.void applyClutterFilter()
void beginStandardLighting()
endStandardLighting()
must be called when rendering of the
current shape is complete.Vec4 computePointFromPosition(Position position, int altitudeMode)
position
- the position to convert.altitudeMode
- the altitude mode.java.lang.IllegalArgumentException
- if the position is null.Vec4 computeTerrainPoint(Angle lat, Angle lon, double offset)
lat
- the point's latitude.lon
- the point's longitude.offset
- an distance in meters to place the point above or below the terrain.java.lang.IllegalArgumentException
- if either the latitude or longitude is null.void disablePickingMode()
void drawNormals(float length, java.nio.FloatBuffer vBuf, java.nio.FloatBuffer nBuf)
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.void drawOutlinedShape(OutlinedShape renderer, java.lang.Object shape)
renderer
- an object implementing the OutlinedShape
interface for the
shape.shape
- the shape to render.OutlinedShape
void drawUnitQuad()
void drawUnitQuad(TextureCoords texCoords)
texCoords
- texture coordinates to assign to each quadrilateral vertex.java.lang.NullPointerException
- if the texture coordinate reference is null.void drawUnitQuadOutline()
void enablePickingMode()
void endStandardLighting()
beginStandardLighting()
.AnnotationRenderer getAnnotationRenderer()
AnnotationLayer
.java.awt.Color getClearColor()
ClutterFilter getClutterFilter()
Layer getCurrentLayer()
DeclutteringTextRenderer getDeclutteringTextRenderer()
int getDrawableHeight()
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
.DrawContext
, in pixels.int getDrawableWidth()
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
.DrawContext
, in pixels.long getFrameTimeStamp()
System.currentTimeMillis()
for its numerical meaning.SurfaceTileRenderer getGeographicSurfaceTileRenderer()
GL getGL()
javax.media.opengl.GL
. A GL
or GLU
is required for
all graphical rendering in WorldWind.GL
if available, null otherwiseGLContext getGLContext()
DrawContext
s javax.media.opengl.GLContext. If this method returns null,
then there are potentially no active GLContext
s and rendering should be aborted.DrawContext
s javax.media.opengl.GLContext.GLDrawable getGLDrawable()
javax.media.opengl.GLDrawable
. A GLDrawable
can be used to create
a GLContext
, which can then be used for rendering.GLDrawable
, null if none availableGlobe getGlobe()
Globe
, which may be null.Globe
, which may be nullGLRuntimeCapabilities getGLRuntimeCapabilities()
GLRuntimeCapabilities
associated with this DrawContext.GLU getGLU()
javax.media.opengl.glu.GLU
. A GLU
or GL
is required
for all graphical rendering in WorldWind.GLU
if available, null otherwiseGpuResourceCache getGpuResourceCache()
LayerList getLayers()
LayerList
containing all the current layersModel getModel()
Model
, which may be null.Model
, which may be nullPickedObjectList getObjectsInPickRectangle()
null
.java.util.Queue<OrderedRenderable> getOrderedSurfaceRenderables()
java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
java.util.Set<java.lang.String> getPerFrameStatisticsKeys()
int getPickColorAtPoint(java.awt.Point point)
point
- the point to return a color for, in AWT screen coordinates.java.lang.IllegalArgumentException
- if the point is null
.int[] getPickColorsInRectangle(java.awt.Rectangle rectangle, int[] minAndMaxColorCodes)
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.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.null
if the rectangle is
empty or the rectangle contains only the clear color.java.lang.IllegalArgumentException
- if the rectangle is null
.PickedObjectList getPickedObjects()
null
.PickPointFrustumList getPickFrustums()
java.awt.Point getPickPoint()
null
if no pick point is available.setPickPoint(java.awt.Point)
java.awt.Dimension getPickPointFrustumDimension()
java.awt.Rectangle getPickRectangle()
null
if no pick rectangle is current.setPickRectangle(java.awt.Rectangle)
Vec4 getPointOnTerrain(Angle latitude, Angle longitude)
latitude
- the location's latitude.longitude
- the location's longitude.int getRedrawRequested()
SceneController
.java.util.Collection<java.lang.Throwable> getRenderingExceptions()
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 addRenderingException(Throwable)
. A null collection indicates
this DrawContext does not accumulate rendering exceptions.java.util.Map<ScreenCredit,java.lang.Long> getScreenCredits()
LightingModel getStandardLightingModel()
SectorGeometryList getSurfaceGeometry()
SectorGeometryList
containing every SectorGeometry
rendered so far this
render pass.Terrain getTerrain()
Terrain
object that uses the current sector geometry or the current globe to compute surface
points.TextRendererCache getTextRendererCache()
GpuResourceCache getTextureCache()
getGpuResourceCache()
.getGpuResourceCache()
java.awt.Color getUniquePickColor()
java.awt.Color getUniquePickColorRange(int count)
count
unique colors from the pick color address space and returns the first color in the range. The first color's RGB
components represent an address to the beginning of a sequential range of pick color codes. This method is
similar to calling the no-argument getUniquePickColor()
count
times, but guarantees a
contiguous range of color codes and is more efficient when count
is large.
The number of pick colors is limited to a finite address space. This method returns null when there are fewer
than count
remaining unique colors in the pick color address space, or when count
is
less than 1.count
- the number of unique colors to allocate.count
is
greater than 0, otherwise null.double getVerticalExaggeration()
Globe
. A vertical exaggeration of 3 will create mountains and valleys which are three times as
high/deep as they really are.View getView()
View
, which may be null.View
, which may be nullPosition getViewportCenterPosition()
java.awt.Point getViewportCenterScreenPoint()
Sector getVisibleSector()
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.Sector
at least the size of the current visible sector, null if unavailablejava.util.List<Sector> getVisibleSectors(double[] resolutions, long timeLimit, Sector searchSector)
resolutions
- the resolutions of the sectors to return, in latitude.timeLimit
- the amount of time, in milliseconds, to allow for searching.searchSector
- the sector to decompose into visible sectors.java.lang.IllegalArgumentException
- if the resolutions array or the search sector is null.void initialize(GLContext glContext)
DrawContext
. This method should be called at the beginning of each frame to prepare
the DrawContext
for the coming render pass.glContext
- the javax.media.opengl.GLContext
to use for this render passboolean is2DGlobe()
boolean isContinuous2DGlobe()
boolean isDeepPickingEnabled()
boolean isOrderedRenderingMode()
SceneController
is currently rendering the draw context's OrderedRenderable
s. 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
addOrderedRenderable(OrderedRenderable)
rather than draw it. When this method returns true during a call
to its render method, the ordered renderable should draw itself.boolean isPickingMode()
boolean isPreRenderMode()
PreRenderable
boolean isSmall(Extent extent, int numPixels)
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.OrderedRenderable peekOrderedRenderables()
OrderedRenderable
on the ordered-renderable priority queue but
does not remove it from the queue.OrderedRenderable pollOrderedRenderables()
OrderedRenderable
on the ordered-renderable priority queue and
removes it from the queue.void popProjectionOffest()
pushProjectionOffest(Double)
.pushProjectionOffest(Double)
void pushProjectionOffest(java.lang.Double offset)
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.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.popProjectionOffest()
void restoreDefaultBlending()
void restoreDefaultCurrentColor()
void restoreDefaultDepthTesting()
void setAnnotationRenderer(AnnotationRenderer annotationRenderer)
Annotation
s are Renderable
s, 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.annotationRenderer
- the new annotation renderer for the draw context.java.lang.IllegalArgumentException
- if annotationRenderer
is null;void setClutterFilter(ClutterFilter filter)
filter
- the clutter filter.void setCurrentLayer(Layer layer)
layer
- the current layer or null.void setDeepPickingEnabled(boolean tf)
tf
- true to pick all objects under the cursorvoid setFrameTimeStamp(long frameTimeStamp)
frameTimeStamp
- the frame time stamp. See System.currentTimeMillis()
for its numerical meaning.void setGLContext(GLContext glContext)
DrawContext
a new javax.media.opengl.GLContext. May throw a
NullPointerException
if glContext
is null.glContext
- the new javax.media.opengl.GLContext
java.lang.NullPointerException
- if glContext is nullvoid setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
GLRuntimeCapabilities
associated with this DrawContext to the specified parameter.capabilities
- the GLRuntimeCapabilities to be associated with this DrawContext.java.lang.IllegalArgumentException
- if the capabilities are null.void setGpuResourceCache(GpuResourceCache gpuResourceCache)
gpuResourceCache
- the GPU resource cache for this draw context.void setModel(Model model)
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.model
- the new Model
void setOrderedRenderingMode(boolean tf)
SceneController
to indicate whether it is currently drawing the draw
context's OrderedRenderable
s. See isOrderedRenderingMode()
for more
information.tf
- true if ordered renderables are being drawn, false if ordered renderables are only being accumulated.void setPerFrameStatistic(java.lang.String key, java.lang.String displayName, java.lang.Object statistic)
key
- the key identifying the statistic to monitor.displayName
- the name to use when displaying this statistic.statistic
- the statistic's value. May be null.java.lang.IllegalArgumentException
- if either the key or display name are null.setPerFrameStatistics(java.util.Collection)
void setPerFrameStatistics(java.util.Collection<PerformanceStatistic> stats)
stats
- the statistic keys and their associated values.java.lang.IllegalArgumentException
- if the list is null.setPerFrameStatistic(String, String, Object)
void setPerFrameStatisticsKeys(java.util.Set<java.lang.String> statKeys, java.util.Collection<PerformanceStatistic> stats)
statKeys
- the keys identifying the statistics to monitor.stats
- a list in which the statistics are placed as they're monitored.void setPickPoint(java.awt.Point pickPoint)
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 addPickedObject(gov.nasa.worldwind.pick.PickedObject)
. This list can be accessed by calling 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.pickPoint
- the current pick point, or null
to specify that there is no pick point.void setPickPointFrustumDimension(java.awt.Dimension dim)
dim
- dimension of pick point frustumvoid setPickRectangle(java.awt.Rectangle pickRect)
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 addObjectInPickRectangle(gov.nasa.worldwind.pick.PickedObject)
. This is list can be accessed by calling 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.pickRect
- the current pick rectangle, or null
to specify that there is no pick rectangle.void setPreRenderMode(boolean preRenderMode)
preRenderMode
- true to indicate pre-rendering, otherwise false.PreRenderable
void setRedrawRequested(int redrawRequested)
SceneController
.redrawRequested
- a delay in milliseconds if a redraw is requested, otherwise 0.void setRenderingExceptions(java.util.Collection<java.lang.Throwable> exceptions)
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 addRenderingException(Throwable)
. A null collection
indicates this DrawContext should not accumulate rendering exceptions.exceptions
- the Collection of exceptions to be used to accumulate rendering exceptions, or null to disable
accumulation of rendering exception.void setStandardLightingModel(LightingModel standardLighting)
standardLighting
- the lighting model to use for standard lighting, or null to disable standard lighting.void setSurfaceGeometry(SectorGeometryList surfaceGeometry)
surfaceGeometry
- the surface geometry to make current. May be null, indicating no surface geometry.void setTextRendererCache(TextRendererCache textRendererCache)
textRendererCache
- the context's text renderer cache.java.lang.IllegalArgumentException
- if the cache is null.void setVerticalExaggeration(double verticalExaggeration)
Globe
. A vertical exaggeration of 3 will create mountains and valleys which are three times as
high/deep as they really are.verticalExaggeration
- the new vertical exaggeration.void setView(View view)
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.view
- the enw View
void setViewportCenterPosition(Position viewportCenterPosition)
viewportCenterPosition
- the geographic coordinates of the current viewport's center. May be null.void setViewportCenterScreenPoint(java.awt.Point viewportCenterPoint)
viewportCenterPoint
- the screen-coordinate point of the current viewport's center.void setVisibleSector(Sector s)
Sector
. The new visible sector must completely encompass the Sector which is
visible on the display.s
- the new visible Sector