Skip To Content ArcGIS for Developers Sign In Dashboard

Scene Class

class Esri::ArcGISRuntime::Scene

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

Header: #include <Scene>
Since: Esri::ArcGISRuntime 100.0
Inherits: Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::Loadable

This class was introduced in Esri::ArcGISRuntime 100.0.

Public Functions

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::BasemapType basemapType, 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::Basemap *basemap() const
Esri::ArcGISRuntime::BookmarkListModel *bookmarks() const
Esri::ArcGISRuntime::Viewpoint initialViewpoint() const
bool isAutoFetchLegendInfos() const
Esri::ArcGISRuntime::Item *item() const
Esri::ArcGISRuntime::LegendInfoListModel *legendInfos() const
Esri::ArcGISRuntime::LoadSettings *loadSettings() const
Esri::ArcGISRuntime::LayerListModel *operationalLayers() const
Esri::ArcGISRuntime::SceneViewTilingScheme sceneViewTilingScheme() const
void setAutoFetchLegendInfos(bool autoFetchLegendInfos)
void setBaseSurface(Esri::ArcGISRuntime::Surface *surface)
void setBasemap(Esri::ArcGISRuntime::Basemap *basemap)
void setInitialViewpoint(const Esri::ArcGISRuntime::Viewpoint &viewpoint)
void setLoadSettings(Esri::ArcGISRuntime::LoadSettings *settings)
void setSceneViewTilingScheme(Esri::ArcGISRuntime::SceneViewTilingScheme sceneViewTilingScheme)
Esri::ArcGISRuntime::SpatialReference spatialReference() const
Esri::ArcGISRuntime::FeatureTableListModel *tables() const
QList<Esri::ArcGISRuntime::TransportationNetworkDataset *> transportationNetworks() const
QJsonObject unknownJson() const
QJsonObject unsupportedJson() const
QString version() const

Reimplemented Public Functions

virtual void cancelLoad() override
virtual void load() override
virtual Esri::ArcGISRuntime::Error loadError() const override
virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
virtual void retryLoad() override

Signals

void basemapChanged(Esri::ArcGISRuntime::Basemap *oldBasemap)
void doneLoading(Esri::ArcGISRuntime::Error loadError)
void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

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(Basemap::imagery(this), 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::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

This function was introduced in Esri::ArcGISRuntime 100.3.

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::BasemapType basemapType, QObject *parent = nullptr)

Constructor that takes the following parameters.

  • basemapType - The type of basemap you want to use.
  • parent - An optional parent.

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)

Default constructor with an optional parent.

[signal] void Scene::basemapChanged(Esri::ArcGISRuntime::Basemap *oldBasemap)

The signal emitted when the basemap changes.

  • oldBasemap - The previous basemap.

The returned Basemap object has the Scene as its parent.

See also Returned QObjects Parenting.

[signal] void Scene::doneLoading(Esri::ArcGISRuntime::Error loadError)

Signal emitted when this object is done loading.

  • loadError - The load error.

Note: If there is a load error it will also be emitted on the errorOccurred signal.

See also Loadable and Object.

[signal] void Scene::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

Signal emitted when the load status changes for this object.

See also Loadable.

[override virtual] Scene::~Scene()

Destructor.

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

Gets the surface of the scene.

See also setBaseSurface().

Esri::ArcGISRuntime::Basemap *Scene::basemap() const

Gets the basemap object.

See also setBasemap().

Esri::ArcGISRuntime::BookmarkListModel *Scene::bookmarks() const

Gets the bookmarks list model for the scene.

The Scene only supports BoundingGeometry viewpoints types (declared with an extent). CenterAndScale viewpoints (declared around a center point) are not supported in the Scene.

[override virtual] void Scene::cancelLoad()

Reimplements: Loadable::cancelLoad().

See Loadable.

