Support Orbital Camera navigation around a stationary or moving point GeoElement object. More...
Header: | #include <OrbitGeoElementCameraController.h> |
Since: | Esri::ArcGISRuntime 100.1 |
Inherits: | Esri::ArcGISRuntime::CameraController |
Public Functions
OrbitGeoElementCameraController(Esri::ArcGISRuntime::GeoElement *geoElement, double distance, QObject *parent = nullptr) | |
virtual | ~OrbitGeoElementCameraController() override |
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 |
QFuture<bool> | moveCameraAsync(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) |
QFuture<bool> | setTargetOffsetsAsync(double x, double y, double z, float duration) |
void | setTargetVerticalScreenFactor(float verticalFactor) |
Esri::ArcGISRuntime::GeoElement * | targetGeoElement() const |
double | targetOffsetX() const |
double | targetOffsetY() const |
double | targetOffsetZ() const |
float | targetVerticalScreenFactor() const |
Signals
void | cameraDistanceChanged() |
void | cameraHeadingOffsetChanged() |
void | cameraPitchOffsetChanged() |
Detailed Description
Orbit camera controller provides orbital navigation around a point object.
See also OrbitLocationCameraController and GlobeCameraController.
Member Function Documentation
OrbitGeoElementCameraController::OrbitGeoElementCameraController (Esri::ArcGISRuntime::GeoElement *geoElement , double distance, QObject *parent = nullptr)
Creates an OrbitGeoElementCameraController using a distance to specified GeoElement.
- geoElement - A pointer to the GeoElement which will be the focus of the camera in the view.
- distance - The distance from the GeoElement the camera will be placed.
- parent - The optional parent QObject.
An Orbit camera controller is used associate camera navigation and movement with a GeoElement point object. This can take the form of a Graphic, a Feature, or a DynamicEntity. When the controller is set on the Scene View using SceneView::cameraController the interaction mode for will change for the active navigation model be focused on the input GeoElement allowing the user to rotation around and zoom in an out from the object. For a moving GeoElement the camera will move in synchronization with it. Adjusting it position, heading, pitch and roll with the object by simply changing the object with no requirement to change the camera.
[override virtual]
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.
There is no limit on the set maximum distance. Animations and interactions are bounded by this limit.
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.
Animations and interactions are bounded by this limit.
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().
[since Esri::ArcGISRuntime 200.2]
QFuture<bool> OrbitGeoElementCameraController::moveCameraAsync (double distanceDelta , double headingDelta , double pitchDelta , float duration)
Animate the camera to the new position relative to the target.
- distanceDelta - The change in distance to apply in the animation.
- headingDelta - The change in heading to apply in the animation.
- pitchDelta - The change in pitch to apply in the animation.
- duration - The duration of the animation in seconds.
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.
This function was introduced in Esri::ArcGISRuntime 200.2.
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 coordinate 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 coordinate 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 coordinate 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().
[since Esri::ArcGISRuntime 200.2]
QFuture<bool> OrbitGeoElementCameraController::setTargetOffsetsAsync (double x, double y, double z, float duration)
Animate the camera target offsets of the camera.
- x - The change x offset symbol center.
- y - The change y offset symbol center.
- z - The change z offset symbol center.
- duration - The duration of the animation in seconds.
By default the camera focus's on the target's geometry center point. Using the offsets you can move the focal point to a new position relative to that center point.
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.
This function was introduced in Esri::ArcGISRuntime 200.2.
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().
Esri::ArcGISRuntime::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 coordinate 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 coordinate 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 coordinate 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().