Skip To Content ArcGIS for Developers Sign In Dashboard

SceneView Class

(Esri::ArcGISRuntime::SceneView)

The base class for a 3D scene. More...

Header: #include <SceneView>
Since: Esri::ArcGISRuntime 100.0
Inherits: GeoView
Inherited By:

Esri::ArcGISRuntime::SceneGraphicsView and Esri::ArcGISRuntime::SceneQuickView

Public Functions

~SceneView()
QColor ambientLightColor() const
AnalysisOverlayListModel *analysisOverlays() const
Scene *arcGISScene() const
AtmosphereEffect atmosphereEffect() const
CameraController *cameraController() const
Camera currentViewpointCamera() const
double fieldOfView() const
double fieldOfViewDistortionRatio() const
bool isManualRendering() const
LocationToScreenResult locationToScreen(const Point &scenePoint) const
void renderFrame()
Point screenToBaseSurface(double screenX, double screenY) const
TaskWatcher screenToLocation(double screenX, double screenY)
void setAmbientLightColor(const QColor &color)
void setArcGISScene(Scene *scene)
void setAtmosphereEffect(AtmosphereEffect atmosphereEffect)
void setCameraController(CameraController *cameraController)
void setFieldOfView(double angle)
void setFieldOfViewAndDistortionRatio(double angle, double distortionRatio)
void setFieldOfViewFromLensIntrinsics(double xFocalLength, double yFocalLength, double xPrincipal, double yPrincipal, double xImageSize, double yImageSize, DeviceOrientation deviceOrientation)
virtual void setManualRendering(bool manualRendering)
void setSpaceEffect(SpaceEffect spaceEffect)
void setSunLighting(LightingMode lightingMode)
void setSunTime(const QDateTime &sunTime)
TaskWatcher setViewpointCamera(const Camera &camera)
TaskWatcher setViewpointCamera(const Camera &camera, float durationSeconds)
void setViewpointCameraAndWait(const Camera &camera)
SpaceEffect spaceEffect() const
LightingMode sunLighting() const
QDateTime sunTime() const

Protected Functions

SceneView(int width, int height)
virtual void screenToLocationCompletedEvent(QUuid taskId, const Point &location)
virtual void setViewpointCameraCompletedEvent(bool success)

Detailed Description

The base class for a 3D scene.

A SceneView renders data in a 3D scene and allows users to interact with the scene. In an MVC architecture, a SceneView represents the view and a Scene represents the model.

SceneView is a virtual class that can be reimplemented to a desired Qt type. For example, SceneQuickView implements the scene view as a QQuickItem, and SceneGraphicsView implements the scene view as a QGraphicsView. Beyond this, one could implement the scene view as another desired type, such as QGraphicsWidget.

See also Scene, GeoView, SceneGraphicsView, and SceneQuickView.

Member Function Documentation

[protected] SceneView::SceneView(int width, int height)

Constructs a SceneView with a specified size.

  • width - The width in physical pixels.
  • height - The height in physical pixels.

SceneView::~SceneView()

Destructor.

QColor SceneView::ambientLightColor() const

Returns the ambient light color.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setAmbientLightColor().

AnalysisOverlayListModel *SceneView::analysisOverlays() const

Gets the list of analysis overlays as a model.

This function was introduced in Esri::ArcGISRuntime 100.2.

Scene *SceneView::arcGISScene() const

Gets the scene associated with this SceneView.

Returns the scene.

See also setArcGISScene().

AtmosphereEffect SceneView::atmosphereEffect() const

Gets the atmosphere display effect. Returns the atmosphere effect.

See also setAtmosphereEffect().

CameraController *SceneView::cameraController() const

Returns the CameraController for the sceneview.

The camera controller determines the camera interaction and navigation model. The default is GlobeCameraController.

See also setCameraController().

Camera SceneView::currentViewpointCamera() const

Gets the Camera. Returns the camera for the sceneview.

double SceneView::fieldOfView() const

Gets the field of view on the scene view in degrees.

The default value is 45.0.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also setFieldOfView().

double SceneView::fieldOfViewDistortionRatio() const

Gets the the distortion factor.

