public interface SurfaceObject extends OrderedRenderable, SurfaceRenderable, PreRenderable, AVList
SurfaceShape
. SurfaceObject implements the Renderable
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 before Renderable.render(DrawContext)
and pick(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.Modifier and Type | Method and 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 an
Extent in model coordinates,
given a specified DrawContext . |
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.
|
getSectors, getStateKey
render
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
java.lang.Object getDelegateOwner()
double getDistanceFromEye()
getDistanceFromEye
in interface OrderedRenderable
Extent getExtent(DrawContext dc)
Extent
in model coordinates,
given a specified DrawContext
.dc
- the current draw context.java.lang.IllegalArgumentException
- if the draw context is null.boolean isEnableBatchPicking()
true
to enable batch picking; false
otherwise.setEnableBatchPicking(boolean)
boolean isVisible()
void pick(DrawContext dc, java.awt.Point pickPoint)
pick
in interface OrderedRenderable
dc
- the current draw context.pickPoint
- the pick point.java.lang.IllegalArgumentException
- if the draw context is null.void preRender(DrawContext dc)
preRender
in interface PreRenderable
dc
- the current draw context.void setDelegateOwner(java.lang.Object owner)
owner
- the object to use as the pickable object returned during picking, or null to return the surface
object.void setEnableBatchPicking(boolean enable)
enable
- true
to enable batch picking; false
otherwise.void setVisible(boolean visible)
visible
- true if the object is to be drawn, otherwise false.