Class AbstractSceneController

    • Field Detail

      • model

        protected Model model
      • view

        protected View view
      • verticalExaggeration

        protected double verticalExaggeration
      • lastPickedObjects

        protected PickedObjectList lastPickedObjects
        The list of picked objects at the current pick point. This list is computed during each call to repaint. Initially null.
      • lastObjectsInPickRect

        protected PickedObjectList lastObjectsInPickRect
        The list of picked objects that intersect the current pick rectangle. This list is computed during each call to repaint. Initially null.
      • frame

        protected long frame
      • timebase

        protected long timebase
      • framesPerSecond

        protected double framesPerSecond
      • frameTime

        protected double frameTime
      • pickTime

        protected double pickTime
      • pickPoint

        protected java.awt.Point pickPoint
        The pick point in AWT screen coordinates, or null if the pick point is disabled. Initially null.
      • pickRect

        protected java.awt.Rectangle pickRect
        The pick rectangle in AWT screen coordinates, or null if the pick rectangle is disabled. Initially null.
      • deepPick

        protected boolean deepPick
      • perFrameStatisticsKeys

        protected java.util.Set<java.lang.String> perFrameStatisticsKeys
      • renderingExceptions

        protected java.util.Collection<java.lang.Throwable> renderingExceptions
      • pickPoints

        protected java.util.ArrayList<java.awt.Point> pickPoints
      • surfaceObjectTileBuilder

        protected SurfaceObjectTileBuilder surfaceObjectTileBuilder
        Support class used to build the composite representation of surface objects as a list of SurfaceTiles. We keep a reference to the tile builder instance used to build tiles because it acts as a cache key to the tiles and determines when the tiles must be updated. The tile builder does not retain any references the SurfaceObjects, so keeping a reference to it does not leak memory.
      • SURFACE_OBJECT_TILE_COUNT_NAME

        protected static final java.lang.String SURFACE_OBJECT_TILE_COUNT_NAME
        The display name for the surface object tile count performance statistic.
        See Also:
        Constant Field Values
      • deferOrderedRendering

        protected boolean deferOrderedRendering
    • Constructor Detail

      • AbstractSceneController

        public AbstractSceneController()
    • Method Detail

      • dispose

        public void dispose()
        Releases resources associated with this scene controller.
        Specified by:
        dispose in interface Disposable
      • getModel

        public Model getModel()
        Description copied from interface: SceneController
        Indicates the scene controller's model. This returns null if the scene controller has no model.
        Specified by:
        getModel in interface SceneController
        Returns:
        the scene controller's model, or null if the scene controller has no model.
      • setModel

        public void setModel​(Model model)
        Description copied from interface: SceneController
        Specifies the scene controller's model. This method fires an AVKey.MODEL property change event.
        Specified by:
        setModel in interface SceneController
        Parameters:
        model - the scene controller's model.
      • setVerticalExaggeration

        public void setVerticalExaggeration​(double verticalExaggeration)
        Description copied from interface: SceneController
        Specifies the exaggeration to apply to elevation values of terrain and other displayed items.
        Specified by:
        setVerticalExaggeration in interface SceneController
        Parameters:
        verticalExaggeration - the vertical exaggeration to apply.
      • getVerticalExaggeration

        public double getVerticalExaggeration()
        Description copied from interface: SceneController
        Indicates the current vertical exaggeration.
        Specified by:
        getVerticalExaggeration in interface SceneController
        Returns:
        the current vertical exaggeration.
      • setPickPoint

        public 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. 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.

        Specified by:
        setPickPoint in interface SceneController
        Parameters:
        pickPoint - the current pick point, or null.
      • setPickRectangle

        public 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. 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.

        Specified by:
        setPickRectangle in interface SceneController
        Parameters:
        pickRect - the current pick rectangle, or null.
      • getPickedObjectList

        public PickedObjectList getPickedObjectList()
        Returns the list of picked objects at the current pick point. The returned list is computed during the most recent call to repaint.
        Specified by:
        getPickedObjectList in interface SceneController
        Returns:
        the list of picked objects at the pick point, or null if no objects are currently picked.
      • setPickedObjectList

        protected void setPickedObjectList​(PickedObjectList pol)
      • getObjectsInPickRectangle

        public PickedObjectList getObjectsInPickRectangle()
        Returns the list of picked objects that intersect the current pick rectangle. The returned list is computed during the most recent call to repaint.
        Specified by:
        getObjectsInPickRectangle in interface SceneController
        Returns:
        the list of picked objects intersecting the pick rectangle, or null if no objects are currently intersecting the rectangle.
      • setDeepPickEnabled

        public void setDeepPickEnabled​(boolean tf)
        Description copied from interface: SceneController
        Specifies whether all items under the cursor are identified during picking and within SelectEvents.
        Specified by:
        setDeepPickEnabled in interface SceneController
        Parameters:
        tf - true to identify all items under the cursor during picking, otherwise false.
      • isDeepPickEnabled

        public boolean isDeepPickEnabled()
        Description copied from interface: SceneController
        Indicates whether all items under the cursor are identified during picking and within SelectEvents.
        Specified by:
        isDeepPickEnabled in interface SceneController
        Returns:
        true if all items under the cursor are identified during picking, otherwise false.
      • getTerrain

        public SectorGeometryList getTerrain()
        Description copied from interface: SceneController
        Returns the terrain geometry used to draw the most recent frame. The geometry spans only the area most recently visible.
        Specified by:
        getTerrain in interface SceneController
        Returns:
        the terrain geometry used to draw the most recent frame. May be null.
      • getFramesPerSecond

        public double getFramesPerSecond()
        Description copied from interface: SceneController
        Returns the current average frames drawn per second. A frame is one repaint of the window and includes a pick pass and a render pass.
        Specified by:
        getFramesPerSecond in interface SceneController
        Returns:
        the current average number of frames drawn per second.
      • getFrameTime

        public double getFrameTime()
        Description copied from interface: SceneController
        Returns the per-frame timestamp.
        Specified by:
        getFrameTime in interface SceneController
        Returns:
        the per-frame timestamp, in milliseconds.
      • setPerFrameStatisticsKeys

        public void setPerFrameStatisticsKeys​(java.util.Set<java.lang.String> keys)
        Description copied from interface: SceneController
        Specifies the performance values to monitor. See PerformanceStatistic for the available keys.
        Specified by:
        setPerFrameStatisticsKeys in interface SceneController
        Parameters:
        keys - the performance statistic keys to monitor.
      • getRenderingExceptions

        public java.util.Collection<java.lang.Throwable> getRenderingExceptions()
        Description copied from interface: SceneController
        Returns the rendering exceptions accumulated by this SceneController during the last frame as a Collection of Throwable objects.
        Specified by:
        getRenderingExceptions in interface SceneController
        Returns:
        the Collection of accumulated rendering exceptions.
      • getClutterFilter

        public ClutterFilter getClutterFilter()
        Description copied from interface: SceneController
        Returns the current clutter filter.
        Specified by:
        getClutterFilter in interface SceneController
        Returns:
        the current clutter filter. May be null, in which case decluttering is not performed.
      • setClutterFilter

        public void setClutterFilter​(ClutterFilter clutterFilter)
        Description copied from interface: SceneController
        Specifies the clutter filter to use.
        Specified by:
        setClutterFilter in interface SceneController
        Parameters:
        clutterFilter - the clutter filter to use. May be null to indicate no decluttering.
      • isDeferOrderedRendering

        public boolean isDeferOrderedRendering()
      • setDeferOrderedRendering

        public void setDeferOrderedRendering​(boolean deferOrderedRendering)
      • repaint

        public int repaint()
        Description copied from interface: SceneController
        Cause the window to regenerate the frame, including pick resolution.
        Specified by:
        repaint in interface SceneController
        Returns:
        if greater than zero, the window should be automatically repainted again at the indicated number of milliseconds from this method's return.
      • doRepaint

        protected abstract void doRepaint​(DrawContext dc)
      • initializeDrawContext

        protected void initializeDrawContext​(DrawContext dc)
      • getViewportCenter

        protected java.awt.Point getViewportCenter​(DrawContext dc)
      • initializeFrame

        protected void initializeFrame​(DrawContext dc)
      • clearFrame

        protected void clearFrame​(DrawContext dc)
      • finalizeFrame

        protected void finalizeFrame​(DrawContext dc)
      • applyView

        protected void applyView​(DrawContext dc)
      • createPickFrustum

        protected void createPickFrustum​(DrawContext dc)
      • createTerrain

        protected void createTerrain​(DrawContext dc)
      • preRender

        protected void preRender​(DrawContext dc)
      • pickTerrain

        protected void pickTerrain​(DrawContext dc)
      • pickLayers

        protected void pickLayers​(DrawContext dc)
      • resolveTopPick

        protected void resolveTopPick​(DrawContext dc)
      • doResolveTopPick

        protected void doResolveTopPick​(DrawContext dc,
                                        java.awt.Point pickPoint)
      • doResolveTopPick

        protected void doResolveTopPick​(DrawContext dc,
                                        java.awt.Rectangle pickRect)
      • doNonTerrainPick

        protected void doNonTerrainPick​(DrawContext dc)
      • doDeepPick

        protected void doDeepPick​(DrawContext dc)
      • checkGLErrors

        protected void checkGLErrors​(DrawContext dc)
        Called to check for openGL errors. This method includes a "round-trip" between the application and renderer, which is slow. Therefore, this method is excluded from the "normal" render pass. It is here as a matter of convenience to developers, and is not part of the API.
        Parameters:
        dc - the relevant DrawContext
      • preRenderOrderedSurfaceRenderables

        protected void preRenderOrderedSurfaceRenderables​(DrawContext dc)
      • pickOrderedSurfaceRenderables

        protected void pickOrderedSurfaceRenderables​(DrawContext dc)
      • drawOrderedSurfaceRenderables

        protected void drawOrderedSurfaceRenderables​(DrawContext dc)
      • buildCompositeSurfaceObjects

        protected void buildCompositeSurfaceObjects​(DrawContext dc)
        Builds a composite representation for all 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.

        Parameters:
        dc - The drawing context containing the surface objects to build a composite representation for.
        See Also:
        DrawContext.getOrderedSurfaceRenderables()
      • drawCompositeSurfaceObjects

        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. 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.
        Parameters:
        dc - The drawing context containing the surface objects who's composite representation is drawn.