public class DrawContextImpl extends WWObjectImpl implements DrawContext
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DrawContextImpl.OrderedRenderableEntry |
| Modifier and Type | Field and Description |
|---|---|
protected AnnotationRenderer |
annotationRenderer |
protected java.awt.Color |
clearColor |
protected ClutterFilter |
clutterFilter |
protected java.util.LinkedHashMap<ScreenCredit,java.lang.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 com.jogamp.opengl.GLContext |
glContext |
protected Globe |
globe |
protected GLRuntimeCapabilities |
glRuntimeCaps |
protected com.jogamp.opengl.glu.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 java.util.PriorityQueue<DrawContextImpl.OrderedRenderableEntry> |
orderedRenderables |
protected java.util.Queue<OrderedRenderable> |
orderedSurfaceRenderables |
protected java.util.Collection<PerformanceStatistic> |
perFrameStatistics |
protected java.util.Set<java.lang.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 java.awt.Point |
pickPoint
Indicates the current pick point in AWT screen coordinates, or
null to indicate that there is no
pick point. |
protected java.awt.Dimension |
pickPointFrustumDimension |
protected java.awt.Rectangle |
pickRect
Indicates the current pick rectangle in AWT screen coordinates, or
null to indicate that there is no
pick rectangle. |
protected java.nio.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 java.util.Collection<java.lang.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 java.awt.Point |
viewportCenterScreenPoint |
protected Sector |
visibleSector |
protected SectorVisibilityTree |
visibleSectors |
| Constructor and Description |
|---|
DrawContextImpl() |
| 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 |
dispose()
Free internal resources held by this draw context.
|
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(com.jogamp.opengl.util.texture.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. |
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.
|
com.jogamp.opengl.GL |
getGL()
Retrieves the current
com.jogamp.opengl.GL. |
com.jogamp.opengl.GLContext |
getGLContext()
Retrieves this
DrawContexts com.jogamp.opengl.GLContext. |
com.jogamp.opengl.GLDrawable |
getGLDrawable()
Retrieves the current
com.jogamp.opengl.GLDrawable. |
Globe |
getGlobe()
Retrieves the current
Globe, which may be null. |
GLRuntimeCapabilities |
getGLRuntimeCapabilities()
Returns the
GLRuntimeCapabilities associated with this DrawContext. |
com.jogamp.opengl.glu.GLU |
getGLU()
Retrieves the current
com.jogamp.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 sector)
Returns the visible sectors at one of several specified resolutions within a specified search sector.
|
void |
initialize(com.jogamp.opengl.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 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(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 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(com.jogamp.opengl.GLContext glContext)
Assigns this
DrawContext a new com.jogamp.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(java.lang.String key,
java.lang.String displayName,
java.lang.Object value)
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 viewportCenterScreenPoint)
Specifies the screen-coordinate point of the current viewport's center.
|
void |
setVisibleSector(Sector s)
Sets the visible
Sector. |
onMessage, propertyChangeaddPropertyChangeListener, 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, setValuesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValuesonMessageprotected AnnotationRenderer annotationRenderer
protected java.awt.Color clearColor
protected ClutterFilter clutterFilter
protected java.util.LinkedHashMap<ScreenCredit,java.lang.Long> credits
protected Layer currentLayer
protected DeclutteringTextRenderer declutteringTextRenderer
protected boolean deepPickingMode
public static final float DEFAULT_DEPTH_OFFSET_FACTOR
public static final float DEFAULT_DEPTH_OFFSET_UNITS
protected long frameTimestamp
protected SurfaceTileRenderer geographicSurfaceTileRenderer
protected com.jogamp.opengl.GLContext glContext
protected Globe globe
protected GLRuntimeCapabilities glRuntimeCaps
protected com.jogamp.opengl.glu.GLU glu
protected GpuResourceCache gpuResourceCache
protected boolean isOrderedRenderingMode
protected Model model
protected PickedObjectList objectsInPickRect
protected java.util.PriorityQueue<DrawContextImpl.OrderedRenderableEntry> orderedRenderables
protected java.util.Queue<OrderedRenderable> orderedSurfaceRenderables
protected java.util.Collection<PerformanceStatistic> perFrameStatistics
protected java.util.Set<java.lang.String> perFrameStatisticsKeys
protected PickedObjectList pickedObjects
protected PickPointFrustumList pickFrustumList
protected boolean pickingMode
protected java.awt.Point pickPoint
null to indicate that there is no
pick point. Initially null.protected java.awt.Dimension pickPointFrustumDimension
protected java.awt.Rectangle pickRect
null to indicate that there is no
pick rectangle. Initially null.protected java.nio.ByteBuffer pixelColors
protected boolean preRenderMode
protected int redrawRequested
protected java.util.Collection<java.lang.Throwable> renderingExceptions
protected LightingModel standardLighting
protected SectorGeometryList surfaceGeometry
protected Terrain terrain
protected TextRendererCache textRendererCache
protected int uniquePickNumber
protected IntSet uniquePixelColors
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.protected double verticalExaggeration
protected View view
protected Position viewportCenterPosition
protected java.awt.Point viewportCenterScreenPoint
protected Sector visibleSector
protected SectorVisibilityTree visibleSectors
public void addObjectInPickRectangle(PickedObject pickedObject)
DrawContextDrawContext.getObjectsInPickRectangle().addObjectInPickRectangle in interface DrawContextpickedObject - the object to add.public void addOrderedRenderable(OrderedRenderable orderedRenderable)
DrawContextOrderedRenderable to the draw context's ordered renderable list.addOrderedRenderable in interface DrawContextorderedRenderable - the ordered renderable to add.public 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.addOrderedRenderable in interface DrawContextorderedRenderable - 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.public 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.addOrderedSurfaceRenderable in interface DrawContextorderedRenderable - the ordered renderable to add.public void addPickedObject(PickedObject pickedObject)
DrawContextDrawContext.getPickedObjects().addPickedObject in interface DrawContextpickedObject - the object to add.public void addPickedObjects(PickedObjectList pickedObjects)
DrawContextDrawContext.getPickedObjects().addPickedObjects in interface DrawContextpickedObjects - the list to add.public void addPickPointFrustum()
DrawContextDrawContext.setPickPointFrustumDimension(java.awt.Dimension).
This does nothing if the current pick point is null.
addPickPointFrustum in interface DrawContextpublic void addPickRectangleFrustum()
DrawContext
This does nothing if the current pick rectangle is null.
addPickRectangleFrustum in interface DrawContextpublic void addRenderingException(java.lang.Throwable t)
DrawContextThrowable 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.addRenderingException in interface DrawContextt - the rendering exception to add as a Throwable.public void addScreenCredit(ScreenCredit credit)
DrawContextaddScreenCredit in interface DrawContextcredit - the screen credit to display.public void applyClutterFilter()
DrawContextapplyClutterFilter in interface DrawContextpublic void beginStandardLighting()
DrawContextDrawContext.endStandardLighting() must be called when rendering of the
current shape is complete.beginStandardLighting in interface DrawContextDrawContext.setStandardLightingModel(LightingModel),
DrawContext.endStandardLighting()public Vec4 computePointFromPosition(Position position, int altitudeMode)
DrawContextcomputePointFromPosition in interface DrawContextposition - the position to convert.altitudeMode - the altitude mode.public Vec4 computeTerrainPoint(Angle lat, Angle lon, double offset)
DrawContextcomputeTerrainPoint in interface DrawContextlat - the point's latitude.lon - the point's longitude.offset - an distance in meters to place the point above or below the terrain.public void disablePickingMode()
DrawContextdisablePickingMode in interface DrawContextpublic void dispose()
dispose in interface Disposablecom.jogamp.opengl.GLException - - If an OpenGL context is not current when this method is called.public void drawNormals(float length,
java.nio.FloatBuffer vBuf,
java.nio.FloatBuffer nBuf)
DrawContextdrawNormals in interface DrawContextlength - 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.public void drawOutlinedShape(OutlinedShape renderer, java.lang.Object shape)
DrawContextdrawOutlinedShape in interface DrawContextrenderer - an object implementing the OutlinedShape interface for the
shape.shape - the shape to render.OutlinedShapepublic void drawUnitQuad()
DrawContextdrawUnitQuad in interface DrawContextpublic void drawUnitQuad(com.jogamp.opengl.util.texture.TextureCoords texCoords)
DrawContextdrawUnitQuad in interface DrawContexttexCoords - texture coordinates to assign to each quadrilateral vertex.public void drawUnitQuadOutline()
DrawContextdrawUnitQuadOutline in interface DrawContextpublic void enablePickingMode()
DrawContextenablePickingMode in interface DrawContextpublic void endStandardLighting()
DrawContextDrawContext.beginStandardLighting().endStandardLighting in interface DrawContextpublic AnnotationRenderer getAnnotationRenderer()
DrawContextAnnotationLayer.getAnnotationRenderer in interface DrawContextpublic java.awt.Color getClearColor()
DrawContextgetClearColor in interface DrawContextpublic ClutterFilter getClutterFilter()
DrawContextgetClutterFilter in interface DrawContextpublic Layer getCurrentLayer()
DrawContextgetCurrentLayer in interface DrawContextpublic DeclutteringTextRenderer getDeclutteringTextRenderer()
DrawContextgetDeclutteringTextRenderer in interface DrawContextpublic final int getDrawableHeight()
DrawContextDrawContext. 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.
getDrawableHeight in interface DrawContextDrawContext, in pixels.public final int getDrawableWidth()
DrawContextDrawContext. 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.
getDrawableWidth in interface DrawContextDrawContext, in pixels.public long getFrameTimeStamp()
DrawContextgetFrameTimeStamp in interface DrawContextSystem.currentTimeMillis() for its numerical meaning.public SurfaceTileRenderer getGeographicSurfaceTileRenderer()
DrawContextgetGeographicSurfaceTileRenderer in interface DrawContextpublic final com.jogamp.opengl.GL getGL()
DrawContextcom.jogamp.opengl.GL. A GL or GLU is required for
all graphical rendering in World Wind.getGL in interface DrawContextGL if available, null otherwisepublic final com.jogamp.opengl.GLContext getGLContext()
DrawContextDrawContexts com.jogamp.opengl.GLContext. If this method returns null,
then there are potentially no active GLContexts and rendering should be aborted.getGLContext in interface DrawContextDrawContexts com.jogamp.opengl.GLContext.public final com.jogamp.opengl.GLDrawable getGLDrawable()
DrawContextcom.jogamp.opengl.GLDrawable. A GLDrawable can be used to create
a GLContext, which can then be used for rendering.getGLDrawable in interface DrawContextGLDrawable, null if none availablepublic final Globe getGlobe()
DrawContextGlobe, which may be null.getGlobe in interface DrawContextGlobe, which may be nullpublic GLRuntimeCapabilities getGLRuntimeCapabilities()
DrawContextGLRuntimeCapabilities associated with this DrawContext.getGLRuntimeCapabilities in interface DrawContextpublic final com.jogamp.opengl.glu.GLU getGLU()
DrawContextcom.jogamp.opengl.glu.GLU. A GLU or GL is required
for all graphical rendering in World Wind.getGLU in interface DrawContextGLU if available, null otherwisepublic GpuResourceCache getGpuResourceCache()
DrawContextgetGpuResourceCache in interface DrawContextpublic final LayerList getLayers()
DrawContextgetLayers in interface DrawContextLayerList containing all the current layerspublic final Model getModel()
DrawContextModel, which may be null.getModel in interface DrawContextModel, which may be nullpublic PickedObjectList getObjectsInPickRectangle()
DrawContextnull.getObjectsInPickRectangle in interface DrawContextpublic java.util.Queue<OrderedRenderable> getOrderedSurfaceRenderables()
getOrderedSurfaceRenderables in interface DrawContextpublic java.util.Collection<PerformanceStatistic> getPerFrameStatistics()
DrawContextgetPerFrameStatistics in interface DrawContextpublic java.util.Set<java.lang.String> getPerFrameStatisticsKeys()
DrawContextgetPerFrameStatisticsKeys in interface DrawContextpublic int getPickColorAtPoint(java.awt.Point point)
This returns 0 if the point contains the clear color, or is outside this draw context's drawable area.
getPickColorAtPoint in interface DrawContextpoint - the point to return a color for, in AWT screen coordinates.public int[] getPickColorsInRectangle(java.awt.Rectangle rectangle,
int[] minAndMaxColorCodes)
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.
getPickColorsInRectangle in interface DrawContextrectangle - 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.public PickedObjectList getPickedObjects()
DrawContextnull.getPickedObjects in interface DrawContextpublic PickPointFrustumList getPickFrustums()
DrawContextgetPickFrustums in interface DrawContextpublic java.awt.Point getPickPoint()
DrawContextgetPickPoint in interface DrawContextnull if no pick point is available.DrawContext.setPickPoint(java.awt.Point)public java.awt.Dimension getPickPointFrustumDimension()
DrawContextgetPickPointFrustumDimension in interface DrawContextpublic java.awt.Rectangle getPickRectangle()
DrawContextgetPickRectangle in interface DrawContextnull if no pick rectangle is current.DrawContext.setPickRectangle(java.awt.Rectangle)public Vec4 getPointOnTerrain(Angle latitude, Angle longitude)
DrawContextgetPointOnTerrain in interface DrawContextlatitude - the location's latitude.longitude - the location's longitude.public int getRedrawRequested()
DrawContextSceneController.getRedrawRequested in interface DrawContextpublic java.util.Collection<java.lang.Throwable> getRenderingExceptions()
DrawContextCollection 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.getRenderingExceptions in interface DrawContextpublic java.util.Map<ScreenCredit,java.lang.Long> getScreenCredits()
DrawContextgetScreenCredits in interface DrawContextpublic LightingModel getStandardLightingModel()
DrawContextgetStandardLightingModel in interface DrawContextpublic SectorGeometryList getSurfaceGeometry()
DrawContextgetSurfaceGeometry in interface DrawContextSectorGeometryList containing every SectorGeometry rendered so far this
render pass.public Terrain getTerrain()
DrawContextTerrain object that uses the current sector geometry or the current globe to compute surface
points.getTerrain in interface DrawContextpublic TextRendererCache getTextRendererCache()
DrawContextgetTextRendererCache in interface DrawContextpublic GpuResourceCache getTextureCache()
DrawContextDrawContext.getGpuResourceCache().getTextureCache in interface DrawContextDrawContext.getGpuResourceCache()public java.awt.Color getUniquePickColor()
DrawContextgetUniquePickColor in interface DrawContextpublic java.awt.Color getUniquePickColorRange(int count)
DrawContextcount
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 DrawContext.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.
getUniquePickColorRange in interface DrawContextcount - the number of unique colors to allocate.count is
greater than 0, otherwise null.public final double getVerticalExaggeration()
DrawContextGlobe. A vertical exaggeration of 3 will create mountains and valleys which are three times as
high/deep as they really are.getVerticalExaggeration in interface DrawContextpublic final View getView()
DrawContextView, which may be null.getView in interface DrawContextView, which may be nullpublic Position getViewportCenterPosition()
DrawContextgetViewportCenterPosition in interface DrawContextpublic java.awt.Point getViewportCenterScreenPoint()
DrawContextgetViewportCenterScreenPoint in interface DrawContextpublic final Sector getVisibleSector()
DrawContextSector 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.getVisibleSector in interface DrawContextSector at least the size of the current visible sector, null if unavailablepublic java.util.List<Sector> getVisibleSectors(double[] resolutions, long timeLimit, Sector sector)
DrawContextAdherence 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.
getVisibleSectors in interface DrawContextresolutions - 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.public final void initialize(com.jogamp.opengl.GLContext glContext)
DrawContextDrawContext. This method should be called at the beginning of each frame to prepare
the DrawContext for the coming render pass.initialize in interface DrawContextglContext - the com.jogamp.opengl.GLContext to use for this render passpublic boolean is2DGlobe()
is2DGlobe in interface DrawContextpublic boolean isContinuous2DGlobe()
isContinuous2DGlobe in interface DrawContextpublic boolean isDeepPickingEnabled()
DrawContextisDeepPickingEnabled in interface DrawContextpublic boolean isOrderedRenderingMode()
DrawContextSceneController 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.isOrderedRenderingMode in interface DrawContextpublic boolean isPickingMode()
DrawContextisPickingMode in interface DrawContextpublic boolean isPreRenderMode()
DrawContextisPreRenderMode in interface DrawContextPreRenderablepublic boolean isSmall(Extent extent, int numPixels)
DrawContextisSmall in interface DrawContextextent - 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.public OrderedRenderable peekOrderedRenderables()
DrawContextOrderedRenderable on the ordered-renderable priority queue but
does not remove it from the queue.peekOrderedRenderables in interface DrawContextpublic OrderedRenderable pollOrderedRenderables()
DrawContextOrderedRenderable on the ordered-renderable priority queue and
removes it from the queue.pollOrderedRenderables in interface DrawContextpublic void popProjectionOffest()
DrawContextDrawContext.pushProjectionOffest(Double).popProjectionOffest in interface DrawContextDrawContext.pushProjectionOffest(Double)public void pushProjectionOffest(java.lang.Double offset)
DrawContextDrawContext.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.
pushProjectionOffest in interface DrawContextoffset - 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.DrawContext.popProjectionOffest()public void restoreDefaultBlending()
DrawContextrestoreDefaultBlending in interface DrawContextpublic void restoreDefaultCurrentColor()
DrawContextrestoreDefaultCurrentColor in interface DrawContextpublic void restoreDefaultDepthTesting()
DrawContextrestoreDefaultDepthTesting in interface DrawContextpublic void setAnnotationRenderer(AnnotationRenderer ar)
DrawContextAnnotations 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.setAnnotationRenderer in interface DrawContextar - the new annotation renderer for the draw context.public void setClutterFilter(ClutterFilter filter)
DrawContextsetClutterFilter in interface DrawContextfilter - the clutter filter.public void setCurrentLayer(Layer layer)
DrawContextsetCurrentLayer in interface DrawContextlayer - the current layer or null.public void setDeepPickingEnabled(boolean tf)
DrawContextsetDeepPickingEnabled in interface DrawContexttf - true to pick all objects under the cursorpublic void setFrameTimeStamp(long frameTimeStamp)
DrawContextsetFrameTimeStamp in interface DrawContextframeTimeStamp - the frame time stamp. See System.currentTimeMillis() for its numerical meaning.public final void setGLContext(com.jogamp.opengl.GLContext glContext)
DrawContextDrawContext a new com.jogamp.opengl.GLContext. May throw a
NullPointerException if glContext is null.setGLContext in interface DrawContextglContext - the new com.jogamp.opengl.GLContextpublic void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
DrawContextGLRuntimeCapabilities associated with this DrawContext to the specified parameter.setGLRuntimeCapabilities in interface DrawContextcapabilities - the GLRuntimeCapabilities to be associated with this DrawContext.public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
DrawContextsetGpuResourceCache in interface DrawContextgpuResourceCache - the GPU resource cache for this draw context.public final void setModel(Model model)
DrawContextModel. 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.setModel in interface DrawContextmodel - the new Modelpublic void setOrderedRenderingMode(boolean tf)
DrawContextSceneController to indicate whether it is currently drawing the draw
context's OrderedRenderables. See DrawContext.isOrderedRenderingMode() for more
information.setOrderedRenderingMode in interface DrawContexttf - true if ordered renderables are being drawn, false if ordered renderables are only being accumulated.public void setPerFrameStatistic(java.lang.String key,
java.lang.String displayName,
java.lang.Object value)
DrawContextsetPerFrameStatistic in interface DrawContextkey - the key identifying the statistic to monitor.displayName - the name to use when displaying this statistic.value - the statistic's value. May be null.DrawContext.setPerFrameStatistics(java.util.Collection)public void setPerFrameStatistics(java.util.Collection<PerformanceStatistic> stats)
DrawContextsetPerFrameStatistics in interface DrawContextstats - the statistic keys and their associated values.DrawContext.setPerFrameStatistic(String, String, Object)public void setPerFrameStatisticsKeys(java.util.Set<java.lang.String> statKeys,
java.util.Collection<PerformanceStatistic> stats)
DrawContextsetPerFrameStatisticsKeys in interface DrawContextstatKeys - the keys identifying the statistics to monitor.stats - a list in which the statistics are placed as they're monitored.public void setPickPoint(java.awt.Point pickPoint)
DrawContextnull 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.
setPickPoint in interface DrawContextpickPoint - the current pick point, or null to specify that there is no pick point.public void setPickPointFrustumDimension(java.awt.Dimension dim)
DrawContextsetPickPointFrustumDimension in interface DrawContextdim - dimension of pick point frustumpublic void setPickRectangle(java.awt.Rectangle pickRect)
DrawContextnull 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.
setPickRectangle in interface DrawContextpickRect - the current pick rectangle, or null to specify that there is no pick rectangle.public void setPreRenderMode(boolean preRenderMode)
DrawContextsetPreRenderMode in interface DrawContextpreRenderMode - true to indicate pre-rendering, otherwise false.PreRenderablepublic void setRedrawRequested(int redrawRequested)
DrawContextSceneController.setRedrawRequested in interface DrawContextredrawRequested - a delay in milliseconds if a redraw is requested, otherwise 0.public void setRenderingExceptions(java.util.Collection<java.lang.Throwable> exceptions)
DrawContextCollection 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.setRenderingExceptions in interface DrawContextexceptions - the Collection of exceptions to be used to accumulate rendering exceptions, or null to disable
accumulation of rendering exception.public void setStandardLightingModel(LightingModel standardLighting)
DrawContextsetStandardLightingModel in interface DrawContextstandardLighting - the lighting model to use for standard lighting, or null to disable standard lighting.public void setSurfaceGeometry(SectorGeometryList surfaceGeometry)
DrawContextsetSurfaceGeometry in interface DrawContextsurfaceGeometry - the surface geometry to make current. May be null, indicating no surface geometry.public void setTextRendererCache(TextRendererCache textRendererCache)
DrawContextsetTextRendererCache in interface DrawContexttextRendererCache - the context's text renderer cache.public final void setVerticalExaggeration(double verticalExaggeration)
DrawContextGlobe. A vertical exaggeration of 3 will create mountains and valleys which are three times as
high/deep as they really are.setVerticalExaggeration in interface DrawContextverticalExaggeration - the new vertical exaggeration.public final void setView(View view)
DrawContextView. 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.setView in interface DrawContextview - the enw Viewpublic void setViewportCenterPosition(Position viewportCenterPosition)
DrawContextsetViewportCenterPosition in interface DrawContextviewportCenterPosition - the geographic coordinates of the current viewport's center. May be null.public void setViewportCenterScreenPoint(java.awt.Point viewportCenterScreenPoint)
DrawContextsetViewportCenterScreenPoint in interface DrawContextviewportCenterScreenPoint - the screen-coordinate point of the current viewport's center.public final void setVisibleSector(Sector s)
DrawContextSector. The new visible sector must completely encompass the Sector which is
visible on the display.setVisibleSector in interface DrawContexts - the new visible Sector