public abstract class AbstractSceneController extends WWObjectImpl implements SceneController
Modifier and Type | Field and Description |
---|---|
protected ClutterFilter |
clutterFilter |
protected DrawContext |
dc |
protected boolean |
deepPick |
protected boolean |
deferOrderedRendering |
protected long |
frame |
protected double |
framesPerSecond |
protected double |
frameTime |
protected GLRuntimeCapabilities |
glRuntimeCaps |
protected GpuResourceCache |
gpuResourceCache |
protected PickedObjectList |
lastObjectsInPickRect
The list of picked objects that intersect the current pick rectangle.
|
protected PickedObjectList |
lastPickedObjects
The list of picked objects at the current pick point.
|
protected Model |
model |
protected Collection<PerformanceStatistic> |
perFrameStatistics |
protected Set<String> |
perFrameStatisticsKeys |
protected Map<Integer,PickedObject> |
pickableObjects
Map of integer color codes to picked objects used to quickly resolve the top picked objects in
doResolveTopPick(gov.nasa.worldwind.render.DrawContext, java.awt.Rectangle) . |
protected Point |
pickPoint
The pick point in AWT screen coordinates, or
null if the pick point is disabled. |
protected ArrayList<Point> |
pickPoints |
protected Rectangle |
pickRect
The pick rectangle in AWT screen coordinates, or
null if the pick rectangle is disabled. |
protected double |
pickTime |
protected Collection<Throwable> |
renderingExceptions |
protected ScreenCreditController |
screenCreditController |
protected static String |
SURFACE_OBJECT_TILE_COUNT_NAME
The display name for the surface object tile count performance statistic.
|
protected SurfaceObjectTileBuilder |
surfaceObjectTileBuilder
Support class used to build the composite representation of surface objects as a list of SurfaceTiles.
|
protected TextRendererCache |
textRendererCache |
protected long |
timebase |
protected double |
verticalExaggeration |
protected View |
view |
Constructor and Description |
---|
AbstractSceneController() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyView(DrawContext dc) |
protected void |
buildCompositeSurfaceObjects(DrawContext dc)
Builds a composite representation for all
SurfaceObject instances in the draw
context's ordered surface renderable queue. |
protected void |
checkGLErrors(DrawContext dc)
Called to check for openGL errors.
|
protected void |
clearFrame(DrawContext dc) |
protected void |
createPickFrustum(DrawContext dc) |
protected void |
createTerrain(DrawContext dc) |
void |
dispose()
Releases resources associated with this scene controller.
|
protected void |
doDeepPick(DrawContext dc) |
protected void |
doNonTerrainPick(DrawContext dc) |
protected abstract void |
doRepaint(DrawContext dc) |
protected void |
doResolveTopPick(DrawContext dc,
Point pickPoint) |
protected void |
doResolveTopPick(DrawContext dc,
Rectangle pickRect) |
protected void |
draw(DrawContext dc) |
protected void |
drawCompositeSurfaceObjects(DrawContext dc)
Causes the scene controller to draw the composite representation of all
SurfaceObject instances in the draw context's ordered surface renderable queue. |
protected void |
drawOrderedSurfaceRenderables(DrawContext dc) |
protected void |
finalizeFrame(DrawContext dc) |
ClutterFilter |
getClutterFilter()
Returns the current clutter filter.
|
DrawContext |
getDrawContext()
Returns the current draw context.
|
double |
getFramesPerSecond()
Returns the current average frames drawn per second.
|
double |
getFrameTime()
Returns the per-frame timestamp.
|
GLRuntimeCapabilities |
getGLRuntimeCapabilities()
Returns the
GLRuntimeCapabilities associated with this SceneController. |
GpuResourceCache |
getGpuResourceCache()
Returns this scene controller's GPU Resource cache.
|
Model |
getModel()
Indicates the scene controller's model.
|
PickedObjectList |
getObjectsInPickRectangle()
Returns the list of picked objects that intersect the current pick rectangle.
|
Collection<PerformanceStatistic> |
getPerFrameStatistics()
Returns the current per-frame statistics.
|
PickedObjectList |
getPickedObjectList()
Returns the list of picked objects at the current pick point.
|
Point |
getPickPoint()
Returns the current pick point in AWT screen coordinates.
|
Rectangle |
getPickRectangle()
Returns the current pick rectangle in AWT screen coordinates.
|
Collection<Throwable> |
getRenderingExceptions()
Returns the rendering exceptions accumulated by this SceneController during the last frame as a
Collection of Throwable objects. |
ScreenCreditController |
getScreenCreditController()
Returns the current screen credit controller.
|
SectorGeometryList |
getTerrain()
Returns the terrain geometry used to draw the most recent frame.
|
TextRendererCache |
getTextRendererCache() |
double |
getVerticalExaggeration()
Indicates the current vertical exaggeration.
|
View |
getView()
Returns the current view.
|
protected Point |
getViewportCenter(DrawContext dc) |
protected void |
initializeDrawContext(DrawContext dc) |
protected void |
initializeFrame(DrawContext dc) |
boolean |
isDeepPickEnabled()
Indicates whether all items under the cursor are identified during picking and within
SelectEvent s. |
boolean |
isDeferOrderedRendering() |
protected PickedObjectList |
mergePickedObjectLists(PickedObjectList listA,
PickedObjectList listB) |
protected void |
pick(DrawContext dc) |
protected void |
pickLayers(DrawContext dc) |
protected void |
pickOrderedSurfaceRenderables(DrawContext dc) |
protected void |
pickTerrain(DrawContext dc) |
protected void |
preRender(DrawContext dc) |
protected void |
preRenderOrderedSurfaceRenderables(DrawContext dc) |
void |
reinitialize()
Reinitializes the scene controller.
|
int |
repaint()
Cause the window to regenerate the frame, including pick resolution.
|
protected void |
resolveTopPick(DrawContext dc) |
void |
setClutterFilter(ClutterFilter clutterFilter)
Specifies the clutter filter to use.
|
void |
setDeepPickEnabled(boolean tf)
Specifies whether all items under the cursor are identified during picking and within
SelectEvent s. |
void |
setDeferOrderedRendering(boolean deferOrderedRendering) |
void |
setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
Sets the
GLRuntimeCapabilities associated with this SceneController to the specified parameter. |
void |
setGpuResourceCache(GpuResourceCache gpuResourceCache)
Specifies the GPU Resource cache to use.
|
void |
setModel(Model model)
Specifies the scene controller's model.
|
void |
setPerFrameStatisticsKeys(Set<String> keys)
Specifies the performance values to monitor.
|
protected void |
setPickedObjectList(PickedObjectList pol) |
void |
setPickPoint(Point pickPoint)
Specifies the current pick point in AWT screen coordinates, or
null to indicate that there is no
pick point. |
void |
setPickRectangle(Rectangle pickRect)
Specifies the current pick rectangle in AWT screen coordinates, or
null to indicate that there is no
pick rectangle. |
void |
setScreenCreditController(ScreenCreditController screenCreditController)
Specifies the
ScreenCreditController to use for displaying screen credits for
the model of this screen controller. |
void |
setVerticalExaggeration(double verticalExaggeration)
Specifies the exaggeration to apply to elevation values of terrain and other displayed items.
|
void |
setView(View view)
Sets the current view.
|
onMessage, propertyChange
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
propertyChange
onMessage
protected ClutterFilter clutterFilter
protected DrawContext dc
protected boolean deepPick
protected boolean deferOrderedRendering
protected long frame
protected double framesPerSecond
protected double frameTime
protected GLRuntimeCapabilities glRuntimeCaps
protected GpuResourceCache gpuResourceCache
protected PickedObjectList lastObjectsInPickRect
null
.protected PickedObjectList lastPickedObjects
null
.protected Model model
protected Collection<PerformanceStatistic> perFrameStatistics
protected Map<Integer,PickedObject> pickableObjects
doResolveTopPick(gov.nasa.worldwind.render.DrawContext, java.awt.Rectangle)
. This map is used only when a pick
rectangle is specified. Initialized to a new HashMap.protected Point pickPoint
null
if the pick point is disabled. Initially
null
.protected Rectangle pickRect
null
if the pick rectangle is disabled. Initially
null
.protected double pickTime
protected Collection<Throwable> renderingExceptions
protected ScreenCreditController screenCreditController
protected static final String SURFACE_OBJECT_TILE_COUNT_NAME
protected SurfaceObjectTileBuilder surfaceObjectTileBuilder
protected TextRendererCache textRendererCache
protected long timebase
protected double verticalExaggeration
protected View view
protected void applyView(DrawContext dc)
protected void buildCompositeSurfaceObjects(DrawContext dc)
SurfaceObject
instances in the draw
context's ordered surface renderable queue. While building the composite representation this invokes Renderable.render(gov.nasa.worldwind.render.DrawContext)
in ordered rendering mode.
This does nothing if the ordered surface renderable queue is empty, or if it does not contain any
SurfaceObjects.
This method is called during the preRender phase, and is therefore free to modify the framebuffer contents to
create the composite representation.dc
- The drawing context containing the surface objects to build a composite representation for.DrawContext.getOrderedSurfaceRenderables()
protected void checkGLErrors(DrawContext dc)
dc
- the relevant DrawContext
protected void clearFrame(DrawContext dc)
protected void createPickFrustum(DrawContext dc)
protected void createTerrain(DrawContext dc)
public void dispose()
dispose
in interface Disposable
protected void doDeepPick(DrawContext dc)
protected void doNonTerrainPick(DrawContext dc)
protected abstract void doRepaint(DrawContext dc)
protected void doResolveTopPick(DrawContext dc, Point pickPoint)
protected void doResolveTopPick(DrawContext dc, Rectangle pickRect)
protected void draw(DrawContext dc)
protected void drawCompositeSurfaceObjects(DrawContext dc)
SurfaceObject
instances in the draw context's ordered surface renderable queue. This
representation was built during the preRender phase. This does nothing if the ordered surface renderable queue is
empty, or if it does not contain any SurfaceObjects.dc
- The drawing context containing the surface objects who's composite representation is drawn.protected void drawOrderedSurfaceRenderables(DrawContext dc)
protected void finalizeFrame(DrawContext dc)
public ClutterFilter getClutterFilter()
SceneController
getClutterFilter
in interface SceneController
public DrawContext getDrawContext()
SceneController
getDrawContext
in interface SceneController
public double getFramesPerSecond()
SceneController
getFramesPerSecond
in interface SceneController
public double getFrameTime()
SceneController
getFrameTime
in interface SceneController
public GLRuntimeCapabilities getGLRuntimeCapabilities()
GLRuntimeCapabilities
associated with this SceneController.getGLRuntimeCapabilities
in interface SceneController
public GpuResourceCache getGpuResourceCache()
SceneController
getGpuResourceCache
in interface SceneController
public Model getModel()
SceneController
null
if the scene controller has no model.getModel
in interface SceneController
null
if the scene controller has no model.public PickedObjectList getObjectsInPickRectangle()
getObjectsInPickRectangle
in interface SceneController
public Collection<PerformanceStatistic> getPerFrameStatistics()
SceneController
getPerFrameStatistics
in interface SceneController
public PickedObjectList getPickedObjectList()
getPickedObjectList
in interface SceneController
public Point getPickPoint()
getPickPoint
in interface SceneController
null
if no pick point is current.SceneController.setPickPoint(java.awt.Point)
public Rectangle getPickRectangle()
getPickRectangle
in interface SceneController
null
if no pick rectangle is current.SceneController.setPickRectangle(java.awt.Rectangle)
public Collection<Throwable> getRenderingExceptions()
SceneController
Collection
of Throwable
objects.getRenderingExceptions
in interface SceneController
public ScreenCreditController getScreenCreditController()
SceneController
getScreenCreditController
in interface SceneController
SceneController.setScreenCreditController(gov.nasa.worldwind.render.ScreenCreditController)
public SectorGeometryList getTerrain()
SceneController
getTerrain
in interface SceneController
public TextRendererCache getTextRendererCache()
public double getVerticalExaggeration()
SceneController
getVerticalExaggeration
in interface SceneController
public View getView()
SceneController
AVKey.VIEW
property change
event.getView
in interface SceneController
protected Point getViewportCenter(DrawContext dc)
protected void initializeDrawContext(DrawContext dc)
protected void initializeFrame(DrawContext dc)
public boolean isDeepPickEnabled()
SceneController
SelectEvent
s.isDeepPickEnabled
in interface SceneController
public boolean isDeferOrderedRendering()
protected PickedObjectList mergePickedObjectLists(PickedObjectList listA, PickedObjectList listB)
protected void pick(DrawContext dc)
protected void pickLayers(DrawContext dc)
protected void pickOrderedSurfaceRenderables(DrawContext dc)
protected void pickTerrain(DrawContext dc)
protected void preRender(DrawContext dc)
protected void preRenderOrderedSurfaceRenderables(DrawContext dc)
public void reinitialize()
SceneController
reinitialize
in interface SceneController
public int repaint()
SceneController
repaint
in interface SceneController
protected void resolveTopPick(DrawContext dc)
public void setClutterFilter(ClutterFilter clutterFilter)
SceneController
setClutterFilter
in interface SceneController
clutterFilter
- the clutter filter to use. May be null to indicate no decluttering.public void setDeepPickEnabled(boolean tf)
SceneController
SelectEvent
s.setDeepPickEnabled
in interface SceneController
tf
- true to identify all items under the cursor during picking, otherwise false.public void setDeferOrderedRendering(boolean deferOrderedRendering)
public void setGLRuntimeCapabilities(GLRuntimeCapabilities capabilities)
GLRuntimeCapabilities
associated with this SceneController to the specified parameter.setGLRuntimeCapabilities
in interface SceneController
capabilities
- the GLRuntimeCapabilities to be associated with this SceneController.public void setGpuResourceCache(GpuResourceCache gpuResourceCache)
SceneController
setGpuResourceCache
in interface SceneController
gpuResourceCache
- the texture cache.public void setModel(Model model)
SceneController
AVKey.MODEL
property change event.setModel
in interface SceneController
model
- the scene controller's model.public void setPerFrameStatisticsKeys(Set<String> keys)
SceneController
PerformanceStatistic
for the
available keys.setPerFrameStatisticsKeys
in interface SceneController
keys
- the performance statistic keys to monitor.protected void setPickedObjectList(PickedObjectList pol)
public void setPickPoint(Point pickPoint)
null
to indicate that there is no
pick point. Each frame, this scene controller determines which objects are drawn at the pick point and places
them in a PickedObjectList. This list can be accessed by calling SceneController.getPickedObjectList()
.
If the pick point is null
, this scene controller ignores the pick point and the list of objects
returned by getPickedObjectList is empty.setPickPoint
in interface SceneController
pickPoint
- the current pick point, or null
.public void setPickRectangle(Rectangle pickRect)
null
to indicate that there is no
pick rectangle. Each frame, this scene controller determines which objects intersect the pick rectangle and
places them in a PickedObjectList. This list can be accessed by calling SceneController.getObjectsInPickRectangle()
.
If the pick rectangle is null
, this scene controller ignores the pick rectangle and the list of
objects returned by getObjectsInPickRectangle is empty.setPickRectangle
in interface SceneController
pickRect
- the current pick rectangle, or null
.public void setScreenCreditController(ScreenCreditController screenCreditController)
SceneController
ScreenCreditController
to use for displaying screen credits for
the model of this screen controller.setScreenCreditController
in interface SceneController
screenCreditController
- the screen credit controller. May be null, in which case screen credits are not
displayed.public void setVerticalExaggeration(double verticalExaggeration)
SceneController
setVerticalExaggeration
in interface SceneController
verticalExaggeration
- the vertical exaggeration to apply.public void setView(View view)
SceneController
setView
in interface SceneController
view
- the view.