[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::Viewpoint Scene::initialViewpoint() const

Gets the initial viewpoint.

See also setInitialViewpoint.

bool Scene::isAutoFetchLegendInfos() const

Gets whether legend infos are automatically fetched by the operational layers in the scene.

Returns true if legend infos will be fetched automatically when the LegendInfoListModel is instantiated.

Esri::ArcGISRuntime::Item *Scene::item() const

Returns the item used to construct this Scene object, if any.

This function was introduced in Esri::ArcGISRuntime 100.3.

Esri::ArcGISRuntime::LegendInfoListModel *Scene::legendInfos() const

Gets a list model containing legend infos for the scene's operational layers and any sublayers.

Returns a LegendInfoListModel representing the legend information for the scene's operational layers and their sublayers.

[override virtual] void Scene::load()

Reimplements: Loadable::load().

See Loadable.

[override virtual] Esri::ArcGISRuntime::Error Scene::loadError() const

Reimplements: Loadable::loadError() const.

See Loadable.

Esri::ArcGISRuntime::LoadSettings *Scene::loadSettings() const

Gets the load settings properties that can be used to make changes to how feature layers, loaded by this scene, are rendered.

This function was introduced in Esri::ArcGISRuntime 100.2.

See also setLoadSettings().

[override virtual] Esri::ArcGISRuntime::LoadStatus Scene::loadStatus() const

Reimplements: Loadable::loadStatus() const.

See Loadable.

Esri::ArcGISRuntime::LayerListModel *Scene::operationalLayers() const

Gets a list model of operational layers in the scene.

[override virtual] void Scene::retryLoad()

Reimplements: Loadable::retryLoad().

See Loadable.

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::setAutoFetchLegendInfos(bool autoFetchLegendInfos)

Sets whether legend infos are automatically fetched by the operational layers in the scene.

Set autoFetchLegendInfos to true to have legend infos fetched automatically when the LegendInfoListModel is instantiated.

See also isAutoFetchLegendInfos().

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

Sets the surface for the scene.

See also baseSurface().

void Scene::setBasemap(Esri::ArcGISRuntime::Basemap *basemap)

Sets the basemap to basemap.

See also basemap().

void Scene::setInitialViewpoint(const Esri::ArcGISRuntime::Viewpoint &viewpoint)

Sets the initial viewpoint with a specified viewpoint.

The initial viewpoint is based on the envelope specified in the source and it can be modified using a new viewpoint object.

  • viewpoint - The viewpoint to set the scene to.

See also initialViewpoint().

void Scene::setLoadSettings(Esri::ArcGISRuntime::LoadSettings *settings)

Sets the load settings for this scene to settings.

The load settings change how feature layers, loaded by this scene, are rendered.

This function was introduced in Esri::ArcGISRuntime 100.2.

See also loadSettings().

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.

Esri::ArcGISRuntime::SpatialReference Scene::spatialReference() const

Gets the spatial reference of the scene.

Esri::ArcGISRuntime::FeatureTableListModel *Scene::tables() const

Returns a list of non-spatial tables in the scene.

Tables can be added and removed from the scene through this model.

Tables are not loaded by default. Tables are loaded internally when asynchronous operations like query are performed. Alternatively, they can be loaded by calling load on each table.

This function was introduced in Esri::ArcGISRuntime 100.3.

QList<Esri::ArcGISRuntime::TransportationNetworkDataset *> Scene::transportationNetworks() const

A collection of transportation network datasets defined for the scene.

Scene authors can use ArcGIS Pro to create mobile scene packages containing scenes that include transportation networks. If so, this property will be populated with the collection of TransportationNetworkDataset objects.

A TransportationNetworkDataset from this collection can be used to construct one of the network analysis tasks (such as RouteTask, ServiceAreaTask, and ClosestFacilityTask).

This function was introduced in Esri::ArcGISRuntime 100.7.

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.

QString Scene::version() const

Returns the version information.

This function was introduced in Esri::ArcGISRuntime 100.3.


Feedback on this topic?