Scene Class

  • Scene
  • class Esri::ArcGISRuntime::Scene

    A scene which can be displayed on the screen by the scene view. More...

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

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

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

    Static Public Members

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

    Detailed Description

    A scene represents the model in an MVC architecture and a scene view represents the 3-d view. Scene and SceneView work together to visualize geographic data in 3D on a screen. A scene specifies how the geographic data is organized, and a scene view renders the data 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.

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

    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);

    See also Loadable.

    Member Function Documentation

    Scene::Scene(Esri::ArcGISRuntime::BasemapStyle basemapStyle, QObject *parent = nullptr)

    Creates a scene with a basemap style.

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

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also BasemapStyle.

    Scene::Scene(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)

    Constructor that takes an item with an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    Scene::Scene(const QUrl &url, QObject *parent = nullptr)

    Constructor that takes a url with an optional parent.

    The URL can be one of three possible types that refer to a PortalItem:

    • The item details page : http://www.myPortal.com/home/item.html?id=12345678901234567890123456789012
    • The web scene viewer page : http://www.myPortal.com/home/webscene/viewer.html?webscene=12345678901234567890123456789012
    • The sharing data page : http://www.myPortal.com/sharing/rest/content/items/12345678901234567890123456789012/data

    If the specified URL is a portal item URL (see PortalItem::PortalItem(QUrl) for the supported URL formats), the underlying PortalItem will be created and accessible through item.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also PortalItem, PortalItem(QUrl), and GeoModel::item.

    Scene::Scene(Esri::ArcGISRuntime::SceneViewTilingScheme sceneViewTilingScheme, QObject *parent = nullptr)

    Constructor that takes a sceneViewTilingScheme with an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.2.

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

    Constructor that takes a basemap with an optional parent.

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

    Constructor that takes a baseSurface with an optional parent.

    Scene::Scene(QObject *parent = nullptr)

    Creates a scene.

    • parent - The optional parent QObject.

    See also GeoModel::load.

    [override virtual] Scene::~Scene()

    Destructor.

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

    Gets the surface of the scene.

    See also setBaseSurface().

    [static] 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.

    Esri::ArcGISRuntime::SceneViewTilingScheme Scene::sceneViewTilingScheme() const

    The SceneViewTilingScheme as used to render tile based data.

    The default value is SceneViewTilingScheme::WebMercator (see SceneViewTilingScheme.) The tiling scheme property is used by the SceneView to determine how to render tiled data. If this property was not set in advance of loading the scene, it will be determined during the Scene::load(). This will examine the SpatialReference of the first tiled elevation source (see ArcGISTiledElevationSource) or tiled layer in the basemap or operational layers (see ArcGISTiledLayer) to choose either SceneViewTilingScheme::Geographic or SceneViewTilingScheme::WebMercator values. The SceneViewTilingScheme must correspond to the SpatialReference for those layers to render correctly.

    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().

    void Scene::setSceneViewTilingScheme(Esri::ArcGISRuntime::SceneViewTilingScheme sceneViewTilingScheme)

    Sets the tiling scheme of the scene to sceneViewTilingScheme.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    See also sceneViewTilingScheme() and SceneViewTilingScheme.

    QJsonObject Scene::unknownJson() const

    Gets the unknown JSON of this object.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    QJsonObject Scene::unsupportedJson() const

    Gets the unsupported JSON of this object.

    This function was introduced in Esri::ArcGISRuntime 100.3.

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