Interface SurfaceObject
-
- All Superinterfaces:
AVList
,OrderedRenderable
,PreRenderable
,Renderable
,SurfaceRenderable
- All Known Subinterfaces:
SurfaceShape
- All Known Implementing Classes:
AbstractSurfaceObject
,AbstractSurfaceRenderable
,AbstractSurfaceShape
,AnalyticSurface.AnalyticSurfaceObject
,AnalyticSurface.ClampToGroundSurface
,AnalyticSurface.ShadowSurface
,DirectedSurfacePolyline
,KMLSurfacePolygonImpl
,SectorSelector.RegionShape
,SurfaceBox
,SurfaceCircle
,SurfaceEllipse
,SurfaceIcon
,SurfaceIcons
,SurfaceMultiPolygon
,SurfacePolygon
,SurfacePolygons
,SurfacePolyline
,SurfacePolylines
,SurfaceQuad
,SurfaceSector
,SurfaceSquare
,SurfaceText
public interface SurfaceObject extends OrderedRenderable, SurfaceRenderable, PreRenderable, AVList
Common interface for renderables that are drawn on the Globe's surface terrain, such asSurfaceShape
. SurfaceObject implements theRenderable
interface, so a surface object may be aggregated within any layer or within some arbitrary rendering code.SurfaceObjects automatically aggregate themselves in the DrawContext's ordered surface renderable queue by calling
DrawContext.addOrderedSurfaceRenderable(OrderedRenderable)
during the preRender, pick, and render stages. This enables SurfaceObjects to be processed in bulk, and reduces texture memory consumption by sharing rendering resources amongst multiple SurfaceObjects.Implementations of SurfaceObject require that
preRender(DrawContext)
is called beforeRenderable.render(DrawContext)
andpick(DrawContext, java.awt.Point)
, and that preRender is called at the appropriate stage in the current rendering cycle. Calling preRender locks in the SurfaceObject's visual appearance for any subsequent calls to pick or render until the next call preRender.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
getDelegateOwner()
Returns the delegate owner of the surface object.double
getDistanceFromEye()
Returns zero to indicate that the surface object's distance from the eye is unknown.Extent
getExtent(DrawContext dc)
Returns the surface object's enclosing volume as anExtent
in model coordinates, given a specifiedDrawContext
.boolean
isEnableBatchPicking()
Indicates whether batch picking is enabled.boolean
isVisible()
Indicates whether the surface object should be drawn during rendering.void
pick(DrawContext dc, java.awt.Point pickPoint)
Causes the surface object to draw a pickable representation of itself on the surface terrain, using the provided draw context.void
preRender(DrawContext dc)
Causes the surface object to prepare a representation of itself which can be drawn on the surface terrain, using the provided draw context.void
setDelegateOwner(java.lang.Object owner)
Specifies the delegate owner of the surface object.void
setEnableBatchPicking(boolean enable)
Specifies whether adjacent SurfaceObjects in the DrawContext's ordered surface renderable list may be rendered together during picking if they are contained in the same layer.void
setVisible(boolean visible)
Specifies whether the surface object should be drawn during rendering.-
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 gov.nasa.worldwind.render.Renderable
render
-
Methods inherited from interface gov.nasa.worldwind.render.SurfaceRenderable
getSectors, getStateKey
-
-
-
-
Method Detail
-
isVisible
boolean isVisible()
Indicates whether the surface object should be drawn during rendering.- Returns:
- true if the object is to be drawn, otherwise false.
-
setVisible
void setVisible(boolean visible)
Specifies whether the surface object should be drawn during rendering.- Parameters:
visible
- true if the object is to be drawn, otherwise false.
-
isEnableBatchPicking
boolean isEnableBatchPicking()
Indicates whether batch picking is enabled.- Returns:
true
to enable batch picking;false
otherwise.- See Also:
setEnableBatchPicking(boolean)
-
setEnableBatchPicking
void setEnableBatchPicking(boolean enable)
Specifies whether adjacent SurfaceObjects in the DrawContext's ordered surface renderable list may be rendered together during picking if they are contained in the same layer. This increases performance and there is seldom a reason to disable it.- Parameters:
enable
-true
to enable batch picking;false
otherwise.
-
getDistanceFromEye
double getDistanceFromEye()
Returns zero to indicate that the surface object's distance from the eye is unknown. SurfaceObjects are processed on the DrawContext's ordered surface renderable queue. Ordered surface renderables do not utilize the renderable's distance from the eye to determine draw order.- Specified by:
getDistanceFromEye
in interfaceOrderedRenderable
- Returns:
- zero, to indicate that the object's distance from the eye is unknown.
-
getDelegateOwner
java.lang.Object getDelegateOwner()
Returns the delegate owner of the surface object. If non-null, the returned object replaces the surface object as the pickable object returned during picking. If null, the surface object itself is the pickable object returned during picking.- Returns:
- the object used as the pickable object returned during picking, or null to indicate the the surface object is returned during picking.
-
setDelegateOwner
void setDelegateOwner(java.lang.Object owner)
Specifies the delegate owner of the surface object. If non-null, the delegate owner replaces the surface object as the pickable object returned during picking. If null, the surface object itself is the pickable object returned during picking.- Parameters:
owner
- the object to use as the pickable object returned during picking, or null to return the surface object.
-
getExtent
Extent getExtent(DrawContext dc)
Returns the surface object's enclosing volume as anExtent
in model coordinates, given a specifiedDrawContext
.- Parameters:
dc
- the current draw context.- Returns:
- the surface object's Extent in model coordinates.
- Throws:
java.lang.IllegalArgumentException
- if the draw context is null.
-
preRender
void preRender(DrawContext dc)
Causes the surface object to prepare a representation of itself which can be drawn on the surface terrain, using the provided draw context.- Specified by:
preRender
in interfacePreRenderable
- Parameters:
dc
- the current draw context.
-
pick
void pick(DrawContext dc, java.awt.Point pickPoint)
Causes the surface object to draw a pickable representation of itself on the surface terrain, using the provided draw context.- Specified by:
pick
in interfaceOrderedRenderable
- Parameters:
dc
- the current draw context.pickPoint
- the pick point.- Throws:
java.lang.IllegalArgumentException
- if the draw context is null.
-
-