A view that displays 3D content from a Scene with a viewing mode of SceneViewingMode::Local. More...
| Header | #include <Local |
| Since | Esri |
| Inherits | Esri |
| Inherited By | Esri |
Public Functions
| virtual | ~ |
| Esri | arc |
| Esri | critical |
| Esri | current |
| Esri | location |
| Esri | screen |
| QFuture | screen |
| void | set |
| QFuture | set |
| void | set |
| QFuture | set |
| QFuture | set |
| QList | warnings() const |
Detailed Description
Local scenes are used to view local 3D data in projected coordinate systems.
To display a local scene, add this view to your app and assign a local scene to it via arcGISScene. This view loads the local scene and its content, such as the GeoModel::basemap and the Scene::operationalLayers, and then renders the local scene on screen.
FloorAware is not supported in this view. Any layer floor aware configurations will be ignored.
Programmatic Navigation:
Pan, zoom, and rotate user interactions are supported in this view using touch, mouse, keyboard or pen/pencil.
Programmatic Navigation:
The visible area (Viewpoint) of the local scene view is defined by the visible extent of the local scene. You can programmatically set the visible area by specifying a viewpoint. For example, GeoView::setViewpointAndWait(const Esri::ArcGISRuntime::Viewpoint&) sets the visible area to a viewpoint, or setViewpointCameraAndWait(const Esri::ArcGISRuntime::Camera&) sets the visible area by moving the camera. In addition, you can change the visible area with a smooth transition animation by calling GeoView::setViewpointAsync(const Esri::ArcGISRuntime::Viewpoint&) or setViewpointCameraAsync(const Esri::ArcGISRuntime::Camera&).
View errors:
This view supports several kinds errors to give the user helpful information about the view. These errors are:
- LocalSceneQuickView::criticalErrorChanged and LocalSceneWidget::criticalErrorChanged: These two errors are the most severe, which means the view is in an unusable state from which the view cannot recover.
- MapQuickView::geoModelErrorChanged, MapGraphicsView::geoModelErrorChanged, SceneQuickView::geoModelErrorChanged, SceneGraphicsView::geoModelErrorChanged, LocalSceneQuickView::geoModelErrorChanged, and LocalSceneWidget::geoModelErrorChanged: These errors are less severe and means the view is in a usable state but nothing is displaying. The reason nothing is displaying most likely due to something is not configured correctly with the geo model.
- LocalSceneQuickView::warningsChanged and LocalSceneWidget::warningsChanged: The errors are the least severe. These warnings mean the view is in an unusable state but something may not look correct or as expected.
Relevant samples:
- 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.
- Display local scene view: Display a local scene with a topographic surface and 3D scene layer clipped to a local area.
- Filter building scene layer: Explore details of a building scene by using filters and sublayer visibility.
- Configure scene environment: Configure the environment settings in a local scene to change the lighting conditions and background appearance.
Member Function Documentation
[override virtual noexcept] LocalSceneView::~LocalSceneView ()
Destructor.
Esri::ArcGISRuntime::Scene *LocalSceneView::arcGISScene () const
Returns the local scene that the local scene view is displaying.
The scene needs to have a local viewing mode.
If you assign a local scene to the local scene view, the scene, its Surface, Basemap, and collection of operational layers automatically start to load. When loading completes, the layers and basemap are rendered over the surface in this view.
You can load a scene into your app before you assign it to the local scene view by calling GeoModel::load. This is useful if you want to validate the content of a scene before you display it.
See also setArcGISScene().
Esri::ArcGISRuntime::Error LocalSceneView::criticalError () const
Returns the critical error on the view.
A critical error happens when the view has reached an unusable state and it cannot recover.
Esri::ArcGISRuntime::Camera LocalSceneView::currentViewpointCamera () const
Retrieves and returns the camera that displays the current viewpoint.
Esri::ArcGISRuntime::LocationToScreenResult LocalSceneView::locationToScreen (const Esri::ArcGISRuntime::Point &scenePoint ) const
Converts and returns a location in scene coordinates to a point in screen coordinates relative to the upper-left corner of the local scene view.
- scenePoint - A location defined within the spatial reference of the local scene view.
The screen coordinates are in device-independent pixels (DIP) relative to the upper-left corner of the scene view at position 0,0. The LocationToScreenResult indicates whether the result screen point is visible in the local scene view. It will not be visible if it is outside the applied clipping area, is not within the current Viewpoint, or is blocked by the base surface or elevation layer.
If the input point does not have a spatial reference, it is assumed to be in the view's spatial reference.
If the input point's spatial reference is not the same as the view's, it is projected to the view's spatial reference. If the projection fails, then empty is returned.
To call this method, assign a local scene to the local scene view and ensure that it is loaded.
Esri::ArcGISRuntime::Point LocalSceneView::screenToBaseSurface (double screenX , double screenY ) const
Converts and returns a screen coordinate to a location on the base surface in scene coordinates, considering only the scene's base surface and ignoring other scene content.
- screenX - The x screen coordinate.
- screenY - The y screen coordinate.
The coordinate of the top left corner of the screen is 0,0.
Note that the elevation value for the converted location is approximated, as the precision of the elevation value decreases with increasing distance between the camera and the surface.
This method returns empty if the provided screen coordinate is outside the bounds of the current screen or if its location does not intersect with the surface of the local scene.
To call this method, assign a local scene to the local scene view and ensure that it is loaded.
QFuture<Esri::ArcGISRuntime::Point > LocalSceneView::screenToLocationAsync (double screenX , double screenY )
Converts a screen coordinate to a location in scene coordinates, considering both the scene's base surface and other scene content.
- screenX - The screen's x-coordinate to convert to map coordinate.
- screenY - The screen's y-coordinate to convert to map coordinate.
The coordinate of the top left corner of the screen is 0,0.
Note that elevation values are approximated, and as the distance between the camera and the surface increases, the precision of the elevation value decreases.
This method will fail with an error when:
- The provided screen coordinates are outside of the bounds of the current screen.
- The view does not have a spatial reference.
- The screen coordinates contain
NaNvalues.
If the provided screen coordinates do not intersect with the surface of the local scene, the returned point will be empty.
To call this method, assign a local scene to the local scene view and ensure that it is loaded.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
void LocalSceneView::setArcGISScene (Esri::ArcGISRuntime::Scene *scene)
Sets the scene to scene.
See also arcGISScene.
QFuture<bool> LocalSceneView::setViewpointAsync (const Esri::ArcGISRuntime::Viewpoint &viewpoint, float durationSeconds , Esri::ArcGISRuntime::AnimationCurve curve)
Pans or zooms the local scene view using animation to the specified viewpoint location asynchronously. The animation takes place over the specified duration. The animation curve defines the animation easing function.
- viewpoint - The viewpoint that should be set on the local scene view.
- durationSeconds - The amount of time in seconds to move to the new viewpoint.
- curve - The type of animation curve.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
void LocalSceneView::setViewpointCameraAndWait (const Esri::ArcGISRuntime::Camera &camera)
Changes the display to the viewpoint specified by the given camera.
- camera - The camera that should be set on the local scene view.
QFuture<bool> LocalSceneView::setViewpointCameraAsync (const Esri::ArcGISRuntime::Camera &camera)
Animates the display to the viewpoint specified by the given camera.
- camera - The camera that should be set on the local scene view.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
QFuture<bool> LocalSceneView::setViewpointCameraAsync (const Esri::ArcGISRuntime::Camera &camera, float duration)
Animates the display to the viewpoint specified by the given camera using the specified duration to arrive.
- camera - The camera that should be set on the local scene view.
- duration - The amount of time in seconds to move to the new viewpoint.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
QList<Esri::ArcGISRuntime::Error > LocalSceneView::warnings() const
Returns the warnings on the local scene view.