A scene is a container for layers. You use a scene together with a SceneView or LocalSceneView to display layers of geographic data in 3D. More...
| Header | #include <Scene.h |
| Since | Esri |
| Inherits | Esri |
Public Functions
| Scene(QObject *parent = nullptr) | |
| Scene( | |
(since Esri | Scene( |
(since Esri | Scene( |
(since Esri | Scene( |
(since Esri | Scene( |
| Scene( | |
(since Esri | Scene(const QUrl &url, QObject *parent = nullptr) |
(since Esri | Scene( |
(since Esri | Scene( |
(since Esri | Scene( |
| virtual | ~ |
| Esri | base |
(since Esri Esri | clipping |
(since Esri Esri | environment() const |
(since Esri bool | is |
(since Esri Esri | scene |
| void | set |
(since Esri void | set |
(since Esri void | set |
(since Esri void | set |
(since Esri Esri | viewing |
Static Public Members
(since Esri Esri | from |
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 a global scene in a SceneView or a local scene in a LocalSceneView depending on the SceneViewingMode.
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.
A scene can contain a base surface, a basemap, and one or more operational layers:
- A base surface is the default surface on which layers are draped or from which relative layers are offset. The ground height is provided by ElevationSource objects that are combined to make the Surface.
- A basemap is a layer that helps orient the user of the scene. It is composed of a collection of base layers, such as imagery or hillshade, that are draped on the surface, and/or reference layers such as street labels that are displayed on top of operational layers. This content is relatively static.
- An operational layer provides content that is of unique interest to the app and the task at hand, such as data about earthquakes, traffic, or weather. This content can change frequently.
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.
If you create a new scene without specifying a spatial reference, the spatial reference of the first layer you add, which is typically the Basemap, defines the spatial reference of the entire scene.
See Scenes 3D for more information about scenes.
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:
- Add an integrated mesh layer: View an integrated mesh layer from a scene service.
- Add building scene layer: Add a layer to a local scene to visualize and interact with 3D building models developed using Building Information Modeling (BIM) tools.
- Animate 3D symbols: Demonstrates how to animate a graphic's position and rotation and follow it using a `OrbitGeoElementCameraController`.
- Change atmosphere effect: Changes the appearance of the atmosphere in a scene.
- Choose camera controller: Control the behavior of the camera in a scene.
- Configure scene environment: Configure the environment settings in a local scene to change the lighting conditions and background appearance.
- Create terrain surface from a local raster: Set the terrain surface with elevation described by a raster file.
- Create terrain surface from a local tile package: Set the terrain surface with elevation described by a local tile package.
- Display a scene: Display a scene with a terrain surface and imagery.
- Display a scene layer: Add a scene layer to a scene.
- Display local scene view: Display a local scene with a topographic surface and 3D scene layer clipped to a local area.
- Feature layer rendering mode (scene): Render features in a scene statically or dynamically by setting the feature layer rendering mode.
- Filter building scene layer: Explore details of a building scene by using filters and sublayer visibility.
- Get elevation at point: Get the elevation for a given point on a surface.
- Open a scene (portal item): Open a web scene from a portal item.
- Open mobile scene package: Opens and displays a scene from a Mobile Scene Package (.mspk).
- Realistic lighting and shadows: Show realistic lighting and shadows for the specific date and time of day.
- Scene layer selection: Identify features in a scene to select.
- Show labels on layer in 3D: This sample demonstrates how to display custom labels in a 3D scene.
- Terrain exaggeration: Vertically exaggerate terrain in a scene.
- View content beneath terrain surface: See through terrain in a scene and move the camera underground.
See also Loadable.
Member Function Documentation
[explicit] Scene::Scene(QObject *parent = nullptr)
Creates a scene with a global SceneViewingMode.
- parent - The optional parent QObject.
See also GeoModel::load.
[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.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.
[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.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 300.0] Scene::Scene(Esri::ArcGISRuntime::SceneViewingMode viewingMode , QObject *parent = nullptr)
Creates a scene with a SceneViewingMode.
- viewingMode - The viewing mode to use for the scene.
- parent - The optional parent QObject.
This function was introduced in Esri::ArcGISRuntime 300.0.
[explicit] Scene::Scene(Esri::ArcGISRuntime::Surface *baseSurface , QObject *parent = nullptr)
Constructor that takes a baseSurface with an optional parent.
[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:
- The web scene viewer page, for example: https://www.arcgis.com/home/webscene/viewer.html?webscene=579f97b2f3b94d4a8e48a5f140a6639b
- The web scene item details page, for example: https://www.arcgis.com/home/item.html?id=579f97b2f3b94d4a8e48a5f140a6639b
- The REST sharing API data, for example: https://www.arcgis.com/sharing/rest/content/items/579f97b2f3b94d4a8e48a5f140a6639b/data
- The REST sharing API page (with or without the query parameter f=json), for example: https://www.arcgis.com/sharing/rest/content/items/579f97b2f3b94d4a8e48a5f140a6639b?f=json
This function was introduced in Esri::ArcGISRuntime 100.3.
See also PortalItem, PortalItem::PortalItem(const QUrl&, QObject*), and GeoModel::item.
[since Esri::ArcGISRuntime 300.0] Scene::Scene(Esri::ArcGISRuntime::SceneViewingMode viewingMode , Esri::ArcGISRuntime::Basemap *basemap, QObject *parent = nullptr)
Creates a scene with a SceneViewingMode and a Basemap.
- viewingMode - The viewing mode to use for the scene.
- basemap - A basemap object.
- parent - The optional parent QObject.
This function was introduced in Esri::ArcGISRuntime 300.0.
[since Esri::ArcGISRuntime 300.0] Scene::Scene(Esri::ArcGISRuntime::SceneViewingMode viewingMode , Esri::ArcGISRuntime::BasemapStyle basemapStyle , QObject *parent = nullptr)
Creates a scene with a SceneViewingMode and a BasemapStyle.
- viewingMode - The viewing mode to use for the scene.
- basemapStyle - The basemap style.
- parent - The optional parent QObject.
This function was introduced in Esri::ArcGISRuntime 300.0.
[since Esri::ArcGISRuntime 300.0] Scene::Scene(Esri::ArcGISRuntime::SceneViewingMode viewingMode , const Esri::ArcGISRuntime::SpatialReference &spatialReference , QObject *parent = nullptr)
Creates a scene with a SceneViewingMode and a SpatialReference.
- viewingMode - The viewing mode to use for the scene.
- spatialReference - A spatial reference object.
- parent - The optional parent QObject.
This function was introduced in Esri::ArcGISRuntime 300.0.
[override virtual noexcept] 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().
[since Esri::ArcGISRuntime 300.0] Esri::ArcGISRuntime::Envelope Scene::clippingArea () const
Returns the area that defines what is clipped for display.
This property only applies to local scenes. It is used to define the bounds of a local scene. If defined, only data (including the basemap) inside the specified area is displayed.
Set the isClippingEnabled property to true to apply the specified clipping area to the view.
This function was introduced in Esri::ArcGISRuntime 300.0.
See also setClippingArea().
[since Esri::ArcGISRuntime 300.0] Esri::ArcGISRuntime::SceneEnvironment *Scene::environment() const
Returns the environment that affects how the scene is displayed.
This is populated from the webscene or MobileScenePackage (if configured), otherwise a default constructed SceneEnvironment is applied. Setting this property before loading the scene overrides any initial environment settings specified by a predefined scene.
This function was introduced in Esri::ArcGISRuntime 300.0.
See also setEnvironment().
[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 300.0] bool Scene::isClippingEnabled () const
Returns true if clipping is enabled, false otherwise.
This property only applies to local scenes. It determines whether clipping using the clippingArea is enabled. If the clipping area is empty and this property is true then nothing is clipped. The default value is false.
This function was introduced in Esri::ArcGISRuntime 300.0.
[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 SceneViewTilingScheme.
void Scene::setBaseSurface (Esri::ArcGISRuntime::Surface *surface)
Sets the surface for the scene.
See also baseSurface().
[since Esri::ArcGISRuntime 300.0] void Scene::setClippingArea (const Esri::ArcGISRuntime::Envelope &clippingArea )
Sets the clippingArea to clippingArea.
This function was introduced in Esri::ArcGISRuntime 300.0.
See also clippingArea.
[since Esri::ArcGISRuntime 300.0] void Scene::setClippingEnabled (bool clippingEnabled )
Sets the clippingEnabled to clippingEnabled.
This function was introduced in Esri::ArcGISRuntime 300.0.
See also isClippingEnabled.
[since Esri::ArcGISRuntime 300.0] void Scene::setEnvironment (Esri::ArcGISRuntime::SceneEnvironment *environment)
Sets the environment to environment.
This function was introduced in Esri::ArcGISRuntime 300.0.
See also environment.
[since Esri::ArcGISRuntime 300.0] Esri::ArcGISRuntime::SceneViewingMode Scene::viewingMode () const
Returns the viewing mode of the scene, either global or local.
The viewing mode is specified via the constructor or deserialized from the web scene or MobileScenePackage.
This function was introduced in Esri::ArcGISRuntime 300.0.