Skip To Content ArcGIS for Developers Sign In Dashboard

Scene 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: Object and Loadable

Public Functions

Scene(QObject *parent = nullptr)
Scene(Surface *baseSurface, QObject *parent = nullptr)
Scene(Basemap *basemap, QObject *parent = nullptr)
Scene(BasemapType basemapType, QObject *parent = nullptr)
Scene(SceneViewTilingScheme sceneViewTilingScheme, QObject *parent = nullptr)
Scene(const QUrl &url, QObject *parent = nullptr)
Scene(Item *item, QObject *parent = nullptr)
~Scene()
Surface *baseSurface() const
Basemap *basemap() const
BookmarkListModel *bookmarks() const
Viewpoint initialViewpoint() const
bool isAutoFetchLegendInfos() const
Item *item() const
LegendInfoListModel *legendInfos() const
LoadSettings *loadSettings() const
LayerListModel *operationalLayers() const
SceneViewTilingScheme sceneViewTilingScheme() const
void setAutoFetchLegendInfos(bool autoFetchLegendInfos)
void setBaseSurface(Surface *surface)
void setBasemap(Basemap *basemap)
void setInitialViewpoint(const Viewpoint &viewpoint)
void setLoadSettings(LoadSettings *settings)
void setSceneViewTilingScheme(SceneViewTilingScheme sceneViewTilingScheme)
SpatialReference spatialReference() const
FeatureTableListModel *tables() const
QJsonObject unknownJson() const
QJsonObject unsupportedJson() const
QString version() const

Reimplemented Public Functions

virtual void cancelLoad()
virtual void load()
virtual Error loadError() const
virtual LoadStatus loadStatus() const
virtual void retryLoad()

Signals

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

Static Public Members

Scene *fromJson(const QString &json, QObject *parent = nullptr)
  • 10 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

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

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

See also Loadable.

Member Function Documentation

Scene::Scene(QObject *parent = nullptr)

Default constructor with an optional parent.

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

Constructor that takes a baseSurface with an optional parent.

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

Constructor that takes a basemap with an optional parent.

Scene::Scene(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(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(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(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()

Destructor.

Surface *Scene::baseSurface() const

Gets the surface of the scene.

See also setBaseSurface().

Basemap *Scene::basemap() const

Gets the basemap object.

See also setBasemap().

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

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.

[virtual] void Scene::cancelLoad()

Reimplemented from Loadable::cancelLoad().

See Loadable.

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

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

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.

Item *Scene::item() const

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

This function was introduced in Esri::ArcGISRuntime 100.3.

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.

[virtual] void Scene::load()

Reimplemented from Loadable::load().

See Loadable.

[virtual] Error Scene::loadError() const

Reimplemented from Loadable::loadError().

See Loadable.

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

[virtual] LoadStatus Scene::loadStatus() const

Reimplemented from Loadable::loadStatus().

See Loadable.

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

Signal emitted when the load status changes for this object.

See also Loadable.

LayerListModel *Scene::operationalLayers() const

Gets a list model of operational layers in the scene.

[virtual] void Scene::retryLoad()

Reimplemented from Loadable::retryLoad().

See Loadable.

SceneViewTilingScheme Scene::sceneViewTilingScheme() const

Returns the the tiling scheme of the scene.

The default value is SceneViewTilingScheme::WebMercator.

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(Surface *surface)

Sets the surface for the scene.

See also baseSurface().

void Scene::setBasemap(Basemap *basemap)

Sets the basemap to basemap.

See also basemap().

void Scene::setInitialViewpoint(const 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(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(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.

SpatialReference Scene::spatialReference() const

Gets the spatial reference of the scene.

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.

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?