Skip To Content ArcGIS for Developers Sign In Dashboard

OrbitGeoElementCameraController Class

(Esri::ArcGISRuntime::OrbitGeoElementCameraController)

Provides orbital camera navigation around a stationary or moving GeoElement. More...

Header: #include <OrbitGeoElementCameraController>
Since: Esri::ArcGISRuntime 100.1
Inherits: CameraController

Public Functions

OrbitGeoElementCameraController(GeoElement *geoElement, double distance, QObject *parent = nullptr)
~OrbitGeoElementCameraController()
double cameraDistance() const
double cameraHeadingOffset() const
double cameraPitchOffset() const
bool isAutoHeadingEnabled() const
bool isAutoPitchEnabled() const
bool isAutoRollEnabled() const
bool isCameraDistanceInteractive() const
bool isCameraHeadingOffsetInteractive() const
bool isCameraPitchOffsetInteractive() const
double maxCameraDistance() const
double maxCameraHeadingOffset() const
double maxCameraPitchOffset() const
double minCameraDistance() const
double minCameraHeadingOffset() const
double minCameraPitchOffset() const
TaskWatcher moveCamera(double distanceDelta, double headingDelta, double pitchDelta, float duration)
void setAutoHeadingEnabled(bool enabled)
void setAutoPitchEnabled(bool enabled)
void setAutoRollEnabled(bool enabled)
void setCameraDistance(double distance)
void setCameraDistanceInteractive(bool interactiveDistance)
void setCameraHeadingOffset(double cameraHeading)
void setCameraHeadingOffsetInteractive(bool interactiveHeading)
void setCameraPitchOffset(double cameraPitch)
void setCameraPitchOffsetInteractive(bool interactivePitch)
void setMaxCameraDistance(double maxDistance)
void setMaxCameraHeadingOffset(double maxHeading)
void setMaxCameraPitchOffset(double maxPitch)
void setMinCameraDistance(double minDistance)
void setMinCameraHeadingOffset(double minHeading)
void setMinCameraPitchOffset(double minPitch)
void setTargetOffsetX(double offsetX)
void setTargetOffsetY(double offsetY)
void setTargetOffsetZ(double offsetZ)
TaskWatcher setTargetOffsets(double x, double y, double z, float duration)
void setTargetVerticalScreenFactor(float verticalFactor)
GeoElement *targetGeoElement() const
double targetOffsetX() const
double targetOffsetY() const
double targetOffsetZ() const
float targetVerticalScreenFactor() const

Signals

void cameraDistanceChanged()
void cameraHeadingOffsetChanged()
void cameraPitchOffsetChanged()
void moveCameraCompleted(QUuid taskId, bool succeeded)
void setTargetOffsetsCompleted(QUuid taskId, bool succeeded)

Additional Inherited Members

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

Detailed Description

Provides orbital camera navigation around a stationary or moving GeoElement.

Camera controllers can be applied to a SceneView to determine the camera interaction and navigation model.

Setting this type as the CameraController for a SceneView will ensure that the camera is always focused on the targetGeoElement. The controller allows the camera to be adjusted relative to the orientation of the targetGeoElement.

When the target moves, the camera will move with the target to maintain it's relative position. To update the target's heading, pitch and roll you must use a Renderer and GeoElement attributes.

When using a Graphic as the GeoElement, the Graphic and the GraphicsOverlay that contains it must be added to the SceneView before you add the OrbitGeoElementCameraController to the SceneView.

Member Function Documentation

OrbitGeoElementCameraController::OrbitGeoElementCameraController(GeoElement *geoElement, double distance, QObject *parent = nullptr)

Constructs a OrbitGeoElementCameraController with a specified target element.

  • geoElement - The element which will be the focus of the camera in the view.
  • distance - The distance (in meters) from the GeoElement the camera will be placed.
  • parent - An optional parent.

OrbitGeoElementCameraController::~OrbitGeoElementCameraController()

Destructor.

double OrbitGeoElementCameraController::cameraDistance() const

Get the distance from the target object to the camera in meters.

See also setCameraDistance().

[signal] void OrbitGeoElementCameraController::cameraDistanceChanged()

Signal emitted when the distance from the camera to the target is changed.