The distortion factor determines how much the vertical field of view is distorted. A distortion factor less than 1.0 will cause the visuals to be stretched taller in comparison to their width. A distortion factor greater than 1.0 will cause the visuals to be shrunk shorter in comparison to their width.

The default value is 1.0.

This function was introduced in Esri::ArcGISRuntime 100.6.

bool SceneView::isManualRendering() const

Returns whether the SceneView is under manual rendering control.

Note: manual rendering is only supported on iOS and Android platforms.

This property determines whether the SceneView will use manual rendering updates rather than the using the ArcGIS Runtime internal rendering mechanism.

When this property is true, you must call renderFrame for any updates to be drawn on the screen. Calling renderFrame isn't necessary when this property is false. The default value is false.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also renderFrame.

LocationToScreenResult SceneView::locationToScreen(const Point &scenePoint) const

Returns a LocationToScreenResult from the provided scenePoint.

void SceneView::renderFrame()

Manually render the current frame.

Note: manual rendering (along with this method) is only supported on iOS and Android platforms.

This call will block the caller until the latest changes have been rendered to the screen.

This method may be called from the main/GUI thread or a sub-thread. Do not mix calls from the main thread and a sub-thread to this method in the same application session.

If calling this method from a timer event, be sure to stop the timer before shutting down the application.

In certain situations you may be able to achieve better rendering performance by utilizing the single-threaded renderer. This is already the default setting on some platforms.

// use the environment variable to use the "basic" rendering loop
// for the Qt Quick Scene Graph
qputenv("QSG_RENDER_LOOP", "basic");

For more information, see here https://links.esri.com/qtquick-visualcanvas-scenegraph-rendering

This function was introduced in Esri::ArcGISRuntime 100.6.

See also isManualRendering.

Point SceneView::screenToBaseSurface(double screenX, double screenY) const

Returns the x/y location on the map that corresponds to the provided screen coordinates.

  • screenX - The x screen coordinate.
  • screenY - The y screen coordinate.

This method gets the x/y coordinates on the base surface that would be seen at the screen coordinates without regard for any features in the scene. Any features in the line of sight from the camera to the base surface are ignored. To convert this result into a 3D scene location, use the returned x/y coordinates with the z-value at that x/y location on the base surface.

TaskWatcher SceneView::screenToLocation(double screenX, double screenY)

Converts screenX and screenY screen coordinates to a Point in coordinates of the scene view asynchronously.

This method will wait for the next drawing cycle to get the exact point from the graphics card that is at the screen coordinate supplied. This location could be on the surface, a building, or a feature.

Note: This operation could return an empty point (clicked outside the earth).

[virtual protected] void SceneView::screenToLocationCompletedEvent(QUuid taskId, const Point &location)

Override this method to perform custom logic when a screenToLocation operation completes.

  • taskId - The task ID of the operation.
  • location - The location in scene coordinates.

void SceneView::setAmbientLightColor(const QColor &color)

Sets the ambient light color.

  • color - The ambient light color to set.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also ambientLightColor().

void SceneView::setArcGISScene(Scene *scene)

Sets the scene associated with this SceneView.

  • scene - The scene to associate with this sceneview.

See also arcGISScene().

void SceneView::setAtmosphereEffect(AtmosphereEffect atmosphereEffect)

Sets the atmosphere display effect.

See also atmosphereEffect().

void SceneView::setCameraController(CameraController *cameraController)

Sets the sceneview's camera controller.

The camera controller determines the camera interaction and navigation model.

  • cameraController - The Camera controller to set for the sceneview.

The default is GlobeCameraController.

See also cameraController().

void SceneView::setFieldOfView(double angle)

Sets the field of view on the scene view in degrees to angle.

This value must be between 0 and 120. If the value is outside the range, the field of view is not changed and an error "Invalid argument" is emitted.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also fieldOfView().

void SceneView::setFieldOfViewAndDistortionRatio(double angle, double distortionRatio)

Sets the angle and the distortion factor.

Set the field of view on the scene view in degrees and determines how much the vertical field of view is distorted. A distortion factor of 1.0 is default. A distortion factor less than 1.0 will cause the visuals to be stretched taller in comparison to their width. A distortion factor greater than 1.0 will cause the visuals to be shrunk shorter in comparison to their width.

  • angle - The field of view on the scene view in degrees. This value must be between 0 and 120.
  • distortionRatio - The field of view vertical distortion ratio. This value must be between 0.1 and 10.

