Class SceneView

  • All Implemented Interfaces:
    SceneViewNavigation, Styleable, EventTarget, Skinnable

    public final class SceneView
    extends GeoView
    implements SceneViewNavigation
    A SceneView renders data from an ArcGISScene in 3-dimensional space and allows users to interact with the scene. In an MVC architecture, a SceneView represents the view and an ArcGISScene represents the model. This class must only be created and used on the UI thread.
     ArcGISScene scene = new ArcGISScene(Basemap.createImagery());
     SceneView sceneView = new SceneView();
     sceneView.setArcGISScene(scene);
     
    Since:
    100.0.0
    See Also:
    ArcGISScene
    • Constructor Detail

      • SceneView

        public SceneView()
        Creates a new scene view
        Since:
        100.0.0
    • Method Detail

      • setArcGISScene

        public void setArcGISScene​(ArcGISScene scene)
        Sets the ArcGISScene to be displayed in this view. Null is allowed.
        Parameters:
        scene - the new ArcGISScene
        Since:
        100.0.0
      • getArcGISScene

        public ArcGISScene getArcGISScene()
        Gets the ArcGISScene displayed in this view.
        Returns:
        the ArcGISScene
        Since:
        100.0.0
      • setViewpointCameraAsync

        public ListenableFuture<Boolean> setViewpointCameraAsync​(Camera camera)
        Sets the viewpoint asynchronously, based on the given camera.
        Parameters:
        camera - the new viewpoint camera
        Returns:
        a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
        Throws:
        IllegalArgumentException - if the camera is null
        Since:
        100.0.0
      • setViewpointCameraAsync

        public ListenableFuture<Boolean> setViewpointCameraAsync​(Camera camera,
                                                                 float durationSeconds)
        Sets the viewpoint camera asynchronously with a specified animation duration.
        Parameters:
        camera - the new viewpoint camera
        durationSeconds - the duration seconds
        Returns:
        a ListenableFuture. Add a listener to this to know when the viewpoint has finished animating. The result of the future indicates if the operation completed successfully or not.
        Throws:
        IllegalArgumentException - if the camera is null
        Since:
        100.0.0
      • getSpatialReference

        public SpatialReference getSpatialReference()
        Gets the spatial reference.
        Specified by:
        getSpatialReference in class GeoView
        Returns:
        the spatial reference, null if the ArcGISScene is null
        Since:
        100.0.0
      • setAmbientLightColor

        public void setAmbientLightColor​(int color)
        Sets the color of the ambient light.
        Parameters:
        color - the color of the ambient light, in 0xAARRGGBB format
        Since:
        100.0.0
      • getAmbientLightColor

        public int getAmbientLightColor()
        Returns the color of the ambient light. Default is 0.
        Returns:
        the color of the ambient light, in 0xAARRGGBB format
        Since:
        100.0.0
      • setAtmosphereEffect

        public void setAtmosphereEffect​(AtmosphereEffect atmosphereEffect)
        Sets the effect to be applied to the scene view's atmosphere.
        Parameters:
        atmosphereEffect - the atmosphere effect
        Throws:
        IllegalArgumentException - if atmosphereEffect is null
        Since:
        100.0.0
      • getAtmosphereEffect

        public AtmosphereEffect getAtmosphereEffect()
        Returns the atmosphere effect on the scene view. The default value is AtmosphereEffect.HORIZON_ONLY.
        Returns:
        the atmosphere effect on the scene view
        Since:
        100.0.0
      • getSunTime

        public Calendar getSunTime()
        Returns the time that indicates the position of the Sun. Default is Fri Sep 22 2000 12:00:00 GMT+0000.
        Returns:
        the time that indicates the position of the Sun
        Since:
        100.0.0
      • setSunLighting

        public void setSunLighting​(LightingMode lightingMode)
        Sets the type of sun lighting to be applied to the scene view. For example, this can be used to control whether the shadows of terrain and 3D models are cast.
        Parameters:
        lightingMode - the lighting mode to be applied for this scene view
        Throws:
        IllegalArgumentException - if lightingMode is null
        Since:
        100.0.0
        See Also:
        setSunTime(java.util.Calendar)
      • getSunLighting

        public LightingMode getSunLighting()
        Returns the type of Sun lighting applied to the scene view. Default is LightingMode.NO_LIGHT.
        Returns:
        the type of Sun lighting
        Since:
        100.0.0
      • screenToBaseSurface

        public Point screenToBaseSurface​(Point2D screenPoint)
        Returns the scene location of a point in JavaFX local coordinates on the base surface i.e. ignoring any elevation.
        Specified by:
        screenToBaseSurface in interface SceneViewNavigation
        Parameters:
        screenPoint - the JavaFX local coordinates
        Returns:
        the scene location on the base surface
        Throws:
        IllegalArgumentException - if screenPoint is null
        Since:
        100.0.0
      • screenToLocationAsync

        public ListenableFuture<Point> screenToLocationAsync​(Point2D screenPoint)
        Asynchronously converts a screen coordinate to a location coordinate in the spatial reference of the scene view. This method will wait for the next drawing cycle to get the exact point (location coordinate) from the graphic card that is at this JavaFX local coordinate (screen coordinate). That could be on the surface, on a building, or on a feature, e.g. aircraft.

        This is a high performance calculation executed on the GPU using a triangular mesh. Note that elevation values are approximated, and as the distance between the camera and the surface increases, the precision of the elevation value decreases.

        Parameters:
        screenPoint - the JavaFX local coordinates
        Returns:
        a ListenableFuture. Add a listener to this to know when the result is ready. The result of the future is the location of the screen point.
        Throws:
        IllegalArgumentException - if screenPoint is null
        Since:
        100.0.0
      • getCameraController

        public CameraController getCameraController()
        Gets the current camera controller. The default is an instance of GlobeCameraController.
        Returns:
        the current camera controller
        Since:
        100.1.0
      • getAnalysisOverlays

        public ListenableList<AnalysisOverlay> getAnalysisOverlays()
        Gets a modifiable list of the analysis overlays. Add or remove analysis overlays from this list to modify what is displayed. The list returned can be empty but not null. You can add listeners to this list to monitor changes to the list.

        An analysis overlay can only be in the list once.

        Returns:
        the analysis overlays
        Since:
        100.2.0
      • getSpaceEffect

        public SpaceEffect getSpaceEffect()
        Gets the space effect on the scene view. The default value is SpaceEffect.STARS.
        Returns:
        the space effect on the scene view
        Since:
        100.6.0
      • setSpaceEffect

        public void setSpaceEffect​(SpaceEffect spaceEffect)
        Sets the effect to be applied to the scene view's background.
        Parameters:
        spaceEffect - the space effect
        Throws:
        IllegalArgumentException - if spaceEffect is null
        Since:
        100.6.0
      • getImageOverlays

        public List<ImageOverlay> getImageOverlays()
        Gets a modifiable list of overlays for displaying images in the scene view.

        An image overlay collection cannot belong to more than one SceneView. If the collection contains multiple image overlays, they display in the order in which they were added to the collection. So the first overlay in the collection (at index 0) displays at the bottom and each one that follows displays on top of the previous ones. If the SceneView also has a GraphicsOverlay, it displays on top of the ImageOverlay.

        Returns:
        the image overlays
        Since:
        100.8.0