double OrbitGeoElementCameraController::cameraHeadingOffset() const

Get the heading offset of the camera, in degrees, relative to the target object.

A clockwise angle in the target's horizontal plane starting from the heading of the target.

For example, if the target has a heading of 45°,a heading offset of 10 for the camera controller indicates an effective compass bearing of 55°.

The default is 0°.

See also setCameraHeadingOffset().

[signal] void OrbitGeoElementCameraController::cameraHeadingOffsetChanged()

Signal emitted when the heading offset from the camera relative to the target is changed.

double OrbitGeoElementCameraController::cameraPitchOffset() const

Get the pitch offset of the camera, in degrees, relative to the target object.

An anti-clockwise angle from the positive z-axis of the target element to the target's horizontal plane.

The default is 45°.

See also setCameraPitchOffset().

[signal] void OrbitGeoElementCameraController::cameraPitchOffsetChanged()

Signal emitted when the pitch offset from the camera relative to the target is changed.

bool OrbitGeoElementCameraController::isAutoHeadingEnabled() const

Returns whether the camera heading offset is updated with target's heading.

When true, the camera's position will rotate with the target's heading. Otherwise, the camera position is not affected by the target's heading.

Defaults to true.

bool OrbitGeoElementCameraController::isAutoPitchEnabled() const

Returns whether the camera pitch offset is updated with target's pitch.

If true, the camera will maintain its roll offset when the target's roll changes. The graphic's roll can be controlled using an expression in the renderer class.

Defaults to true.

bool OrbitGeoElementCameraController::isAutoRollEnabled() const

Returns whether the camera roll offset is updated with target's roll.

When true, the camera's position will rotate with the target's roll. Otherwise, the camera position is not affected by the target's roll.

Defaults to true.

bool OrbitGeoElementCameraController::isCameraDistanceInteractive() const

Returns whether user interactions affect the distance from the camera to the target element.

When true, the user may zoom towards and away from the targetGeoElement using mouse/touch interactions with the view.

The default setting is true.

bool OrbitGeoElementCameraController::isCameraHeadingOffsetInteractive() const

Returns whether user interactions affect the heading of the camera relative to the target element.

When interactive heading is true the user is able to manually change the relative heading between the target focal point and the camera.

The default setting is true.

bool OrbitGeoElementCameraController::isCameraPitchOffsetInteractive() const

Returns whether user interactions affect the pitch of the camera relative to the target element.

When interactive pitch is true the user is able to manually change the relative pitch between the target focal point and the camera.

The default setting is true

double OrbitGeoElementCameraController::maxCameraDistance() const

Returns the maximum camera distance from the target in meters.

See also setMaxCameraDistance().

double OrbitGeoElementCameraController::maxCameraHeadingOffset() const

Returns the maximum camera heading offset in degrees.

See also setMaxCameraHeadingOffset().

double OrbitGeoElementCameraController::maxCameraPitchOffset() const

Returns the maximum camera pitch offset in degrees.

Defaults to 180°.

See also setMaxCameraPitchOffset().

double OrbitGeoElementCameraController::minCameraDistance() const

Returns the minimum distance from the camera to the target in meters.

Defaults to 0.

See also setMinCameraDistance().

double OrbitGeoElementCameraController::minCameraHeadingOffset() const

Returns the minimum camera heading offset in degrees.

Defaults to 0°.

See also setMinCameraHeadingOffset().

double OrbitGeoElementCameraController::minCameraPitchOffset() const

Returns the minimum camera pitch offset in degrees.

Defaults to 0°.

See also setMinCameraPitchOffset().

TaskWatcher OrbitGeoElementCameraController::moveCamera(double distanceDelta, double headingDelta, double pitchDelta, float duration)

Animate the camera to the new offset position relative to the target.

  • distanceDelta - The change in distance (meters) to apply in the animation.
  • headingDelta - The change in heading (degrees) to apply in the animation.
  • pitchDelta - The change in pitch (degrees) to apply in the animation.
  • duration - The duration of the animation in seconds.

The moveCameraCompleted signal emits when the operation is complete.

[signal] void OrbitGeoElementCameraController::moveCameraCompleted(QUuid taskId, bool succeeded)

