SceneView QML Type

Scene."> SceneView QML Type | ArcGISQtQml
  • Esri.ArcGISRuntime
  • SceneView
  • A user interface control that displays three-dimensional (3D) geographic content defined by a Scene. More...

    Import Statement: import Esri.ArcGISRuntime
    Since: Esri.ArcGISRuntime 100.0
    Inherits:

    GeoView

    Properties

    Signals

    Methods

    Detailed Description

    To display a Scene, add a SceneView control to your app and assign the scene to it. This loads the scene, its Surface, Basemap and collection of operational layers, and displays their content on screen.

    User interactions such as pan, zoom, tilt, rotate, and identify or selection are supported in the SceneView using touch, mouse, keyboard or pen/pencil. If required, you can override keys, clicks, and gestures to provide a specific user experience.

    The visible area of the SceneView is represented by the Viewpoint. It is determined by a Camera object and a CameraController is used to enable or constrain user interaction. To zoom to a specific visible area, pass a Viewpoint to the SceneView::setViewpointCamera method. You can also zoom to the Viewpoint specified by the camera.

    To determine the current visible area, call GeoView::currentViewpointExtent. Make sure that any user-initiated or programmatic navigation is complete before getting the current Viewpoint by calling GeoView::navigating.

    In an MVC architecture, this class represents the View tier. The Model tier is represented by the Scene object which provides a collection of operational layers, a Basemap, and a Surface. A Layer provides a visual representation of geographic information and comes in many forms. The types of layers that are displayed in a SceneView are three-dimensional in nature; meaning they are displayed in X/Y/Z coordinate space.

    Example:

    Display a Scene with the World Imagery basemap and the World Elevation surface in a SceneView:

    // Create a scene view
    SceneView {
        anchors.fill: parent
    
        Component.onCompleted: {
            // Set the focus on SceneView to initially enable keyboard navigation
            forceActiveFocus();
    
            // set viewpoint to the specified camera
            setViewpointCameraAndWait(camera);
        }
    
        // create a scene...scene is a default property of sceneview
        // and thus will get added to the sceneview
        Scene {
            // add a basemap
            Basemap {
                initStyle: Enums.BasemapStyleArcGISImagery
            }
    
            // add a surface...surface is a default property of scene
            Surface {
                // add an arcgis tiled elevation source...elevation source is a default property of surface
                ArcGISTiledElevationSource {
                    url: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
                }
            }
        }
    }

    See also Cancelable, Scene, and GeoView.

    Property Documentation

    [since Esri.ArcGISRuntime 100.1] ambientLightColor : color

    The color of the scene view's ambient light.

    The ambient light is visible if the SceneView::sunLighting is set to LightingModeLight or LightAndShadows.

    This property was introduced in Esri.ArcGISRuntime 100.1.


    [read-only, since Esri.ArcGISRuntime 100.2] analysisOverlays : AnalysisOverlayListModel

    Gets the list of analysis overlays that render the results of 3D visual analysis on the scene view.

    Dynamic 3D analyses, such as LineOfSight and Viewshed, generate visual results that are rendered on the scene view. To display the results, add the Analysis to a collection of AnalysisOverlay::analyses and then add the AnalysisOverlay to the collection of SceneView::analysisOverlays.

    Note that the SceneView::analysisOverlays collection can be empty but is never null. It's created for a specific SceneView so you can't reuse an AnalysisOverlay collection from another SceneView. Each AnalysisOverlay can only exist in one SceneView::analysisOverlays collection.

    This property was introduced in Esri.ArcGISRuntime 100.2.


    atmosphereEffect : Enums.AtmosphereEffect

    The effect applied to the scene's atmosphere.

    The default value is Enum.AtmosphereEffectHorizonOnly

    See also Enums.AtmosphereEffect.


    cameraController : CameraController

    The camera controller manages the position, orientation, and movement of the camera for a SceneView.

    The controller handles user-interaction with the SceneView and updates the Camera. You can assign a CameraController with a specific navigation mode that is free roaming, following a moving target, fixed on a stationary target, or that supports AR transformation matrices. For more information, see CameraController.


    [read-only] currentViewpointCamera : Camera

    Returns the camera that displays the current viewpoint (read-only).

    The Camera determines at what position and angle the scene is viewed.


    [since Esri.ArcGISRuntime 100.6] fieldOfView : double

    The horizontal field of view of the scene view in degrees (read-only).

    The value of the field of view is influenced by the size and orientation of the device screen. A landscape orientation has a larger field of view value than a portrait orientation.

    This value must be between 0 and 120.

    The default value is 45.0.

    This property was introduced in Esri.ArcGISRuntime 100.6.


    [read-only, since Esri.ArcGISRuntime 100.6] fieldOfViewDistortionRatio : double

    The field of view on the scene view in degrees and determines how much the vertical field of view is distorted.

    A distortion ratio less than 1.0 will cause the visuals to be stretched taller in comparison to their width. A distortion ratio greater than 1.0 will cause the visuals to be shrunk shorter in comparison to their width.

    The default value is 1.0.

    This property was introduced in Esri.ArcGISRuntime 100.6.


    [read-only, since Esri.ArcGISRuntime 100.8] imageOverlays : ImageOverlayListModel

    A collection of overlays for displaying images in the scene view.

    A collection of overlays for displaying images in the scene view.

    An image overlay collection cannot belong to more that 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.

    This property was introduced in Esri.ArcGISRuntime 100.8.


    [since Esri.ArcGISRuntime 100.6] manualRendering : bool

    Whether the SceneView is under manual rendering control.

    Note: manual rendering is only supported on iOS and Android platforms.

    This property determines whether the SceneView will use manual rendering updates rather than the using this API's internal rendering mechanism.

    When this property is true, you must call renderFrame for any updates to be drawn on the screen. Calling renderFrame isn't necessary when this property is false. The default value is false.

    This property was introduced in Esri.ArcGISRuntime 100.6.

    See also renderFrame.


    [default] scene : Scene

    The scene that the SceneView is displaying.

    If you assign a Scene to a SceneView, the scene, its Surface, Basemap, and collection of operational layers automatically start to load. When loading completes, the layers and basemap are rendered over the Surface in the scene view.

    You can load a Scene into your app before you assign it to a SceneView. This is useful if you want to validate the content of a scene before you display it.

    Setting a non-loaded scene to a view starts the load process of the scene so the scene can be displayed once loaded.


    [since Esri.ArcGISRuntime 100.6] spaceEffect : Enums.SpaceEffect

    Sets the horizontal field of view of the scene view in degrees.

    The value of the field of view is influenced by the size and orientation of the device screen. A landscape orientation has a larger field of view value than a portrait orientation.

    This value must be between 0 and 120. If the value is outside the range, the field of view is not changed and an error "Invalid argument" is emitted.

    angle - The field of view on the scene view in degrees. This value must be greater than 0 and less than or equal to 120.

    This property was introduced in Esri.ArcGISRuntime 100.6.

    See also Enums.SpaceEffect.


    [since Esri.ArcGISRuntime 100.1] sunLighting : Enums.LightingMode

    The type of ambient sunlight and shadows in the scene view.

    LightingModeLight and LightingModeLightAndShadows display ambient light according to the specified SceneView::ambientLightColor. The default value is LightingModeNoLight.

    This property was introduced in Esri.ArcGISRuntime 100.1.

    See also Enums.LightingMode.


    [since Esri.ArcGISRuntime 100.1] sunTime : DateTime

    The Sun's position to simulate a specific time.

    The position of sunset, sunrise, and the night-time area of darkness are visible in the scene view as calculated from the SceneView::sunTime value. These lighting effects are visible if you have set the SceneView::sunLighting modes of LightingModeLight and LightingModeLightAndShadows. The default value is Fri Sep 22 2000 12:00:00 GMT+0000.

    You can simulate the Sun's position relative to the Earth to be as it would at a specific date and time.

    The default time of the simulation is September 22, 2000 at noon GMT.

    This property was introduced in Esri.ArcGISRuntime 100.1.


    Signal Documentation

    ambientLightColorChanged()

    Emitted when the ambientLightColor property changes.

    Note: The corresponding handler is onAmbientLightColorChanged.


    atmosphereEffectChanged()

    Emitted when the atmosphereEffect property for the scene view changes.

    Note: The corresponding handler is onAtmosphereEffectChanged.


    [since Esri.ArcGISRuntime 100.1] cameraControllerChanged()

    Emitted when the cameraController property changes.

    Note: The corresponding handler is onCameraControllerChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.1.


    currentViewpointCameraChanged()

    Emitted when the currentViewpointCamera property changes.

    Note: The corresponding handler is onCurrentViewpointCameraChanged.


    [since Esri.ArcGISRuntime 100.6] fieldOfViewChanged()

    Emitted when the fieldOfView property changes or when the functions setFieldOfViewAndDistortionRatio or setFieldOfViewFromLensIntrinsics are called.

    Note: The corresponding handler is onFieldOfViewChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.6.


    [since Esri.ArcGISRuntime 100.6] fieldOfViewDistortionRatioChanged()

    Emitted when the functions setFieldOfViewAndDistortionRatio or setFieldOfViewFromLensIntrinsics are called.

    Note: The corresponding handler is onFieldOfViewDistortionRatioChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.6.


    [since Esri.ArcGISRuntime 100.8] imageOverlaysChanged()

    Emitted when the imageOverlays property changes.

    Note: The corresponding handler is onImageOverlaysChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.8.


    [since Esri.ArcGISRuntime 100.6] manualRenderingChanged()

    Emitted when the manualRendering property changes.

    Note: The corresponding handler is onManualRenderingChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.6.


    sceneChanged()

    Emitted when the scene for the scene view changes.

    Note: The corresponding handler is onSceneChanged.


    screenToLocationCompleted(Point location)

    Emitted when the screenToLocation operation has finished.

    • location - The location on the scene view.

    Note: The corresponding handler is onScreenToLocationCompleted.


    setViewpointCameraCompleted(bool succeeded)

    Emitted when any of the setViewpointCamera functions have finished.

    • succeeded - Whether the viewpoint camera was successfully set.

    Note: The corresponding handler is onSetViewpointCameraCompleted.


    [since Esri.ArcGISRuntime 100.6] spaceEffectChanged()

    Emitted when the spaceEffect property changes.

    Note: The corresponding handler is onSpaceEffectChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.6.


    sunLightingChanged()

    Emitted when the sunLighting property changes.

    Note: The corresponding handler is onSunLightingChanged.


    sunTimeChanged()

    Emitted when the sunTime property changes.

    Note: The corresponding handler is onSunTimeChanged.


    Method Documentation

    LocationToScreenResult locationToScreen(Point scenePoint)

    Converts a location in map coordinates to a point in screen coordinates relative to the upper-left corner of the scene view.

    • scenePoint - A location defined within the spatial reference of the scene view.

    The screen coordinates are in device-independent pixels (DIP) relative to the upper-left corner of the scene view at position 0,0. The LocationToScreenResult indicates whether the screen coordinates are visible in the scene view. They can be invisible if they are on the other side of the globe, not in the Viewpoint, or are blocked by the base surface or elevation layer.

    To call this method, assign a scene to the scene view, ensure that it is loaded and the draw status is Enums.DrawStatusCompleted.


    [since Esri.ArcGISRuntime 100.6] void renderFrame()

    Manually render the current frame.

    Note: manual rendering (along with this method) is only supported on iOS and Android platforms.

    This call will block the caller until the latest changes have been rendered to the screen.

    This method may be called from any thread.

    In certain situations you may be able to achieve better rendering performance by utilizing the single-threaded renderer. This is already the default setting on some platforms.

    // use the environment variable to use the "basic" rendering loop
    // for the Qt Quick Scene Graph
    // this C++ call should be placed in your startup code (probably main.cpp) as early
    // as possible
    qputenv("QSG_RENDER_LOOP", "basic");

    For more information, see here https://links.esri.com/qtquick-visualcanvas-scenegraph-rendering

    This method was introduced in Esri.ArcGISRuntime 100.6.

    See also manualRendering.


    Point screenToBaseSurface(double screenX, double screenY)

    Returns the x/y location on the map that corresponds to the provided screen coordinates.

    Converts the specified screen coordinate, relative to the upper-left corner of the scene view, to a location on the base surface in map coordinates.

    • screenX - The x screen coordinate.
    • screenY - The y screen coordinate.

    This method gets the x/y coordinates on the base surface that would be seen at the screen coordinates without regard for any features in the scene. Any features in the line of sight from the camera to the base surface are ignored. To convert this result into a 3D scene location, use the returned x/y coordinates with the z-value at that x/y location on the base surface.

    To call this method, assign a scene to the scene view, ensure that it is loaded and the draw status is Enums.DrawStatusCompleted.


    string screenToLocation(double screenX, double screenY)

    Asynchronously converts a screen coordinate relative to the upper-left corner of the scene view to a location in map coordinates.

    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.

    This method will wait for the next drawing cycle to get the exact point from the graphics card that is at the screen coordinate supplied. This location could be on the surface, a building, or a feature. To call this method, assign a scene to the scene view, ensure that it is loaded and the draw status is Enums.DrawStatusCompleted.

    • screenX - The screen's x-coordinate to convert to map coordinate.
    • screenY - The screen's y-coordinate to convert to map coordinate.

    Note: This operation could return an empty point (clicked outside the earth).

    See also Cancelable.


    [since Esri.ArcGISRuntime 100.6] void setFieldOfViewAndDistortionRatio(double angle, double distortionRatio)

    Sets the angle and the distortion factor.

    Set the field of view on the scene view in degrees and determines how much the vertical field of view is distorted. A distortion factor of 1.0 is default. A distortion factor less than 1.0 will cause the visuals to be stretched taller in comparison to their width. A distortion factor greater than 1.0 will cause the visuals to be shrunk shorter in comparison to their width.

    • angle - The field of view on the scene view in degrees. This value must be between 0 and 120.
    • distortionRatio - The field of view vertical distortion ratio. This value must be between 0.1 and 10.

    This method was introduced in Esri.ArcGISRuntime 100.6.


    [since Esri.ArcGISRuntime 100.6] void setFieldOfViewFromLensIntrinsics(double xFocalLength, double yFocalLength, double xPrincipal, double yPrincipal, double xImageSize, double yImageSize, DeviceOrientation deviceOrientation)

    Sets the field of view of the scene view to the field of view of a camera lens using the lens characteristics

    Allows for matching the field of view of the scene view to the field of view of a camera lens using the lens characteristics. All parameter values must be greater than 0.

    • xFocalLength - The pixel focal length along the x-axis. The units are in pixels. xFocal and yFocal should be identical for square pixels.
    • yFocalLength - The pixel focal length along the y-axis. The units are in pixels. xFocal and yFocal should be identical for square pixels.
    • xPrincipal - The distance along the x-axis between the principal point and the top-left corner of the image frame. The units are in pixels. This must also be less than xImageSize.
    • yPrincipal - The distance along the y-axis between the principal point and the top-left corner of the image frame. The units are in pixels. This must also be less than xImageSize.
    • xImageSize - The x value of the image size captured by the camera. The units are in pixels.
    • yImageSize - The y value of the image size captured by the camera. The units are in pixels.
    • deviceOrientation - Describes the orientation of the device.

    This method was introduced in Esri.ArcGISRuntime 100.6.


    string setViewpointCamera(Camera camera)

    Animates the display to the viewpoint specified by the given camera.

    The Camera determines at what position and angle the scene is viewed.

    • camera - The Camera to set for the scene view.

    Returns a task ID that can be used to cancel the setViewpointCamera task.

    See also Cancelable.


    string setViewpointCameraAndSeconds(Camera camera, real durationSeconds)

    Sets the viewpoint camera for the scene view with animation duration.

    The Camera determines at what position and angle the scene is viewed.

    • camera - The new camera information for the scene view.
    • durationSeconds - The time for the transition animation to complete, in seconds.

    Returns a task ID that can be used to cancel the setViewpointCameraAndSeconds task.

    See also Cancelable.


    void setViewpointCameraAndWait(Camera camera)

    Synchronously sets the viewpoint camera for the scene view.

    The Camera determines at what position and angle the scene is viewed. Animates the display to the viewpoint specified by the given camera.

    • camera - The new camera information for the scene view.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.