Scene Class

  • Scene
  • class Esri::ArcGISRuntime::Scene

    A scene is a container for layers. You use a scene together with a SceneView to display layers of geographic data in 3D. More...

    Header: #include <Scene.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::GeoModel

    Public Functions

    Scene(QObject *parent = nullptr)
    Scene(Esri::ArcGISRuntime::Surface *baseSurface, QObject *parent = nullptr)
    Scene(Esri::ArcGISRuntime::Basemap *basemap, QObject *parent = nullptr)
    Scene(Esri::ArcGISRuntime::SceneViewTilingScheme sceneViewTilingScheme, QObject *parent = nullptr)
    Scene(const QUrl &url, QObject *parent = nullptr)
    Scene(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
    Scene(Esri::ArcGISRuntime::BasemapStyle basemapStyle, QObject *parent = nullptr)
    virtual ~Scene() override
    Esri::ArcGISRuntime::Surface *baseSurface() const
    Esri::ArcGISRuntime::SceneViewTilingScheme sceneViewTilingScheme() const
    void setBaseSurface(Esri::ArcGISRuntime::Surface *surface)
    QJsonObject unknownJson() const
    QJsonObject unsupportedJson() const

    Static Public Members

    Esri::ArcGISRuntime::Scene *fromJson(const QString &json, QObject *parent = nullptr)

    Detailed Description

    Scene contains layers of mapping data and information such as elevation data, renderers, and labels which define the scene's capabilities. You can access Scene content directly or, more commonly, visualize the scene in a SceneView.

    In an MVC architecture, Scene represents the model and SceneView represents the 3D view. Scene specifies how the geographic data is organized, and SceneView renders the data on the screen and allows users to interact with it.

    Conceptually, a scene's geographic content is derived from its basemap and operational layers. The elevation is derived from the surface class, which contains ElevationSource.

    A basemap provides a background of geographical context for the content you want to display in the scene. It is used for locational reference and provides a framework on which you can overlay operational layers. Thus, the basemap serves as a foundation and provides a framework for working with information geographically. Its content is typically geographic features that are static and do not change frequently, such as streets, parcel boundaries, or rivers.

    Operational layers provide content that is of unique interest to the application and the task at hand. Their content might change frequently, such as earthquake reports, traffic, or weather.

    If operational layers are added to an existing scene before the scene is loaded, then the scene's original list of operational layers is overridden to only contain the added layers. To keep the scene's original operational layers and also add new ones, wait until the scene is done loading before adding operational layers. You can wait for the doneLoading signal to be emitted before adding the new operational layers.

    You can create a scene from an existing web scene using its URL or PortalItem. Alternatively, you can get a scene directly from a MobileScenePackage::scenes collection. Scene properties are hydrated when the scene is loaded.

    The scene has a spatial reference which specifies how the geographic content from its basemap and operational layers are aligned when combined together.

    If you create a new scene, the spatial reference of the first layer you add, which is typically the first layer in the Basemap, defines the spatial reference of the entire scene.

    Once the scene has obtained a spatial reference it cannot be changed, even by changing the basemap.

    Example:

    Create a Scene with the World Imagery basemap and the World Elevation surface:

    // Create a scene with the imagery basemap and world elevation surface
    m_sceneView = findChild<SceneQuickView*>("sceneView");
    Scene* scene = new Scene(BasemapStyle::ArcGISImageryStandard, this);
    Surface* surface = new Surface(this);
    surface->elevationSources()->append(new ArcGISTiledElevationSource(QUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"), this));
    scene->setBaseSurface(surface);
    
    // Create scene layer from the Brest, France scene server.
    ArcGISSceneLayer* sceneLayer = new ArcGISSceneLayer(QUrl("https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_Brest/SceneServer"), this);
    scene->operationalLayers()->append(sceneLayer);

    Relevant samples:

    See also Loadable.

    Member Function Documentation

    [explicit] Scene::Scene(QObject *parent = nullptr)

    Creates a scene.

    • parent - The optional parent QObject.

    See also GeoModel::load.

    [explicit] Scene::Scene(Esri::ArcGISRuntime::Surface *baseSurface, QObject *parent = nullptr)

    Constructor that takes a baseSurface with an optional parent.

    [explicit] Scene::Scene(Esri::ArcGISRuntime::Basemap *basemap, QObject *parent = nullptr)

    Creates a scene with a Basemap.

    • basemap - A basemap object.
    • parent - The optional parent QObject.

    [explicit, since Esri::ArcGISRuntime 100.2] Scene::Scene(Esri::ArcGISRuntime::SceneViewTilingScheme sceneViewTilingScheme, QObject *parent = nullptr)

    Creates a scene with a specific tiling scheme.

    • sceneViewTilingScheme - The tiling scheme to use for tiled layers.
    • parent - The optional parent QObject.

    The tiling scheme determines which cached tiled services can render in the scene.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    [explicit, since Esri::ArcGISRuntime 100.3] Scene::Scene(const QUrl &url, QObject *parent = nullptr)

    Creates a scene with the URL to a web scene.

    • url - URL of the web scene on ArcGIS Online or ArcGIS Enterprise portal.
    • parent - The optional parent QObject.

    If the specified URL is a portal item URL, the underlying PortalItem is created and can be accessed through item. The URL may be a direct URL to web scene JSON content or the URL of a portal item.

    Examples of supported URL formats:

    {PortalItem::PortalItem(const QUrl&, QObject*)}, {Esri::ArcGISRuntime::GeoModel::item} {GeoModel::item}

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also PortalItem and Esri::ArcGISRuntime::PortalItem::PortalItem(const QUrl&, QObject*).

    [explicit, since Esri::ArcGISRuntime 100.3] Scene::Scene(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)

    Creates a scene with a portal item of type PortalItemType::WebScene.

    • item - The web scene item (only PortalItem are supported).
    • parent - The optional parent QObject.

    The PortalItem automatically loads when the Scene loads. If the loaded Item is not a portal item of type PortalItemType::WebScene, the scene fails to load.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    [explicit, since Esri::ArcGISRuntime 100.10] Scene::Scene(Esri::ArcGISRuntime::BasemapStyle basemapStyle, QObject *parent = nullptr)

    Creates a scene with a BasemapStyle.

    • basemapStyle - The basemap style.
    • parent - The optional parent QObject.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    [override virtual] Scene::~Scene()

    Destructor.

    Esri::ArcGISRuntime::Surface *Scene::baseSurface() const

    Returns the base surface of the scene.

    The base surface is the default surface on which layers are draped or from which relative layers are offset.

    See also setBaseSurface().

    [static, since Esri::ArcGISRuntime 100.3] Esri::ArcGISRuntime::Scene *Scene::fromJson(const QString &json, QObject *parent = nullptr)

    Creates this Scene from its JSON representation.

    Returns a Scene created using the data in the json parameter and an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    [since Esri::ArcGISRuntime 100.2] Esri::ArcGISRuntime::SceneViewTilingScheme Scene::sceneViewTilingScheme() const

    Returns the tiling scheme defines how tile based data is rendered.

    The tiling scheme property is used by the SceneView to determine how to render tiled data.

    This property is determined during GeoModel::load. The SpatialReference of the first tiled elevation source (ArcGISTiledElevationSource) or tiled layer in the basemap or operational layer (see ArcGISTiledLayer) determines whether the value is SceneViewTilingScheme::Geographic or SceneViewTilingScheme::WebMercator.

    If you create a new scene, you can set this value before adding the base surface, basemap or operational layers. The SceneViewTilingScheme must correspond to the SpatialReference of the layers to ensure they render correctly.

    The default value is SceneViewTilingScheme::WebMercator.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    See also setSceneViewTilingScheme() and SceneViewTilingScheme.

    void Scene::setBaseSurface(Esri::ArcGISRuntime::Surface *surface)

    Sets the surface for the scene.

    See also baseSurface().

    [since Esri::ArcGISRuntime 100.3] QJsonObject Scene::unknownJson() const

    Returns unknown data from the source JSON.

    Unknown JSON is a QJsonObject of values not defined in the ArcGIS web scene specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also Scene.

    [since Esri::ArcGISRuntime 100.3] QJsonObject Scene::unsupportedJson() const

    Returns unsupported data from the source JSON.

    Unsupported JSON is a QJsonObject of values defined in the ArcGIS web scene specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also Scene.

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