Signal emitted when a moveCamera operation is completed.

  • taskId - The task ID of the asynchronous task.
  • succeeded - Whether the operation was successful.

void OrbitGeoElementCameraController::setAutoHeadingEnabled(bool enabled)

Sets whether the camera heading offset is updated with target's heading to enabled.

When true, the camera's position will rotate with the target's heading. Otherwise, the camera position is not affected by the target's heading.

See also isAutoHeadingEnabled().

void OrbitGeoElementCameraController::setAutoPitchEnabled(bool enabled)

Sets whether the camera pitch offset is updated with target's pitch to enabled.

If true, the camera will maintain its pitch offset when the target's pitch changes. The target's pitch can be controlled using an expression in the renderer class.

See also isAutoPitchEnabled().

void OrbitGeoElementCameraController::setAutoRollEnabled(bool enabled)

Sets whether the camera pitch offset is updated with target's pitch to enabled.

If true, the camera will maintain its roll offset when the target's roll changes. The target's roll can be controlled using an expression in the RendererSceneProperties applied to the element's renderer.

See also isAutoRollEnabled().

void OrbitGeoElementCameraController::setCameraDistance(double distance)

Set the distance from the target object to the camera in meters.

  • distance - Distance from the target in meters.

This value must be greater than 0.

See also cameraDistance().

void OrbitGeoElementCameraController::setCameraDistanceInteractive(bool interactiveDistance)

Enables user interactions for changing the distance/zoom between the camera and the target object.

Set interactiveDistance to true to allow the user to zoom towards and away from the targetGeoElement using mouse/touch interactions with the view.

See also isCameraDistanceInteractive().

void OrbitGeoElementCameraController::setCameraHeadingOffset(double cameraHeading)

Sets the heading offset, in degrees, relative to the target object.

  • cameraHeading - The heading offset of the camera in degrees.

A clockwise angle in the target's horizontal plane starting from the heading of the target. Any angle in degrees is valid: the value will be wrapped between -180° and 180°.

See also cameraHeadingOffset().

void OrbitGeoElementCameraController::setCameraHeadingOffsetInteractive(bool interactiveHeading)

Enables user interactions for changing the heading offset between the camera and the target object.

Set interactiveHeading to true to allow the user to interactively change the heading between the camera and the target object using mouse/touch interactions with the view.

See also isCameraHeadingOffsetInteractive().

void OrbitGeoElementCameraController::setCameraPitchOffset(double cameraPitch)

Sets the pitch offset, in degrees, relative to the target object.

  • cameraPitch - The pitch offset of the camera in degrees.

An anti-clockwise angle from the positive z-axis of the target element to the target's horizontal plane. Any angle in degrees is valid: the value will be wrapped between 0° and 180°.

See also cameraPitchOffset().

void OrbitGeoElementCameraController::setCameraPitchOffsetInteractive(bool interactivePitch)

Enables user interactions for changing the pitch offset between the camera and the target object.

Set interactivePitch to true to allow the user to interactively change the pitch of the camera relative to the target object using mouse/touch interactions with the view.

See also isCameraPitchOffsetInteractive().

void OrbitGeoElementCameraController::setMaxCameraDistance(double maxDistance)

Sets the maximum distance from the camera to the target in meters.

  • maxDistance - The new value for the maximum camera distance.

See also maxCameraDistance().

void OrbitGeoElementCameraController::setMaxCameraHeadingOffset(double maxHeading)

Sets the maximum camera heading offset in degrees.

  • maxHeading - The new value for the maximum camera heading offset.

This value must be greater than minCameraHeadingOffset.

See also maxCameraHeadingOffset().

void OrbitGeoElementCameraController::setMaxCameraPitchOffset(double maxPitch)

Sets the maximum camera pitch offset in degrees.

  • maxPitch - The new value for the maximum camera pitch offset.

This value must be greater than minCameraPitchOffset.

See also maxCameraPitchOffset().

void OrbitGeoElementCameraController::setMinCameraDistance(double minDistance)

Sets the minimum distance from the camera to the target.

  • minDistance - The new value for the minimum camera distance.

This value must be greater than 0.

See also minCameraDistance().