If the values are outside the range, the field of view and the field of view vertical distortion ratio are not changed and an error "Invalid argument" is emitted.

This function was introduced in Esri::ArcGISRuntime 100.6.

void SceneView::setFieldOfViewFromLensIntrinsics(double xFocalLength, double yFocalLength, double xPrincipal, double yPrincipal, double xImageSize, double yImageSize, DeviceOrientation deviceOrientation)

Sets the field of view of a camera lens using the lens characteristics.

Allows for matching the field of view of the scene view to the field of view of a camera lens using the lens characteristics.

  • xFocalLength - The pixel focal length along the x axis. The units are in pixels. xFocal and yFocal should be identical for square pixels.
  • yFocalLength - The pixel focal length along the y axis. The units are in pixels. xFocal and yFocal should be identical for square pixels.
  • xPrincipal - The distance along the x axis between the principal point and the top-left corner of the image frame. The units are in pixels.
  • yPrincipal - The distance along the y axis between the principal point and the top-left corner of the image frame. The units are in pixels.
  • xImageSize - The x value of the image size captured by the camera. The units are in pixels.
  • yImageSize - The y value of the image size captured by the camera. The units are in pixels.
  • deviceOrientation - Describes the orientation of the device.

This function was introduced in Esri::ArcGISRuntime 100.6.

[virtual] void SceneView::setManualRendering(bool manualRendering)

Sets the SceneView rendering mode manualRendering.

Note: manual rendering is only supported on iOS and Android platforms.

When the SceneView is using manual rendering, you must call renderFrame on a regular interval for the view to update.

Note: this can only be set once, and must be set as early as possible. This setting cannot be changed once rendering has started.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also isManualRendering() and renderFrame.

void SceneView::setSpaceEffect(SpaceEffect spaceEffect)

Sets the space effect for the scene view.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also spaceEffect().

void SceneView::setSunLighting(LightingMode lightingMode)

Sets the lighting mode for the sceneview.

The lighting mode determines whether the Earth appears to be illuminated by the Sun, and whether to simulate shadows. For example, this can be used to control whether the shadows of terrain and 3D models are cast.

  • lightingMode - The lighting mode to set.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also sunLighting().

void SceneView::setSunTime(const QDateTime &sunTime)

Sets the Sun's position to simulate a specific time.

You can simulate the Sun's position relative to the Earth to be as it would at a specific date and time.

The default time of the simulation is September 22, 2000 at noon GMT.

  • sunTime - The time to be used.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also sunTime().

TaskWatcher SceneView::setViewpointCamera(const Camera &camera)

Sets the Camera for the scene view asynchronously.

The Camera determines at what position and angle the scene is viewed.

  • camera - The Camera to set for the scene view.

TaskWatcher SceneView::setViewpointCamera(const Camera &camera, float durationSeconds)

Sets the Camera for the scene view asynchronously with animation duration.

The Camera determines at what position and angle the scene is viewed.

  • camera - The Camera to set for the scene view.
  • durationSeconds - The number of seconds for the animation to run from beginning to end.

void SceneView::setViewpointCameraAndWait(const Camera &camera)

Sets the Camera for the scene view synchronously. This call runs in the same thread as the caller and will block until it finishes.

The Camera determines at what position and angle the scene is viewed.

  • camera - The Camera to set for the sceneview.

[virtual protected] void SceneView::setViewpointCameraCompletedEvent(bool success)

Override this method to perform custom logic when a setViewpointCamera operation completes.

  • success True if setting the viewport camera completed successfully.

SpaceEffect SceneView::spaceEffect() const

Gets the space effect for the scene view.

Determines whether outer space is black with stars or transparent in the scene view.

The default value is SpaceEffect::Stars.

This function was introduced in Esri::ArcGISRuntime 100.6.

See also setSpaceEffect().

LightingMode SceneView::sunLighting() const

Returns the lighting mode.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setSunLighting().

QDateTime SceneView::sunTime() const

Gets the time used to simulate the Sun's position.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setSunTime().


Feedback on this topic?