void OrbitGeoElementCameraController::setMinCameraHeadingOffset(double minHeading)

Sets the minimum camera heading offset in degrees.

  • minHeading - The new value for the minimum camera heading offset.

This value must be greater than 0° and less than maxCameraHeadingOffset.

See also minCameraHeadingOffset().

void OrbitGeoElementCameraController::setMinCameraPitchOffset(double minPitch)

Sets the minimum camera pitch offset in degrees.

  • minPitch - The new value for the minimum camera pitch offset.

This value must be less than maxCameraPitchOffset.

See also minCameraPitchOffset().

void OrbitGeoElementCameraController::setTargetOffsetX(double offsetX)

Offsets the target focus point relative to the target object in the x-axis in the target's coordindate system.

  • offsetX - Offset to apply to the target focal point relative to the target object in the x-axis.

Setting the offsets for the target allows the user to move the focal point from the graphic's geometry to any point.

See also targetOffsetX().

void OrbitGeoElementCameraController::setTargetOffsetY(double offsetY)

Offsets the target focus point relative to the target object in the y-axis in the target's coordindate system.

  • offsetY - Offset to apply to the target focal point relative to the target object in the y-axis.

Setting the offsets for the target allows the user to move the focal point from the graphic's geometry to any pointl.

See also targetOffsetY().

void OrbitGeoElementCameraController::setTargetOffsetZ(double offsetZ)

Offsets the target focus point relative to the target object in the z-axis in the target's coordindate system.

  • offsetZ - Offset to apply to the target focal point relative to the target object in the z-axis.

Setting the offsets for the target allows the user to move the focal point from the graphic's geometry to any point.

See also targetOffsetZ().

TaskWatcher OrbitGeoElementCameraController::setTargetOffsets(double x, double y, double z, float duration)

Animate the camera to focus on the new point offset relative to the target.

  • x - The offset along the target's x-axis to apply in the animation.
  • y - The offset along the target's y-axis to apply in the animation.
  • z - The offset along the target's z-axis to apply in the animation.
  • duration - The duration of the animation in seconds.

The setTargetOffsetsCompleted signal emits when the operation is complete.

[signal] void OrbitGeoElementCameraController::setTargetOffsetsCompleted(QUuid taskId, bool succeeded)

Signal emitted when a setTargetOffsets operation is completed.

  • taskId - The task ID of the asynchronous task.
  • succeeded - Whether the operation was successful.

void OrbitGeoElementCameraController::setTargetVerticalScreenFactor(float verticalFactor)

Sets the target vertical screen factor of the orbit camera controller.

  • verticalFactor - A factor indicating the target object vertical screen position, values between 0.0 - 1.0.

Controls the vertical position of the target on the screen. The value can range between 0.0 (bottom of the screen) and 1.0 (top of the screen).

Defaults to 0.5 (center of the screen).

See also targetVerticalScreenFactor().

GeoElement *OrbitGeoElementCameraController::targetGeoElement() const

Returns the target GeoElement which is the focal point for the camera.

double OrbitGeoElementCameraController::targetOffsetX() const

Returns the x offset of the target focus point relative to the target object in the x-axis of the target's coordindate system.

The offset of the camera focal point from the targetGeoElement along its x-axis.

Defaults to 0.

See also setTargetOffsetX().

double OrbitGeoElementCameraController::targetOffsetY() const

Returns the y offset of the target focus point relative to the target object in the y-axis of the target's coordindate system.

The offset of the camera focal point from the targetGeoElement along its y-axis.

Defaults to 0.

See also setTargetOffsetY().

double OrbitGeoElementCameraController::targetOffsetZ() const

Returns the z offset of the target focus point relative to the target object in the z-axis of the target's coordindate system.

The offset of the camera focal point from the targetGeoElement along its z-axis.

Defaults to 0.

See also setTargetOffsetZ().

float OrbitGeoElementCameraController::targetVerticalScreenFactor() const

Returns the target vertical screen factor of the orbit camera controller.

Controls the vertical position of the target on the screen. The value can range between 0.0 (bottom of the screen) and 1.0 (top of the screen).

Defaults to 0.5 (center of the screen).

See also setTargetVerticalScreenFactor().


Feedback on this topic?