diff --git a/.clang-format b/.clang-format index a7e998eff..d03d38161 100644 --- a/.clang-format +++ b/.clang-format @@ -16,7 +16,7 @@ # and Qt Creator 4.14.1. Language: Cpp -Standard: c++14 +Standard: c++17 # Pointers DerivePointerAlignment: false diff --git a/CHANGELOG.md b/CHANGELOG.md index ff88d08ed..979b47599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 200.0 +* (UtilityNetworkTrace) Introduction of the new Utility Network Trace tool (C++/Quick). + ## 100.15 * (Callout) Deprecated `calloutContent` property in favour of `contentItem` usage. @@ -9,7 +12,7 @@ * Added a `CONTRIBUTING.md`. * Added a `.clang-format` file. * Added vscode/spellchecking for documentation purposes. -* (BookmarksView) Introduction of new Bookmark tool (C++/Quick, QML/Quick, Widget) +* (BookmarksView) Introduction of new Bookmark tool (C++/Quick, QML/Quick, Widget). ## 100.14 * `toolkitwidgets.pri`, `toolkitqml.pri`, and `toolkitcpp.pri` now include `QT += ...` lines to account for needed dependencies. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86b6fa7ca..3d6e4b028 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Welcome to the contributors' guide on the ArcGIS Runtime toolkit! We hope this document +Welcome to the contributors' guide on the ArcGIS Maps SDK for Qt Toolkit! We hope this document encourages you to help improve and expand upon our toolkit offering. For specific resources on: @@ -14,45 +14,45 @@ You will need: - System requirements as laid out [here](https://developers.arcgis.com/qt/reference/system-requirements/) for your development platform. -- Latest version of the [ArcGIS Runtime SDK](https://developers.arcgis.com/qt/). +- Latest version of the [ArcGIS Maps SDK for Qt](https://developers.arcgis.com/qt/). ## Important resources -- The [Qt ArcGIS Runtime API Reference](https://developers.arcgis.com/qt/api-reference/). Which includes: +- The [ArcGIS Maps SDK for Qt Reference](https://developers.arcgis.com/qt/api-reference/). Which includes: - [Qt Toolkit API](https://developers.arcgis.com/qt/toolkit/api-reference/). - [QML API](https://developers.arcgis.com/qt/qml/api-reference/). - [C++ API](https://developers.arcgis.com/qt/cpp/api-reference/). -- The [Qt ArcGIS Runtime Guide](https://developers.arcgis.com/qt/). +- The [ArcGIS Maps SDK for Qt Guide](https://developers.arcgis.com/qt/). - [Qt's board on Esri Community](https://community.esri.com/t5/arcgis-runtime-sdk-for-qt-questions/bd-p/arcgis-runtime-sdk-for-qt-questions). - [Official Qt documentation](https://doc.qt.io/). -- [DSA App](https://github.com/Esri/dynamic-situational-awareness-qt), an open source project built with the ArcGIS Runtime Toolkit for Qt. +- [DSA App](https://github.com/Esri/dynamic-situational-awareness-qt), an open source project built with the ArcGIS Maps SDK for Qt Toolkit. ## Submitting a change There are two active branches within toolkit: `main` and `v.next`. -- **main** is the active branch, and must always be compatible with - the [release version of ArcGIS Runtime for Qt](https://developers.arcgis.com/qt/). This is +- **main** is the active branch, and must always be compatible with + the [release version of ArcGIS Maps SDK for Qt](https://developers.arcgis.com/qt/). This is the main branch all our users consume to access toolkit features. - **v.next** is the "next version" branch which contains upcoming features and is - compatible with the upcoming version of ArcGIS Runtime. While anyone may contribute to this + compatible with the upcoming version of the ArcGIS Maps SDK. While anyone may contribute to this branch, public contributors outside of Esri will not be able to build this branch as the upcoming - version of ArcGIS Runtime will be unavailable. + version of ArcGIS Maps SDK will be unavailable. ### Bugfixes If you are contributing a bugfix, and you believe the bug is high priority -in impact, then target the **main** branch in your PR. Otherwise consider targeting **v.next**! +in impact, then target the **main** branch in your PR. Otherwise consider targeting **v.next**! If unsure, the PR reviewer can help make the right call. ### Feature enhancements -Once you have implemented a new feature, and are ready for a pull-request, please target the **v.next** branch. +Once you have implemented a new feature, and are ready for a pull-request, please target the **v.next** branch. This helps the toolkit team verify the feature is production ready before we ship! ### CHANGELOG.md diff --git a/README.md b/README.md index 34bdba964..e85c64d68 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -# ArcGIS Runtime Toolkit - Qt +# ArcGIS Maps SDK for Qt Toolkit [![API reference](https://img.shields.io/badge/API_Reference-purple)](https://developers.arcgis.com/qt/latest/toolkit/api-reference/) [![Current release](https://img.shields.io/github/v/release/esri/arcgis-runtime-toolkit-qt?label=current%20release)](https://github.com/Esri/arcgis-runtime-toolkit-qt/releases) ## Introduction -This toolkit is an open source resource intended for use with the ArcGIS Runtime +This toolkit is an open source resource intended for use with the ArcGIS Maps SDK for Qt. It provides ready made components to complement mapping and GIS applications. Because it is open source you are encouraged to modify these tools and add your own. ## Resources -* [ArcGIS Runtime SDK for Qt](https://developers.arcgis.com/qt/) +* [ArcGIS Maps SDK for Qt](https://developers.arcgis.com/qt/) * [System requirements](https://developers.arcgis.com/qt/latest/qml/guide/system-requirements.htm) * [Qt and QML](http://www.qt.io/) diff --git a/augmentedreality/Common/3rdparty/arcore/include/arcore_c_api.h b/augmentedreality/Common/3rdparty/arcore/include/arcore_c_api.h index 2638eb65c..f2ff9b0b3 100755 --- a/augmentedreality/Common/3rdparty/arcore/include/arcore_c_api.h +++ b/augmentedreality/Common/3rdparty/arcore/include/arcore_c_api.h @@ -20,48 +20,49 @@ #include /// @defgroup concepts Concepts -/// High-Level concepts of ARCore +/// High-Level ARCore concepts. /// /// @section ownership Object ownership /// -/// ARCore has two categories of objects: "value types" and "reference types". +/// ARCore objects fall into two categories: /// -/// - Value types are owned by application. They are created and destroyed using -/// the @c create / @c destroy methods, and are populated by ARCore using -/// methods with @c get in the method name. +/// - Value types are owned by application. They are created and +/// destroyed using the @c create / @c destroy functions, and are populated by +/// ARCore using functions with @c get in the function name. /// -/// - Reference types are owned by ARCore. A reference is acquired by one of the -/// @c acquire methods. For each call to the @c acquire method, the -/// application must call the matching @c release method. Note that even if -/// last reference is released, ARCore may continue to hold a reference to the -/// object at ARCore's discretion. +/// - Reference types are owned by ARCore. A reference is acquired by one +/// of the @c acquire functions. For each call to the @c acquire function, +/// the application must call the matching @c release function. Note that even +/// if the last reference is released, ARCore may continue to hold a reference +/// to the object at ARCore's discretion. /// /// Reference types are further split into: /// -/// - Long-lived objects. These objects persist across frames, possibly for the -/// life span of the application or session. Acquire may fail if ARCore is in -/// an incorrect state, e.g. not tracking. Acquire from list always succeeds, -/// as the object already exists. +/// - Long-lived objects. These objects persist across frames, possibly +/// for the life span of the application or session. Acquire may fail if +/// ARCore is in an incorrect state, e.g. not tracking. Acquire from list +/// always succeeds, as the object already exists. /// -/// - Transient large data. These objects are usually acquired per-frame and are -/// a limited resource. The @c acquire call may fail if the resource is -/// exhausted (too many are currently held), deadline exceeded (the target of -/// the acquire was already released), or the resource is not yet available. +/// - Transient large data. These objects are usually acquired per-frame +/// and are a limited resource. The @c acquire call may fail if the resource +/// is exhausted (too many are currently held), deadline exceeded (the target +/// of the acquire was already released), or the resource is not yet +/// available. /// /// Note: Lists are value types (owned by application), but can hold references /// to long-lived objects. This means that the references held by a list are not /// released until either the list is destroyed, or is re-populated by another /// api call. /// -/// For example, ::ArAnchorList, which is a value type, will hold references to -/// Anchors, which are long-lived objects. +/// For example, @c ::ArAnchorList, which is a value type, will hold references +/// to anchors, which are long-lived objects. /// -/// @section spaces Poses and Coordinate Spaces +/// @section spaces Poses and coordinate spaces /// -/// An @c ArPose describes an rigid transformation from one coordinate space to -/// another. As provided from all ARCore APIs, Poses always describe the +/// An @c ::ArPose describes an rigid transformation from one coordinate space +/// to another. As provided from all ARCore APIs, poses always describe the /// transformation from object's local coordinate space to the world -/// coordinate space (see below). That is, Poses from ARCore APIs can be +/// coordinate space (see below). That is, poses from ARCore APIs can be /// thought of as equivalent to OpenGL model matrices. /// /// The transformation is defined using a quaternion rotation about the origin @@ -71,7 +72,7 @@ /// /// Translation units are meters. /// -/// @section worldcoordinates World Coordinate Space +/// @section worldcoordinates World coordinate space /// /// As ARCore's understanding of the environment changes, it adjusts its model /// of the world to keep things consistent. When this happens, the numerical @@ -86,312 +87,467 @@ /// beyond the scope of a single rendering frame, either an anchor should be /// created or a position relative to a nearby existing anchor should be used. -/// @defgroup common Common Definitions -/// Shared types and constants +/// @defgroup shared_types Shared types and enums +/// Shared types and constants. -/// @defgroup anchor Anchor -/// Describes a fixed location and orientation in the real world. +/// @defgroup utility_functions Utility functions +/// Utility functions for releasing data. -/// @defgroup arcoreapk ArCoreApk -/// Management of the ARCore service APK +#ifdef __cplusplus +/// @defgroup type_conversions C++ type conversions +/// These functions expose allowable type conversions as C++ helper functions. +/// This avoids having to explicitly @c reinterpret_cast in most cases. +/// +/// Note: These functions only change the type of a pointer; they do not change +/// the reference count of the referenced objects. +/// +/// Note: There is no runtime checking that casts are correct. Call +/// @c ::ArTrackable_getType beforehand to figure out the correct cast. -/// @defgroup augmented_image AugmentedImage -/// An image being detected and tracked by ARCore. +/// @defgroup ArAnchor ArAnchor +/// Describes a fixed location and orientation in the real world, representing +/// local and Cloud Anchors. -/// @defgroup augmented_face AugmentedFace -/// Describes a face detected by ARCore and provides methods to access +/// @defgroup ArAugmentedFace ArAugmentedFace +/// Describes a face detected by ARCore and provides functions to access /// additional center and face region poses as well as face mesh related data. /// /// Augmented Faces supports front-facing (selfie) camera only, and does not /// support attaching anchors nor raycast hit testing. Calling -/// #ArTrackable_acquireNewAnchor() will return @c AR_ERROR_ILLEGAL_STATE. +/// @c ::ArTrackable_acquireNewAnchor will return @c #AR_ERROR_ILLEGAL_STATE. +#endif // __cplusplus -/// @defgroup augmented_image_database AugmentedImageDatabase +/// @defgroup ArAugmentedImage ArAugmentedImage +/// An image being detected and tracked by ARCore. + +/// @defgroup ArAugmentedImageDatabase ArAugmentedImageDatabase /// Database containing a list of images to be detected and tracked by ARCore. -/// @defgroup camera Camera +/// @defgroup ArCamera ArCamera /// Provides information about the camera that is used to capture images. -/// @defgroup cloud Cloud Anchors -/// The cloud state and configuration of an Anchor and the AR Session. +/// @defgroup ArCameraConfig ArCameraConfig +/// Camera configuration. -/// @defgroup config Configuration -/// Session configuration. +/// @defgroup ArCameraConfigFilter ArCameraConfigFilter +/// Filters available camera configurations. -/// @defgroup cameraconfig CameraConfig -/// Camera configuration. +/// @defgroup ArCameraIntrinsics ArCameraIntrinsics +/// Provides information about the physical characteristics of the device +/// camera. -/// @defgroup frame Frame +/// @defgroup ArConfig ArConfig +/// Session configuration. +/// +/// To configure an @c ::ArSession: +/// +/// 1. Use @c ::ArConfig_create to create an @c ::ArConfig object. +/// 2. Call any number of configuration functions on the newly created object. +/// 3. To apply the configuration to the session, use @c ::ArSession_configure. +/// 4. To release the memory used by the @c ::ArConfig object, use +/// @c ::ArConfig_destroy. +/// +/// Note: None of the `ArConfig_set*()` functions will actually affect the state +/// of the given @c ::ArSession until @c ::ArSession_configure is called. + +/// @defgroup ArCoreApk ArCoreApk +/// Functions for installing and updating "Google Play Services for AR" (ARCore) +/// and determining whether the current device is an +/// ARCore +/// supported device. + +/// @defgroup ArDepthPoint ArDepthPoint +/// Hit Depth API + +/// @defgroup ArEarth ArEarth +/// A @c ::ArTrackable implementation representing the Earth. Provides +/// localization ability in geospatial coordinates. +/// +/// To access @c ::ArEarth, configure the session with an appropriate @c +/// ::ArGeospatialMode and use @c ::ArSession_acquireEarth. +/// +/// Not all devices support @c #AR_GEOSPATIAL_MODE_ENABLED, use +/// @c ::ArSession_isGeospatialModeSupported to check if the current device and +/// selected camera support enabling this mode. +/// +/// @c ::ArEarth should only be used when its @c ::ArTrackingState is @c +/// #AR_TRACKING_STATE_TRACKING, and otherwise should not be used. Use @c +/// ::ArTrackable_getTrackingState to obtain the current @c ::ArTrackingState. +/// If the @c ::ArTrackingState does not become @c #AR_TRACKING_STATE_TRACKING, +/// then @c ::ArEarth_getEarthState may contain more information as @c +/// ::ArEarthState. +/// +/// Use @c ::ArEarth_getCameraGeospatialPose to obtain the Earth-relative +/// virtual camera pose for the latest frame. +/// +/// Use @c ::ArEarth_acquireNewAnchor to attach anchors to Earth. Calling @c +/// ::ArTrackable_acquireNewAnchor with an @c ::ArEarth instance will +/// fail to create a new anchor and will return the @c +/// #AR_ERROR_INVALID_ARGUMENT error code. +/// +/// @c ::ArEarth does not support hit testing. Because @c ::ArEarth +/// is a type of @c ::ArTrackable, the singleton @c ::ArEarth instance may also +/// be returned by @c ::ArSession_getAllTrackables when enabled. + +/// @defgroup ArGeospatialPose ArGeospatialPose +/// Describes a specific location, elevation, and compass heading relative to +/// Earth (@ref ownership "value type"). It is comprised of: +/// +/// - Latitude and longitude are specified in degrees, with positive values +/// being north of the equator and east of the prime meridian as defined by +/// the WGS84 +/// specification. +/// - Altitude is specified in meters above the WGS84 ellipsoid, which is +/// roughly equivalent to meters above sea level. +/// - Heading is defined in degrees clockwise from north. See @c +/// ::ArGeospatialPose_getHeading for more information. +/// - Accuracy of the latitude, longitude, altitude, and heading are available +/// as numeric confidence intervals where a large value (large interval) means +/// low confidence and small value (small interval) means high confidence. +/// +/// An @c ::ArGeospatialPose can be retrieved from @c +/// ::ArEarth_getCameraGeospatialPose. +/// + +/// @defgroup ArFrame ArFrame /// Per-frame state. -/// @defgroup hit HitResult +/// @defgroup ArHitResult ArHitResult /// Defines an intersection between a ray and estimated real-world geometry. -/// @defgroup image Image -/// Provides access to metadata from the camera image capture result. - -/// @defgroup intrinsics Intrinsics -/// Provides information about the physical characteristics of the device -/// camera. - -/// @defgroup light LightEstimate +/// @defgroup ArImage ArImage +/// Provides access to CPU camera images. + +/// @defgroup ArImageMetadata ArImageMetadata +/// Provides access to CPU image camera metadata. + +/// @defgroup ArInstantPlacementPoint ArInstantPlacementPoint +/// Trackable Instant Placement point returned by +/// @c ::ArFrame_hitTestInstantPlacement. +/// +/// If ARCore has an accurate 3D pose for the @c ::ArInstantPlacementPoint +/// returned by @c ::ArFrame_hitTestInstantPlacement it will start with tracking +/// method @c #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING. +/// Otherwise, it will start with tracking method +/// @c +/// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE, +/// and will transition to +/// @c #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING +/// once ARCore has an accurate 3D pose. Once the tracking method is +/// @c #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING it will not +/// revert to @c +/// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE. +/// +/// When the tracking method changes from +/// @c +/// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE +/// in one frame to @c #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING +/// in the next frame, the pose will jump from its initial location based on the +/// provided approximate distance to a new location at an accurate distance. +/// +/// This instantaneous change in pose will change the apparent scale of any +/// objects that are anchored to the @c ::ArInstantPlacementPoint. That is, an +/// object will suddenly appear larger or smaller than it was in the previous +/// frame. +/// +/// To avoid the visual jump due to the sudden change in apparent object scale, +/// use the following procedure: +/// 1. Keep track of the pose and tracking method of the +/// @c ::ArInstantPlacementPoint in each frame. +/// 2. Wait for the tracking method to change to +/// @c #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING. +/// 3. Use the pose from the previous frame and the pose in the current frame to +/// determine the object's distance to the device in both frames. +/// 4. Calculate the apparent change in scale due to the change in distance +/// from the camera. +/// 5. Adjust the scale of the object to counteract the perceived change in +/// scale, so that visually the object does not appear to change in size. +/// 6. Optionally, smoothly adjust the scale of the object back to its original +/// value over several frames. + +/// @defgroup ArLightEstimate ArLightEstimate /// Holds information about the estimated lighting of the real scene. -/// @defgroup plane Plane +/// @defgroup ArPlane ArPlane /// Describes the current best knowledge of a real-world planar surface. -/// @defgroup point Point +/// @defgroup ArPoint ArPoint /// Represents a point in space that ARCore is tracking. -/// @defgroup pointcloud PointCloud +/// @defgroup ArPointCloud ArPointCloud /// Contains a set of observed 3D points and confidence values. -/// @defgroup pose Pose +/// @defgroup ArPose ArPose /// Represents an immutable rigid transformation from one coordinate /// space to another. -/// @defgroup session Session -/// Session management. +/// @defgroup ArRecordingConfig ArRecordingConfig +/// Session recording management. -/// @defgroup trackable Trackable -/// Something that can be tracked and that Anchors can be attached to. +/// @defgroup ArTrack ArTrack +/// External data recording. -/// @defgroup cpp_helpers C++ helper functions +/// @defgroup ArTrackData ArTrackData +/// External data track, used by Recording and Playback API. -/// @addtogroup config -/// @{ +/// @defgroup ArSession ArSession +/// Session management. + +/// @defgroup ArTrackable ArTrackable +/// Something that can be tracked and that anchors can be attached to. + +/// @defgroup ArVpsAvailabilityFuture ArVpsAvailabilityFuture +/// An asynchronous operation checking VPS availability. The availability of VPS +/// in a given location helps to improve the quality of Geospatial localization +/// and tracking accuracy. See @c ::ArSession_checkVpsAvailabilityAsync for more +/// details. +/// @ingroup ArConfig /// An opaque session configuration object (@ref ownership "value type"). /// -/// Create with ArConfig_create()
-/// Release with ArConfig_destroy() +/// - Create with: @c ::ArConfig_create +/// - Release with: @c ::ArConfig_destroy typedef struct ArConfig_ ArConfig; -/// @} - // CameraConfig objects and list. -/// @addtogroup cameraconfig -/// @{ - +/// @ingroup ArCameraConfig /// A camera config struct that contains the config supported by /// the physical camera obtained from the low level device profiles. /// (@ref ownership "value type"). /// -/// Allocate with ArCameraConfig_create()
-/// Release with ArCameraConfig_destroy() +/// - Create with: @c ::ArCameraConfig_create +/// - Release with: @c ::ArCameraConfig_destroy typedef struct ArCameraConfig_ ArCameraConfig; +/// @ingroup ArCameraConfig /// A list of camera config (@ref ownership "value type"). /// -/// Allocate with ArCameraConfigList_create()
-/// Release with ArCameraConfigList_destroy() +/// - Create with: @c ::ArCameraConfigList_create +/// - Release with: @c ::ArCameraConfigList_destroy typedef struct ArCameraConfigList_ ArCameraConfigList; -/// @} - // Shared Camera objects definition. // Excluded from generated docs (// vs ///) since it's a detail of the Java SDK. - -// A shared camera contains methods that require sending Java objects over the -// c/c++ interface. To avoid using void* and making code clarity that the Java -// object is being just transmitted we define a new typedef. // +// A shared camera contains functions that require sending Java objects over +// the c/c++ interface. To avoid using void* and making code clarity that the +// Java object is being just transmitted we define a new typedef. typedef void *ArJavaObject; -/// @addtogroup session -/// @{ +// Camera config filters and camera config filters objects. -/// The ARCore session (@ref ownership "value type"). +/// @ingroup ArCameraConfigFilter +/// A camera config filter struct contains the filters that are desired +/// by the application. (@ref ownership "value type"). /// -/// Create with ArSession_create()
-/// Release with ArSession_destroy() -typedef struct ArSession_ ArSession; +/// - Create with: @c ::ArCameraConfigFilter_create +/// - Release with: @c ::ArCameraConfigFilter_destroy +typedef struct ArCameraConfigFilter_ ArCameraConfigFilter; -/// @} +/// @ingroup ArRecordingConfig +/// A recording config struct that contains the config to set the recorder. +/// +/// (@ref ownership "value type"). +/// +/// - Create with: @c ::ArRecordingConfig_create +/// - Release with: @c ::ArRecordingConfig_destroy +typedef struct ArRecordingConfig_ ArRecordingConfig; -/// @addtogroup pose -/// @{ +/// @ingroup ArTrack +/// A track recording configuration struct of type data. +/// +/// (@ref ownership "value type"). +/// +/// - Create with: @c ::ArTrack_create +/// - Release with: @c ::ArTrack_destroy +typedef struct ArTrack_ ArTrack; + +/// @ingroup ArSession +/// The ARCore session (@ref ownership "value type"). +/// +/// - Create with: @c ::ArSession_create +/// - Release with: @c ::ArSession_destroy +typedef struct ArSession_ ArSession; +/// @ingroup ArPose /// A structured rigid transformation (@ref ownership "value type"). /// -/// Allocate with ArPose_create()
-/// Release with ArPose_destroy() +/// - Allocate with: @c ::ArPose_create +/// - Release with: @c ::ArPose_destroy typedef struct ArPose_ ArPose; -/// @} - // Camera. -/// @addtogroup camera -/// @{ - +/// @ingroup ArCamera /// The virtual and physical camera /// (@ref ownership "reference type, long-lived"). /// -/// Acquire with ArFrame_acquireCamera()
-/// Release with ArCamera_release() +/// - Acquire with: @c ::ArFrame_acquireCamera +/// - Release with: @c ::ArCamera_release typedef struct ArCamera_ ArCamera; -/// @} - -// === Camera intrinstics types and methods === - -/// @addtogroup intrinsics -/// @{ +// === Camera intrinstics types and functions === +/// @ingroup ArCameraIntrinsics /// The physical characteristics of a given camera. /// -/// Allocate with ArCameraIntrinsics_create()
-/// Populate with ArCamera_getIntrinsics()
-/// Release with ArCameraIntrinsics_destroy() +/// - Allocate with: @c ::ArCameraIntrinsics_create +/// - Release with: @c ::ArCameraIntrinsics_destroy typedef struct ArCameraIntrinsics_ ArCameraIntrinsics; -/// @} - // Frame and frame objects. -/// @addtogroup frame -/// @{ - +/// @ingroup ArFrame /// The world state resulting from an update (@ref ownership "value type"). /// -/// Allocate with ArFrame_create()
-/// Populate with ArSession_update()
-/// Release with ArFrame_destroy() +/// - Create with: @c ::ArFrame_create +/// - Allocate with: @c ::ArSession_update +/// - Release with: @c ::ArFrame_destroy typedef struct ArFrame_ ArFrame; -/// @} - // LightEstimate. -/// @addtogroup light -/// @{ - +/// @ingroup ArLightEstimate /// An estimate of the real-world lighting (@ref ownership "value type"). /// -/// Allocate with ArLightEstimate_create()
-/// Populate with ArFrame_getLightEstimate()
-/// Release with ArLightEstimate_destroy() +/// - Create with: @c ::ArLightEstimate_create +/// - Allocate with: @c ::ArFrame_getLightEstimate +/// - Release with: @c ::ArLightEstimate_destroy typedef struct ArLightEstimate_ ArLightEstimate; -/// @} - // PointCloud. -/// @addtogroup pointcloud -/// @{ - +/// @ingroup ArPointCloud /// A cloud of tracked 3D visual feature points /// (@ref ownership "reference type, large data"). /// -/// Acquire with ArFrame_acquirePointCloud()
-/// Release with ArPointCloud_release() +/// - Acquire with: @c ::ArFrame_acquirePointCloud +/// - Release with: @c ::ArPointCloud_release typedef struct ArPointCloud_ ArPointCloud; -/// @} - // ImageMetadata. -/// @addtogroup image -/// @{ - +/// @ingroup ArImageMetadata /// Camera capture metadata (@ref ownership "reference type, large data"). /// -/// Acquire with ArFrame_acquireImageMetadata()
-/// Release with ArImageMetadata_release() +/// - Acquire with: @c ::ArFrame_acquireImageMetadata +/// - Release with: @c ::ArImageMetadata_release typedef struct ArImageMetadata_ ArImageMetadata; +/// @ingroup ArImage /// Accessing CPU image from the camera /// (@ref ownership "reference type, large data"). /// -/// Acquire with ArFrame_acquireCameraImage()
-/// Convert to NDK AImage with ArImage_getNdkImage()
-/// Release with ArImage_release(). +/// - Acquire with: @c ::ArFrame_acquireCameraImage +/// - Release with: @c ::ArImage_release. typedef struct ArImage_ ArImage; +/// @ingroup ArImage /// Convenient definition for cubemap image storage where it is a fixed size -/// array of 6 ArImage. +/// array of 6 @c ::ArImage. typedef ArImage *ArImageCubemap[6]; -/// Forward declaring the AImage struct from Android NDK, which is used -/// in ArImage_getNdkImage(). -typedef struct AImage AImage; -/// @} - // Trackables. -/// @addtogroup trackable -/// @{ - +/// @ingroup ArTrackable /// Trackable base type (@ref ownership "reference type, long-lived"). typedef struct ArTrackable_ ArTrackable; -/// A list of ArTrackables (@ref ownership "value type"). +/// @ingroup ArTrackable +/// A list of @c ::ArTrackable's (@ref ownership "value type"). /// -/// Allocate with ArTrackableList_create()
-/// Release with ArTrackableList_destroy() +/// - Create with: @c ::ArTrackableList_create +/// - Release with: @c ::ArTrackableList_destroy typedef struct ArTrackableList_ ArTrackableList; -/// @} +/// @ingroup ArTrackData +/// Data that has been recorded to an external track. +typedef struct ArTrackData_ ArTrackData; -// Plane +/// @ingroup ArTrackData +/// A list of @c ::ArTrackData +typedef struct ArTrackDataList_ ArTrackDataList; -/// @addtogroup plane -/// @{ +// Planes. +/// @ingroup ArPlane /// A detected planar surface (@ref ownership "reference type, long-lived"). /// -/// Trackable type: #AR_TRACKABLE_PLANE
-/// Release with: ArTrackable_release() +/// - Trackable type: @c #AR_TRACKABLE_PLANE +/// - Release with: @c ::ArTrackable_release typedef struct ArPlane_ ArPlane; -/// @} - -// Point - -/// @addtogroup point -/// @{ +// Points. +/// @ingroup ArPoint /// An arbitrary point in space (@ref ownership "reference type, long-lived"). /// -/// Trackable type: #AR_TRACKABLE_POINT
-/// Release with: ArTrackable_release() +/// - Trackable type: @c #AR_TRACKABLE_POINT +/// - Release with: @c ::ArTrackable_release typedef struct ArPoint_ ArPoint; -/// @} +// Depth Points. -// Augmented Image +/// @ingroup ArDepthPoint +/// A point measurement taken from a depth image +/// (@ref ownership "reference type, long-lived"). +/// +/// - Trackable type: @c #AR_TRACKABLE_DEPTH_POINT +/// - Release with: @c ::ArTrackable_release +typedef struct ArDepthPoint_ ArDepthPoint; -/// @addtogroup augmented_image -/// @{ +// Instant Placement points. -/// An image that has been detected and tracked (@ref ownership "reference type, -/// long-lived"). +/// @ingroup ArInstantPlacementPoint +/// (@ref ownership "reference type, long-lived"). /// -/// Trackable type: #AR_TRACKABLE_AUGMENTED_IMAGE
-/// Release with: ArTrackable_release() -typedef struct ArAugmentedImage_ ArAugmentedImage; +/// - Trackable type: @c #AR_TRACKABLE_INSTANT_PLACEMENT_POINT +/// - Release with: @c ::ArTrackable_release +typedef struct ArInstantPlacementPoint_ ArInstantPlacementPoint; -/// @} +// Augmented Images. -// Augmented Faces +/// @ingroup ArAugmentedImage +/// An image that has been detected and tracked +/// (@ref ownership "reference type, long-lived"). +/// +/// - Trackable type: @c #AR_TRACKABLE_AUGMENTED_IMAGE +/// - Release with: @c ::ArTrackable_release +typedef struct ArAugmentedImage_ ArAugmentedImage; -/// @addtogroup augmented_face -/// @{ +// Augmented Faces. +/// @ingroup ArAugmentedFace /// A detected face trackable (@ref ownership "reference type, long-lived"). /// -/// Trackable type: #AR_TRACKABLE_FACE
-/// Release with: ArTrackable_release() +/// - Trackable type: @c #AR_TRACKABLE_FACE +/// - Release with: @c ::ArTrackable_release typedef struct ArAugmentedFace_ ArAugmentedFace; -/// @} +// Earth. + +/// @ingroup ArEarth +/// The Earth trackable (@ref ownership "reference type, long-lived"). +/// +/// - Trackable type: @c #AR_TRACKABLE_EARTH +/// - Acquire with: @c ::ArSession_acquireEarth +/// - Release with: @c ::ArTrackable_release +typedef struct ArEarth_ ArEarth; + +// Geospatial Pose. + +/// @ingroup ArGeospatialPose +/// Describes a specific location, elevation, and compass heading relative to +/// Earth (@ref ownership "value type"). +/// +/// - Create with: @c ::ArGeospatialPose_create +/// - Release with: @c ::ArGeospatialPose_destroy +typedef struct ArGeospatialPose_ ArGeospatialPose; -// Augmented Image Database -/// @addtogroup augmented_image_database -/// @{ +// Augmented Images database +/// @ingroup ArAugmentedImageDatabase /// A database of images to be detected and tracked by ARCore (@ref ownership /// "value type"). /// @@ -400,123 +556,119 @@ typedef struct ArAugmentedFace_ ArAugmentedFace; /// or dynamically created at runtime by adding individual images. /// /// Only one image database can be active in a session. Any images in the -/// currently active image database that have a TRACKING/PAUSED state will -/// immediately be set to the STOPPED state if a different or null image -/// database is made active in the current session Config. -/// -/// Create with ArAugmentedImageDatabase_create() or -/// ArAugmentedImageDatabase_deserialize()
-/// Release with: ArAugmentedImageDatabase_destroy() +/// currently active image database that have a +/// @c #AR_TRACKING_STATE_TRACKING/#AR_TRACKING_STATE_PAUSED state will +/// immediately be set to the @c #AR_TRACKING_STATE_STOPPED state if a different +/// or @c NULL image database is made active in the current session Config. +/// +/// - Create with: @c ::ArAugmentedImageDatabase_create or +/// @c ::ArAugmentedImageDatabase_deserialize +/// - Release with: @c ::ArAugmentedImageDatabase_destroy typedef struct ArAugmentedImageDatabase_ ArAugmentedImageDatabase; -/// @} - // Anchors. -/// @addtogroup anchor -/// @{ - +/// @ingroup ArAnchor /// A position in space attached to a trackable /// (@ref ownership "reference type, long-lived"). /// -/// To create a new anchor call ArSession_acquireNewAnchor() or -/// ArHitResult_acquireNewAnchor().
-/// To have ARCore stop tracking the anchor, call ArAnchor_detach().
-/// To release the memory associated with this anchor reference, call -/// ArAnchor_release(). Note that, this will not cause ARCore to stop tracking -/// the anchor. Other references to the same anchor acquired through -/// ArAnchorList_acquireItem() are unaffected. +/// - To create a new anchor call @c ::ArSession_acquireNewAnchor or +/// @c ::ArHitResult_acquireNewAnchor. +/// - To have ARCore stop tracking the anchor, call @c ::ArAnchor_detach. +/// - To release the memory associated with this anchor reference, call +/// @c ::ArAnchor_release. Note that this will not cause ARCore to stop +/// tracking the anchor. Other references to the same anchor acquired through +/// @c ::ArAnchorList_acquireItem are unaffected. typedef struct ArAnchor_ ArAnchor; +/// @ingroup ArAnchor /// A list of anchors (@ref ownership "value type"). /// -/// Allocate with ArAnchorList_create()
-/// Release with ArAnchorList_destroy() +/// - Create with: @c ::ArAnchorList_create +/// - Release with: @c ::ArAnchorList_destroy typedef struct ArAnchorList_ ArAnchorList; -/// @} - // Hit result functionality. -/// @addtogroup hit -/// @{ - +/// @ingroup ArHitResult /// A single trackable hit (@ref ownership "value type"). /// -/// Allocate with ArHitResult_create()
-/// Populate with ArHitResultList_getItem()
-/// Release with ArHitResult_destroy() +/// - Create with: @c ::ArHitResult_create +/// - Allocate with: @c ::ArHitResultList_getItem +/// - Release with: @c ::ArHitResult_destroy typedef struct ArHitResult_ ArHitResult; +/// @ingroup ArHitResult /// A list of hit test results (@ref ownership "value type"). /// -/// Allocate with ArHitResultList_create()
-/// Release with ArHitResultList_destroy()
+/// - Create with: @c ::ArHitResultList_create +/// - Release with: @c ::ArHitResultList_destroy typedef struct ArHitResultList_ ArHitResultList; -/// @} - -/// @cond EXCLUDE_FROM_DOXYGEN - -// Forward declaring the ACameraMetadata struct from Android NDK, which is used -// in ArImageMetadata_getNdkCameraMetadata -typedef struct ACameraMetadata ACameraMetadata; - -/// @endcond - -/// @addtogroup cpp_helpers -/// @{ -/// These methods expose allowable type conversions as C++ helper functions. -/// This avoids having to explicitly @c reinterpret_cast in most cases. -/// -/// Note: These methods only change the type of a pointer - they do not change -/// the reference count of the referenced objects. -/// -/// Note: There is no runtime checking that casts are correct. Call @ref -/// ArTrackable_getType() beforehand to figure out the correct cast. - #ifdef __cplusplus -/// Upcasts to ArTrackable +/// @ingroup type_conversions +/// Upcasts to @c ::ArTrackable inline ArTrackable *ArAsTrackable(ArPlane *plane) { return reinterpret_cast(plane); } -/// Upcasts to ArTrackable +/// @ingroup type_conversions +/// Upcasts to @c ::ArTrackable inline ArTrackable *ArAsTrackable(ArPoint *point) { return reinterpret_cast(point); } -/// Upcasts to ArTrackable +/// @ingroup type_conversions +/// Upcasts to @c ::ArTrackable inline ArTrackable *ArAsTrackable(ArAugmentedImage *augmented_image) { return reinterpret_cast(augmented_image); } -/// Downcasts to ArPlane. +/// @ingroup type_conversions +/// Downcasts to @c ::ArPlane. inline ArPlane *ArAsPlane(ArTrackable *trackable) { return reinterpret_cast(trackable); } -/// Downcasts to ArPoint. +/// @ingroup type_conversions +/// Downcasts to @c ::ArPoint. inline ArPoint *ArAsPoint(ArTrackable *trackable) { return reinterpret_cast(trackable); } -/// Downcasts to ArAugmentedImage. +/// @ingroup type_conversions +/// Upcasts to @c ::ArTrackable. +inline ArTrackable *ArAsTrackable( + ArInstantPlacementPoint *instant_placement_point) { + return reinterpret_cast(instant_placement_point); +} + +/// @ingroup type_conversions +/// Downcasts to @c ::ArInstantPlacementPoint. +inline ArInstantPlacementPoint *ArAsInstantPlacementPoint( + ArTrackable *trackable) { + return reinterpret_cast(trackable); +} + +/// @ingroup type_conversions +/// Downcasts to @c ::ArAugmentedImage. inline ArAugmentedImage *ArAsAugmentedImage(ArTrackable *trackable) { return reinterpret_cast(trackable); } -/// Upcasts to ArTrackable +/// @ingroup type_conversions +/// Upcasts to @c ::ArTrackable inline ArTrackable *ArAsTrackable(ArAugmentedFace *face) { return reinterpret_cast(face); } -/// Downcasts to ArAugmentedFace +/// @ingroup type_conversions +/// Downcasts to @c ::ArAugmentedFace inline ArAugmentedFace *ArAsFace(ArTrackable *trackable) { return reinterpret_cast(trackable); } + #endif // __cplusplus -/// @} // If compiling for C++11, use the 'enum underlying type' feature to enforce // size for ABI compatibility. In pre-C++11, use int32_t for fixed size. @@ -526,78 +678,101 @@ inline ArAugmentedFace *ArAsFace(ArTrackable *trackable) { #define AR_DEFINE_ENUM(_type) \ typedef int32_t _type; \ enum -#endif +#endif // __cplusplus >= 201100 #if defined(__GNUC__) && !defined(AR_DEPRECATED_SUPPRESS) #define AR_DEPRECATED(_deprecation_string) \ __attribute__((deprecated(_deprecation_string))) #else #define AR_DEPRECATED(_deprecation_string) -#endif +#endif // defined(__GNUC__) && !defined(AR_DEPRECATED_SUPPRESS) -/// @ingroup trackable +/// @ingroup ArTrackable /// Object types for heterogeneous query/update lists. AR_DEFINE_ENUM(ArTrackableType){ - /// The base Trackable type. Can be passed to ArSession_getAllTrackables() - /// and ArFrame_getUpdatedTrackables() as the @c filter_type to get + /// The base Trackable type. Can be passed to @c ::ArSession_getAllTrackables + /// and @c ::ArFrame_getUpdatedTrackables as the @p filter_type to get /// all/updated Trackables of all types. AR_TRACKABLE_BASE_TRACKABLE = 0x41520100, - /// The ::ArPlane subtype of Trackable. + /// The @c ::ArPlane subtype of Trackable. AR_TRACKABLE_PLANE = 0x41520101, - /// The ::ArPoint subtype of Trackable. + /// The @c ::ArPoint subtype of Trackable. AR_TRACKABLE_POINT = 0x41520102, - /// The ::ArAugmentedImage subtype of Trackable. + /// The @c ::ArAugmentedImage subtype of Trackable. AR_TRACKABLE_AUGMENTED_IMAGE = 0x41520104, /// Trackable type for faces. AR_TRACKABLE_FACE = 0x41520105, + /// Trackable type for @c ::ArEarth. + AR_TRACKABLE_EARTH = 0x41520109, + + /// On supported devices, trackable type for depth image based hit results + /// returned by @c ::ArFrame_hitTest when @c ::ArConfig_setDepthMode has been + /// set to @c #AR_DEPTH_MODE_AUTOMATIC. + AR_TRACKABLE_DEPTH_POINT = 0x41520111, + + /// Trackable type for results retrieved from + /// @c ::ArFrame_hitTestInstantPlacement. This trackable type is only + /// available when when @c ::ArConfig_setInstantPlacementMode is + /// @c #AR_INSTANT_PLACEMENT_MODE_LOCAL_Y_UP. + AR_TRACKABLE_INSTANT_PLACEMENT_POINT = 0x41520112, + /// An invalid Trackable type. AR_TRACKABLE_NOT_VALID = 0}; -/// @ingroup session -/// Feature names for use with ArSession_createWithFeatures() +/// @ingroup ArSession +/// Feature names for use with @c ::ArSession_createWithFeatures /// /// All currently defined features are mutually compatible. AR_DEFINE_ENUM(ArSessionFeature){ - /// Indicates the end of a features list. This must be the last entry in - /// the - /// array passed to ArSession_createWithFeatures(). + /// Indicates the end of a features list. This must be the last entry in the + /// array passed to @c ::ArSession_createWithFeatures. AR_SESSION_FEATURE_END_OF_LIST = 0, /// Use the front-facing (selfie) camera. When the front camera is selected, /// ARCore's behavior changes in the following ways: /// /// - The display will be mirrored. Specifically, - /// ArCamera_getProjectionMatrix() will include a horizontal flip in the - /// generated projection matrix and APIs that reason about things in - /// screen - /// space such as ArFrame_transformCoordinates2d() will mirror screen - /// coordinates. Open GL apps should consider using \c glFrontFace to + /// @c ::ArCamera_getProjectionMatrix will include a horizontal flip in the + /// generated projection matrix and APIs that reason about things in screen + /// space, such as @c ::ArFrame_transformCoordinates2d, will mirror screen + /// coordinates. Open GL apps should consider using @c glFrontFace to /// render mirrored assets without changing their winding direction. - /// - ArCamera_getTrackingState() will always output - /// #AR_TRACKING_STATE_PAUSED. - /// - ArFrame_hitTest() will always output an empty list. - /// - ArCamera_getDisplayOrientedPose() will always output an identity pose. - /// - ArSession_acquireNewAnchor() will always return - /// #AR_ERROR_NOT_TRACKING. + /// - @c ::ArCamera_getTrackingState will always output + /// @c #AR_TRACKING_STATE_PAUSED. + /// - @c ::ArFrame_hitTest will always output an empty list. + /// - @c ::ArCamera_getDisplayOrientedPose will always output an identity + /// pose. + /// - @c ::ArSession_acquireNewAnchor will always return + /// @c #AR_ERROR_NOT_TRACKING. /// - Planes will never be detected. - /// - ArSession_configure() will fail if the supplied configuration requests - /// Cloud Anchors or Augmented Images. - AR_SESSION_FEATURE_FRONT_CAMERA = 1, + /// - @c ::ArSession_configure will fail if the supplied configuration + /// requests + /// Cloud Anchors, Augmented Images, or Environmental HDR Lighting + /// Estimation mode. + /// + /// @deprecated To create a session using the front-facing (selfie) + /// camera, use @c ::ArSession_setCameraConfig with the desired config + /// retrieved from @c ::ArSession_getSupportedCameraConfigsWithFilter. + AR_SESSION_FEATURE_FRONT_CAMERA AR_DEPRECATED( + "To create a session using the front-facing (selfie) camera, use " + "@c ::ArSession_setCameraConfig with the desired config retrieved " + "from @c ::ArSession_getSupportedCameraConfigsWithFilter.") = 1, + }; -/// @ingroup common -/// Return code indicating success or failure of a method. +/// @ingroup shared_types +/// Return code indicating success or failure of a function. AR_DEFINE_ENUM(ArStatus){ /// The operation was successful. AR_SUCCESS = 0, - /// One of the arguments was invalid, either null or not appropriate for the - /// operation requested. + /// One of the arguments was invalid; either @c NULL or not appropriate for + /// the operation requested. AR_ERROR_INVALID_ARGUMENT = -1, /// An internal error occurred that the application should not attempt to @@ -612,60 +787,59 @@ AR_DEFINE_ENUM(ArStatus){ /// session was running. AR_ERROR_SESSION_NOT_PAUSED = -4, - /// An operation was attempted that the session be in the TRACKING state, - /// but the session was not. + /// An operation was attempted that the session be in the + /// @c #AR_TRACKING_STATE_TRACKING state, but the session was not. AR_ERROR_NOT_TRACKING = -5, - /// A texture name was not set by calling ArSession_setCameraTextureName() - /// before the first call to ArSession_update() + /// A texture name was not set by calling @c ::ArSession_setCameraTextureName + /// before the first call to @c ::ArSession_update. AR_ERROR_TEXTURE_NOT_SET = -6, /// An operation required GL context but one was not available. AR_ERROR_MISSING_GL_CONTEXT = -7, - /// The configuration supplied to ArSession_configure() was unsupported. + /// The configuration supplied to @c ::ArSession_configure is unsupported. /// To avoid this error, ensure that Session_checkSupported() returns true. AR_ERROR_UNSUPPORTED_CONFIGURATION = -8, - /// The android camera permission has not been granted prior to calling - /// ArSession_resume() + /// The application does not have Android camera permission. AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED = -9, - /// Acquire failed because the object being acquired is already released. - /// For example, this happens if the application holds an ::ArFrame beyond - /// the next call to ArSession_update(), and then tries to acquire its point - /// cloud. + /// Acquire failed because the object being acquired was already released. + /// For example, this happens if the application holds an @c ::ArFrame beyond + /// the next call to @c ::ArSession_update, and then tries to acquire its + /// Point Cloud. AR_ERROR_DEADLINE_EXCEEDED = -10, - /// There are no available resources to complete the operation. In cases of - /// @c acquire methods returning this error, This can be avoided by + /// There are no available resources to complete the operation. In cases of + /// @c acquire functions returning this error, this can be avoided by /// releasing previously acquired objects before acquiring new ones. AR_ERROR_RESOURCE_EXHAUSTED = -11, /// Acquire failed because the data isn't available yet for the current - /// frame. For example, acquire the image metadata may fail with this error + /// frame. For example, acquiring image metadata may fail with this error /// because the camera hasn't fully started. AR_ERROR_NOT_YET_AVAILABLE = -12, - /// The android camera has been reallocated to a higher priority app or is - /// otherwise unavailable. + /// The Android camera has been reallocated to a higher priority application + /// or is otherwise unavailable. AR_ERROR_CAMERA_NOT_AVAILABLE = -13, /// The host/resolve function call failed because the Session is not - /// configured for cloud anchors. + /// configured for Cloud Anchors. AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED = -14, - /// ArSession_configure() failed because the specified configuration + /// @c ::ArSession_configure failed because the specified configuration /// required the Android INTERNET permission, which the application did not /// have. AR_ERROR_INTERNET_PERMISSION_NOT_GRANTED = -15, - /// HostCloudAnchor() failed because the anchor is not a type of anchor that - /// is currently supported for hosting. + /// @c ::ArSession_hostAndAcquireNewCloudAnchor failed because the anchor is + /// not a type of anchor that is currently supported for hosting. AR_ERROR_ANCHOR_NOT_SUPPORTED_FOR_HOSTING = -16, - /// An image with insufficient quality (e.g. too few features) was attempted - /// to be added to the image database. + /// Attempted to add an image with insufficient quality (e.g., too few + /// features) to the image database. AR_ERROR_IMAGE_INSUFFICIENT_QUALITY = -17, /// The data passed in for this operation was not in a valid format. @@ -677,11 +851,53 @@ AR_DEFINE_ENUM(ArStatus){ /// A function has been invoked at an illegal or inappropriate time. A /// message will be printed to logcat with additional details for the - /// developer. For example, ArSession_resume() will return this status if - /// the camera configuration was changed and there are any unreleased - /// images. + /// developer. For example, @c ::ArSession_resume will return this status if + /// the camera configuration was changed and there is at least one + /// unreleased image. AR_ERROR_ILLEGAL_STATE = -20, + /// The Android precise location permission (@c ACCESS_FINE_LOCATION) is + /// required, but has not been granted prior to calling @c + /// ::ArSession_configure when @c ::ArGeospatialMode is set to @c + /// #AR_GEOSPATIAL_MODE_ENABLED. + /// + /// See Android + /// documentation on Request location access at runtime for more + /// information on how to request the @c ACCESS_FINE_LOCATION permission. + AR_ERROR_FINE_LOCATION_PERMISSION_NOT_GRANTED = -21, + + /// The Fused + /// Location Provider for Android library is required, but wasn't found in + /// the client app's binary prior to calling @c ::ArSession_configure when @c + /// ::ArGeospatialMode is set to @c #AR_GEOSPATIAL_MODE_ENABLED. + /// + ///

Ensure that your app includes + /// the Fused Location Provider of Android library, and that your app's ProGuard + /// rules are correctly set up for the Geospatial API. + /// + ///

When building your app, check the resulting binary with the APK + /// Analyzer, and ensure that the built application binary includes the @c + /// com.google.android.gms.location package, and that its contents are not + /// renamed or minified. + + AR_ERROR_GOOGLE_PLAY_SERVICES_LOCATION_LIBRARY_NOT_LINKED = -22, + + /// When recording failed. + AR_ERROR_RECORDING_FAILED = -23, + + /// When playback failed. + AR_ERROR_PLAYBACK_FAILED = -24, + /// Operation is unsupported with the current session. + AR_ERROR_SESSION_UNSUPPORTED = -25, + + /// The requested metadata tag cannot be found in input metadata. + AR_ERROR_METADATA_NOT_FOUND = -26, + /// The ARCore APK is not installed on this device. AR_UNAVAILABLE_ARCORE_NOT_INSTALLED = -100, @@ -700,16 +916,16 @@ AR_DEFINE_ENUM(ArStatus){ /// application and the current request was not marked as user-initiated. AR_UNAVAILABLE_USER_DECLINED_INSTALLATION = -105}; -/// @ingroup common -/// Describes the tracking state of a @c Trackable, an ::ArAnchor or the -/// ::ArCamera. +/// @ingroup shared_types +/// Describes the tracking state of an @c ::ArTrackable, an @c ::ArAnchor or the +/// @c ::ArCamera. AR_DEFINE_ENUM(ArTrackingState){ /// The object is currently tracked and its pose is current. AR_TRACKING_STATE_TRACKING = 0, /// ARCore has paused tracking this object, but may resume tracking it in /// the future. This can happen if device tracking is lost, if the user - /// enters a new space, or if the Session is currently paused. When in this + /// enters a new space, or if the session is currently paused. When in this /// state, the positional properties of the object may be wildly inaccurate /// and should not be used. AR_TRACKING_STATE_PAUSED = 1, @@ -718,11 +934,13 @@ AR_DEFINE_ENUM(ArTrackingState){ /// tracking it. AR_TRACKING_STATE_STOPPED = 2}; -/// Describes possible tracking failure reasons of a @c ::ArCamera. +/// @ingroup shared_types +/// Describes possible tracking failure reasons of an @c ::ArCamera. AR_DEFINE_ENUM(ArTrackingFailureReason){ /// Indicates expected motion tracking behavior. Always returned when - /// ArCamera_getTrackingState() is #AR_TRACKING_STATE_TRACKING. When - /// ArCamera_getTrackingState() is #AR_TRACKING_STATE_PAUSED, indicates that + /// @c ::ArCamera_getTrackingState is @c #AR_TRACKING_STATE_TRACKING. When + /// @c ::ArCamera_getTrackingState is @c #AR_TRACKING_STATE_PAUSED, + /// indicates that /// the session is initializing normally. AR_TRACKING_FAILURE_REASON_NONE = 0, /// Motion tracking lost due to bad internal state. No specific user action @@ -730,6 +948,10 @@ AR_DEFINE_ENUM(ArTrackingFailureReason){ AR_TRACKING_FAILURE_REASON_BAD_STATE = 1, /// Motion tracking lost due to poor lighting conditions. Ask the user to /// move to a more brightly lit area. + /// On Android 12 (API level 31) or later, the user may have + /// disabled camera access, causing ARCore to receive a blank camera + /// feed. AR_TRACKING_FAILURE_REASON_INSUFFICIENT_LIGHT = 2, /// Motion tracking lost due to excessive motion. Ask the user to move the /// device more slowly. @@ -737,18 +959,27 @@ AR_DEFINE_ENUM(ArTrackingFailureReason){ /// Motion tracking lost due to insufficient visual features. Ask the user /// to move to a different area and to avoid blank walls and surfaces /// without detail. - AR_TRACKING_FAILURE_REASON_INSUFFICIENT_FEATURES = 4}; - -/// @ingroup cloud -/// Describes the current cloud state of an @c Anchor. + AR_TRACKING_FAILURE_REASON_INSUFFICIENT_FEATURES = 4, + /// Motion tracking paused because the camera is in use by another + /// application. Tracking will resume once this app regains priority, or + /// once all apps with higher priority have stopped using the camera. Prior + /// to ARCore SDK 1.13, @c #AR_TRACKING_FAILURE_REASON_NONE is returned in + /// this + /// case instead. + AR_TRACKING_FAILURE_REASON_CAMERA_UNAVAILABLE = 5}; + +/// @ingroup ArAnchor +/// Describes the current cloud state of an @c ::ArAnchor. AR_DEFINE_ENUM(ArCloudAnchorState){ /// The anchor is purely local. It has never been hosted using - /// hostCloudAnchor, and has not been acquired using acquireCloudAnchor. + /// @c ::ArSession_hostAndAcquireNewCloudAnchor, and has not been resolved + /// using + /// @c ::ArSession_resolveAndAcquireNewCloudAnchor. AR_CLOUD_ANCHOR_STATE_NONE = 0, /// A hosting/resolving task for the anchor is in progress. Once the task /// completes in the background, the anchor will get a new cloud state after - /// the next update() call. + /// the next @c ::ArSession_update call. AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS = 1, /// A hosting/resolving task for this anchor completed successfully. @@ -758,21 +989,26 @@ AR_DEFINE_ENUM(ArCloudAnchorState){ /// error. The app should not attempt to recover from this error. AR_CLOUD_ANCHOR_STATE_ERROR_INTERNAL = -1, - /// The app cannot communicate with the ARCore Cloud because of an invalid - /// or unauthorized API key in the manifest, or because there was no API key - /// present in the manifest. + /// The authorization provided by the application is not valid. + /// - The Google Cloud project may not have enabled the ARCore API. + /// - It may fail if the operation you are trying to perform is not allowed. + /// - When using API key authentication, this will happen if the API key in + /// the manifest is invalid, unauthorized or missing. It may also fail if + /// the API key is restricted to a set of apps not including the current + /// one. + /// - When using keyless authentication, this will happen if the developer + /// fails to create OAuth client. It may also fail if Google Play Services + /// isn't installed, is too old, or is malfunctioning for some reason (e.g. + /// services killed due to memory pressure). AR_CLOUD_ANCHOR_STATE_ERROR_NOT_AUTHORIZED = -2, - /// The ARCore Cloud was unreachable. This can happen because of a number of - /// reasons. The request sent to the server could have timed out with no - /// response, there could be a bad network connection, DNS unavailability, - /// firewall issues, or anything that could affect the device's ability to - /// connect to the ARCore Cloud. - AR_CLOUD_ANCHOR_STATE_ERROR_SERVICE_UNAVAILABLE = -3, + AR_CLOUD_ANCHOR_STATE_ERROR_SERVICE_UNAVAILABLE AR_DEPRECATED( + "AR_CLOUD_ANCHOR_STATE_ERROR_SERVICE_UNAVAILABLE is deprecated in " + "ARCore SDK 1.12. See release notes to learn more.") = -3, /// The application has exhausted the request quota allotted to the given - /// API key. The developer should request additional quota for the ARCore - /// Cloud for their API key from the Google Developers Console. + /// API key. The developer should request additional quota for the ARCore API + /// for their API key from the Google Developers Console. AR_CLOUD_ANCHOR_STATE_ERROR_RESOURCE_EXHAUSTED = -4, /// Hosting failed, because the server could not successfully process the @@ -780,27 +1016,36 @@ AR_DEFINE_ENUM(ArCloudAnchorState){ /// device has gathered more data from the environment. AR_CLOUD_ANCHOR_STATE_ERROR_HOSTING_DATASET_PROCESSING_FAILED = -5, - /// Resolving failed, because the ARCore Cloud could not find the provided - /// cloud anchor ID. + /// Resolving failed, because the ARCore Cloud Anchor service could not find + /// the provided Cloud Anchor ID. AR_CLOUD_ANCHOR_STATE_ERROR_CLOUD_ID_NOT_FOUND = -6, - /// The server could not match the visual features provided by ARCore - /// against the localization dataset of the requested cloud anchor ID. This - /// means that the anchor pose being requested was likely not created in the - /// user's surroundings. - AR_CLOUD_ANCHOR_STATE_ERROR_RESOLVING_LOCALIZATION_NO_MATCH = -7, + AR_CLOUD_ANCHOR_STATE_ERROR_RESOLVING_LOCALIZATION_NO_MATCH AR_DEPRECATED( + "AR_CLOUD_ANCHOR_STATE_ERROR_RESOLVING_LOCALIZATION_NO_MATCH is " + "deprecated in ARCore SDK 1.12. See release notes to learn more.") = -7, - /// The anchor could not be resolved because the SDK used to host the anchor - /// was newer than and incompatible with the version being used to acquire - /// it. + /// The Cloud Anchor could not be resolved because the SDK version used to + /// resolve the anchor is older than and incompatible with the version used to + /// host it. AR_CLOUD_ANCHOR_STATE_ERROR_RESOLVING_SDK_VERSION_TOO_OLD = -8, - /// The anchor could not be acquired because the SDK used to host the anchor - /// was older than and incompatible with the version being used to acquire - /// it. - AR_CLOUD_ANCHOR_STATE_ERROR_RESOLVING_SDK_VERSION_TOO_NEW = -9}; + /// The Cloud Anchor could not be resolved because the SDK version used to + /// resolve the anchor is newer than and incompatible with the version used to + /// host it. + AR_CLOUD_ANCHOR_STATE_ERROR_RESOLVING_SDK_VERSION_TOO_NEW = -9, + + /// The ARCore Cloud Anchor service was unreachable. This can happen for + /// a number of reasons. The device might be in airplane mode or does not + /// have a working internet connection. The request sent to the server might + /// have timed out with no response, or there might be a bad network + /// connection, DNS unavailability, firewall issues, or anything else that + /// might affect the device's ability to connect to the ARCore Cloud Anchor + /// service. + AR_CLOUD_ANCHOR_STATE_ERROR_HOSTING_SERVICE_UNAVAILABLE = -10, -/// @ingroup arcoreapk +}; + +/// @ingroup ArCoreApk /// Describes the current state of ARCore availability on the device. AR_DEFINE_ENUM(ArAvailability){ /// An internal error occurred while determining ARCore availability. @@ -822,8 +1067,8 @@ AR_DEFINE_ENUM(ArAvailability){ /// ARCore is supported, installed, and available to use. AR_AVAILABILITY_SUPPORTED_INSTALLED = 203}; -/// @ingroup arcoreapk -/// Indicates the outcome of a call to ArCoreApk_requestInstall(). +/// @ingroup ArCoreApk +/// Indicates the outcome of a call to @c ::ArCoreApk_requestInstall. AR_DEFINE_ENUM(ArInstallStatus){ /// The requested resource is already installed. AR_INSTALL_STATUS_INSTALLED = 0, @@ -831,7 +1076,7 @@ AR_DEFINE_ENUM(ArInstallStatus){ /// paused. AR_INSTALL_STATUS_INSTALL_REQUESTED = 1}; -/// @ingroup arcoreapk +/// @ingroup ArCoreApk /// Controls the behavior of the installation UI. AR_DEFINE_ENUM(ArInstallBehavior){ /// Hide the Cancel button during initial prompt and prevent user from @@ -844,7 +1089,7 @@ AR_DEFINE_ENUM(ArInstallBehavior){ /// after installation has been initiated. AR_INSTALL_BEHAVIOR_OPTIONAL = 1}; -/// @ingroup arcoreapk +/// @ingroup ArCoreApk /// Controls the message displayed by the installation UI. AR_DEFINE_ENUM(ArInstallUserMessageType){ /// Display a localized message like "This application requires ARCore...". @@ -852,20 +1097,25 @@ AR_DEFINE_ENUM(ArInstallUserMessageType){ /// Display a localized message like "This feature requires ARCore...". AR_INSTALL_USER_MESSAGE_TYPE_FEATURE = 1, /// Application has explained why ARCore is required prior to calling - /// ArCoreApk_requestInstall(), skip user education dialog. + /// @c ::ArCoreApk_requestInstall, skip user education dialog. AR_INSTALL_USER_MESSAGE_TYPE_USER_ALREADY_INFORMED = 2}; -/// @ingroup config -/// Select the behavior of the lighting estimation subsystem. +/// @ingroup ArConfig +/// Select the behavior of the Lighting Estimation subsystem. AR_DEFINE_ENUM(ArLightEstimationMode){ - /// Lighting estimation is disabled. + /// Lighting Estimation is disabled. AR_LIGHT_ESTIMATION_MODE_DISABLED = 0, - /// Lighting estimation is enabled, generating a single-value intensity - /// estimate. + /// Lighting Estimation is enabled, generating a single-value intensity + /// estimate and three (R, G, B) color correction values. AR_LIGHT_ESTIMATION_MODE_AMBIENT_INTENSITY = 1, + /// Lighting Estimation is enabled, generating inferred Environmental HDR + /// Lighting Estimation in linear color space. Note, + /// @c #AR_LIGHT_ESTIMATION_MODE_ENVIRONMENTAL_HDR is not supported when using + /// the front-facing (selfie) camera. + AR_LIGHT_ESTIMATION_MODE_ENVIRONMENTAL_HDR = 2, }; -/// @ingroup config +/// @ingroup ArConfig /// Select the behavior of the plane detection subsystem. AR_DEFINE_ENUM(ArPlaneFindingMode){ /// Plane detection is disabled. @@ -875,52 +1125,63 @@ AR_DEFINE_ENUM(ArPlaneFindingMode){ /// Detection of only vertical planes is enabled. AR_PLANE_FINDING_MODE_VERTICAL = 2, /// Detection of horizontal and vertical planes is enabled. - AR_PLANE_FINDING_MODE_HORIZONTAL_AND_VERTICAL = 3}; + AR_PLANE_FINDING_MODE_HORIZONTAL_AND_VERTICAL = 3, +}; -/// @ingroup config -/// Selects the behavior of ArSession_update(). +/// @ingroup ArRecordingConfig +/// Describe the current recording status. +AR_DEFINE_ENUM(ArRecordingStatus){ + /// The dataset recorder is not recording. + AR_RECORDING_NONE = 0, + /// The dataset recorder is recording normally. + AR_RECORDING_OK = 1, + /// The dataset recorder encountered an error while recording. + AR_RECORDING_IO_ERROR = 2, +}; + +/// @ingroup ArConfig +/// Selects the behavior of @c ::ArSession_update. AR_DEFINE_ENUM(ArUpdateMode){ - /// @c update() will wait until a new camera image is available, or until - /// the built-in timeout (currently 66ms) is reached. On most - /// devices the camera is configured to capture 30 frames per second. - /// If the camera image does not arrive by the built-in timeout, then - /// @c update() will return the most recent ::ArFrame object. + /// @c ::ArSession_update will wait until a new camera image is available, or + /// until the built-in timeout (currently 66ms) is reached. On most devices + /// the camera is configured to capture 30 frames per second. If the camera + /// image does not arrive by the built-in timeout, then @c ::ArSession_update + /// will return the most recent @c ::ArFrame object. AR_UPDATE_MODE_BLOCKING = 0, - /// @c update() will return immediately without blocking. If no new camera - /// image is available, then @c update() will return the most recent - /// ::ArFrame object. - AR_UPDATE_MODE_LATEST_CAMERA_IMAGE = 1}; + /// @c ::ArSession_update will return immediately without blocking. If no new + /// camera image is available, then @c ::ArSession_update will return the most + /// recent @c ::ArFrame object. + AR_UPDATE_MODE_LATEST_CAMERA_IMAGE = 1, +}; -/// @ingroup config +/// @ingroup ArConfig /// Selects the behavior of Augmented Faces subsystem. -/// Default value is AR_AUGMENTED_FACE_MODE_DISABLED. +/// Default value is @c #AR_AUGMENTED_FACE_MODE_DISABLED. AR_DEFINE_ENUM(ArAugmentedFaceMode){ /// Disable augmented face mode. AR_AUGMENTED_FACE_MODE_DISABLED = 0, /// Face 3D mesh is enabled. Augmented Faces is currently only - /// supported when using the front-facing (selfie) camera. See - /// #AR_SESSION_FEATURE_FRONT_CAMERA for details and additional - /// restrictions. + /// supported when using the front-facing (selfie) camera. AR_AUGMENTED_FACE_MODE_MESH3D = 2, }; -/// @ingroup augmented_image +/// @ingroup ArAugmentedImage /// Defines the current tracking mode for an Augmented Image. To retrieve the -/// tracking mode for an image use #ArAugmentedImage_getTrackingMethod(). +/// tracking mode for an image use @c ::ArAugmentedImage_getTrackingMethod. AR_DEFINE_ENUM(ArAugmentedImageTrackingMethod){ - // The Augmented Image is not currently being tracked. + /// The Augmented Image is not currently being tracked. AR_AUGMENTED_IMAGE_TRACKING_METHOD_NOT_TRACKING = 0, - // The Augmented Image is currently being tracked using the camera image. + /// The Augmented Image is currently being tracked using the camera image. AR_AUGMENTED_IMAGE_TRACKING_METHOD_FULL_TRACKING = 1, - // The Augmented Image is currently being tracked based on its last known - // pose, because it can no longer be tracked using the camera image. + /// The Augmented Image is currently being tracked based on its last known + /// pose, because it can no longer be tracked using the camera image. AR_AUGMENTED_IMAGE_TRACKING_METHOD_LAST_KNOWN_POSE = 2}; -/// @ingroup augmented_face +/// @ingroup ArAugmentedFace /// Defines face regions to query the pose for. Left and right are defined /// relative to the person that the mesh belongs to. To retrieve the center pose -/// use #ArAugmentedFace_getCenterPose(). +/// use @c ::ArAugmentedFace_getCenterPose. AR_DEFINE_ENUM(ArAugmentedFaceRegionType){ /// The region at the tip of the nose. AR_AUGMENTED_FACE_REGION_NOSE_TIP = 0, @@ -930,14 +1191,57 @@ AR_DEFINE_ENUM(ArAugmentedFaceRegionType){ AR_AUGMENTED_FACE_REGION_FOREHEAD_RIGHT = 2, }; -/// @ingroup config +/// @ingroup ArConfig /// Selects the desired behavior of the camera focus subsystem. AR_DEFINE_ENUM(ArFocusMode){/// Focus is fixed. AR_FOCUS_MODE_FIXED = 0, /// Auto-focus is enabled. AR_FOCUS_MODE_AUTO = 1}; -/// @ingroup plane +/// @ingroup ArConfig +/// Selects the desired depth mode. Not all devices support all modes, use +/// @c ::ArSession_isDepthModeSupported to find whether the current device and +/// the selected camera support a particular depth mode. +AR_DEFINE_ENUM(ArDepthMode){ + /// No depth information will be provided. Calling + /// @c ::ArFrame_acquireDepthImage16Bits or + /// @c ::ArFrame_acquireRawDepthImage16Bits will return + /// @c #AR_ERROR_ILLEGAL_STATE. + AR_DEPTH_MODE_DISABLED = 0, + /// On supported devices the best possible depth is estimated based on + /// hardware and software sources. Available sources of automatic depth are: + /// - Depth from motion, using the main RGB camera + /// - Hardware depth sensor, such as a time-of-flight sensor (or ToF sensor) + /// + /// Provides depth estimation for every pixel in the image, and works best for + /// static scenes. For a list of supported devices, see: + /// https://developers.google.com/ar/devices + /// Adds significant computational load. + /// + /// With this mode enabled, @c ::ArFrame_hitTest also returns + /// @c ::ArDepthPoint in the output @c ::ArHitResultList, which are + /// sampled from the generated depth image for the current frame if available. + AR_DEPTH_MODE_AUTOMATIC = 1, + /// @ingroup ArFrame + /// On ARCore + /// supported devices that also support the Depth API, provides a "raw", + /// mostly unfiltered, depth image + /// (@c ::ArFrame_acquireRawDepthImage16Bits) and depth confidence image + /// (@c ::ArFrame_acquireRawDepthConfidenceImage). + /// + /// The raw depth image is sparse and does not provide valid depth for all + /// pixels. Pixels without a valid depth estimate have a pixel value of 0. + /// + /// Raw depth data is also available when @c #AR_DEPTH_MODE_AUTOMATIC is + /// selected. + /// + /// Raw depth is intended to be used in cases that involve understanding of + /// the geometry in the environment. + AR_DEPTH_MODE_RAW_DEPTH_ONLY = 3, +}; + +/// @ingroup ArPlane /// Simple summary of the normal vector of a plane, for filtering purposes. AR_DEFINE_ENUM(ArPlaneType){ /// A horizontal plane facing upward (for example a floor or tabletop). @@ -947,43 +1251,204 @@ AR_DEFINE_ENUM(ArPlaneType){ /// A vertical plane (for example a wall). AR_PLANE_VERTICAL = 2}; -/// @ingroup light -/// Tracks the validity of a light estimate. +/// @ingroup ArLightEstimate +/// Tracks the validity of an @c ::ArLightEstimate object. AR_DEFINE_ENUM(ArLightEstimateState){ - /// The light estimate is not valid this frame and should not be used for - /// rendering. + /// The @c ::ArLightEstimate is not valid this frame and should not be used + /// for rendering. AR_LIGHT_ESTIMATE_STATE_NOT_VALID = 0, - /// The light estimate is valid this frame. + /// The @c ::ArLightEstimate is valid this frame. AR_LIGHT_ESTIMATE_STATE_VALID = 1}; -/// @ingroup point -/// Indicates the orientation mode of the ::ArPoint. +/// @ingroup ArPoint +/// Indicates the orientation mode of the @c ::ArPoint. AR_DEFINE_ENUM(ArPointOrientationMode){ - /// The orientation of the ::ArPoint is initialized to identity but may + /// The orientation of the @c ::ArPoint is initialized to identity but may /// adjust slightly over time. AR_POINT_ORIENTATION_INITIALIZED_TO_IDENTITY = 0, - /// The orientation of the ::ArPoint will follow the behavior described in - /// ArHitResult_getHitPose(). + /// The orientation of the @c ::ArPoint will follow the behavior described + /// in + /// @c ::ArHitResult_getHitPose. AR_POINT_ORIENTATION_ESTIMATED_SURFACE_NORMAL = 1}; -/// @ingroup cloud -/// Indicates the cloud configuration of the ::ArSession. +/// @ingroup ArInstantPlacementPoint +/// Tracking methods for @c ::ArInstantPlacementPoint. +AR_DEFINE_ENUM(ArInstantPlacementPointTrackingMethod){ + /// The @c ::ArInstantPlacementPoint is not currently being tracked. The + /// @c ::ArTrackingState is @c #AR_TRACKING_STATE_PAUSED or + /// @c #AR_TRACKING_STATE_STOPPED. + AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_NOT_TRACKING = 0, + /// The @c ::ArInstantPlacementPoint is currently being tracked in screen + /// space and the pose returned by @c ::ArInstantPlacementPoint_getPose is + /// being estimated using the approximate distance provided to + /// @c ::ArFrame_hitTestInstantPlacement. + /// + /// ARCore concurrently tracks at most 20 Instant Placement points that are + /// @c + /// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE. + /// As additional Instant Placement points with + /// @c + /// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE + /// are created, the oldest points will become permanently + /// @c #AR_TRACKING_STATE_STOPPED in order to maintain the maximum number of + /// concurrently tracked points. + AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE = // NOLINT + 1, + /// The @c ::ArInstantPlacementPoint is being tracked normally and + /// @c ::ArInstantPlacementPoint_getPose is using a pose fully determined by + /// ARCore. + /// + /// ARCore doesn't limit the number of Instant Placement points with + /// @c #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING that are + /// being tracked concurrently. + AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING = 2}; + +/// @ingroup ArAnchor +/// Indicates the cloud configuration of the @c ::ArSession. AR_DEFINE_ENUM(ArCloudAnchorMode){ - /// Anchor Hosting is disabled. This is the value set in the default - /// ::ArConfig. + /// Cloud Anchors are disabled. This is the value set in the default + /// @c ::ArConfig. AR_CLOUD_ANCHOR_MODE_DISABLED = 0, - /// Anchor Hosting is enabled. Setting this value and calling @c configure() - /// will require that the application have the Android INTERNET permission. - AR_CLOUD_ANCHOR_MODE_ENABLED = 1}; + /// This mode will enable Cloud Anchors. Setting this value and calling + /// @c ::ArSession_configure will require the application to have the Android + /// INTERNET permission. + AR_CLOUD_ANCHOR_MODE_ENABLED = 1, +}; -/// @ingroup frame +/// @ingroup ArConfig +/// Describes the desired behavior of the ARCore Geospatial API. +/// The Geospatial API uses a combination of Google's Visual Positioning Service +/// (VPS) and GPS to determine the geospatial pose. +/// +/// The Geospatial API is able to provide the best user experience when it is +/// able to generate high accuracy poses. However, the Geospatial API can be +/// used anywhere, as long as the device is able to determine its location, even +/// if the available location information has low accuracy. +/// +/// - In areas with VPS coverage, the Geospatial API is able to generate high +/// accuracy poses. This can work even where GPS accuracy is low, such as +/// dense urban environments. Under typical conditions, VPS can be expected to +/// provide positional accuracy typically better than 5 meters and often +/// around 1 meter, and a rotational accuracy of better than 5 degrees. Use @c +/// ::ArSession_checkVpsAvailabilityAsync to determine if a given location +/// has VPS coverage. +/// - In outdoor environments with few or no overhead obstructions, GPS may be +/// sufficient to generate high accuracy poses. GPS accuracy may be low in +/// dense urban environments and indoors. +/// +/// A small number of ARCore supported devices do not support the Geospatial +/// API. Use @c ::ArSession_isGeospatialModeSupported to determine if the +/// current device is supported. Affected devices are also indicated on the ARCore supported devices +/// page. +/// +/// The default value is @c #AR_GEOSPATIAL_MODE_DISABLED. Use @c +/// ::ArConfig_setGeospatialMode to set the desired mode. +AR_DEFINE_ENUM(ArGeospatialMode){ + /// The Geospatial API is disabled. When a configuration with @c + /// #AR_GEOSPATIAL_MODE_DISABLED becomes active on the @c ::ArSession, current + /// @c ::ArEarth and @c ::ArAnchor objects created from @c + /// ::ArEarth_acquireNewAnchor will stop updating; have their @c + /// ::ArTrackingState set to @c #AR_TRACKING_STATE_STOPPED and should be + /// released; and @c ::ArSession_acquireEarth will return @c NULL. If + /// re-enabled, you will need to call @c ::ArSession_acquireEarth to acquire + /// @c ::ArEarth again. + AR_GEOSPATIAL_MODE_DISABLED = 0, + + /// The Geospatial API is enabled. @c ::ArSession_acquireEarth will create + /// valid @c ::ArEarth objects when a configuration becomes active with this + /// mode through @c ::ArSession_configure. + /// + /// Using this mode requires your app do the following: + /// + /// - Add the ACCESS_INTERNET + /// permission to the AndroidManifest; otherwise, + /// @c ::ArSession_configure returns + /// @c #AR_ERROR_INTERNET_PERMISSION_NOT_GRANTED. + /// - Include the Google Play Services Location Library as a dependency for + /// your app. See Declare + /// dependencies for Google Play services for instructions on how to + /// include this library in your app. If this library is not linked, @c + /// ::ArSession_configure returns + /// @c #AR_ERROR_GOOGLE_PLAY_SERVICES_LOCATION_LIBRARY_NOT_LINKED. + /// - Request and be granted the Android + /// ACCESS_FINE_LOCATION permission; + /// otherwise, @c ::ArSession_configure returns + /// @c #AR_ERROR_FINE_LOCATION_PERMISSION_NOT_GRANTED. + /// + /// Location is tracked only while @c ::ArSession is resumed. While + /// @c ::ArSession is paused, @c ::ArEarth's @c ::ArTrackingState will be + /// @c #AR_TRACKING_STATE_PAUSED. + /// + /// For more information, see documentation on the + /// Geospatial API on Google Developers. + /// + /// This mode is not compatible with the front-facing + /// (selfie) camera. If @c ::ArGeospatialMode is @c + /// #AR_GEOSPATIAL_MODE_ENABLED on a session using + /// @c #AR_CAMERA_CONFIG_FACING_DIRECTION_FRONT, @c ::ArSession_configure will + /// return @c #AR_ERROR_UNSUPPORTED_CONFIGURATION. + /// + /// Not all devices support @c #AR_GEOSPATIAL_MODE_ENABLED, use + /// @c ::ArSession_isGeospatialModeSupported to check if the current device + /// and selected camera support enabling this mode. + AR_GEOSPATIAL_MODE_ENABLED = 2, +}; + +/// @ingroup ArInstantPlacementPoint +/// Used in @c ::ArConfig to indicate whether Instant Placement should be +/// enabled or disabled. Default value is @c +/// #AR_INSTANT_PLACEMENT_MODE_DISABLED. +AR_DEFINE_ENUM(ArInstantPlacementMode){ + /// Instant Placement is disabled. + + /// When Instant Placement is disabled, any @c ::ArInstantPlacementPoint that + /// has + /// @c + /// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE + /// tracking method will result in tracking state becoming permanently + /// @c #AR_TRACKING_STATE_STOPPED. + AR_INSTANT_PLACEMENT_MODE_DISABLED = 0, + + /// Enable Instant Placement. If the hit test is successful, + /// @c ::ArFrame_hitTestInstantPlacement will return a single + /// @c ::ArInstantPlacementPoint with the +Y pointing upward, against gravity. + /// Otherwise, returns an empty result set. + /// + /// This mode is currently intended to be used with hit tests against + /// horizontal surfaces. + /// + /// Hit tests may also be performed against surfaces with any orientation, + /// however: + /// - The resulting Instant Placement point will always have a pose + /// with +Y pointing upward, against gravity. + /// - No guarantees are made with respect to orientation of +X and +Z. + /// Specifically, a hit test against a vertical surface, such as a wall, + /// will not result in a pose that's in any way aligned to the plane of the + /// wall, other than +Y being up, against gravity. + /// - The @c ::ArInstantPlacementPoint's tracking method may + /// never become + /// @c #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING or may + /// take a long time to reach this state. The tracking method remains + /// @c + /// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE. + /// until a (tiny) horizontal plane is fitted at the point of the hit test. + AR_INSTANT_PLACEMENT_MODE_LOCAL_Y_UP = 2, +}; + +/// @ingroup ArFrame /// 2d coordinate systems supported by ARCore. AR_DEFINE_ENUM(ArCoordinates2dType){ /// GPU texture, (x,y) in pixels. AR_COORDINATES_2D_TEXTURE_TEXELS = 0, /// GPU texture coordinates, (s,t) normalized to [0.0f, 1.0f] range. AR_COORDINATES_2D_TEXTURE_NORMALIZED = 1, - /// CPU image, (x,y) in pixels. + /// CPU image, (x,y) in pixels. The range of x and y is determined by the CPU + /// image resolution. AR_COORDINATES_2D_IMAGE_PIXELS = 2, /// CPU image, (x,y) normalized to [0.0f, 1.0f] range. AR_COORDINATES_2D_IMAGE_NORMALIZED = 3, @@ -997,126 +1462,151 @@ AR_DEFINE_ENUM(ArCoordinates2dType){ }; -/// @addtogroup cameraconfig -/// @{ - +/// @ingroup ArCameraConfig /// Describes the direction a camera is facing relative to the device. Used by -/// ArCameraConfig_getFacingDirection(). +/// @c ::ArCameraConfig_getFacingDirection. AR_DEFINE_ENUM(ArCameraConfigFacingDirection){ /// Camera looks out the back of the device (away from the user). AR_CAMERA_CONFIG_FACING_DIRECTION_BACK = 0, - /// Camera looks out the front of the device (towards the user). To create - /// a session using the front-facing (selfie) camera, include - /// #AR_SESSION_FEATURE_FRONT_CAMERA in the feature list passed to - /// ArSession_createWithFeatures(). + /// Camera looks out the front of the device (towards the user). + /// To create a session using the front-facing (selfie) camera, use + /// @c ::ArSession_setCameraConfig to set a front-facing (selfie) camera + /// config retrieved from @c + /// ::ArSession_getSupportedCameraConfigsWithFilter. + /// + /// When the front camera is selected, + /// ARCore's behavior changes in the following ways: + /// + /// - The display will be mirrored. Specifically, + /// @c ::ArCamera_getProjectionMatrix will include a horizontal flip in + /// the generated projection matrix and APIs that reason about things in + /// screen space, such as @c ::ArFrame_transformCoordinates2d, will mirror + /// screen coordinates. Open GL apps should consider using @c glFrontFace + /// to render mirrored assets without changing their winding direction. + /// - @c ::ArCamera_getTrackingState will always output + /// @c #AR_TRACKING_STATE_PAUSED. + /// - @c ::ArFrame_hitTest will always output an empty list. + /// - @c ::ArCamera_getDisplayOrientedPose will always output an identity + /// pose. + /// - @c ::ArSession_acquireNewAnchor will always return + /// @c #AR_ERROR_NOT_TRACKING. + /// - Planes will never be detected. + /// - @c ::ArSession_configure will fail if the supplied configuration + /// requests Cloud Anchors, Augmented Images, or Environmental HDR + /// Lighting Estimation mode. AR_CAMERA_CONFIG_FACING_DIRECTION_FRONT = 1}; -/// @} - #ifdef __cplusplus extern "C" { -#endif +#endif // __cplusplus -// Note: destroy methods do not take ArSession* to allow late destruction in +// Note: Destroy functions do not take ArSession* to allow late destruction in // finalizers of garbage-collected languages such as Java. -/// @addtogroup arcoreapk -/// @{ - +/// @ingroup ArCoreApk /// Determines if ARCore is supported on this device. This may initiate a query /// with a remote service to determine if the device is compatible, in which -/// case it will return immediately with @c out_availability set to -/// #AR_AVAILABILITY_UNKNOWN_CHECKING. +/// case it will return immediately with @p out_availability set to +/// @c #AR_AVAILABILITY_UNKNOWN_CHECKING. /// /// For ARCore-required apps (as indicated by the manifest -/// meta-data) this method will assume device compatibility and will always -/// immediately return one of #AR_AVAILABILITY_SUPPORTED_INSTALLED, -/// #AR_AVAILABILITY_SUPPORTED_APK_TOO_OLD, or -/// #AR_AVAILABILITY_SUPPORTED_NOT_INSTALLED. +/// @c meta-data ) this function will assume device compatibility and will +/// always immediately return one of @c #AR_AVAILABILITY_SUPPORTED_INSTALLED, +/// @c #AR_AVAILABILITY_SUPPORTED_APK_TOO_OLD, or +/// @c #AR_AVAILABILITY_SUPPORTED_NOT_INSTALLED. /// -/// Note: A result #AR_AVAILABILITY_SUPPORTED_INSTALLED only indicates presence -/// of a suitably versioned ARCore APK. Session creation may still fail if the -/// ARCore APK has been sideloaded onto an incompatible device. +/// Note: A result @c #AR_AVAILABILITY_SUPPORTED_INSTALLED only indicates +/// presence of a suitably versioned ARCore APK. Session creation may still fail +/// if the ARCore APK has been side-loaded onto an unsupported device. /// -/// May be called prior to ArSession_create(). +/// May be called prior to @c ::ArSession_create. /// /// @param[in] env The application's @c JNIEnv object -/// @param[in] context A @c jobject for an Android @c Context. -/// @param[out] out_availability A pointer to an ArAvailability to receive +/// @param[in] context A @c JOBject for an Android @c Context. +/// @param[out] out_availability A pointer to an @c ::ArAvailability to receive /// the result. void ArCoreApk_checkAvailability(void *env, void *context, ArAvailability *out_availability); -/// Initiates installation of ARCore if needed. When your apllication launches -/// or enters an AR mode, it should call this method with @c -/// user_requested_install = 1. +/// @ingroup ArCoreApk +/// On supported devices initiates download and installation of +/// Google Play Services for AR (ARCore) and ARCore device profile data, see +/// https://developers.google.com/ar/develop/c/enable-arcore. +/// +/// Do not call this function unless @c ::ArCoreApk_checkAvailability has +/// returned either @c #AR_AVAILABILITY_SUPPORTED_APK_TOO_OLD or +/// @c #AR_AVAILABILITY_SUPPORTED_NOT_INSTALLED. /// -/// If ARCore is installed and compatible, this function will set @c -/// out_install_status to #AR_INSTALL_STATUS_INSTALLED. +/// When your application launches or wishes to enter AR mode, call this +/// function with @p user_requested_install = 1. /// -/// If ARCore is not currently installed or the installed version not -/// compatible, the function will set @c out_install_status to -/// #AR_INSTALL_STATUS_INSTALL_REQUESTED and return immediately. Your current -/// activity will then pause while the user is offered the opportunity to -/// install it. +/// If Google Play Services for AR and device profile data are fully installed +/// and up to date, this function will set @p out_install_status to +/// @c #AR_INSTALL_STATUS_INSTALLED. /// -/// When your activity resumes, you should call this method again, this time -/// with @c user_requested_install = 0. This will either set -/// @c out_install_status to #AR_INSTALL_STATUS_INSTALLED or return an error -/// code indicating the reason that installation could not be completed. +/// If Google Play Services for AR or device profile data is not installed or +/// not up to date, the function will set @p out_install_status to +/// @c #AR_INSTALL_STATUS_INSTALL_REQUESTED and return immediately. The current +/// activity will then pause while the user is prompted to install +/// Google Play Services for AR (market://details?id=com.google.ar.core) and/or +/// ARCore downloads required device profile data. /// -/// ARCore-optional applications must ensure that ArCoreApk_checkAvailability() -/// returns one of the AR_AVAILABILITY_SUPPORTED_... values before -/// calling this method. +/// When your activity resumes, call this function again, this time with +/// @p user_requested_install = 0. This will either set @p out_install_status +/// to @c #AR_INSTALL_STATUS_INSTALLED or return an error code indicating the +/// reason that installation could not be completed. /// -/// See -/// our sample code for an example of how an ARCore-required application -/// should use this function. +/// Once this function returns with @p out_install_status set to +/// @c #AR_INSTALL_STATUS_INSTALLED, it is safe to call @c ::ArSession_create. /// -/// May be called prior to ArSession_create(). +/// Side-loading Google Play Services for AR (ARCore) on unsupported devices +/// will not work. Although @c ::ArCoreApk_checkAvailability may return +/// @c #AR_AVAILABILITY_SUPPORTED_APK_TOO_OLD or +/// @c #AR_AVAILABILITY_SUPPORTED_INSTALLED after side-loading the ARCore APK, +/// the device will still fail to create an AR session, because it is unable to +/// locate the required ARCore device profile data. /// /// For more control over the message displayed and ease of exiting the process, -/// see ArCoreApk_requestInstallCustom(). +/// see @c ::ArCoreApk_requestInstallCustom. /// -/// Caution: The value of *out_install_status should only be -/// considered when #AR_SUCCESS is returned. Otherwise this value must be -/// ignored. +/// Caution: The value of @p *out_install_status is only valid when +/// @c #AR_SUCCESS is returned. Otherwise this value must be ignored. /// /// @param[in] env The application's @c JNIEnv object -/// @param[in] application_activity A @c jobject referencing the application's +/// @param[in] application_activity A @c JObject referencing the application's /// current Android @c Activity. /// @param[in] user_requested_install if set, override the previous installation /// failure message and always show the installation interface. -/// @param[out] out_install_status A pointer to an ArInstallStatus to receive -/// the resulting install status, if successful. Note: this value is only -/// valid with the return value is #AR_SUCCESS. -/// @return #AR_SUCCESS, or any of: -/// - #AR_ERROR_FATAL if an error occurs while checking for or requesting -/// installation -/// - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if ARCore is not supported -/// on this device. -/// - #AR_UNAVAILABLE_USER_DECLINED_INSTALLATION if the user previously declined -/// installation. +/// @param[out] out_install_status A pointer to an @c ::ArInstallStatus to +/// receive the resulting install status, if successful. Value is only valid +/// when the return value is @c #AR_SUCCESS. +/// @return @c #AR_SUCCESS, or any of: +/// - @c #AR_ERROR_FATAL if an error occurs while checking for or requesting +/// installation +/// - @c #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if ARCore is not supported +/// on this device. +/// - @c #AR_UNAVAILABLE_USER_DECLINED_INSTALLATION if the user previously +/// declined installation. ArStatus ArCoreApk_requestInstall(void *env, void *application_activity, int32_t user_requested_install, ArInstallStatus *out_install_status); -/// Initiates installation of ARCore if required, with configurable behavior. +/// @ingroup ArCoreApk +/// Initiates installation of Google Play Services for AR (ARCore) and required +/// device profile data, with configurable behavior. /// -/// This is a more flexible version of ArCoreApk_requestInstall() allowing the -/// application control over the initial informational dialog and ease of +/// This is a more flexible version of @c ::ArCoreApk_requestInstall, allowing +/// the application control over the initial informational dialog and ease of /// exiting or cancelling the installation. /// -/// See ArCoreApk_requestInstall() for details of use and behavior. -/// -/// May be called prior to ArSession_create(). +/// Refer to @c ::ArCoreApk_requestInstall for correct use and expected runtime +/// behavior. /// /// @param[in] env The application's @c JNIEnv object -/// @param[in] application_activity A @c jobject referencing the application's +/// @param[in] application_activity A @c JObject referencing the application's /// current Android @c Activity. /// @param[in] user_requested_install if set, override the previous installation /// failure message and always show the installation interface. @@ -1125,16 +1615,16 @@ ArStatus ArCoreApk_requestInstall(void *env, /// install-in-progress screen causes them to dismiss. /// @param[in] message_type controls the text of the of message displayed /// before showing the install prompt, or disables display of this message. -/// @param[out] out_install_status A pointer to an ArInstallStatus to receive -/// the resulting install status, if successful. Note: this value is only -/// valid with the return value is #AR_SUCCESS. -/// @return #AR_SUCCESS, or any of: -/// - #AR_ERROR_FATAL if an error occurs while checking for or requesting -/// installation -/// - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if ARCore is not supported -/// on this device. -/// - #AR_UNAVAILABLE_USER_DECLINED_INSTALLATION if the user previously declined -/// installation. +/// @param[out] out_install_status A pointer to an @c ::ArInstallStatus to +/// receive the resulting install status, if successful. Value is only valid +/// when the return value is @c #AR_SUCCESS. +/// @return @c #AR_SUCCESS, or any of: +/// - @c #AR_ERROR_FATAL if an error occurs while checking for or requesting +/// installation +/// - @c #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if ARCore is not supported +/// on this device. +/// - @c #AR_UNAVAILABLE_USER_DECLINED_INSTALLATION if the user previously +/// declined installation. ArStatus ArCoreApk_requestInstallCustom(void *env, void *application_activity, int32_t user_requested_install, @@ -1142,160 +1632,167 @@ ArStatus ArCoreApk_requestInstallCustom(void *env, ArInstallUserMessageType message_type, ArInstallStatus *out_install_status); -/// @} -/// @addtogroup session -/// @{ - +/// @ingroup ArSession /// Creates a new ARCore session. Prior to calling this function, your app must /// check that ARCore is installed by verifying that either: /// -/// - ArCoreApk_requestInstall() or ArCoreApk_requestInstallCustom() returns -/// #AR_INSTALL_STATUS_INSTALLED, or -/// - ArCoreApk_checkAvailability() returns -/// #AR_AVAILABILITY_SUPPORTED_INSTALLED. +/// - @c ::ArCoreApk_requestInstall or @c ::ArCoreApk_requestInstallCustom +/// returns +/// @c #AR_INSTALL_STATUS_INSTALLED, or +/// - @c ::ArCoreApk_checkAvailability returns +/// @c #AR_AVAILABILITY_SUPPORTED_INSTALLED. /// -/// This check must be performed prior to creating an ArSession, otherwise -/// ArSession creation will fail, and subsequent installation or upgrade of +/// This check must be performed prior to creating an @c ::ArSession, otherwise +/// @c ::ArSession creation will fail, and subsequent installation or upgrade of /// ARCore will require an app restart and might cause Android to kill your app. /// /// @param[in] env The application's @c JNIEnv object -/// @param[in] context A @c jobject for an Android @c Context -/// @param[out] out_session_pointer A pointer to an @c ArSession* to receive +/// @param[in] context A @c JObject for an Android @c Context +/// @param[out] out_session_pointer A pointer to an @c ::ArSession* to receive /// the address of the newly allocated session. -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_FATAL if an internal error occurred while creating the session. -/// `adb logcat` may contain useful information. -/// - #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED if your app does not have the +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_FATAL if an internal error occurred while creating the +/// session. `adb logcat` may contain useful information. +/// - @c #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED if your app does not have the /// [CAMERA](https://developer.android.com/reference/android/Manifest.permission.html#CAMERA) /// permission. -/// - #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED if the ARCore APK is not present. +/// - @c #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED if the ARCore APK is not present. /// This can be prevented by the installation check described above. -/// - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if the device is not compatible with -/// ARCore. If encountered after completing the installation check, this +/// - @c #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if the device is not compatible +/// with ARCore. If encountered after completing the installation check, this /// usually indicates a user has side-loaded ARCore onto an incompatible /// device. -/// - #AR_UNAVAILABLE_APK_TOO_OLD if the installed ARCore APK is too old for the -/// ARCore SDK with which this application was built. This can be prevented by -/// the installation check described above. -/// - #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built with -/// is too old and no longer supported by the installed ARCore APK. +/// - @c #AR_UNAVAILABLE_APK_TOO_OLD if the installed ARCore APK is too old for +/// the ARCore SDK with which this application was built. This can be +/// prevented by the installation check described above. +/// - @c #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built +/// with is too old and no longer supported by the installed ARCore APK. ArStatus ArSession_create(void *env, void *context, ArSession **out_session_pointer); +/// @ingroup ArSession /// Creates a new ARCore session requesting additional features. Prior to /// calling this function, your app must check that ARCore is installed by /// verifying that either: /// -/// - ArCoreApk_requestInstall() or ArCoreApk_requestInstallCustom() returns -/// #AR_INSTALL_STATUS_INSTALLED, or -/// - ArCoreApk_checkAvailability() returns -/// #AR_AVAILABILITY_SUPPORTED_INSTALLED. +/// - @c ::ArCoreApk_requestInstall or @c ::ArCoreApk_requestInstallCustom +/// returns +/// @c #AR_INSTALL_STATUS_INSTALLED, or +/// - @c ::ArCoreApk_checkAvailability returns +/// @c #AR_AVAILABILITY_SUPPORTED_INSTALLED. /// -/// This check must be performed prior to creating an ArSession, otherwise -/// ArSession creation will fail, and subsequent installation or upgrade of +/// This check must be performed prior to creating an @c ::ArSession, otherwise +/// @c ::ArSession creation will fail, and subsequent installation or upgrade of /// ARCore will require an app restart and might cause Android to kill your app. /// /// @param[in] env The application's @c JNIEnv object -/// @param[in] context A @c jobject for an Android @c Context +/// @param[in] context A @c JObject for an Android @c Context /// @param[in] features The list of requested features, terminated -/// by with #AR_SESSION_FEATURE_END_OF_LIST. -/// @param[out] out_session_pointer A pointer to an @c ArSession* to receive +/// by with @c #AR_SESSION_FEATURE_END_OF_LIST. +/// @param[out] out_session_pointer A pointer to an @c ::ArSession* to receive /// the address of the newly allocated session. -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_FATAL if an internal error occurred while creating the session. -/// `adb logcat` may contain useful information. -/// - #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED if your app does not have the +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_FATAL if an internal error occurred while creating the +/// session. `adb logcat` may contain useful information. +/// - @c #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED if your app does not have the /// [CAMERA](https://developer.android.com/reference/android/Manifest.permission.html#CAMERA) /// permission. -/// - #AR_ERROR_INVALID_ARGUMENT if the requested features are mutually -/// incompatible. See #ArSessionFeature for details. -/// - #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED if the ARCore APK is not present. +/// - @c #AR_ERROR_INVALID_ARGUMENT if the requested features are mutually +/// incompatible. See @c ::ArSessionFeature for details. +/// - @c #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED if the ARCore APK is not present. /// This can be prevented by the installation check described above. -/// - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if the device is not compatible with -/// ARCore. If encountered after completing the installation check, this +/// - @c #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if the device is not compatible +/// with ARCore. If encountered after completing the installation check, this /// usually indicates a user has side-loaded ARCore onto an incompatible /// device. -/// - #AR_UNAVAILABLE_APK_TOO_OLD if the installed ARCore APK is too old for the -/// ARCore SDK with which this application was built. This can be prevented by -/// the installation check described above. -/// - #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built with -/// is too old and no longer supported by the installed ARCore APK. +/// - @c #AR_UNAVAILABLE_APK_TOO_OLD if the installed ARCore APK is too old for +/// the ARCore SDK with which this application was built. This can be +/// prevented by the installation check described above. +/// - @c #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built +/// with is too old and no longer supported by the installed ARCore APK. ArStatus ArSession_createWithFeatures(void *env, void *context, const ArSessionFeature *features, ArSession **out_session_pointer); -/// @} - -// === ArConfig methods === - -/// @addtogroup config -/// @{ +// === ArConfig functions === +/// @ingroup ArConfig /// Creates a new configuration object and initializes it to a sensible default -/// configuration. Plane detection and lighting estimation are enabled, and +/// configuration. Plane detection and Lighting Estimation are enabled, and /// blocking update is selected. This configuration is guaranteed to be /// supported on all devices that support ARCore. void ArConfig_create(const ArSession *session, ArConfig **out_config); +/// @ingroup ArConfig /// Releases memory used by the provided configuration object. void ArConfig_destroy(ArConfig *config); -/// Stores the currently configured lighting estimation mode into -/// @c *light_estimation_mode. +/// @ingroup ArConfig +/// Stores the currently configured @c ::ArLightEstimationMode mode into +/// @p *light_estimation_mode. void ArConfig_getLightEstimationMode( const ArSession *session, const ArConfig *config, ArLightEstimationMode *light_estimation_mode); -/// Sets the lighting estimation mode that should be used. See -/// ::ArLightEstimationMode for available options. +/// @ingroup ArConfig +/// Sets the desired @c ::ArLightEstimationMode. See @c ::ArLightEstimationMode +/// for available options. void ArConfig_setLightEstimationMode( const ArSession *session, ArConfig *config, ArLightEstimationMode light_estimation_mode); +/// @ingroup ArConfig /// Stores the currently configured plane finding mode into -/// @c *plane_finding_mode. +/// @p *plane_finding_mode. void ArConfig_getPlaneFindingMode(const ArSession *session, const ArConfig *config, ArPlaneFindingMode *plane_finding_mode); -/// Sets the plane finding mode that should be used. See -/// ::ArPlaneFindingMode for available options. +/// @ingroup ArConfig +/// Sets the desired plane finding mode. See @c ::ArPlaneFindingMode for +/// available options. void ArConfig_setPlaneFindingMode(const ArSession *session, ArConfig *config, ArPlaneFindingMode plane_finding_mode); -/// Stores the currently configured behavior of @ref ArSession_update() into -/// @c *update_mode. +/// @ingroup ArConfig +/// Stores the currently configured behavior of @c ::ArSession_update into +/// @p *update_mode. void ArConfig_getUpdateMode(const ArSession *session, const ArConfig *config, ArUpdateMode *update_mode); -/// Sets the behavior of @ref ArSession_update(). See -/// ::ArUpdateMode for available options. +/// @ingroup ArConfig +/// Sets the behavior of @c ::ArSession_update. See +/// @c ::ArUpdateMode for available options. void ArConfig_setUpdateMode(const ArSession *session, ArConfig *config, ArUpdateMode update_mode); -/// Gets the current cloud anchor mode from the ::ArConfig. +/// @ingroup ArConfig +/// Gets the current Cloud Anchor mode from the @c ::ArConfig. void ArConfig_getCloudAnchorMode(const ArSession *session, const ArConfig *config, ArCloudAnchorMode *out_cloud_anchor_mode); -/// Sets the cloud configuration that should be used. See ::ArCloudAnchorMode -/// for available options. +/// @ingroup ArConfig +/// Sets the desired cloud configuration. See @c ::ArCloudAnchorMode for +/// available options. void ArConfig_setCloudAnchorMode(const ArSession *session, ArConfig *config, ArCloudAnchorMode cloud_anchor_mode); +/// @ingroup ArConfig /// Sets the image database in the session configuration. /// /// Any images in the currently active image database that have a -/// TRACKING/PAUSED state will immediately be set to the STOPPED state if a -/// different or null image database is set. +/// @c #AR_TRACKING_STATE_TRACKING/#AR_TRACKING_STATE_PAUSED state will +/// immediately be set to the @c #AR_TRACKING_STATE_STOPPED state if a different +/// or @c NULL image database is set. /// /// This function makes a copy of the image database. void ArConfig_setAugmentedImageDatabase( @@ -1303,138 +1800,644 @@ void ArConfig_setAugmentedImageDatabase( ArConfig *config, const ArAugmentedImageDatabase *augmented_image_database); +/// @ingroup ArConfig /// Returns the image database from the session configuration. /// -/// This function returns a copy of the internally stored image database. +/// This function returns a copy of the internally stored image database, so any +/// changes to the copy will not affect the current configuration or session. +/// +/// If no @c ::ArAugmentedImageDatabase has been configured, a new empty +/// database will be constructed using @c ::ArAugmentedImageDatabase_create. void ArConfig_getAugmentedImageDatabase( const ArSession *session, const ArConfig *config, ArAugmentedImageDatabase *out_augmented_image_database); -/// Stores the currently configured augmented face mode into @c -/// *augmented_face_mode. +/// @ingroup ArConfig +/// Stores the currently configured augmented face mode into +/// @p *augmented_face_mode. void ArConfig_getAugmentedFaceMode(const ArSession *session, const ArConfig *config, ArAugmentedFaceMode *augmented_face_mode); -/// Sets the face mode that should be used. See @c ArAugmentedFaceMode for +/// @ingroup ArConfig +/// Sets the desired face mode. See @c ::ArAugmentedFaceMode for /// available options. Augmented Faces is currently only supported when using -/// the front-facing (selfie) camera. See #AR_SESSION_FEATURE_FRONT_CAMERA for -/// details. +/// the front-facing (selfie) camera. void ArConfig_setAugmentedFaceMode(const ArSession *session, ArConfig *config, ArAugmentedFaceMode augmented_face_mode); -/// Sets the focus mode that should be used. See ::ArFocusMode for available -/// options. Currently, the default focus mode is AR_FOCUS_MODE_FIXED, but this -/// default might change in the future. Note, on devices where ARCore does not -/// support Auto Focus due to the use of a fixed focus camera, setting -/// AR_FOCUS_MODE_AUTO will be ignored. See the ARCore Supported Devices -/// (https://developers.google.com/ar/discover/supported-devices) page for a -/// list of affected devices. +/// @ingroup ArConfig +/// On supported devices, selects the desired camera focus mode. On these +/// devices, the default desired focus mode is currently @c +/// #AR_FOCUS_MODE_FIXED, although this default might change in the future. See +/// the ARCore +/// supported devices page for a list of devices on which ARCore does not +/// support changing the desired focus mode. /// /// For optimal AR tracking performance, use the focus mode provided by the /// default session config. While capturing pictures or video, use -/// AR_FOCUS_MODE_AUTO. For optimal AR tracking, revert to the default focus -/// mode once auto focus behavior is no longer needed. If your app requires -/// fixed focus camera, call ArConfig_setFocusMode(…, …, AR_FOCUS_MODE_FIXED) -/// when configuring the AR session. This will ensure that your app always uses -/// fixed focus, even if the default camera config focus mode changes in a -/// future release. +/// @c #AR_FOCUS_MODE_AUTO. For optimal AR tracking, revert to the default +/// focus mode once auto focus behavior is no longer needed. If your app +/// requires fixed focus camera, set @c #AR_FOCUS_MODE_FIXED before enabling the +/// AR session. This ensures that your app always uses fixed focus, even if the +/// default camera config focus mode changes in a future release. +/// +/// To determine whether the configured ARCore camera supports auto focus, check +/// ACAMERA_LENS_INFO_MINIMUM_FOCUS_DISTANCE, which is 0 for fixed-focus +/// cameras. +/// +/// The desired focus mode is ignored while an MP4 dataset file is being played +/// back. void ArConfig_setFocusMode(const ArSession *session, ArConfig *config, ArFocusMode focus_mode); -/// Stores the currently configured focus mode into @c *focus_mode. +/// @ingroup ArConfig +/// Stores the currently configured desired focus mode into @p *focus_mode. +/// Note: The desired focus mode may be different from the actual focus +/// mode. See the +/// ARCore +/// supported devices page for a list of affected devices. void ArConfig_getFocusMode(const ArSession *session, ArConfig *config, ArFocusMode *focus_mode); -/// @} +/// @ingroup ArConfig +/// Sets the Geospatial mode. See @c ::ArGeospatialMode for available options. +void ArConfig_setGeospatialMode(const ArSession *session, + ArConfig *config, + ArGeospatialMode geospatial_mode); + +/// @ingroup ArConfig +/// Gets the current geospatial mode set on the configuration. +/// +/// @param[in] session The ARCore session. +/// @param[in] config The configuration object. +/// @param[out] out_geospatial_mode The current geospatial mode set on the +/// config. +void ArConfig_getGeospatialMode(const ArSession *session, + const ArConfig *config, + ArGeospatialMode *out_geospatial_mode); + +/// @ingroup ArConfig +/// Gets the currently configured desired @c ::ArDepthMode. +void ArConfig_getDepthMode(const ArSession *session, + const ArConfig *config, + ArDepthMode *out_depth_mode); + +/// @ingroup ArConfig +/// Sets the desired @c ::ArDepthMode. +/// +/// Notes: +/// - Not all devices support all modes. Use @c ::ArSession_isDepthModeSupported +/// to determine whether the current device and the selected camera support a +/// particular depth mode. +/// - With depth enabled through this call, calls to +/// @c ::ArFrame_acquireDepthImage16Bits and +/// @c ::ArFrame_acquireRawDepthImage16Bits can be made to acquire the latest +/// computed depth image. +/// - With depth enabled through this call, calling @c ::ArFrame_hitTest +/// generates an @c ::ArHitResultList that also includes @c ::ArDepthPoint +/// values that are sampled from the latest computed depth image. +void ArConfig_setDepthMode(const ArSession *session, + ArConfig *config, + ArDepthMode mode); -// === ArCameraConfigList and ArCameraConfig methods === +/// @ingroup ArConfig +/// Sets the current Instant Placement mode from the @c ::ArConfig. +void ArConfig_setInstantPlacementMode( + const ArSession *session, + ArConfig *config, + ArInstantPlacementMode instant_placement_mode); -/// @addtogroup cameraconfig -/// @{ +/// @ingroup ArConfig +/// Gets the current Instant Placement Region mode from the @c ::ArConfig. +void ArConfig_getInstantPlacementMode( + const ArSession *session, + const ArConfig *config, + ArInstantPlacementMode *instant_placement_mode); + +// === ArCameraConfigList and ArCameraConfig functions === -// === ArCameraConfigList methods === +// === ArCameraConfigList functions === +/// @ingroup ArCameraConfig /// Creates a camera config list object. /// /// @param[in] session The ARCore session -/// @param[out] out_list A pointer to an @c ArCameraConfigList* to receive -/// the address of the newly allocated ArCameraConfigList. +/// @param[out] out_list A pointer to an @c ::ArCameraConfigList* to +/// receive the address of the newly allocated @c ::ArCameraConfigList. void ArCameraConfigList_create(const ArSession *session, ArCameraConfigList **out_list); +/// @ingroup ArCameraConfig /// Releases the memory used by a camera config list object, /// along with all the camera config references it holds. void ArCameraConfigList_destroy(ArCameraConfigList *list); +/// @ingroup ArCameraConfig /// Retrieves the number of camera configs in this list. void ArCameraConfigList_getSize(const ArSession *session, const ArCameraConfigList *list, int32_t *out_size); +/// @ingroup ArCameraConfig /// Retrieves the specific camera config based on the position in this list. void ArCameraConfigList_getItem(const ArSession *session, const ArCameraConfigList *list, int32_t index, ArCameraConfig *out_camera_config); -// === ArCameraConfig methods === +// === ArCameraConfig functions === +/// @ingroup ArCameraConfig /// Creates a camera config object. /// -/// @param[in] session The ARCore session -/// @param[out] out_camera_config A pointer to an @c ArCameraConfig* to receive -/// the address of the newly allocated ArCameraConfig. +/// @param[in] session The ARCore session +/// @param[out] out_camera_config Pointer to an @c ::ArCameraConfig* to +/// receive the address of the newly allocated @c ::ArCameraConfig. void ArCameraConfig_create(const ArSession *session, ArCameraConfig **out_camera_config); +/// @ingroup ArCameraConfig /// Releases the memory used by a camera config object. void ArCameraConfig_destroy(ArCameraConfig *camera_config); -/// Obtains the camera image dimensions for the given camera config. +/// @ingroup ArCameraConfig +/// Obtains the CPU camera image dimensions for the given camera config. void ArCameraConfig_getImageDimensions(const ArSession *session, const ArCameraConfig *camera_config, int32_t *out_width, int32_t *out_height); -/// Obtains the texture dimensions for the given camera config. +/// @ingroup ArCameraConfig +/// Obtains the GPU texture dimensions for the given camera config. void ArCameraConfig_getTextureDimensions(const ArSession *session, const ArCameraConfig *camera_config, int32_t *out_width, int32_t *out_height); +/// @ingroup ArCameraConfig +/// Obtains the minimum and maximum camera capture rate in frames per second +/// (fps) for the current camera config. Actual capture frame rate will vary +/// within this range, depending on lighting conditions. Frame rates will +/// generally be lower under poor lighting conditions to accommodate longer +/// exposure times. +void ArCameraConfig_getFpsRange(const ArSession *session, + const ArCameraConfig *camera_config, + int32_t *out_min_fps, + int32_t *out_max_fps); + +/// @ingroup ArCameraConfig +/// Gets the depth sensor usage settings. @p out_depth_sensor_usage will contain +/// one of the values from @c ::ArCameraConfigDepthSensorUsage enum. +void ArCameraConfig_getDepthSensorUsage(const ArSession *session, + const ArCameraConfig *camera_config, + uint32_t *out_depth_sensor_usage); + +/// @ingroup ArCameraConfig /// Obtains the camera id for the given camera config which is obtained from the -/// list of ArCore compatible camera configs. +/// list of ARCore compatible camera configs. The acquired ID must be released +/// after use by the @c ::ArString_release function. void ArCameraConfig_getCameraId(const ArSession *session, const ArCameraConfig *camera_config, char **out_camera_id); +/// @ingroup ArCameraConfig /// Obtains the facing direction of the camera selected by this config. void ArCameraConfig_getFacingDirection( const ArSession *session, const ArCameraConfig *camera_config, ArCameraConfigFacingDirection *out_facing); -/// @} -// === ArSession methods === +// Camera config filters and camera config filters objects. -/// @addtogroup session -/// @{ +/// @ingroup ArCameraConfigFilter +/// Target camera capture frame rates. +/// The target frame rate represents the maximum or desired frame rate. Actual +/// camera capture frame rates can be lower than the target frame rate under low +/// light conditions in order to accommodate longer exposure times. +AR_DEFINE_ENUM(ArCameraConfigTargetFps){ + /// Target 30fps camera capture frame rate. + /// + /// Available on all ARCore supported devices. + /// + /// Used as a camera filter, via @c ::ArCameraConfigFilter_setTargetFps. + AR_CAMERA_CONFIG_TARGET_FPS_30 = 0x0001, + /// Target 60fps camera capture frame rate. + /// + /// Increases power consumption and may increase app memory usage. + /// + /// See the ARCore supported devices + /// (https://developers.google.com/ar/devices) + /// page for a list of devices that currently support 60fps. + /// + /// Used as a camera filter, via @c ::ArCameraConfigFilter_setTargetFps. + AR_CAMERA_CONFIG_TARGET_FPS_60 = 0x0002, +}; + +/// @ingroup ArCameraConfigFilter +/// Depth sensor usage. +AR_DEFINE_ENUM(ArCameraConfigDepthSensorUsage){ + /// When used as a camera filter, via + /// @c ::ArCameraConfigFilter_setDepthSensorUsage, filters for camera + /// configs that require a depth sensor to be present on the device, and + /// that will be used by ARCore. + /// + /// See the ARCore supported devices + /// (https://developers.google.com/ar/devices) + /// page for a list of devices that currently have supported depth sensors. + /// + /// When returned by @c ::ArCameraConfig_getDepthSensorUsage, indicates + /// that a depth sensor is present, and that the camera config will use the + /// available depth sensor. + AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_REQUIRE_AND_USE = 0x0001, + + /// When used as a camera filter, via + /// @c ::ArCameraConfigFilter_setDepthSensorUsage, filters for camera + /// configs + /// where a depth sensor is not present, or is present but will not be used + /// by ARCore. + /// + /// Most commonly used to filter camera configurations when the app requires + /// exclusive access to the depth sensor outside of ARCore, for example to + /// support 3D mesh reconstruction. Available on all ARCore supported + /// devices. + /// + /// When returned by @c ::ArCameraConfig_getDepthSensorUsage, indicates that + /// the camera config will not use a depth sensor, even if it is present. + AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_DO_NOT_USE = 0x0002, +}; + +/// @ingroup ArCameraConfigFilter +/// Stereo camera usage. +// TODO(b/166280987) Finalize documentation +AR_DEFINE_ENUM(ArCameraConfigStereoCameraUsage){ + /// When used as a camera filter, via + /// @c ::ArCameraConfigFilter_setStereoCameraUsage, indicates that a stereo + /// camera must be present on the device, and the stereo multi-camera + /// (https://source.android.com/devices/camera/multi-camera) must be used by + /// ARCore. Increases CPU and device power consumption. Not supported on all + /// devices. + /// + /// See the ARCore supported devices + /// (https://developers.google.com/ar/devices) + /// page for a list of devices that currently have supported stereo camera + /// capability. + /// + /// When returned by @c ::ArCameraConfig_getStereoCameraUsage, indicates + /// that a + /// stereo camera is present on the device and that the camera config will + /// use the available stereo camera. + AR_CAMERA_CONFIG_STEREO_CAMERA_USAGE_REQUIRE_AND_USE = 0x0001, + + /// When used as a camera filter, via + /// @c ::ArCameraConfigFilter_setStereoCameraUsage, indicates that ARCore + /// will + /// not attempt to use a stereo multi-camera + /// (https://source.android.com/devices/camera/multi-camera), even if one is + /// present. Can be used to limit power consumption. Available on all ARCore + /// supported devices. + /// + /// When returned by @c ::ArCameraConfig_getStereoCameraUsage, indicates + /// that + /// the camera config will not use a stereo camera, even if one is present + /// on the device. + AR_CAMERA_CONFIG_STEREO_CAMERA_USAGE_DO_NOT_USE = 0x0002, +}; + +/// @ingroup ArCameraConfig +/// Gets the stereo multi-camera +/// (https://source.android.com/devices/camera/multi-camera) usage settings. @p +/// out_stereo_camera_usage will contain one of the values from +/// @c ::ArCameraConfigStereoCameraUsage enum. +// TODO(b/166280987) Finalize documentation +void ArCameraConfig_getStereoCameraUsage( + const ArSession *session, + const ArCameraConfig *camera_config, + ArCameraConfigStereoCameraUsage *out_stereo_camera_usage); + +/// @ingroup ArCameraConfigFilter +/// Creates a camera config filter object. +/// +/// @param[in] session The ARCore session +/// @param[out] out_filter A pointer to an @c ::ArCameraConfigFilter* to +/// receive the address of the newly allocated @c ::ArCameraConfigFilter +void ArCameraConfigFilter_create(const ArSession *session, + ArCameraConfigFilter **out_filter); + +/// @ingroup ArCameraConfigFilter +/// Releases memory used by the provided camera config filter object. +/// +/// @param[in] filter The filter to release memory for. +void ArCameraConfigFilter_destroy(ArCameraConfigFilter *filter); + +/// @ingroup ArCameraConfigFilter +/// Sets the desired framerates to allow. +/// +/// @param[in] session The ARCore session +/// @param[in, out] filter The filter object to change +/// @param[in] fps_filters A 32bit integer representing multiple +/// @c ::ArCameraConfigTargetFps values, bitwise-or'd together +void ArCameraConfigFilter_setTargetFps(const ArSession *session, + ArCameraConfigFilter *filter, + const uint32_t fps_filters); + +/// @ingroup ArCameraConfigFilter +/// Gets the desired framerates to allow. +/// +/// @param[in] session The ARCore session +/// @param[in] filter The filter object to query +/// @param[out] out_fps_filters To be filled in with the desired framerates +/// allowed +void ArCameraConfigFilter_getTargetFps(const ArSession *session, + ArCameraConfigFilter *filter, + uint32_t *out_fps_filters); + +/// @ingroup ArCameraConfigFilter +/// Sets the desired depth sensor usages to allow. +/// +/// @param[in] session The ARCore session +/// @param[in, out] filter The filter object to change +/// @param[in] depth_sensor_usage_filters A 32bit integer representing +/// multiple @c ::ArCameraConfigDepthSensorUsage values, bitwise-or'd +/// together +void ArCameraConfigFilter_setDepthSensorUsage( + const ArSession *session, + ArCameraConfigFilter *filter, + uint32_t depth_sensor_usage_filters); + +/// @ingroup ArCameraConfigFilter +/// Gets the desired depth sensor usages to allow. +/// +/// @param[in] session The ARCore session +/// @param[in] filter The filter object to query +/// @param[out] out_depth_sensor_usage To be filled in with the desired depth +/// sensor usages allowed +void ArCameraConfigFilter_getDepthSensorUsage(const ArSession *session, + ArCameraConfigFilter *filter, + uint32_t *out_depth_sensor_usage); + +/// @ingroup ArCameraConfigFilter +/// Sets the stereo multi-camera +/// (https://source.android.com/devices/camera/multi-camera) usage filter. +/// Default is to not filter. +/// +/// @param[in] session The ARCore session +/// @param[in, out] filter The filter object to change +/// @param[in] stereo_camera_usage_filters A 32bit integer representing +/// multiple @c ::ArCameraConfigStereoCameraUsage values, bitwise-or'd +/// together +// TODO(b/166280987) Finalize documentation +void ArCameraConfigFilter_setStereoCameraUsage( + const ArSession *session, + ArCameraConfigFilter *filter, + uint32_t stereo_camera_usage_filters); + +/// @ingroup ArCameraConfigFilter +/// Get the stereo multi-camera +/// (https://source.android.com/devices/camera/multi-camera) usage filter state. +/// +/// @param[in] session The ARCore session +/// @param[in] filter The filter object to query +/// @param[out] out_stereo_camera_usage To be filled in with the desired stereo +/// camera usages allowed +// TODO(b/166280987) Finalize documentation +void ArCameraConfigFilter_getStereoCameraUsage( + const ArSession *session, + ArCameraConfigFilter *filter, + uint32_t *out_stereo_camera_usage); + +/// @ingroup ArCameraConfigFilter +/// Sets the desired camera facing direction to allow. +/// +/// @param[in] session The ARCore session +/// @param[in, out] filter The filter object to change +/// @param[in] facing_direction_filter A valid +/// @c ::ArCameraConfigFacingDirection enum value +void ArCameraConfigFilter_setFacingDirection( + const ArSession *session, + ArCameraConfigFilter *filter, + ArCameraConfigFacingDirection facing_direction_filter); + +/// @ingroup ArCameraConfigFilter +/// Gets the desired camera facing direction to allow. +/// +/// @param[in] session The ARCore session +/// @param[in] filter The filter object to query +/// @param[out] out_facing_direction_filter To be filled in with the desired +/// camera facing direction allowed +void ArCameraConfigFilter_getFacingDirection( + const ArSession *session, + ArCameraConfigFilter *filter, + ArCameraConfigFacingDirection *out_facing_direction_filter); + +/// @ingroup ArRecordingConfig +/// Creates a dataset recording config object. +/// +/// @param[in] session The ARCore session +/// @param[out] out_config Pointer to an @c ::ArRecordingConfig* to receive +/// the address of the newly allocated @c ::ArRecordingConfig +void ArRecordingConfig_create(const ArSession *session, + ArRecordingConfig **out_config); + +/// @ingroup ArRecordingConfig +/// Releases memory used by the provided recording config object. +/// +/// @param[in] config The config to release memory for. +void ArRecordingConfig_destroy(ArRecordingConfig *config); + +/// @ingroup ArRecordingConfig +/// Gets the file path to save an MP4 dataset file for the recording. +/// +/// This will be null if @c ::ArRecordingConfig_setMp4DatasetUri was used to set +/// the output. +/// +/// @param[in] session The ARCore session +/// @param[in] config The config object to query +/// @param[out] out_mp4_dataset_file_path Pointer to an @c char* to receive +/// the address of the newly allocated file path. +/// @deprecated Deprecated in release 1.26.0. Use +/// @c ::ArRecordingConfig_getMp4DatasetUri instead. +void ArRecordingConfig_getMp4DatasetFilePath(const ArSession *session, + const ArRecordingConfig *config, + char **out_mp4_dataset_file_path) + AR_DEPRECATED( + "Deprecated in release 1.26.0. Please see function documentation"); + +/// @ingroup ArRecordingConfig +/// Sets the file path to save an MP4 dataset file for the recording. +/// +/// @param[in] session The ARCore session +/// @param[in, out] config The config object to change +/// @param[in] mp4_dataset_file_path A string representing the file path +/// @deprecated Deprecated in release 1.26.0. Use +/// @c ::ArRecordingConfig_setMp4DatasetUri instead. +void ArRecordingConfig_setMp4DatasetFilePath(const ArSession *session, + ArRecordingConfig *config, + const char *mp4_dataset_file_path) + AR_DEPRECATED( + "Deprecated in release 1.26.0. Please see function documentation"); + +/// @ingroup ArRecordingConfig +/// Gets the URI that the MP4 dataset will be recorded to. +/// +/// This will be null if @c ::ArRecordingConfig_setMp4DatasetFilePath was used +/// to set the output. +/// +/// @param[in] session The ARCore session +/// @param[in] config The config object to query +/// @param[out] out_mp4_dataset_uri Pointer to a @c char* to receive +///     the address of the newly allocated URI. +void ArRecordingConfig_getMp4DatasetUri(const ArSession *session, + const ArRecordingConfig *config, + char **out_mp4_dataset_uri); + +/// @ingroup ArRecordingConfig +/// Sets the file path to save an MP4 dataset file for the recording. +/// +/// The URI must be able to be opened as a file descriptor for reading and +/// writing that supports @c lseek or @c #AR_ERROR_INVALID_ARGUMENT will be +/// returned when @c ::ArSession_startRecording is called. +/// +/// @param[in] session The ARCore session +/// @param[in, out] config The config object to change +/// @param[in] mp4_dataset_uri The percent encoded, null terminated, URI to +/// write data to. +void ArRecordingConfig_setMp4DatasetUri(const ArSession *session, + ArRecordingConfig *config, + const char *mp4_dataset_uri); + +/// @ingroup ArRecordingConfig +/// Gets the setting that indicates whether the recording should stop +/// automatically when the ARCore session is paused. +/// +/// @param[in] session The ARCore session +/// @param[in] config The config object to query +/// @param[out] out_config_enabled To be filled in with the state used (1 for +/// enabled, 0 for disabled) +void ArRecordingConfig_getAutoStopOnPause(const ArSession *session, + const ArRecordingConfig *config, + int32_t *out_config_enabled); + +/// @ingroup ArRecordingConfig +/// Specifies whether recording should stop automatically when the ARCore +/// session is paused. +/// +/// @param[in] session The ARCore session +/// @param[in, out] config The config object to change +/// @param[in] config_enabled Desired state (1 to enable, 0 to disable) +void ArRecordingConfig_setAutoStopOnPause(const ArSession *session, + ArRecordingConfig *config, + int32_t config_enabled); + +/// @ingroup ArRecordingConfig +/// Gets the clockwise rotation in degrees that should be applied to the +/// recorded image. +/// +/// @param[in] session The ARCore session +/// @param[in] config The config object to query +/// @param[out] out_recording_rotation To be filled in with the clockwise +/// rotation in degrees (0, 90, 180, 270, or -1 for unspecified) +void ArRecordingConfig_getRecordingRotation(const ArSession *session, + const ArRecordingConfig *config, + int32_t *out_recording_rotation); + +/// @ingroup ArRecordingConfig +/// Specifies the clockwise rotation in degrees that should be applied to the +/// recorded image. +/// +/// @param[in] session The ARCore session +/// @param[in, out] config The config object to change +/// @param[in] recording_rotation The clockwise rotation in degrees (0, 90, 180, +/// or 270). +void ArRecordingConfig_setRecordingRotation(const ArSession *session, + ArRecordingConfig *config, + int32_t recording_rotation); + +/// @ingroup ArRecordingConfig +/// Configures and adds a track. +/// +/// @param[in] session The ARCore session +/// @param[in, out] config The @c ::ArRecordingConfig object to change +/// @param[in] track The @c ::ArTrack being added to the +/// recording config +void ArRecordingConfig_addTrack(const ArSession *session, + ArRecordingConfig *config, + const ArTrack *track); + +/// @ingroup ArTrack +/// Initializes an @c ::ArTrack. +/// +/// @param[in] session The ARCore session +/// @param[out] out_track Pointer to an @c ::ArTrack to receive +/// the address of the newly allocated @c ::ArTrack +void ArTrack_create(const ArSession *session, ArTrack **out_track); + +/// @ingroup ArTrack +/// Sets the Track Id. +/// +/// @param[in] session The ARCore session +/// @param[in, out] track The track object to change +/// @param[in] track_id_uuid_16 The track ID as UUID as a byte array of 16 +/// bytes in size +void ArTrack_setId(const ArSession *session, + ArTrack *track, + const uint8_t *track_id_uuid_16); + +/// @ingroup ArTrack +/// Sets the Track Metadata. +/// +/// @param[in] session The ARCore session +/// @param[in, out] track The external track object to change +/// @param[in] track_metadata_buffer bytes describing arbitrary data about +/// the track. +/// @param[in] track_metadata_buffer_size size of the @p track_metadata_buffer +void ArTrack_setMetadata(const ArSession *session, + ArTrack *track, + const uint8_t *track_metadata_buffer, + size_t track_metadata_buffer_size); + +/// @ingroup ArTrack +/// Sets the MIME type for the Data Track. Default value is +/// "application/text". +/// +/// @param[in] session The ARCore session +/// @param[in, out] track The track object to change +/// @param[in] mime_type The string representing the MIME type label +/// as a null-terminated string in UTF-8 format. This will be the MIME type set +/// on the additional stream created for this @c ::ArTrack, another convenient +/// means of identification, particularly for applications that do not support +/// UUID as a means of identification. +void ArTrack_setMimeType(const ArSession *session, + ArTrack *track, + const char *mime_type); + +/// @ingroup ArTrack +/// Releases memory used by the provided data track config object. +/// +/// @param[in] track The track config object to release +void ArTrack_destroy(ArTrack *track); + +// === ArSession functions === + +/// @ingroup ArSession /// Releases resources used by an ARCore session. -/// This method will take several seconds to complete. To prevent blocking -/// the main thread, call ArSession_pause() on the main thread, and then call -/// ArSession_destroy() on a background thread. +/// This function will take several seconds to complete. To prevent blocking +/// the main thread, call @c ::ArSession_pause on the main thread, and then call +/// @c ::ArSession_destroy on a background thread. /// void ArSession_destroy(ArSession *session); +/// @ingroup ArSession /// Before release 1.2.0: Checks if the provided configuration is usable on the -/// this device. If this method returns #AR_ERROR_UNSUPPORTED_CONFIGURATION, -/// calls to ArSession_configure(Config) with this configuration will fail. +/// this device. If this function returns @c +/// #AR_ERROR_UNSUPPORTED_CONFIGURATION, calls to @c ::ArSession_configure with +/// this configuration will fail. /// /// This function now always returns true. See documentation for each /// configuration entry to know which configuration options & combinations are @@ -1442,9 +2445,9 @@ void ArSession_destroy(ArSession *session); /// /// @param[in] session The ARCore session /// @param[in] config The configuration to test -/// @return #AR_SUCCESS or: -/// - #AR_ERROR_INVALID_ARGUMENT if any of the arguments are null. -/// @deprecated in release 1.2.0. Please refer to the release notes +/// @return @c #AR_SUCCESS or: +/// - @c #AR_ERROR_INVALID_ARGUMENT if any of the arguments are @c NULL. +/// @deprecated Deprecated in release 1.2.0. Please refer to the release notes /// (release /// notes 1.2.0) @@ -1452,79 +2455,144 @@ void ArSession_destroy(ArSession *session); ArStatus ArSession_checkSupported(const ArSession *session, const ArConfig *config) AR_DEPRECATED( - "deprecated in release 1.2.0. Please see function documentation"); - -/// Configures the session with the given config. -/// Note: a session is always initially configured with the default config. -/// This should be called if a configuration different than default is needed. -/// -/// The following configurations are not supported: -/// -/// - When using the back-facing camera (default): -/// - #AR_AUGMENTED_FACE_MODE_MESH3D. -/// - When using the front-facing (selfie) camera -/// (#AR_SESSION_FEATURE_FRONT_CAMERA): -/// - Any config using ArConfig_setAugmentedImageDatabase(). -/// - #AR_CLOUD_ANCHOR_MODE_ENABLED. -/// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_FATAL -/// - #AR_ERROR_UNSUPPORTED_CONFIGURATION If the configuration is not supported, -/// see above restrictions + "Deprecated in release 1.2.0. Please see function documentation"); + +/// @ingroup ArSession +/// Configures the session and verifies that the enabled features in the +/// specified session config are supported with the currently set camera config. +/// +/// Should be called after @c ::ArSession_setCameraConfig to verify that all +/// requested session config features are supported. Features not supported with +/// the current camera config will otherwise be silently disabled when the +/// session is resumed by calling @c ::ArSession_resume. +/// +/// The following configurations are unsupported and will return +/// @c #AR_ERROR_UNSUPPORTED_CONFIGURATION: +/// +/// - When using the (default) back-facing camera: +/// - @c #AR_AUGMENTED_FACE_MODE_MESH3D. +/// - @c #AR_GEOSPATIAL_MODE_ENABLED on devices that do not support this +/// Geospatial mode. See @c ::ArSession_isGeospatialModeSupported. +/// - When using the front-facing (selfie) camera: +/// - Any config using @c ::ArConfig_setAugmentedImageDatabase. +/// - @c #AR_CLOUD_ANCHOR_MODE_ENABLED. +/// - @c #AR_LIGHT_ESTIMATION_MODE_ENVIRONMENTAL_HDR. +/// - @c #AR_GEOSPATIAL_MODE_ENABLED. +/// +/// @param[in] session The ARCore session. +/// @param[in] config The new configuration setting for the session. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_FATAL +/// - @c #AR_ERROR_UNSUPPORTED_CONFIGURATION if the requested session config is +/// not supported. +/// See above restrictions. +/// - @c #AR_ERROR_INTERNET_PERMISSION_NOT_GRANTED if +/// #AR_GEOSPATIAL_MODE_ENABLED or +/// #AR_CLOUD_ANCHOR_MODE_ENABLED is set and the +/// Android +/// INTERNET permission has not been granted. +/// - @c #AR_ERROR_FINE_LOCATION_PERMISSION_NOT_GRANTED if +/// #AR_GEOSPATIAL_MODE_ENABLED is set and the @c ACCESS_FINE_LOCATION +/// permission has not been granted. +/// - @c #AR_ERROR_GOOGLE_PLAY_SERVICES_LOCATION_LIBRARY_NOT_LINKED if +/// #AR_GEOSPATIAL_MODE_ENABLED is set and the Fused +/// Location Provider for Android library could not be found. See @c +/// #AR_ERROR_GOOGLE_PLAY_SERVICES_LOCATION_LIBRARY_NOT_LINKED for additional +/// troubleshooting steps. ArStatus ArSession_configure(ArSession *session, const ArConfig *config); -/// Gets the current config. More specifically, fills the given ArConfig object -/// with the copy of the configuration most recently set by -/// ArSession_configure(). Note: if the session was not explicitly configured, a -/// default configuration is returned (same as ArConfig_create()). +/// @ingroup ArSession +/// Gets the current config. More specifically, fills the given @c ::ArConfig +/// object with the copy of the configuration most recently set by +/// @c ::ArSession_configure. Note: if the session was not explicitly +/// configured, a default configuration is returned (same as +/// @c ::ArConfig_create). void ArSession_getConfig(ArSession *session, ArConfig *out_config); +/// @ingroup ArSession /// Starts or resumes the ARCore Session. /// /// Typically this should be called from Activity.onResume(). +/// >@c Activity.onResume() . /// /// Note that if the camera configuration has been changed by -/// ArSession_setCameraConfig() since the last call to ArSession_resume(), all -/// images previously acquired using ArFrame_acquireCameraImage() must be -/// released by calling ArImage_release() before calling ArSession_resume(). If -/// there are open images, ArSession_resume will return AR_ERROR_ILLEGAL_STATE -/// and the session will not resume. -/// -/// @returns #AR_SUCCESS or any of: -/// - #AR_ERROR_FATAL -/// - #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED -/// - #AR_ERROR_CAMERA_NOT_AVAILABLE -/// - #AR_ERROR_ILLEGAL_STATE +/// @c ::ArSession_setCameraConfig since the last call to @c ::ArSession_resume, +/// all images previously acquired using @c ::ArFrame_acquireCameraImage must be +/// released by calling @c ::ArImage_release before calling +/// @c ::ArSession_resume. If there are open images, @c ::ArSession_resume will +/// return @c #AR_ERROR_ILLEGAL_STATE and the session will not resume. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_FATAL +/// - @c #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED +/// - @c #AR_ERROR_CAMERA_NOT_AVAILABLE +/// - @c #AR_ERROR_ILLEGAL_STATE ArStatus ArSession_resume(ArSession *session); -/// Pause the current session. This method will stop the camera feed and release -/// resources. The session can be restarted again by calling ArSession_resume(). +/// @ingroup ArSession +/// Pause the current session. This function will stop the camera feed and +/// release resources. The session can be restarted again by calling +/// @c ::ArSession_resume. /// /// Typically this should be called from Activity.onPause(). +/// >@c Activity.onPause() . /// /// Note that ARCore might continue consuming substantial computing resources -/// for up to 10 seconds after calling this method. +/// for up to 10 seconds after calling this function. /// -/// @returns #AR_SUCCESS or any of: -/// - #AR_ERROR_FATAL +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_FATAL ArStatus ArSession_pause(ArSession *session); -/// Sets the OpenGL texture name (id) that will allow GPU access to the camera -/// image. The provided ID should have been created with @c glGenTextures(). The -/// resulting texture must be bound to the @c GL_TEXTURE_EXTERNAL_OES target for -/// use. Shaders accessing this texture must use a @c samplerExternalOES -/// sampler. See sample code for an example. +/// @ingroup ArSession +/// Sets the OpenGL texture names (IDs) that will be assigned to incoming camera +/// frames in sequence in a ring buffer. The textures must be bound to the +/// @c GL_TEXTURE_EXTERNAL_OES target for use. Shaders accessing these textures +/// must use a @c samplerExternalOES sampler. +/// +/// The texture contents are not guaranteed to remain valid after another call +/// to @c ::ArSession_setCameraTextureName or +/// @c ::ArSession_setCameraTextureNames, and additionally are not guaranteed to +/// remain valid after a call to +/// @c ::ArSession_pause or @c ::ArSession_destroy. +/// +/// Passing multiple textures allows for a multithreaded rendering pipeline, +/// unlike @c ::ArSession_setCameraTextureName. +/// +/// Note: this function doesn't fail. If given invalid input, it logs an error +/// without setting the texture names. +/// +/// @param[in] session The ARCore session +/// @param[in] number_of_textures The number of textures being passed. This +/// must always be at least 1. +/// @param[in] texture_ids Pointer to the array of textures names (IDs) +void ArSession_setCameraTextureNames(ArSession *session, + int32_t number_of_textures, + const uint32_t *texture_ids); + +/// @ingroup ArSession +/// Sets the OpenGL texture name (ID) that will allow GPU access to the camera +/// image. The texture must be bound to the @c GL_TEXTURE_EXTERNAL_OES target +/// for use. Shaders accessing this texture must use a @c samplerExternalOES +/// sampler. +/// +/// The texture contents are not guaranteed to remain valid after another call +/// to @c ::ArSession_setCameraTextureName or +/// @c ::ArSession_setCameraTextureNames, and additionally are not guaranteed to +/// remain valid after a call to @c ::ArSession_pause or @c ::ArSession_destroy. void ArSession_setCameraTextureName(ArSession *session, uint32_t texture_id); +/// @ingroup ArSession /// Sets the aspect ratio, coordinate scaling, and display rotation. This data /// is used by UV conversion, projection matrix generation, and hit test logic. /// -/// Note: this function doesn't fail. If given invalid input, it logs a error -/// and doesn't apply the changes. +/// Note: this function always returns successfully. If given invalid input, it +/// logs a error and doesn't apply the changes. /// /// @param[in] session The ARCore session /// @param[in] rotation Display rotation specified by @c android.view.Surface @@ -1537,6 +2605,7 @@ void ArSession_setDisplayGeometry(ArSession *session, int32_t width, int32_t height); +/// @ingroup ArSession /// Updates the state of the ARCore system. This includes: receiving a new /// camera frame, updating the location of the device, updating the location of /// tracking anchors, updating detected planes, etc. @@ -1547,17 +2616,17 @@ void ArSession_setDisplayGeometry(ArSession *session, /// /// This call may update the pose of all created anchors and detected planes. /// The set of updated objects is accessible through -/// ArFrame_getUpdatedTrackables(). +/// @c ::ArFrame_getUpdatedTrackables. /// -/// @c update() in blocking mode (see ::ArUpdateMode) will wait until a -/// new camera image is available, or until the built-in timeout +/// @c ::ArSession_update in blocking mode (see @c ::ArUpdateMode) will wait +/// until a new camera image is available, or until the built-in timeout /// (currently 66ms) is reached. /// If the camera image does not arrive by the built-in timeout, then -/// @c update() will return the most recent ::ArFrame object. For some -/// applications it may be important to know if a new frame was actually +/// @c ::ArSession_update will return the most recent @c ::ArFrame object. For +/// some applications it may be important to know if a new frame was actually /// obtained (for example, to avoid redrawing if the camera did not produce a /// new frame). To do that, compare the current frame's timestamp, obtained via -/// @c ArFrame_getTimestamp, with the previously recorded frame timestamp. If +/// @c ::ArFrame_getTimestamp, with the previously recorded frame timestamp. If /// they are different, this is a new frame. /// /// During startup the camera system may not produce actual images @@ -1567,99 +2636,196 @@ void ArSession_setDisplayGeometry(ArSession *session, /// @param[in] session The ARCore session /// @param[inout] out_frame The Frame object to populate with the updated world /// state. This frame must have been previously created using -/// ArFrame_create(). The same ArFrame instance may be used when calling -/// this repeatedly. -/// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_FATAL -/// - #AR_ERROR_SESSION_PAUSED -/// - #AR_ERROR_TEXTURE_NOT_SET -/// - #AR_ERROR_MISSING_GL_CONTEXT -/// - #AR_ERROR_CAMERA_NOT_AVAILABLE - camera was removed during runtime. +/// @c ::ArFrame_create. The same @c ::ArFrame instance may be used when +/// calling this repeatedly. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_FATAL +/// - @c #AR_ERROR_SESSION_PAUSED +/// - @c #AR_ERROR_TEXTURE_NOT_SET +/// - @c #AR_ERROR_MISSING_GL_CONTEXT +/// - @c #AR_ERROR_CAMERA_NOT_AVAILABLE - camera was removed during runtime. ArStatus ArSession_update(ArSession *session, ArFrame *out_frame); +/// @ingroup ArSession /// Defines a tracked location in the physical world. /// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_NOT_TRACKING -/// - #AR_ERROR_SESSION_PAUSED -/// - #AR_ERROR_RESOURCE_EXHAUSTED +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_NOT_TRACKING +/// - @c #AR_ERROR_SESSION_PAUSED +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED ArStatus ArSession_acquireNewAnchor(ArSession *session, const ArPose *pose, ArAnchor **out_anchor); +/// @ingroup ArSession /// Returns all known anchors, including those not currently tracked. Anchors -/// forgotten by ARCore due to a call to ArAnchor_detach() or entering the -/// #AR_TRACKING_STATE_STOPPED state will not be included. +/// forgotten by ARCore due to a call to @c ::ArAnchor_detach or entering the +/// @c #AR_TRACKING_STATE_STOPPED state will not be included. /// /// @param[in] session The ARCore session /// @param[inout] out_anchor_list The list to fill. This list must have already -/// been allocated with ArAnchorList_create(). If previously used, the list -/// will first be cleared. +/// been allocated with @c ::ArAnchorList_create. If previously used, the +/// list will first be cleared. void ArSession_getAllAnchors(const ArSession *session, ArAnchorList *out_anchor_list); -/// Returns the list of all known @ref trackable "trackables". This includes -/// ::ArPlane objects if plane detection is enabled, as well as ::ArPoint -/// objects created as a side effect of calls to ArSession_acquireNewAnchor() or -/// ArFrame_hitTest(). +/// @ingroup ArSession +/// Returns the list of all known @c ::ArTrackable objects. This includes +/// @c ::ArPlane objects if plane detection is enabled, as well as @c ::ArPoint +/// objects created as a side effect of calls to @c ::ArSession_acquireNewAnchor +/// or +/// @c ::ArFrame_hitTest. /// /// @param[in] session The ARCore session /// @param[in] filter_type The type(s) of trackables to return. See -/// ::ArTrackableType for legal values. +/// @c ::ArTrackableType for legal values. /// @param[inout] out_trackable_list The list to fill. This list must have -/// already been allocated with ArTrackableList_create(). If previously +/// already been allocated with @c ::ArTrackableList_create. If previously /// used, the list will first be cleared. void ArSession_getAllTrackables(const ArSession *session, ArTrackableType filter_type, ArTrackableList *out_trackable_list); -/// This will create a new cloud anchor using pose and other metadata from -/// @c anchor. +/// @ingroup ArAnchor +/// Describes the quality of the visual features seen by ARCore in the preceding +/// few seconds and visible from a desired camera @c ::ArPose. A higher quality +/// indicates a Cloud Anchor hosted at the current time with the current set of +/// recently seen features will generally be easier to resolve more accurately. +/// For more details, see +/// https://developers.google.com/ar/develop/c/cloud-anchors/overview-c +AR_DEFINE_ENUM(ArFeatureMapQuality){ + /// The quality of features seen from the pose in the preceding + /// seconds is low. This state indicates that ARCore will likely have more + /// difficulty resolving (@c ::ArSession_resolveAndAcquireNewCloudAnchor) + /// the Cloud Anchor. Encourage the user to move the device, so that the + /// desired position of the Cloud Anchor to be hosted is seen from different + /// angles. + AR_FEATURE_MAP_QUALITY_INSUFFICIENT = 0, + /// The quality of features seen from the pose in the preceding few + /// seconds is likely sufficient for ARCore to successfully resolve + /// (@c ::ArSession_resolveAndAcquireNewCloudAnchor) a Cloud Anchor, + /// although the accuracy of the resolved pose will likely be reduced. + /// Encourage the user to move the device, so that the desired position of + /// the Cloud + /// Anchor to be hosted is seen from different angles. + AR_FEATURE_MAP_QUALITY_SUFFICIENT = 1, + /// The quality of features seen from the pose in the preceding few + /// seconds is likely sufficient for ARCore to successfully resolve + /// (@c ::ArSession_resolveAndAcquireNewCloudAnchor) a Cloud Anchor with a + /// high degree of accuracy. + AR_FEATURE_MAP_QUALITY_GOOD = 2, +}; + +/// @ingroup ArSession +/// Estimates the quality of the visual features seen by ARCore in the +/// preceding few seconds and visible from the provided camera pose. +/// Cloud Anchors hosted using higher quality features will generally result +/// in easier and more accurately resolved Cloud Anchor poses. +/// +/// @param[in] session The ARCore session. +/// @param[in] pose The camera pose to use in estimating the quality. +/// @param[out] out_feature_map_quality The estimated quality of the visual +/// features seen by ARCore in the preceding few seconds and visible from +/// the provided camera pose. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT +/// - @c #AR_ERROR_NOT_TRACKING +/// - @c #AR_ERROR_SESSION_PAUSED +/// - @c #AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED +ArStatus ArSession_estimateFeatureMapQualityForHosting( + const ArSession *session, + const ArPose *pose, + ArFeatureMapQuality *out_feature_map_quality); + +/// @ingroup ArSession +/// This creates a new Cloud Anchor using the pose and other metadata from +/// @p anchor. /// -/// If the function returns #AR_SUCCESS, the cloud state of @c out_cloud_anchor -/// will be set to #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS and the initial pose -/// will be set to the pose of @c anchor. However, the new @c out_cloud_anchor -/// is completely independent of @c anchor, and the poses may diverge over time. -/// If the return value of this function is not #AR_SUCCESS, then -/// @c out_cloud_anchor will be set to null. +/// If the function returns @c #AR_SUCCESS, the cloud state of @p +/// out_cloud_anchor will be set to @c #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS +/// and the initial pose will be set to the pose of @p anchor. However, the new +/// @p out_cloud_anchor is completely independent of @p anchor, and the poses +/// may diverge over time. If the return value of this function is not @c +/// #AR_SUCCESS, then @p out_cloud_anchor will be set to @c NULL. /// /// @param[in] session The ARCore session /// @param[in] anchor The anchor to be hosted -/// @param[inout] out_cloud_anchor The new cloud anchor -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_NOT_TRACKING -/// - #AR_ERROR_SESSION_PAUSED -/// - #AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED -/// - #AR_ERROR_RESOURCE_EXHAUSTED -/// - #AR_ERROR_ANCHOR_NOT_SUPPORTED_FOR_HOSTING +/// @param[inout] out_cloud_anchor The new Cloud Anchor +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_NOT_TRACKING +/// - @c #AR_ERROR_SESSION_PAUSED +/// - @c #AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED +/// - @c #AR_ERROR_ANCHOR_NOT_SUPPORTED_FOR_HOSTING ArStatus ArSession_hostAndAcquireNewCloudAnchor(ArSession *session, const ArAnchor *anchor, ArAnchor **out_cloud_anchor); -/// This will create a new cloud anchor, and schedule a resolving task to -/// resolve the anchor's pose using the given cloud anchor ID. -/// -/// If this function returns #AR_SUCCESS, the cloud state of @c out_cloud_anchor -/// will be #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS, and its tracking state will -/// be #AR_TRACKING_STATE_PAUSED. This anchor will never start tracking until -/// its pose has been successfully resolved. If the resolving task ends in an -/// error, the tracking state will be set to #AR_TRACKING_STATE_STOPPED. If the -/// return value is not #AR_SUCCESS, then @c out_cloud_anchor will be set to -/// null. +/// @ingroup ArSession +/// This creates a new Cloud Anchor and schedules a task to resolve the anchor's +/// pose using the given Cloud Anchor ID. You don't need to wait for a call to +/// resolve a Cloud Anchor to complete before initiating another call. +/// A session can be resolving up to 40 Cloud Anchors at a given time. +/// +/// If this function returns @c #AR_SUCCESS, the cloud state of @p +/// out_cloud_anchor will be @c #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS, and its +/// tracking state will be @c #AR_TRACKING_STATE_PAUSED. This anchor will never +/// start tracking until its pose has been successfully resolved. If the +/// resolving task ends in an error, the tracking state will be set to @c +/// #AR_TRACKING_STATE_STOPPED. If the return value is not @c #AR_SUCCESS, then +/// @p out_cloud_anchor will be set to +/// @c NULL. /// /// @param[in] session The ARCore session /// @param[in] cloud_anchor_id The cloud ID of the anchor to be resolved -/// @param[inout] out_cloud_anchor The new cloud anchor -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_NOT_TRACKING -/// - #AR_ERROR_SESSION_PAUSED -/// - #AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED -/// - #AR_ERROR_RESOURCE_EXHAUSTED +/// @param[inout] out_cloud_anchor The new Cloud Anchor +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_NOT_TRACKING +/// - @c #AR_ERROR_SESSION_PAUSED +/// - @c #AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED ArStatus ArSession_resolveAndAcquireNewCloudAnchor(ArSession *session, const char *cloud_anchor_id, ArAnchor **out_cloud_anchor); +/// @ingroup ArSession +/// This creates a new Cloud Anchor with a given lifetime in days, using the +/// pose of the provided @p anchor. +/// +/// The cloud state of the returned anchor will be set to +/// @c #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS and the initial pose +/// will be set to the pose of the provided @p anchor. However, the returned +/// anchor is completely independent of the original @p anchor, and the two +/// poses might diverge over time. +/// +/// Hosting requires an active session for which the @c ::ArTrackingState +/// is @c #AR_TRACKING_STATE_TRACKING, as well as a working internet connection. +/// ARCore will continue to retry silently in the background if it is unable to +/// establish a connection to the ARCore Cloud Anchor service. +/// +/// @param[in] session The ARCore session. +/// @param[in] anchor The anchor with the desired pose to be used to create a +/// hosted Cloud Anchor. +/// @param[in] ttl_days The lifetime of the anchor in days. Must be positive. +/// The maximum allowed value is 1 if using an API Key to authenticate with +/// the ARCore Cloud Anchor service, otherwise the maximum allowed value is +/// 365. +/// @param[inout] out_cloud_anchor The new Cloud Anchor. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT +/// - @c #AR_ERROR_NOT_TRACKING +/// - @c #AR_ERROR_SESSION_PAUSED +/// - @c #AR_ERROR_CLOUD_ANCHORS_NOT_CONFIGURED +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED +/// - @c #AR_ERROR_ANCHOR_NOT_SUPPORTED_FOR_HOSTING +ArStatus ArSession_hostAndAcquireNewCloudAnchorWithTtl( + ArSession *session, + const ArAnchor *anchor, + int32_t ttl_days, + ArAnchor **out_cloud_anchor); + +/// @ingroup ArSession /// Gets a list of camera configs supported by the camera being used by the /// session. /// @@ -1668,98 +2834,410 @@ ArStatus ArSession_resolveAndAcquireNewCloudAnchor(ArSession *session, /// /// Each config will contain a different CPU resolution. The GPU texture /// resolutions will be the same in all configs. Most devices provide a GPU -/// texture resolution of 1920 x 1080, but the actual resolution will vary with +/// texture resolution of 1920x1080, but the actual resolution will vary with /// device capabilities. /// /// When the session camera is a back-facing camera: /// - The list will always contain three camera configs. /// - The CPU image resolutions returned will be VGA, a middle resolution, and a /// large resolution matching the GPU texture resolution. The middle -/// resolution is typically 1280 x 720, but the actual resolution will vary +/// resolution is typically 1280x720, but the actual resolution will vary /// with device capabilities. /// /// When the session camera is front-facing (selfie) camera, the list will /// contain at least one supported camera config. /// /// Notes: -/// - Prior to ARCore SDK 1.6, the middle CPU image resolution was guaranteed to -/// be 1280 x 720 on all devices. -/// - In ARCore SDK 1.7 and 1.8, when the session camera was a front-facing +/// - Prior to ARCore SDK 1.6.0, the middle CPU image resolution was guaranteed +/// to be 1280x720 on all devices. +/// - In ARCore SDK 1.7.0 and 1.8.0, when the session camera was a front-facing /// (selfie) camera, the list contained three identical camera configs. /// /// @param[in] session The ARCore session /// @param[inout] list The list to fill. This list must have already -/// been allocated with ArCameraConfigList_create(). The list is cleared -/// to remove any existing elements. Once it is no longer needed, the list -/// must be destroyed using ArCameraConfigList_destroy() to release -/// allocated memory. +/// been allocated with @c ::ArCameraConfigList_create. The list is +/// cleared to remove any existing elements. Once it is no longer needed, +/// the list must be destroyed using @c ::ArCameraConfigList_destroy to +/// release allocated memory. +/// @deprecated Deprecated in release 1.11.0. Use +/// @c ::ArSession_getSupportedCameraConfigsWithFilter instead. +// TODO(b/146903940): Change ArSession_getSupportedCameraConfigs to return +// ArStatus. void ArSession_getSupportedCameraConfigs(const ArSession *session, - ArCameraConfigList *list); + ArCameraConfigList *list) + AR_DEPRECATED( + "Deprecated in release 1.11.0. Please see function documentation."); -/// Sets the ArCameraConfig that the ArSession should use. Can only be called -/// while the session is paused. The provided ArCameraConfig must be one of the -/// configs returned by ArSession_getSupportedCameraConfigs. +/// @ingroup ArSession +/// Sets the @c ::ArCameraConfig that the @c ::ArSession should use. Can only be +/// called while the session is paused. The provided @c ::ArCameraConfig must +/// be one of the configs returned by +/// @c ::ArSession_getSupportedCameraConfigsWithFilter. /// /// The camera config will be applied once the session is resumed. -/// All previously acquired frame images must be released via ArImage_release -/// before calling resume(). Failure to do so will cause resume() to return -/// AR_ERROR_ILLEGAL_STATE error. +/// All previously acquired frame images must be released with +/// @c ::ArImage_release before calling @c resume(). Failure to do so will cause +/// @c resume() to return +/// @c #AR_ERROR_ILLEGAL_STATE error. +/// +/// Note: Starting in ARCore 1.12, changing the active camera config may cause +/// the tracking state on certain devices to become permanently +/// @c #AR_TRACKING_STATE_PAUSED. For consistent behavior across all supported +/// devices, release any previously created anchors and trackables when setting +/// a new camera config. +/// +/// Changing the camera config for an existing session may affect which ARCore +/// features can be used. Unsupported session features are silently disabled +/// when the session is resumed. Call @c ::ArSession_configure after setting a +/// camera config to verify that all configured session features are supported +/// with the new camera config. +/// +/// Changing the current session's camera config to one that uses a different +/// camera will cause all internal session states to be reset when the session +/// is next resumed by calling @c ::ArSession_resume. /// /// @param[in] session The ARCore session -/// @param[in] camera_config The provided ArCameraConfig must be from a -/// list returned by ArSession_getSupportedCameraConfigs. -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_INVALID_ARGUMENT -/// - #AR_ERROR_SESSION_NOT_PAUSED +/// @param[in] camera_config The provided @c ::ArCameraConfig must be from +/// a list returned by @c ::ArSession_getSupportedCameraConfigsWithFilter. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT +/// - @c #AR_ERROR_SESSION_NOT_PAUSED ArStatus ArSession_setCameraConfig(const ArSession *session, const ArCameraConfig *camera_config); -/// Gets the ArCameraConfig that the ArSession is currently using. If the -/// camera config was not explicitly set then it returns the default -/// camera config. Use ArCameraConfig_destroy to release memory associated with +/// @ingroup ArSession +/// Gets the @c ::ArCameraConfig that the ::ArSession is currently using. If +/// the camera config was not explicitly set then it returns the default camera +/// config. Use @c ::ArCameraConfig_destroy to release memory associated with /// the returned camera config once it is no longer needed. /// /// @param[in] session The ARCore session /// @param[inout] out_camera_config The camera config object to fill. This -/// object must have already been allocated with ArCameraConfig_create(). -/// Use ArCameraConfig_destroy to release memory associated with -/// out_camera_config once it is no longer needed. +/// object must have already been allocated with @c +/// ::ArCameraConfig_create. Use @c ::ArCameraConfig_destroy to release +/// memory associated with @p out_camera_config once it is no longer +/// needed. void ArSession_getCameraConfig(const ArSession *session, ArCameraConfig *out_camera_config); -/// @} +/// @ingroup ArSession +/// Gets the list of supported camera configs that satisfy the provided +/// filter settings. +/// +/// The returned camera configs might vary at runtime depending on device +/// capabilities. Overly restrictive filtering can result in the returned list +/// being empty on one or more devices. +/// +/// Can be called at any time. +/// +/// Beginning with ARCore SDK 1.15.0, some devices support additional camera +/// configs with lower GPU texture resolutions than the device's default GPU +/// texture resolution. These additional resolutions are only returned when the +/// filter is not a @c nullptr. See the ARCore supported devices +/// (https://developers.google.com/ar/devices) page for +/// an up to date list of supported devices. +/// +/// Beginning with ARCore SDK 1.21.0, some devices will return additional camera +/// configs for supported stereo cameras. See the ARCore supported devices +/// (https://developers.google.com/ar/devices) page for +/// available camera configs by device. +/// +/// Beginning with ARCore SDK 1.23.0, the list of returned camera configs will +/// include front-facing (selfie) and back-facing (world) camera configs. In +/// previous SDKs, returned camera configs included only front-facing (selfie) +/// or only back-facing (world) camera configs, depending on whether the +/// deprecated @c ::AR_SESSION_FEATURE_FRONT_CAMERA feature was used. +/// +/// Element 0 will contain the camera config that best matches the filter +/// settings, according to the following priority: +/// +/// 1. Stereo camera usage: prefer +/// @c #AR_CAMERA_CONFIG_STEREO_CAMERA_USAGE_REQUIRE_AND_USE over +/// @c #AR_CAMERA_CONFIG_STEREO_CAMERA_USAGE_DO_NOT_USE +/// 2. Target FPS: prefer @c #AR_CAMERA_CONFIG_TARGET_FPS_60 over +/// @c #AR_CAMERA_CONFIG_TARGET_FPS_30 +/// 3. Depth sensor usage: prefer +/// @c #AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_REQUIRE_AND_USE over +/// @c #AR_CAMERA_CONFIG_DEPTH_SENSOR_USAGE_DO_NOT_USE +/// +/// No guarantees are made about the order in which the remaining elements are +/// returned. +/// +/// @return list of supported camera configs. +// TODO(b/146903940): Change ArSession_getSupportedCameraConfigsWithFilter to +// return ArStatus. +void ArSession_getSupportedCameraConfigsWithFilter( + const ArSession *session, + const ArCameraConfigFilter *filter, + ArCameraConfigList *list); + +/// @ingroup ArSession +/// Returns the @c ::ArEarth object for the session. This object is long-lived; +/// it should be used for the entire duration of the ARCore session or until an +/// @c ::ArConfig with @c #AR_GEOSPATIAL_MODE_DISABLED is applied on the @c +/// ::ArSession. +/// +/// @c ::ArEarth can only be acquired when an @c ::ArConfig with @c +/// #AR_GEOSPATIAL_MODE_ENABLED is active on the @c ::ArSession. See @c +/// ::ArConfig_setGeospatialMode to enable the Geospatial API. +/// +/// @c ::ArEarth must be released by calling @c ::ArTrackable_release. +/// +/// @param[in] session The ARCore session. +/// @param[out] out_earth Pointer to @c ::ArEarth to receive the earth object, +/// or @c NULL if the session's config @c ::ArGeospatialMode is set to @c +/// #AR_GEOSPATIAL_MODE_DISABLED. +void ArSession_acquireEarth(const ArSession *session, ArEarth **out_earth); + +/// @ingroup ArSession +/// Sets a MP4 dataset file to play back instead of using the live camera feed +/// and IMU sensor data. +/// +/// Restrictions: +/// - Can only be called while the session is paused. Playback of the MP4 +/// dataset file will start once the session is resumed. +/// - The MP4 dataset file must use the same camera facing direction as is +/// configured in the session. +/// - Due to the way session data is processed, ARCore APIs may sometimes +/// produce different results during playback than during recording and +/// produce different results during subsequent playback sessions. +/// For example, the number of detected planes and other trackables, the +/// precise timing of their detection and their pose over time may be +/// different in subsequent playback sessions. +/// - Once playback has started (due to the first call to ::ArSession_resume), +/// pausing the session (by calling @c ::ArSession_pause) will suspend +/// processing of all camera image frames and any other recorded sensor data +/// in the dataset. Camera image frames and sensor frame data that is +/// discarded in this way will not be reprocessed when the session is again +/// resumed (by calling @c ::ArSession_resume). AR tracking for the session +/// will generally suffer due to the gap in processed data. +/// +/// When an MP4 dataset file is set: +/// - All existing trackables (@c ::ArAnchor and @c ::ArTrackable) immediately +/// enter tracking state @c #AR_TRACKING_STATE_STOPPED. +/// - The desired focus mode (@c ::ArConfig_setFocusMode) is ignored, and will +/// not affect the previously recorded camera images. +/// - The current camera configuration (@c ::ArCameraConfig) is immediately set +/// to the default for the device the MP4 dataset file was recorded on. +/// - Calls to @c ::ArSession_getSupportedCameraConfigs will return camera +/// configs supported by the device the MP4 dataset file was recorded on. +/// - Setting a previously obtained camera config to +/// @c ::ArSession_setCameraConfig will have no effect. +/// +/// @param[in] session The ARCore session +/// @param[in] mp4_dataset_file_path A string file path to a MP4 dataset file +/// or @c NULL to use the live camera feed. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_SESSION_NOT_PAUSED if called when session is not paused. +/// - @c #AR_ERROR_SESSION_UNSUPPORTED if playback is incompatible with selected +/// features. +/// - @c #AR_ERROR_PLAYBACK_FAILED if an error occurred with the MP4 dataset +/// file such as not being able to open the file or the file is unable to be +/// decoded. +/// @deprecated Deprecated in release 1.26.0. Use +/// @c ::ArRecordingConfig_setMp4DatasetUri instead. +ArStatus ArSession_setPlaybackDataset(ArSession *session, + const char *mp4_dataset_file_path) + AR_DEPRECATED( + "Deprecated in release 1.26.0. Please see function documentation"); + +/// @ingroup ArSession +/// Sets a MP4 dataset file to play back instead of using the live camera feed +/// and IMU sensor data. +/// +/// This overrides the last path set by @c ::ArSession_setPlaybackDataset. +// +/// The URI must point to a resource that supports @c lseek. +// +/// See @c ::ArSession_setPlaybackDataset for more restrictions and details. +/// +/// @param[in] session The ARCore session +/// @param[in] mp4_dataset_uri The percent encoded, null terminated URI for the +/// dataset +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT if the file descriptor is not seekable. +/// - @c #AR_ERROR_SESSION_NOT_PAUSED if called when session is not paused. +/// - @c #AR_ERROR_SESSION_UNSUPPORTED if playback is incompatible with selected +/// features. +/// - @c #AR_ERROR_PLAYBACK_FAILED if an error occurred with the MP4 dataset +/// such as not being able to open the resource or the resource is unable to +/// be decoded. +ArStatus ArSession_setPlaybackDatasetUri(ArSession *session, + const char *mp4_dataset_uri); + +/// @ingroup ArRecordingConfig +/// Describe the current playback status. +AR_DEFINE_ENUM(ArPlaybackStatus){ + /// The session is not playing back an MP4 dataset file. + AR_PLAYBACK_NONE = 0, + /// Playback is in process without issues. + AR_PLAYBACK_OK = 1, + /// Playback has stopped due to an error. + AR_PLAYBACK_IO_ERROR = 2, + /// Playback has finished successfully. + AR_PLAYBACK_FINISHED = 3, +}; + +/// @ingroup ArSession +/// Gets the playback status. +/// +/// @param[in] session The ARCore session. +/// @param[out] out_playback_status The current playback status. +void ArSession_getPlaybackStatus(ArSession *session, + ArPlaybackStatus *out_playback_status); -// === ArPose methods === +/// @ingroup ArSession +/// Starts a new MP4 dataset file recording that is written to the specific +/// filesystem path. +/// +/// Existing files will be overwritten. +/// +/// +/// The MP4 video stream (VGA) bitrate is 5Mbps (40Mb per minute). +/// +/// Recording introduces additional overhead and may affect app performance. +/// +/// Session recordings may contain sensitive information. See documentation +/// on Recording and Playback to learn which data is saved in a recording. +/// +/// @param[in] session The ARCore session +/// @param[in] recording_config The configuration defined for recording. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_ILLEGAL_STATE +/// - @c #AR_ERROR_INVALID_ARGUMENT +/// - @c #AR_ERROR_RECORDING_FAILED +ArStatus ArSession_startRecording(ArSession *session, + const ArRecordingConfig *recording_config); -/// @addtogroup pose -/// @{ +/// @ingroup ArSession +/// Stops recording and flushes unwritten data to disk. The MP4 dataset file +/// will be ready to read after this call. +/// +/// Recording can be stopped automatically when @c ::ArSession_pause is called, +/// if auto stop is enabled via @c ::ArRecordingConfig_setAutoStopOnPause. +/// Recording errors that would be thrown in stopRecording() are silently +/// ignored in @c ::ArSession_pause. +/// +/// @param[in] session The ARCore session +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_RECORDING_FAILED +ArStatus ArSession_stopRecording(ArSession *session); -/// Allocates and initializes a new pose object. @c pose_raw points to an array +/// @ingroup ArSession +/// Returns the current recording status. +/// +/// @param[in] session The ARCore session. +/// @param[out] out_recording_status The current recording status. +void ArSession_getRecordingStatus(ArSession *session, + ArRecordingStatus *out_recording_status); + +/// @ingroup ArFrame +/// Writes a data sample in the specified track. The samples recorded using +/// this API will be muxed into the recorded MP4 dataset in a corresponding +/// additional MP4 stream. +/// +/// For smooth playback of the MP4 on video players and for future compatibility +/// of the MP4 datasets with ARCore's playback of tracks it is +/// recommended that the samples are recorded at a frequency no higher +/// than 90kHz. +/// +/// Additionally, if the samples are recorded at a frequency lower than 1Hz, +/// empty padding samples will be automatically recorded at approximately +/// one second intervals to fill in the gaps. +/// +/// Recording samples introduces additional CPU and/or I/O overhead and +/// may affect app performance. + +/// +/// @param[in] session The ARCore session +/// @param[in] frame The current @c ::ArFrame +/// @param[in] track_id_uuid_16 The external track ID as UUID as a +/// byte array of 16 bytes in size +/// @param[in] payload The byte array payload to record +/// @param[in] payload_size Size in bytes of the payload +/// +/// @return #AR_SUCCESS or any of: +/// - #AR_ERROR_ILLEGAL_STATE when either @c ::ArSession_getRecordingStatus is +/// not currently @c ::AR_RECORDING_OK or the system is currently under excess +/// load for images to be produced. The system should not be under such excess +/// load for more than a few frames and an app should try to record the data +/// again during the next frame. +/// - #AR_ERROR_INVALID_ARGUMENT when any argument is invalid, e.g. null +/// - #AR_ERROR_DEADLINE_EXCEEDED when the frame is not the current frame +ArStatus ArFrame_recordTrackData(ArSession *session, + const ArFrame *frame, + const uint8_t *track_id_uuid_16, + const void *payload, + size_t payload_size); + +/// @ingroup ArSession +/// Checks whether the provided @c ::ArDepthMode is supported on this device +/// with the selected camera configuration. The current list of supported +/// devices is documented on the ARCore +/// supported devices page. +/// +/// @param[in] session The ARCore session. +/// @param[in] depth_mode The desired depth mode to check. +/// @param[out] out_is_supported Non zero if the depth mode is supported on this +/// device. +void ArSession_isDepthModeSupported(const ArSession *session, + ArDepthMode depth_mode, + int32_t *out_is_supported); + +/// @ingroup ArSession +/// Checks whether the provided @c ::ArGeospatialMode is supported on this +/// device. The current list of supported devices is documented on the ARCore supported devices +/// page. A device may be incompatible with a given @c ::ArGeospatialMode due to +/// insufficient sensor capabilities. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_mode The desired geospatial mode to check. +/// @param[out] out_is_supported Non-zero if the @c ::ArGeospatialMode is +/// supported on this device. +void ArSession_isGeospatialModeSupported(const ArSession *session, + ArGeospatialMode geospatial_mode, + int32_t *out_is_supported); + +// === ArPose functions === + +/// @ingroup ArPose +/// Allocates and initializes a new pose object. @p pose_raw points to an array /// of 7 floats, describing the rotation (quaternion) and translation of the /// pose in the same order as the first 7 elements of the Android /// @c Sensor.TYPE_POSE_6DOF values documented on @c SensorEvent.values() +/// >@c SensorEvent.values() . /// /// The order of the values is: qx, qy, qz, qw, tx, ty, tz. /// -/// If @c pose_raw is null, initializes with the identity pose. +/// If @p pose_raw is @c NULL, initializes with the identity pose. void ArPose_create(const ArSession *session, const float *pose_raw, ArPose **out_pose); +/// @ingroup ArPose /// Releases memory used by a pose object. void ArPose_destroy(ArPose *pose); +/// @ingroup ArPose /// Extracts the quaternion rotation and translation from a pose object. -/// @param[in] session The ARCore session -/// @param[in] pose The pose to extract -/// @param[out] out_pose_raw Pointer to an array of 7 floats, to be filled with -/// the quaternion rotation and translation as described in ArPose_create(). +/// @param[in] session The ARCore session +/// @param[in] pose The pose to extract +/// @param[out] out_pose_raw_7 Pointer to an array of 7 floats, to be filled +/// with the quaternion rotation and translation as described in +/// @c ::ArPose_create. void ArPose_getPoseRaw(const ArSession *session, const ArPose *pose, - float *out_pose_raw); + float *out_pose_raw_7); +/// @ingroup ArPose /// Converts a pose into a 4x4 transformation matrix. /// @param[in] session The ARCore session /// @param[in] pose The pose to convert @@ -1770,21 +3248,17 @@ void ArPose_getMatrix(const ArSession *session, const ArPose *pose, float *out_matrix_col_major_4x4); -/// @} - -// === ArCamera methods === +// === ArCamera functions === -/// @addtogroup camera -/// @{ - -/// Sets @c out_pose to the pose of the physical camera in world space for the +/// @ingroup ArCamera +/// Sets @p out_pose to the pose of the physical camera in world space for the /// latest frame. This is an OpenGL camera pose with +X pointing right, +Y /// pointing right up, -Z pointing in the direction the camera is looking, with /// "right" and "up" being relative to the image readout in the usual /// left-to-right top-to-bottom order. Specifically, this is the camera pose at /// the center of exposure of the center row of the image. /// -/// For applications using the SDK for ARCore 1.5 and earlier, the +/// For applications using the SDK for ARCore 1.5.0 and earlier, the /// returned pose is rotated around the Z axis by a multiple of 90 degrees so /// that the axes correspond approximately to those of the Android @@ -1792,26 +3266,28 @@ void ArPose_getMatrix(const ArSession *session, /// /// See Also: /// -/// * ArCamera_getDisplayOrientedPose() for the pose of the virtual camera. It -/// will differ by a local rotation about the Z axis by a multiple of 90 +/// * @c ::ArCamera_getDisplayOrientedPose for the pose of the virtual camera. +/// It will differ by a local rotation about the Z axis by a multiple of 90 /// degrees. -/// * ArFrame_getAndroidSensorPose() for the pose of the Android sensor frame. +/// * @c ::ArFrame_getAndroidSensorPose for the pose of the Android sensor +/// frame. /// It will differ in both orientation and location. -/// * ArFrame_transformCoordinates2d() to convert viewport coordinates to +/// * @c ::ArFrame_transformCoordinates2d to convert viewport coordinates to /// texture coordinates. /// -/// Note: This pose is only useful when ArCamera_getTrackingState() returns -/// #AR_TRACKING_STATE_TRACKING and otherwise should not be used. +/// Note: This pose is only useful when @c ::ArCamera_getTrackingState returns +/// @c #AR_TRACKING_STATE_TRACKING and otherwise should not be used. /// /// @param[in] session The ARCore session /// @param[in] camera The session's camera (retrieved from any frame). -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArCamera_getPose(const ArSession *session, const ArCamera *camera, ArPose *out_pose); -/// Sets @c out_pose to the virtual camera pose in world space for rendering AR +/// @ingroup ArCamera +/// Sets @p out_pose to the virtual camera pose in world space for rendering AR /// content onto the latest frame. This is an OpenGL camera pose with +X /// pointing right, +Y pointing up, and -Z pointing in the direction the camera /// is looking, with "right" and "up" being relative to current logical display @@ -1819,27 +3295,29 @@ void ArCamera_getPose(const ArSession *session, /// /// See Also: /// -/// * ArCamera_getViewMatrix() to conveniently compute the OpenGL View Matrix. -/// * ArCamera_getPose() for the physical pose of the camera. It will differ by -/// a local rotation about the Z axis by a multiple of 90 degrees. -/// * ArFrame_getAndroidSensorPose() for the pose of the android sensor frame. -/// It will differ in both orientation and location. -/// * ArSession_setDisplayGeometry() to update the display rotation. +/// * @c ::ArCamera_getViewMatrix to conveniently compute the OpenGL view +/// matrix. +/// * @c ::ArCamera_getPose for the physical pose of the camera. It will differ +/// by a local rotation about the Z axis by a multiple of 90 degrees. +/// * @c ::ArFrame_getAndroidSensorPose for the pose of the android sensor +/// frame. It will differ in both orientation and location. +/// * @c ::ArSession_setDisplayGeometry to update the display rotation. /// -/// Note: This pose is only useful when ArCamera_getTrackingState() returns -/// #AR_TRACKING_STATE_TRACKING and otherwise should not be used. +/// Note: This pose is only useful when @c ::ArCamera_getTrackingState returns +/// @c #AR_TRACKING_STATE_TRACKING and otherwise should not be used. /// /// @param[in] session The ARCore session /// @param[in] camera The session's camera (retrieved from any frame). -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArCamera_getDisplayOrientedPose(const ArSession *session, const ArCamera *camera, ArPose *out_pose); +/// @ingroup ArCamera /// Returns the view matrix for the camera for this frame. This matrix performs /// the inverse transform as the pose provided by -/// ArCamera_getDisplayOrientedPose(). +/// @c ::ArCamera_getDisplayOrientedPose. /// /// @param[in] session The ARCore session /// @param[in] camera The session's camera. @@ -1850,20 +3328,31 @@ void ArCamera_getViewMatrix(const ArSession *session, const ArCamera *camera, float *out_col_major_4x4); +/// @ingroup ArCamera /// Gets the current motion tracking state of this camera. If this state is -/// anything other than #AR_TRACKING_STATE_TRACKING the pose should not be -/// considered useful. Use ArCamera_getTrackingFailureReason() to determine the -/// best recommendation to provide to the user to restore motion tracking. +/// anything other than @c #AR_TRACKING_STATE_TRACKING the pose should not be +/// considered useful. Use @c ::ArCamera_getTrackingFailureReason to determine +/// the best recommendation to provide to the user to restore motion tracking. +/// +/// Note: Starting in ARCore 1.12, changing the active camera config using +/// @c ::ArSession_setCameraConfig may cause the tracking state on certain +/// devices to become permanently @c #AR_TRACKING_STATE_PAUSED. For consistent +/// behavior across all supported devices, release any previously created +/// anchors and trackables when setting a new camera config. void ArCamera_getTrackingState(const ArSession *session, const ArCamera *camera, ArTrackingState *out_tracking_state); -/// Gets the reason that ArCamera_getTrackingState() is -/// #AR_TRACKING_STATE_PAUSED. Note, it returns -/// ArTrackingFailureReason#AR_TRACKING_FAILURE_REASON_NONE briefly after -/// ArSession_resume(), while the motion tracking is initializing. Always -/// returns ArTrackingFailureReason#AR_TRACKING_FAILURE_REASON_NONE when -/// ArCamera_getTrackingState is #AR_TRACKING_STATE_TRACKING. +/// @ingroup ArCamera +/// Gets the reason that @c ::ArCamera_getTrackingState is +/// @c #AR_TRACKING_STATE_PAUSED. +/// +/// Note: This function returns +/// @c #AR_TRACKING_FAILURE_REASON_NONE briefly after +/// @c ::ArSession_resume while the motion tracking is initializing. +/// This function always returns +/// @c #AR_TRACKING_FAILURE_REASON_NONE when +/// @c ::ArCamera_getTrackingState is @c #AR_TRACKING_STATE_TRACKING. /// /// If multiple potential causes for motion tracking failure are detected, /// this reports the most actionable failure reason. @@ -1872,12 +3361,13 @@ void ArCamera_getTrackingFailureReason( const ArCamera *camera, ArTrackingFailureReason *out_tracking_failure_reason); +/// @ingroup ArCamera /// Computes a projection matrix for rendering virtual content on top of the /// camera image. Note that the projection matrix reflects the current display /// geometry and display rotation. /// -/// Note: When using #AR_SESSION_FEATURE_FRONT_CAMERA, the returned projection -/// matrix will incorporate a horizontal flip. +/// Note: When using the front-facing (selfie) camera, the returned +/// projection matrix will incorporate a horizontal flip. /// /// @param[in] session The ARCore session /// @param[in] camera The session's camera. @@ -1892,104 +3382,108 @@ void ArCamera_getProjectionMatrix(const ArSession *session, float far, float *dest_col_major_4x4); +/// @ingroup ArCamera /// Retrieves the unrotated and uncropped intrinsics for the image (CPU) stream. /// The intrinsics may change per frame, so this should be called /// on each frame to get the intrinsics for the current frame. /// /// @param[in] session The ARCore session /// @param[in] camera The session's camera. -/// @param[inout] out_camera_intrinsics The camera_intrinsics data. +/// @param[inout] out_camera_intrinsics The @c ::ArCameraIntrinsics data. void ArCamera_getImageIntrinsics(const ArSession *session, const ArCamera *camera, ArCameraIntrinsics *out_camera_intrinsics); -/// Retrieves the unrotated and uncropped intrinsics for the texture (GPU) -/// stream. The intrinsics may change per frame, so this should be called +/// @ingroup ArCamera +/// Retrieves the unrotated and uncropped intrinsics for the GPU texture +/// stream. The intrinsics may change per frame, so this should be called /// on each frame to get the intrinsics for the current frame. /// /// @param[in] session The ARCore session /// @param[in] camera The session's camera. -/// @param[inout] out_camera_intrinsics The camera_intrinsics data. +/// @param[inout] out_camera_intrinsics The @c ::ArCameraIntrinsics data. void ArCamera_getTextureIntrinsics(const ArSession *session, const ArCamera *camera, ArCameraIntrinsics *out_camera_intrinsics); +/// @ingroup ArCamera /// Releases a reference to the camera. This must match a call to -/// ArFrame_acquireCamera(). +/// @c ::ArFrame_acquireCamera. /// -/// This method may safely be called with @c nullptr - it will do nothing. +/// This function may safely be called with @c NULL - it will do nothing. void ArCamera_release(ArCamera *camera); -/// @} - -// === ArCameraIntrinsics methods === -/// @addtogroup intrinsics -/// @{ - +// === ArCameraIntrinsics functions === +/// @ingroup ArCameraIntrinsics /// Allocates a camera intrinstics object. /// /// @param[in] session The ARCore session -/// @param[inout] out_camera_intrinsics The camera_intrinsics data. +/// @param[inout] out_camera_intrinsics The @c ::ArCameraIntrinsics data. void ArCameraIntrinsics_create(const ArSession *session, ArCameraIntrinsics **out_camera_intrinsics); -/// Returns the focal length in pixels. +/// @ingroup ArCameraIntrinsics +/// Returns the camera's focal length in pixels. /// The focal length is conventionally represented in pixels. For a detailed -/// explanation, please see http://ksimek.github.io/2013/08/13/intrinsic. +/// explanation, please see https://ksimek.github.io/2013/08/13/intrinsic. /// Pixels-to-meters conversion can use SENSOR_INFO_PHYSICAL_SIZE and -/// SENSOR_INFO_PIXEL_ARRAY_SIZE in the Android CameraCharacteristics API. +/// SENSOR_INFO_PIXEL_ARRAY_SIZE in the Android Camera Characteristics API. void ArCameraIntrinsics_getFocalLength(const ArSession *session, const ArCameraIntrinsics *intrinsics, float *out_fx, float *out_fy); +/// @ingroup ArCameraIntrinsics /// Returns the principal point in pixels. void ArCameraIntrinsics_getPrincipalPoint(const ArSession *session, const ArCameraIntrinsics *intrinsics, float *out_cx, float *out_cy); +/// @ingroup ArCameraIntrinsics /// Returns the image's width and height in pixels. void ArCameraIntrinsics_getImageDimensions(const ArSession *session, const ArCameraIntrinsics *intrinsics, int32_t *out_width, int32_t *out_height); +/// @ingroup ArCameraIntrinsics /// Releases the provided camera intrinsics object. void ArCameraIntrinsics_destroy(ArCameraIntrinsics *camera_intrinsics); -/// @} - -// === ArFrame methods === - -/// @addtogroup frame -/// @{ +// === ArFrame functions === -/// Allocates a new ArFrame object, storing the pointer into @c *out_frame. +/// @ingroup ArFrame +/// Allocates a new @c ::ArFrame object, storing the pointer into @p *out_frame. /// -/// Note: the same ArFrame can be used repeatedly when calling ArSession_update. +/// Note: the same @c ::ArFrame can be used repeatedly when calling +/// @c ::ArSession_update. void ArFrame_create(const ArSession *session, ArFrame **out_frame); -/// Releases an ArFrame and any references it holds. +/// @ingroup ArFrame +/// Releases an @c ::ArFrame and any references it holds. void ArFrame_destroy(ArFrame *frame); +/// @ingroup ArFrame /// Checks if the display rotation or viewport geometry changed since the -/// previous call to ArSession_update(). The application should re-query -/// ArCamera_getProjectionMatrix() and ArFrame_transformCoordinates2d() +/// previous call to @c ::ArSession_update. The application should re-query +/// @c ::ArCamera_getProjectionMatrix and @c ::ArFrame_transformCoordinates2d /// whenever this emits non-zero. void ArFrame_getDisplayGeometryChanged(const ArSession *session, const ArFrame *frame, int32_t *out_geometry_changed); +/// @ingroup ArFrame /// Returns the timestamp in nanoseconds when this image was captured. This can /// be used to detect dropped frames or measure the camera frame rate. The time /// base of this value is specifically not defined, but it is likely -/// similar to clock_gettime(CLOCK_BOOTTIME). +/// similar to @c clock_gettime(CLOCK_BOOTTIME). void ArFrame_getTimestamp(const ArSession *session, const ArFrame *frame, int64_t *out_timestamp_ns); -/// Sets @c out_pose to the pose of the Android /// Sensor Coordinate System in the world coordinate space for this frame. /// The orientation follows the device's "native" orientation (it is not @@ -1998,82 +3492,87 @@ void ArFrame_getTimestamp(const ArSession *session, /// /// See Also: /// -/// * ArCamera_getDisplayOrientedPose() for the pose of the virtual camera. -/// * ArCamera_getPose() for the pose of the physical camera. -/// * ArFrame_getTimestamp() for the system time that this pose was estimated +/// * @c ::ArCamera_getDisplayOrientedPose for the pose of the virtual camera. +/// * @c ::ArCamera_getPose for the pose of the physical camera. +/// * @c ::ArFrame_getTimestamp for the system time that this pose was estimated /// for. /// -/// Note: This pose is only useful when ArCamera_getTrackingState() returns -/// #AR_TRACKING_STATE_TRACKING and otherwise should not be used. +/// Note: This pose is only useful when @c ::ArCamera_getTrackingState returns +/// @c #AR_TRACKING_STATE_TRACKING and otherwise should not be used. /// /// @param[in] session The ARCore session /// @param[in] frame The current frame. -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArFrame_getAndroidSensorPose(const ArSession *session, const ArFrame *frame, ArPose *out_pose); +/// @ingroup ArFrame /// Transform the given texture coordinates to correctly show the background -/// image. This will account for the display rotation, and any additional -/// required adjustment. For performance, this function should be called only if -/// ArFrame_hasDisplayGeometryChanged() emits true. +/// image. This accounts for the display rotation, and any additional required +/// adjustment. For performance, this function should be called only if +/// @c ::ArFrame_getDisplayGeometryChanged indicates a change. /// /// @param[in] session The ARCore session /// @param[in] frame The current frame. /// @param[in] num_elements The number of floats to transform. Must be -/// a multiple of 2. @c uvs_in and @c uvs_out must point to arrays of at +/// a multiple of 2. @p uvs_in and @p uvs_out must point to arrays of at /// least this many floats. /// @param[in] uvs_in Input UV coordinates in normalized screen space. /// @param[inout] uvs_out Output UV coordinates in texture coordinates. -/// @deprecated in release 1.7.0. Please use instead: @code -/// ArFrame_transformCoordinates2d(session, frame, -/// AR_COORDINATES_2D_VIEW_NORMALIZED, num_elements, uvs_in, -/// AR_COORDINATES_2D_TEXTURE_NORMALIZED, uvs_out); @endcode +/// @deprecated Deprecated in release 1.7.0. Use +/// @c ::ArFrame_transformCoordinates2d instead. void ArFrame_transformDisplayUvCoords(const ArSession *session, const ArFrame *frame, int32_t num_elements, const float *uvs_in, float *uvs_out) AR_DEPRECATED( - "deprecated in release 1.7.0. Please see function documentation."); + "Deprecated in release 1.7.0. Please see function documentation."); +/// @ingroup ArFrame /// Transforms a list of 2D coordinates from one 2D coordinate system to another /// 2D coordinate system. /// -/// For Android view coordinates (VIEW, VIEW_NORMALIZED), the view information -/// is taken from the most recent call to @c ArSession_setDisplayGeometry. +/// For Android view coordinates (@c #AR_COORDINATES_2D_VIEW, +/// @c #AR_COORDINATES_2D_VIEW_NORMALIZED), the view information is taken from +/// the most recent call to @c ::ArSession_setDisplayGeometry. /// -/// Must be called on the most recently obtained @c ArFrame object. If this +/// Must be called on the most recently obtained @c ::ArFrame object. If this /// function is called on an older frame, a log message will be printed and -/// out_vertices_2d will remain unchanged. +/// @p out_vertices_2d will remain unchanged. /// /// Some examples of useful conversions: /// - To transform from [0,1] range to screen-quad coordinates for rendering: -/// VIEW_NORMALIZED -> TEXTURE_NORMALIZED +/// @c #AR_COORDINATES_2D_VIEW_NORMALIZED -> +/// @c #AR_COORDINATES_2D_TEXTURE_NORMALIZED /// - To transform from [-1,1] range to screen-quad coordinates for rendering: -/// OPENGL_NORMALIZED_DEVICE_COORDINATES -> TEXTURE_NORMALIZED +/// @c #AR_COORDINATES_2D_OPENGL_NORMALIZED_DEVICE_COORDINATES -> +/// @c #AR_COORDINATES_2D_TEXTURE_NORMALIZED /// - To transform a point found by a computer vision algorithm in a cpu image /// into a point on the screen that can be used to place an Android View /// (e.g. Button) at that location: -/// IMAGE_PIXELS -> VIEW +/// @c #AR_COORDINATES_2D_IMAGE_PIXELS -> @c #AR_COORDINATES_2D_VIEW /// - To transform a point found by a computer vision algorithm in a CPU image /// into a point to be rendered using GL in clip-space ([-1,1] range): -/// IMAGE_PIXELS -> OPENGL_NORMALIZED_DEVICE_COORDINATES +/// @c #AR_COORDINATES_2D_IMAGE_PIXELS -> +/// @c #AR_COORDINATES_2D_OPENGL_NORMALIZED_DEVICE_COORDINATES /// -/// If inputCoordinates is same as outputCoordinates, the input vertices will be -/// copied to the output vertices unmodified. +/// If @p inputCoordinates is same as @p outputCoordinates, the input vertices +/// will be copied to the output vertices unmodified. /// /// @param[in] session The ARCore session. /// @param[in] frame The current frame. -/// @param[in] input_coordinates The coordinate system used by @c vectors2d_in. +/// @param[in] input_coordinates The coordinate system used by @p vectors2d_in. /// @param[in] number_of_vertices The number of 2D vertices to transform. -/// @c vertices_2d and @c out_vertices_2d must -/// point to arrays of size at least num_vertices*2. +/// @p vertices_2d and @p out_vertices_2d must +/// point to arrays of size at least +/// @p number_of_vertices * 2. /// @param[in] vertices_2d Input 2D vertices to transform. /// @param[in] output_coordinates The coordinate system to convert to. /// @param[inout] out_vertices_2d Transformed 2d vertices, can be the same array -/// as vertices_2d for in-place transform. +/// as @p vertices_2d for in-place transform. void ArFrame_transformCoordinates2d(const ArSession *session, const ArFrame *frame, ArCoordinates2dType input_coordinates, @@ -2082,6 +3581,7 @@ void ArFrame_transformCoordinates2d(const ArSession *session, ArCoordinates2dType output_coordinates, float *out_vertices_2d); +/// @ingroup ArFrame /// Performs a ray cast from the user's device in the direction of the given /// location in the camera view. Intersections with detected scene geometry are /// returned, sorted by distance from the device; the nearest intersection is @@ -2090,27 +3590,35 @@ void ArFrame_transformCoordinates2d(const ArSession *session, /// Note: Significant geometric leeway is given when returning hit results. For /// example, a plane hit may be generated if the ray came close, but did not /// actually hit within the plane extents or plane bounds -/// (ArPlane_isPoseInExtents() and ArPlane_isPoseInPolygon() can be used to -/// determine these cases). A point (point cloud) hit is generated when a point -/// is roughly within one finger-width of the provided screen coordinates. +/// (@c ::ArPlane_isPoseInExtents and @c ::ArPlane_isPoseInPolygon can be used +/// to determine these cases). A point (Point Cloud) hit is generated when a +/// point is roughly within one finger-width of the provided screen coordinates. /// /// The resulting list is ordered by distance, with the nearest hit first /// -/// Note: If not tracking, the hit_result_list will be empty.
+/// Note: If not tracking, the @p hit_result_list will be empty. +/// /// Note: If called on an old frame (not the latest produced by -/// ArSession_update() the hit_result_list will be empty). -/// Note: When using #AR_SESSION_FEATURE_FRONT_CAMERA, the returned hit result -/// list will always be empty, as the camera is not -/// #AR_TRACKING_STATE_TRACKING}. Hit testing against tracked faces is not -/// currently supported. +/// @c ::ArSession_update the @p hit_result_list will be empty). +/// +/// Note: When using the front-facing (selfie) camera, the returned hit +/// result list will always be empty, as the camera is not +/// @c #AR_TRACKING_STATE_TRACKING. Hit testing against tracked faces is not +/// currently supported. +/// +/// Note: In ARCore 1.24.0 or later on supported devices, if the +/// @c ::ArDepthMode is enabled by calling @c ::ArConfig_setDepthMode the +/// @p hit_result_list includes @c ::ArDepthPoint values that are sampled from +/// the latest computed depth image. /// /// @param[in] session The ARCore session. /// @param[in] frame The current frame. /// @param[in] pixel_x Logical X position within the view, as from an /// Android UI event. -/// @param[in] pixel_y Logical X position within the view. +/// @param[in] pixel_y Logical Y position within the view, as from an +/// Android UI event. /// @param[inout] hit_result_list The list to fill. This list must have been -/// previously allocated using ArHitResultList_create(). If the list has +/// previously allocated using @c ::ArHitResultList_create. If the list has /// been previously used, it will first be cleared. void ArFrame_hitTest(const ArSession *session, const ArFrame *frame, @@ -2118,7 +3626,47 @@ void ArFrame_hitTest(const ArSession *session, float pixel_y, ArHitResultList *hit_result_list); -/// Similar to ArFrame_hitTest(), but takes an arbitrary ray in world space +/// @ingroup ArFrame +/// Performs a ray cast that can return a result before ARCore establishes full +/// tracking. +/// +/// The pose and apparent scale of attached objects depends on the +/// @c ::ArInstantPlacementPoint tracking method and the provided +/// @p approximate_distance_meters. A discussion of the different tracking +/// methods and the effects of apparent object scale are described in +/// @c ::ArInstantPlacementPoint. +/// +/// This function will succeed only if @c ::ArInstantPlacementMode is +/// @c #AR_INSTANT_PLACEMENT_MODE_LOCAL_Y_UP in the ARCore session +/// configuration, the ARCore session tracking state is @c +/// #AR_TRACKING_STATE_TRACKING, and there are sufficient feature points to +/// track the point in screen space. +/// +/// @param[in] session The ARCore session. +/// @param[in] frame The current frame. +/// @param[in] pixel_x Logical X position within the view, as from an +/// Android UI event. +/// @param[in] pixel_y Logical Y position within the view, as from an +/// Android UI event. +/// @param[in] approximate_distance_meters The distance at which to create an +/// @c ::ArInstantPlacementPoint. This is only used while the tracking +/// method for the returned point is +/// @c +/// #AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE. +/// @param[inout] hit_result_list The list to fill. If successful the list will +/// contain a single @c ::ArHitResult, otherwise it will be cleared. The +/// @c ::ArHitResult will have a trackable of type @c +/// ::ArInstantPlacementPoint. The list must have been previously allocated +/// using @c ::ArHitResultList_create. +void ArFrame_hitTestInstantPlacement(const ArSession *session, + const ArFrame *frame, + float pixel_x, + float pixel_y, + float approximate_distance_meters, + ArHitResultList *hit_result_list); + +/// @ingroup ArFrame +/// Similar to @c ::ArFrame_hitTest, but takes an arbitrary ray in world space /// coordinates instead of a screen space point. /// /// @param[in] session The ARCore session. @@ -2128,7 +3676,7 @@ void ArFrame_hitTest(const ArSession *session, /// @param[in] ray_direction_3 A pointer to float[3] array containing ray /// direction in world space coordinates. Does not have to be normalized. /// @param[inout] hit_result_list The list to fill. This list must have been -/// previously allocated using ArHitResultList_create(). If the list has +/// previously allocated using @c ::ArHitResultList_create. If the list has /// been previously used, it will first be cleared. void ArFrame_hitTestRay(const ArSession *session, const ArFrame *frame, @@ -2136,19 +3684,21 @@ void ArFrame_hitTestRay(const ArSession *session, const float *ray_direction_3, ArHitResultList *hit_result_list); -/// Gets the current ambient light estimate, if light estimation was enabled. +/// @ingroup ArFrame +/// Gets the current @c ::ArLightEstimate, if Lighting Estimation is enabled. /// /// @param[in] session The ARCore session. /// @param[in] frame The current frame. -/// @param[inout] out_light_estimate The light estimate to fill. This object -/// must have been previously created with ArLightEstimate_create(). +/// @param[inout] out_light_estimate The @c ::ArLightEstimate to fill. This +/// object must have been previously created with @c ::ArLightEstimate_create. void ArFrame_getLightEstimate(const ArSession *session, const ArFrame *frame, ArLightEstimate *out_light_estimate); +/// @ingroup ArFrame /// Acquires the current set of estimated 3d points attached to real-world -/// geometry. A matching call to PointCloud_release() must be made when the -/// application is done accessing the point cloud. +/// geometry. A matching call to @c ::ArPointCloud_release must be made when the +/// application is done accessing the Point Cloud. /// /// Note: This information is for visualization and debugging purposes only. Its /// characteristics and format are subject to change in subsequent versions of @@ -2156,96 +3706,587 @@ void ArFrame_getLightEstimate(const ArSession *session, /// /// @param[in] session The ARCore session. /// @param[in] frame The current frame. -/// @param[out] out_point_cloud Pointer to an @c ArPointCloud* receive the -/// address of the point cloud. -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_DEADLINE_EXCEEDED if @c frame is not the latest frame from -/// by ArSession_update(). -/// - #AR_ERROR_RESOURCE_EXHAUSTED if too many point clouds are currently held. +/// @param[out] out_point_cloud Pointer to an @c ::ArPointCloud* receive the +/// address of the Point Cloud. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_DEADLINE_EXCEEDED if @p frame is not the latest frame from +/// by @c ::ArSession_update. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if too many Point Clouds are currently +/// held. ArStatus ArFrame_acquirePointCloud(const ArSession *session, const ArFrame *frame, ArPointCloud **out_point_cloud); +/// @ingroup ArFrame /// Returns the camera object for the session. Note that this Camera instance is /// long-lived so the same instance is returned regardless of the frame object -/// this method was called on. +/// this function was called on. void ArFrame_acquireCamera(const ArSession *session, const ArFrame *frame, ArCamera **out_camera); +/// @ingroup ArFrame /// Gets the camera metadata for the current camera image. /// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_DEADLINE_EXCEEDED if @c frame is not the latest frame from -/// by ArSession_update(). -/// - #AR_ERROR_RESOURCE_EXHAUSTED if too many metadata objects are currently +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_DEADLINE_EXCEEDED if @p frame is not the latest frame from +/// by @c ::ArSession_update. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if too many metadata objects are currently /// held. -/// - #AR_ERROR_NOT_YET_AVAILABLE if the camera failed to produce metadata for -/// the given frame. Note: this will commonly happen for few frames right -/// after @c ArSession_resume() due to the camera stack bringup. +/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the camera failed to produce metadata +/// for +/// the given frame. Note: this commonly happens for few frames right +/// after @c ::ArSession_resume due to the camera stack bringup. ArStatus ArFrame_acquireImageMetadata(const ArSession *session, const ArFrame *frame, ArImageMetadata **out_metadata); +/// @ingroup ArFrame /// Returns the CPU image for the current frame. -/// Caller is responsible for later releasing the image with @c -/// ArImage_release. -/// Not supported on all devices -/// (see https://developers.google.com/ar/discover/supported-devices). -/// Return values: -/// @returns #AR_SUCCESS or any of: -/// - #AR_ERROR_INVALID_ARGUMENT - one more input arguments are invalid. -/// - #AR_ERROR_DEADLINE_EXCEEDED - the input frame is not the current frame. -/// - #AR_ERROR_RESOURCE_EXHAUSTED - the caller app has exceeded maximum number -/// of images that it can hold without releasing. -/// - #AR_ERROR_NOT_YET_AVAILABLE - image with the timestamp of the input frame -/// was not found within a bounded amount of time, or the camera failed to -/// produce the image +/// Caller is responsible for later releasing the image with +/// @c ::ArImage_release. Not supported on all devices (see +/// https://developers.google.com/ar/devices). Return values: +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT - one more input arguments are invalid. +/// - @c #AR_ERROR_DEADLINE_EXCEEDED - the input frame is not the current frame. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED - the caller app has exceeded maximum +/// number of images that it can hold without releasing. +/// - @c #AR_ERROR_NOT_YET_AVAILABLE - image with the timestamp of the input +/// frame was not found within a bounded amount of time, or the camera failed +/// to produce the image ArStatus ArFrame_acquireCameraImage(ArSession *session, ArFrame *frame, ArImage **out_image); -/// Gets the set of anchors that were changed by the ArSession_update() that +/// @ingroup ArFrame +/// Gets the set of anchors that were changed by the @c ::ArSession_update that /// produced this Frame. /// /// @param[in] session The ARCore session /// @param[in] frame The current frame. -/// @param[inout] out_anchor_list The list to fill. This list must have -/// already been allocated with ArAnchorList_create(). If previously -/// used, the list will first be cleared. +/// @param[inout] out_anchor_list The list to fill. This list must have already +/// been allocated with @c ::ArAnchorList_create. If previously used, the +/// list is cleared first. void ArFrame_getUpdatedAnchors(const ArSession *session, const ArFrame *frame, ArAnchorList *out_anchor_list); +/// @ingroup ArFrame /// Gets the set of trackables of a particular type that were changed by the -/// ArSession_update() call that produced this Frame. +/// @c ::ArSession_update call that produced this Frame. /// /// @param[in] session The ARCore session /// @param[in] frame The current frame. /// @param[in] filter_type The type(s) of trackables to return. See -/// ::ArTrackableType for legal values. +/// @c ::ArTrackableType for legal values. /// @param[inout] out_trackable_list The list to fill. This list must have -/// already been allocated with ArTrackableList_create(). If previously -/// used, the list will first be cleared. +/// already been allocated with @c ::ArTrackableList_create. If previously +/// used, the list is cleared first. void ArFrame_getUpdatedTrackables(const ArSession *session, const ArFrame *frame, ArTrackableType filter_type, ArTrackableList *out_trackable_list); -/// @} +/// @ingroup ArFrame +/// Gets the set of data recorded to the given track available during playback +/// on this @c ::ArFrame. If frames are skipped during playback, which can +/// happen when the device is under load, played back track data will be +/// attached to a later frame in order. +/// +/// Note, currently playback continues internally while the session is paused. +/// Track data from frames that were processed while the session was +/// paused will be discarded. +/// +/// @param[in] session The ARCore session +/// @param[in] frame The current frame +/// @param[in] track_id_uuid_16 The track ID as UUID as a byte +/// array of 16 bytes in size +/// @param[inout] out_track_data_list The list to fill. This list must have +/// already been allocated with @c ::ArTrackDataList_create. If previously +/// used, the list will first be cleared +void ArFrame_getUpdatedTrackData(const ArSession *session, + const ArFrame *frame, + const uint8_t *track_id_uuid_16, + ArTrackDataList *out_track_data_list); + +// === ArTrackData functions === + +/// @ingroup ArTrackData +/// Retrieves the timestamp in nanoseconds of the frame the given +/// @c ::ArTrackData was recorded on. This timestamp is equal to the result of +/// @c ::ArFrame_getTimestamp on the frame during which the track data was +/// written. +/// +/// @param[in] session The ARCore session +/// @param[in] track_data The @c ::ArTrackData to pull the timestamp +/// from +/// @param[inout] out_timestamp_ns The @c int64_t timestamp value to be set +void ArTrackData_getFrameTimestamp(const ArSession *session, + const ArTrackData *track_data, + int64_t *out_timestamp_ns); + +/// @ingroup ArTrackData +/// Retrieves the @c ::ArTrackData byte data that was recorded by +/// @c ::ArFrame_recordTrackData. +/// +/// The pointer returned by this function is valid until +/// @c ::ArTrackData_release is called. +/// +/// @param[in] session The ARCore session +/// @param[in] track_data The @c ::ArTrackData to pull the data from +/// @param[inout] out_data The pointer to the @c ::ArTrackDataList +/// byte data being populated. Will point to an empty list if no data present +/// @param[inout] out_size The number of bytes that were populated in +/// @p out_data, 0 if list is empty +void ArTrackData_getData(const ArSession *session, + const ArTrackData *track_data, + const uint8_t **out_data, + int32_t *out_size); + +/// @ingroup ArTrackData +/// Releases a reference to a @c ::ArTrackData. Acquire a @c ::ArTrackData with +/// @c ::ArTrackDataList_acquireItem. +/// +/// This function may safely be called with @c NULL - it will do nothing. +/// +/// @param[inout] track_data The @c ::ArTrackData being released +void ArTrackData_release(ArTrackData *track_data); + +// === ArTrackDataList functions === + +/// @ingroup ArTrackData +/// Creates an @c ::ArTrackDataList object. +/// +/// @param[in] session The ARCore session +/// @param[inout] out_track_data_list The pointer to the list to be initialized +void ArTrackDataList_create(const ArSession *session, + ArTrackDataList **out_track_data_list); + +/// @ingroup ArTrackData +/// Releases the memory used by the @c ::ArTrackData list object +/// +/// @param[inout] track_data_list The pointer to the @c ::ArTrackDataList +/// memory being released +void ArTrackDataList_destroy(ArTrackDataList *track_data_list); + +/// @ingroup ArTrackData +/// Retrieves the number of @c ::ArTrackData elements in the list. +/// +/// @param[in] session The ARCore session. +/// @param[in] track_data_list The list being checked for size +/// @param[inout] out_size The size of the list, 0 if +/// @p track_data_list is empty +void ArTrackDataList_getSize(const ArSession *session, + const ArTrackDataList *track_data_list, + int32_t *out_size); -// === ArPointCloud methods === +/// @ingroup ArTrackData +/// Acquires a reference to an indexed entry in the list. This call must +/// eventually be matched with a call to @c ::ArTrackData_release. +/// +/// @param[in] session The ARCore session +/// @param[in] track_data_list The list being queried +/// @param[in] index The index of the list +/// @param[inout] out_track_data The pointer to the @c ::ArTrackData +/// acquired at the given index in the list +void ArTrackDataList_acquireItem(const ArSession *session, + const ArTrackDataList *track_data_list, + int32_t index, + ArTrackData **out_track_data); + +/// @ingroup ArFrame +/// Attempts to acquire a depth image that corresponds to the current frame. +/// +/// The depth image has a single 16-bit plane at index 0, stored in +/// little-endian format. Each pixel contains the distance in millimeters to the +/// camera plane. Currently, the three most significant bits are always set to +/// 000. The remaining thirteen bits express values from 0 to 8191, representing +/// depth in millimeters. To extract distance from a depth map, see the +/// Depth API developer guide. +/// +/// The actual size of the depth image depends on the device and its display +/// aspect ratio. The size of the depth image is typically around 160x120 +/// pixels, with higher resolutions up to 640x480 on some devices. These sizes +/// may change in the future. The outputs of +/// @c ::ArFrame_acquireDepthImage, @c ::ArFrame_acquireRawDepthImage and +/// @c ::ArFrame_acquireRawDepthConfidenceImage will all have the exact same +/// size. +/// +/// Optimal depth accuracy is achieved between 500 millimeters (50 centimeters) +/// and 5000 millimeters (5 meters) from the camera. Error increases +/// quadratically as distance from the camera increases. +/// +/// Depth is estimated using data from the world-facing cameras, user motion, +/// and hardware depth sensors such as a time-of-flight sensor (or ToF sensor) +/// if available. As the user moves their device through the environment, 3D +/// depth data is collected and cached which improves the quality of subsequent +/// depth images and reducing the error introduced by camera distance. +/// +/// If an up-to-date depth image isn't ready for the current frame, the most +/// recent depth image available from an earlier frame will be returned instead. +/// This is expected only to occur on compute-constrained devices. An up-to-date +/// depth image should typically become available again within a few frames. +/// +/// The image must be released with @c ::ArImage_release once it is no +/// longer needed. +/// +/// @param[in] session The ARCore session. +/// @param[in] frame The current frame. +/// @param[out] out_depth_image On successful return, this is filled out +/// with a pointer to an @c ::ArImage. On error return, this is filled out +/// with @c nullptr. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT if the session, frame, or depth image +/// arguments are invalid. +/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the number of observed camera frames is +/// not yet sufficient for depth estimation; or depth estimation was not +/// possible due to poor lighting, camera occlusion, or insufficient motion +/// observed. +/// - @c #AR_ERROR_NOT_TRACKING The session is not in the +/// @c #AR_TRACKING_STATE_TRACKING state, which is required to acquire depth +/// images. +/// - @c #AR_ERROR_ILLEGAL_STATE if a supported depth mode was not enabled in +/// Session configuration. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if the caller app has exceeded maximum +/// number of depth images that it can hold without releasing. +/// - @c #AR_ERROR_DEADLINE_EXCEEDED if the provided Frame is not the current +/// one. +/// +/// @deprecated Deprecated in release 1.31.0. Please use +/// @c ::ArFrame_acquireDepthImage16Bits instead, which expands the depth range +/// from 8191mm to 65535mm. This deprecated version may be slower than +/// @c ::ArFrame_acquireDepthImage16Bits due to the clearing of the top 3 bits +/// per pixel. +ArStatus ArFrame_acquireDepthImage(const ArSession *session, + const ArFrame *frame, + ArImage **out_depth_image) + AR_DEPRECATED( + "Deprecated in release 1.31.0. Please use " + "ArFrame_acquireDepthImage16Bits instead, which expands the depth " + "range from 8191mm to 65535mm. This deprecated version may " + "be slower than ArFrame_acquireDepthImage16Bits due to the clearing of " + "the top 3 bits per pixel."); + +/// @ingroup ArFrame +/// Attempts to acquire a depth image that corresponds to the current frame. +/// +/// The depth image has format +/// HardwareBuffer.D_16, which is a single 16-bit plane at index 0, +/// stored in little-endian format. Each pixel contains the distance in +/// millimeters to the camera plane, with the representable depth range between +/// 0 millimeters and 65535 millimeters, or about 65 meters. +/// +/// To extract distance from a depth map, see the +/// Depth API developer guide. +//// +/// The actual size of the depth image depends on the device and its display +/// aspect ratio. The size of the depth image is typically around 160x120 +/// pixels, with higher resolutions up to 640x480 on some devices. These sizes +/// may change in the future. The outputs of +/// @c ::ArFrame_acquireDepthImage16Bits, +/// @c ::ArFrame_acquireRawDepthImage16Bits and +/// @c ::ArFrame_acquireRawDepthConfidenceImage will all have the exact same +/// size. +/// +/// Optimal depth accuracy is achieved between 500 millimeters (50 centimeters) +/// and 15000 millimeters (15 meters) from the camera, with depth reliably +/// observed up to 25000 millimeters (25 meters). Error increases quadratically +/// as distance from the camera increases. +/// +/// Depth is estimated using data from the world-facing cameras, user motion, +/// and hardware depth sensors such as a time-of-flight sensor (or ToF sensor) +/// if available. As the user moves their device through the environment, 3D +/// depth data is collected and cached which improves the quality of subsequent +/// depth images and reducing the error introduced by camera distance. +/// +/// If an up-to-date depth image isn't ready for the current frame, the most +/// recent depth image available from an earlier frame will be returned instead. +/// This is expected only to occur on compute-constrained devices. An up-to-date +/// depth image should typically become available again within a few frames. +/// +/// The image must be released with @c ::ArImage_release once it is no +/// longer needed. +/// +/// @param[in] session The ARCore session. +/// @param[in] frame The current frame. +/// @param[out] out_depth_image On successful return, this is filled out +/// with a pointer to an @c ::ArImage. On error return, this is filled out +/// with @c nullptr. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT if the session, frame, or depth image +/// arguments are invalid. +/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the number of observed camera frames is +/// not yet sufficient for depth estimation; or depth estimation was not +/// possible due to poor lighting, camera occlusion, or insufficient motion +/// observed. +/// - @c #AR_ERROR_NOT_TRACKING The session is not in the +/// @c #AR_TRACKING_STATE_TRACKING state, which is required to acquire depth +/// images. +/// - @c #AR_ERROR_ILLEGAL_STATE if a supported depth mode was not enabled in +/// Session configuration. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if the caller app has exceeded maximum +/// number of depth images that it can hold without releasing. +/// - @c #AR_ERROR_DEADLINE_EXCEEDED if the provided Frame is not the current +/// one. +ArStatus ArFrame_acquireDepthImage16Bits(const ArSession *session, + const ArFrame *frame, + ArImage **out_depth_image); + +/// @ingroup ArFrame +/// Attempts to acquire a "raw", mostly unfiltered, depth image that corresponds +/// to the current frame. +/// +/// The raw depth image is sparse and does not provide valid depth for all +/// pixels. Pixels without a valid depth estimate have a pixel value of 0 and a +/// corresponding confidence value of 0 (see +/// @c ::ArFrame_acquireRawDepthConfidenceImage). +/// +/// The depth image has a single 16-bit plane at index 0, stored in +/// little-endian format. Each pixel contains the distance in millimeters to the +/// camera plane. Currently, the three most significant bits are always set to +/// 000. The remaining thirteen bits express values from 0 to 8191, representing +/// depth in millimeters. To extract distance from a depth map, see the +/// Depth API developer guide. +/// +/// The actual size of the depth image depends on the device and its display +/// aspect ratio. The size of the depth image is typically around 160x120 +/// pixels, with higher resolutions up to 640x480 on some devices. These sizes +/// may change in the future. The outputs of +/// @c ::ArFrame_acquireDepthImage, @c ::ArFrame_acquireRawDepthImage and +/// @c ::ArFrame_acquireRawDepthConfidenceImage will all have the exact same +/// size. +/// +/// Optimal depth accuracy occurs between 500 millimeters (50 centimeters) and +/// 5000 millimeters (5 meters) from the camera. Error increases quadratically +/// as distance from the camera increases. +/// +/// Depth is primarily estimated using data from the motion of world-facing +/// cameras. As the user moves their device through the environment, 3D depth +/// data is collected and cached, improving the quality of subsequent depth +/// images and reducing the error introduced by camera distance. Depth accuracy +/// and robustness improves if the device has a hardware depth sensor, such as a +/// time-of-flight (ToF) camera. +/// +/// Not every raw depth image contains a new depth estimate. Typically there is +/// about 10 updates to the raw depth data per second. The depth images between +/// those updates are a 3D reprojection which transforms each depth pixel into a +/// 3D point in space and renders those 3D points into a new raw depth image +/// based on the current camera pose. This effectively transforms raw depth +/// image data from a previous frame to account for device movement since the +/// depth data was calculated. For some applications it may be important to know +/// whether the raw depth image contains new depth data or is a 3D reprojection +/// (for example, to reduce the runtime cost of 3D reconstruction). To do that, +/// compare the current raw depth image timestamp, obtained via @c +/// ::ArImage_getTimestamp, with the previously recorded raw depth image +/// timestamp. If they are different, the depth image contains new information. +/// +/// The image must be released via @c ::ArImage_release once it is no longer +/// needed. +/// +/// @param[in] session The ARCore session. +/// @param[in] frame The current frame. +/// @param[out] out_depth_image On successful return, this is filled out +/// with a pointer to an @c ::ArImage. On error return, this is filled out +/// filled out with @c nullptr. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT if the session, frame, or depth image +/// arguments are invalid. +/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the number of observed camera frames is +/// not yet sufficient for depth estimation; or depth estimation was not +/// possible due to poor lighting, camera occlusion, or insufficient motion +/// observed. +/// - @c #AR_ERROR_NOT_TRACKING The session is not in the +/// @c #AR_TRACKING_STATE_TRACKING state, which is required to acquire depth +/// images. +/// - @c #AR_ERROR_ILLEGAL_STATE if a supported depth mode was not enabled in +/// Session configuration. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if the caller app has exceeded maximum +/// number of depth images that it can hold without releasing. +/// - @c #AR_ERROR_DEADLINE_EXCEEDED if the provided @c ::ArFrame is not the +/// current one. +/// +/// @deprecated Deprecated in release 1.31.0. Please use +/// @c ::ArFrame_acquireRawDepthImage16Bits instead, which expands the depth +/// range from 8191mm to 65535mm. This deprecated version may be slower than +/// @c ::ArFrame_acquireRawDepthImage16Bits due to the clearing of the top 3 +/// bits per pixel. +ArStatus ArFrame_acquireRawDepthImage(const ArSession *session, + const ArFrame *frame, + ArImage **out_depth_image) + AR_DEPRECATED( + "Deprecated in release 1.31.0. Please use " + "ArFrame_acquireRawDepthImage16Bits instead, which expands the depth " + "range from 8191mm to 65535mm. This deprecated version may " + "be slower than ArFrame_acquireRawDepthImage16Bits due to the clearing " + "of the top 3 bits per pixel."); + +/// @ingroup ArFrame +/// Attempts to acquire a "raw", mostly unfiltered, depth image that corresponds +/// to the current frame. +/// +/// The raw depth image is sparse and does not provide valid depth for all +/// pixels. Pixels without a valid depth estimate have a pixel value of 0 and a +/// corresponding confidence value of 0 (see +/// @c ::ArFrame_acquireRawDepthConfidenceImage). +/// +/// The depth image has format +/// HardwareBuffer.D_16, which is a single 16-bit plane at index 0, +/// stored in little-endian format. Each pixel contains the distance in +/// millimeters to the camera plane, with the representable depth range between +/// 0 millimeters and 65535 millimeters, or about 65 meters. +/// +/// To extract distance from a depth map, see the +/// Depth API developer guide. +/// +/// The actual size of the depth image depends on the device and its display +/// aspect ratio. The size of the depth image is typically around 160x120 +/// pixels, with higher resolutions up to 640x480 on some devices. These sizes +/// may change in the future. The outputs of +/// @c ::ArFrame_acquireDepthImage16Bits, +/// @c ::ArFrame_acquireRawDepthImage16Bits and +/// @c ::ArFrame_acquireRawDepthConfidenceImage will all have the exact same +/// size. +/// +/// Optimal depth accuracy is achieved between 500 millimeters (50 centimeters) +/// and 15000 millimeters (15 meters) from the camera, with depth reliably +/// observed up to 25000 millimeters (25 meters). Error increases quadratically +/// as distance from the camera increases. +/// +/// Depth is primarily estimated using data from the motion of world-facing +/// cameras. As the user moves their device through the environment, 3D depth +/// data is collected and cached, improving the quality of subsequent depth +/// images and reducing the error introduced by camera distance. Depth accuracy +/// and robustness improves if the device has a hardware depth sensor, such as a +/// time-of-flight (ToF) camera. +/// +/// Not every raw depth image contains a new depth estimate. Typically there are +/// about 10 updates to the raw depth data per second. The depth images between +/// those updates are a 3D reprojection which transforms each depth pixel into a +/// 3D point in space and renders those 3D points into a new raw depth image +/// based on the current camera pose. This effectively transforms raw depth +/// image data from a previous frame to account for device movement since the +/// depth data was calculated. For some applications it may be important to know +/// whether the raw depth image contains new depth data or is a 3D reprojection +/// (for example, to reduce the runtime cost of 3D reconstruction). To do that, +/// compare the current raw depth image timestamp, obtained via @c +/// ::ArImage_getTimestamp, with the previously recorded raw depth image +/// timestamp. If they are different, the depth image contains new information. +/// +/// The image must be released via @c ::ArImage_release once it is no longer +/// needed. +/// +/// @param[in] session The ARCore session. +/// @param[in] frame The current frame. +/// @param[out] out_depth_image On successful return, this is filled out +/// with a pointer to an @c ::ArImage. On error return, this is filled out +/// filled out with @c nullptr. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT if the session, frame, or depth image +/// arguments are invalid. +/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the number of observed camera frames is +/// not yet sufficient for depth estimation; or depth estimation was not +/// possible due to poor lighting, camera occlusion, or insufficient motion +/// observed. +/// - @c #AR_ERROR_NOT_TRACKING The session is not in the +/// @c #AR_TRACKING_STATE_TRACKING state, which is required to acquire depth +/// images. +/// - @c #AR_ERROR_ILLEGAL_STATE if a supported depth mode was not enabled in +/// Session configuration. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if the caller app has exceeded maximum +/// number of depth images that it can hold without releasing. +/// - @c #AR_ERROR_DEADLINE_EXCEEDED if the provided @c ::ArFrame is not the +/// current one. +ArStatus ArFrame_acquireRawDepthImage16Bits(const ArSession *session, + const ArFrame *frame, + ArImage **out_depth_image); + +/// @ingroup ArFrame +/// Attempts to acquire the confidence image corresponding to the raw depth +/// image of the current frame. +/// +/// The image must be released via @c ::ArImage_release once it is no longer +/// needed. +/// +/// Each pixel is an 8-bit unsigned integer representing the estimated +/// confidence of the corresponding pixel in the raw depth image. The confidence +/// value is between 0 and 255, inclusive, with 0 representing the lowest +/// confidence and 255 representing the highest confidence in the measured depth +/// value. Pixels without a valid depth estimate have a confidence value of 0 +/// and a corresponding depth value of 0 (see @c +/// ::ArFrame_acquireRawDepthImage16Bits). +/// +/// The scaling of confidence values is linear and continuous within this range. +/// Expect to see confidence values represented across the full range of 0 to +/// 255, with values increasing as better observations are made of each +/// location. If an application requires filtering out low-confidence pixels, +/// removing depth pixels below a confidence threshold of half confidence (128) +/// tends to work well. +/// +/// The actual size of the depth image depends on the device and its display +/// aspect ratio. The size of the depth image is typically around 160x120 +/// pixels, with higher resolutions up to 640x480 on some devices. These sizes +/// may change in the future. The outputs of +/// @c ::ArFrame_acquireDepthImage16Bits, +/// @c ::ArFrame_acquireRawDepthImage16Bits and +/// @c ::ArFrame_acquireRawDepthConfidenceImage will all have the exact same +/// size. +/// +/// @param[in] session The ARCore session. +/// @param[in] frame The current frame. +/// @param[out] out_confidence_image On successful return, this is filled out +/// with a pointer to an @c ::ArImage. On error return, this is filled out +/// filled out with @c nullptr. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT if the session, frame, or depth image +/// arguments are invalid. +/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the number of observed camera frames is +/// not yet sufficient for depth estimation; or depth estimation was not +/// possible due to poor lighting, camera occlusion, or insufficient motion +/// observed. +/// - @c #AR_ERROR_NOT_TRACKING The session is not in the +/// @c #AR_TRACKING_STATE_TRACKING state, which is required to acquire depth +/// images. +/// - @c #AR_ERROR_ILLEGAL_STATE if a supported depth mode was not enabled in +/// Session configuration. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if the caller app has exceeded maximum +/// number of depth images that it can hold without releasing. +/// - @c #AR_ERROR_DEADLINE_EXCEEDED if the provided @c ::ArFrame is not the +/// current one. +ArStatus ArFrame_acquireRawDepthConfidenceImage(const ArSession *session, + const ArFrame *frame, + ArImage **out_confidence_image); + +/// @ingroup ArFrame +/// Returns the OpenGL ES camera texture name (ID) associated with this frame. +/// This is guaranteed to be one of the texture names previously set via +/// @c ::ArSession_setCameraTextureNames or @c ::ArSession_setCameraTextureName. +/// Texture names (IDs) are returned in a round robin fashion in sequential +/// frames. +/// +/// @param[in] session The ARCore session. +/// @param[in] frame The current frame. +/// @param[out] out_texture_id Where to store the texture name (ID). +void ArFrame_getCameraTextureName(const ArSession *session, + const ArFrame *frame, + uint32_t *out_texture_id); -/// @addtogroup pointcloud -/// @{ +// === ArPointCloud functions === -/// Retrieves the number of points in the point cloud. +/// @ingroup ArPointCloud +/// Retrieves the number of points in the Point Cloud. /// void ArPointCloud_getNumberOfPoints(const ArSession *session, const ArPointCloud *point_cloud, int32_t *out_number_of_points); -/// Retrieves a pointer to the point cloud data. +/// @ingroup ArPointCloud +/// Retrieves a pointer to the Point Cloud data. /// /// Each point is represented by four consecutive values in the array; first the /// X, Y, Z position coordinates, followed by a confidence value. This is the @@ -2253,128 +4294,262 @@ void ArPointCloud_getNumberOfPoints(const ArSession *session, /// href="https://developer.android.com/reference/android/graphics/ImageFormat.html#DEPTH_POINT_CLOUD" /// >DEPTH_POINT_CLOUD. /// -/// The pointer returned by this function is valid until ArPointCloud_release() -/// is called. If the number of points is zero, then the value of -/// @c *out_point_cloud_data is undefined. +/// The pointer returned by this function is valid until +/// @c ::ArPointCloud_release is called. If the number of points is zero, then +/// the value of +/// @p *out_point_cloud_data is undefined. /// -/// If your app needs to keep some point cloud data, for example to compare -/// point cloud data frame to frame, consider copying just the data points your -/// app needs, and then calling ArPointCloud_release() to reduce the amount of -/// memory required. +/// If your app needs to keep some Point Cloud data, for example to compare +/// Point Cloud data frame to frame, consider copying just the data points your +/// app needs, and then calling @c ::ArPointCloud_release to reduce the amount +/// of memory required. void ArPointCloud_getData(const ArSession *session, const ArPointCloud *point_cloud, const float **out_point_cloud_data); -/// Retrieves a pointer to the point cloud point IDs. The number of IDs is the +/// @ingroup ArPointCloud +/// Retrieves a pointer to the Point Cloud point IDs. The number of IDs is the /// same as number of points, and is given by -/// @c ArPointCloud_getNumberOfPoints(). +/// @c ::ArPointCloud_getNumberOfPoints. /// /// Each point has a unique identifier (within a session) that is persistent -/// across frames. That is, if a point from point cloud 1 has the same id as the -/// point from point cloud 2, then it represents the same point in space. -/// -/// The pointer returned by this function is valid until ArPointCloud_release() -/// is called. If the number of points is zero, then the value of -/// @c *out_point_ids is undefined. -/// -/// If your app needs to keep some point cloud data, for example to compare -/// point cloud data frame to frame, consider copying just the data points your -/// app needs, and then calling ArPointCloud_release() to reduce the amount of -/// memory required. +/// across frames. That is, if a point from Point Cloud 1 has the same id as the +/// point from Point Cloud 2, then it represents the same point in space. +/// +/// The pointer returned by this function is valid until +/// @c ::ArPointCloud_release is called. If the number of points is zero, then +/// the value of +/// @p *out_point_ids is undefined. +/// +/// If your app needs to keep some Point Cloud data, for example to compare +/// Point Cloud data frame to frame, consider copying just the data points your +/// app needs, and then calling @c ::ArPointCloud_release to reduce the amount +/// of memory required. void ArPointCloud_getPointIds(const ArSession *session, const ArPointCloud *point_cloud, const int32_t **out_point_ids); -/// Returns the timestamp in nanoseconds when this point cloud was observed. -/// This timestamp uses the same time base as ArFrame_getTimestamp(). +/// @ingroup ArPointCloud +/// Returns the timestamp in nanoseconds when this Point Cloud was observed. +/// This timestamp uses the same time base as @c ::ArFrame_getTimestamp. void ArPointCloud_getTimestamp(const ArSession *session, const ArPointCloud *point_cloud, int64_t *out_timestamp_ns); -/// Releases a reference to the point cloud. This must match a call to -/// ArFrame_acquirePointCloud(). +/// @ingroup ArPointCloud +/// Releases a reference to the Point Cloud. This must match a call to +/// @c ::ArFrame_acquirePointCloud. /// -/// This method may safely be called with @c nullptr - it will do nothing. +/// This function may safely be called with @c NULL - it will do nothing. void ArPointCloud_release(ArPointCloud *point_cloud); -/// @} - -// === Image Metadata methods === - -/// @addtogroup image -/// @{ - -/// Retrieves the capture metadata for the current camera image. -/// -/// @c ACameraMetadata is a struct in Android NDK. Include NdkCameraMetadata.h -/// to use this type. -/// -/// Note: that the ACameraMetadata returned from this function will be invalid -/// after its ArImageMetadata object is released. -void ArImageMetadata_getNdkCameraMetadata( - const ArSession *session, - const ArImageMetadata *image_metadata, - const ACameraMetadata **out_ndk_metadata); +// === Image Metadata functions === +/// @ingroup ArImageMetadata /// Releases a reference to the metadata. This must match a call to -/// ArFrame_acquireImageMetadata(). +/// @c ::ArFrame_acquireImageMetadata. /// -/// This method may safely be called with @c nullptr - it will do nothing. +/// This function may safely be called with @c NULL - it will do nothing. void ArImageMetadata_release(ArImageMetadata *metadata); -/// Converts an ArImage object to an Android NDK AImage object. The -/// converted image object format is AIMAGE_FORMAT_YUV_420_888. -void ArImage_getNdkImage(const ArImage *image, const AImage **out_ndk_image); - -/// Releases an instance of ArImage returned by ArFrame_acquireCameraImage(). -void ArImage_release(ArImage *image); +/// @ingroup ArImage +/// Image formats produced by ARCore. +AR_DEFINE_ENUM(ArImageFormat){ + /// Invalid image format. Produced by ARCore when an invalid session/image + /// is given to @c ::ArImage_getFormat. + AR_IMAGE_FORMAT_INVALID = 0, + + /// Produced by @c ::ArFrame_acquireCameraImage. + /// Integer value equal to Android NDK @c AIMAGE_FORMAT_YUV_420_888 + /// and @c YUV_420_888. + AR_IMAGE_FORMAT_YUV_420_888 = 0x23, + + /// Produced by @c ::ArFrame_acquireDepthImage and + /// @c ::ArFrame_acquireRawDepthImage. + /// Integer value equal to DEPTH16. + AR_IMAGE_FORMAT_DEPTH16 = 0x44363159, + + /// Produced by @c ::ArFrame_acquireDepthImage16Bits and + /// @c ::ArFrame_acquireRawDepthImage16Bits. + /// Depth range values in units of millimeters. + /// Integer value equal to D_16. + AR_IMAGE_FORMAT_D_16 = 0x00000030, + + /// Produced by @c ::ArFrame_acquireRawDepthConfidenceImage. Integer value + /// equal to @c Y8. + AR_IMAGE_FORMAT_Y8 = 0x20203859, + + /// Produced by @c ::ArLightEstimate_acquireEnvironmentalHdrCubemap. + /// Integer value equal to Android NDK @c AIMAGE_FORMAT_RGBA_FP16. + AR_IMAGE_FORMAT_RGBA_FP16 = 0x16, +}; -/// @} +/// @ingroup ArImage +/// Gets the width of the input @c ::ArImage. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[inout] out_width The width of the image in pixels. +void ArImage_getWidth(const ArSession *session, + const ArImage *image, + int32_t *out_width); + +/// @ingroup ArImage +/// Gets the height of the input @c ::ArImage. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[inout] out_height The height of the image in pixels. +void ArImage_getHeight(const ArSession *session, + const ArImage *image, + int32_t *out_height); + +/// @ingroup ArImage +/// Gets the source-specific timestamp of the provided @c ::ArImage in +/// nanoseconds. The timestamp is normally monotonically increasing. The +/// timestamps for the images from different sources may have different +/// timebases and should not be compared with each other. The specific meaning +/// and timebase of the returned timestamp depends on the source providing +/// images. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[inout] out_timestamp_ns The timestamp of the image in +/// nanoseconds. +void ArImage_getTimestamp(const ArSession *session, + const ArImage *image, + int64_t *out_timestamp_ns); -// === ArLightEstimate methods === +/// @ingroup ArImage +/// Gets the image format of the provided @c ::ArImage. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[inout] out_format The image format, one of +/// @c ::ArImageFormat values. +void ArImage_getFormat(const ArSession *session, + const ArImage *image, + ArImageFormat *out_format); + +/// @ingroup ArImage +/// Gets the number of planes in the provided @c ::ArImage. The number of planes +/// and format of data in each plane is format dependent. Use +/// @c ::ArImage_getFormat to determine the format. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[inout] out_num_planes The number of planes in the image. +void ArImage_getNumberOfPlanes(const ArSession *session, + const ArImage *image, + int32_t *out_num_planes); + +/// @ingroup ArImage +/// Gets the byte distance between the start of two consecutive pixels in +/// the image. The pixel stride is always greater than 0. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[in] plane_index The index of the plane, between 0 and +/// n-1, where n is number of planes for this image. +/// @param[inout] out_pixel_stride The plane stride of the image in bytes. +void ArImage_getPlanePixelStride(const ArSession *session, + const ArImage *image, + int32_t plane_index, + int32_t *out_pixel_stride); + +/// @ingroup ArImage +/// Gets the number of bytes between the start of two consecutive rows of pixels +/// in the image. The row stride is always greater than 0. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[in] plane_index The index of the plane, between 0 and +/// n-1, where n is number of planes for this image. +/// @param[inout] out_row_stride The row stride of the image in bytes. +void ArImage_getPlaneRowStride(const ArSession *session, + const ArImage *image, + int32_t plane_index, + int32_t *out_row_stride); + +/// @ingroup ArImage +/// Gets the data pointer of the provided image for direct application access. +/// Note that once the @c ::ArImage data is released with @c ::ArImage_release, +/// the data pointer from the corresponding @c ::ArImage_getPlaneData call +/// becomes invalid. Do NOT use it after the @c ::ArImage is released. +/// +/// @param[in] session The ARCore session. +/// @param[in] image The @c ::ArImage of interest. +/// @param[in] plane_index The index of the plane, between 0 and +/// n-1, where n is number of planes for this image. +/// @param[inout] out_data The data pointer to the image. +/// @param[inout] out_data_length The length of data in bytes. +void ArImage_getPlaneData(const ArSession *session, + const ArImage *image, + int32_t plane_index, + const uint8_t **out_data, + int32_t *out_data_length); + +/// @ingroup ArImage +/// Releases an instance of @c ::ArImage returned by +/// @c ::ArFrame_acquireCameraImage. +void ArImage_release(ArImage *image); -/// @addtogroup light -/// @{ +// === ArLightEstimate functions === -/// Allocates a light estimate object. +/// @ingroup ArLightEstimate +/// Allocates an @c ::ArLightEstimate object. void ArLightEstimate_create(const ArSession *session, ArLightEstimate **out_light_estimate); -/// Releases the provided light estimate object. +/// @ingroup ArLightEstimate +/// Releases the provided @c ::ArLightEstimate object. void ArLightEstimate_destroy(ArLightEstimate *light_estimate); -/// Retrieves the validity state of a light estimate. If the resulting value of -/// @c *out_light_estimate_state is not #AR_LIGHT_ESTIMATE_STATE_VALID, the +/// @ingroup ArLightEstimate +/// Retrieves the validity state of an @c ::ArLightEstimate. If the resulting +/// value of +/// @p *out_light_estimate_state is not @c #AR_LIGHT_ESTIMATE_STATE_VALID, the /// estimate should not be used for rendering. void ArLightEstimate_getState(const ArSession *session, const ArLightEstimate *light_estimate, ArLightEstimateState *out_light_estimate_state); -/// Retrieves the pixel intensity, in gamma space, of the current camera view. -/// Values are in the range (0.0, 1.0), with zero being black and one being -/// white. -/// If rendering in gamma space, divide this value by 0.466, which is middle -/// gray in gamma space, and multiply against the final calculated color after -/// rendering. -/// If rendering in linear space, first convert this value to linear space by -/// rising to the power 2.2. Normalize the result by dividing it by 0.18 which -/// is middle gray in linear space. Then multiply by the final calculated color -/// after rendering. +/// @ingroup ArLightEstimate +/// Retrieves the pixel intensity, in gamma color space, of the current camera +/// view. Values are in the range [0.0, 1.0], with zero being black and one +/// being white. If @c #AR_LIGHT_ESTIMATION_MODE_AMBIENT_INTENSITY mode is not +/// set, returns zero. +/// +/// If rendering in gamma color space, divide this value by 0.466, which is +/// middle gray in gamma color space, and multiply against the final calculated +/// color after rendering. If rendering in linear space, first convert this +/// value to linear space by rising to the power 2.2. Normalize the result by +/// dividing it by 0.18 which is middle gray in linear space. Then multiply by +/// the final calculated color after rendering. void ArLightEstimate_getPixelIntensity(const ArSession *session, const ArLightEstimate *light_estimate, float *out_pixel_intensity); +/// @ingroup ArLightEstimate /// Gets the color correction values that are uploaded to the fragment shader. /// Use the RGB scale factors (components 0-2) to match the color of the light /// in the scene. Use the pixel intensity (component 3) to match the intensity -/// of the light in the scene. +/// of the light in the scene. If @c #AR_LIGHT_ESTIMATION_MODE_AMBIENT_INTENSITY +/// mode is not set, returns all zeros. /// /// `out_color_correction_4` components are: -/// - `[0]` Red channel scale factor. -/// - `[1]` Green channel scale factor. -/// - `[2]` Blue channel scale factor. +/// - `[0]` Red channel scale factor. This value is larger or equal to zero. +/// - `[1]` Green channel scale factor. This value is always 1.0 as the green +/// channel is the reference baseline. +/// - `[2]` Blue channel scale factor. This value is larger or equal to zero. /// - `[3]` Pixel intensity. This is the same value as the one return from -/// ArLightEstimate_getPixelIntensity(). +/// @c ::ArLightEstimate_getPixelIntensity. /// /// The RGB scale factors can be used independently from the pixel intensity /// value. They are put together for the convenience of only having to upload @@ -2385,79 +4560,173 @@ void ArLightEstimate_getPixelIntensity(const ArSession *session, /// light; not intensity of the light. The pixel intensity is used to match the /// intensity of the light in the scene. /// -/// Color correction values are reported in gamma space. -/// If rendering in gamma space, component-wise multiply them against the final -/// calculated color after rendering. -/// If rendering in linear space, first convert the values to linear space by -/// rising to the power 2.2. Then component-wise multiply against the final -/// calculated color after rendering. +/// Color correction values are reported in gamma color space. +/// If rendering in gamma color space, multiply them component-wise against the +/// final calculated color after rendering. If rendering in linear space, first +/// convert the values to linear space by rising to the power 2.2. Then +/// multiply component-wise against the final calculated color after rendering. void ArLightEstimate_getColorCorrection(const ArSession *session, const ArLightEstimate *light_estimate, float *out_color_correction_4); -/// @} +/// @ingroup ArLightEstimate +/// Returns the timestamp of the given @c ::ArLightEstimate in nanoseconds. +//// +/// ARCore returns a different timestamp when the underlying light estimate has +/// changed. Conversely, the same timestamp is returned if the light estimate +/// has not changed. +/// +/// This timestamp uses the same time base as @c ::ArFrame_getTimestamp. +void ArLightEstimate_getTimestamp(const ArSession *session, + const ArLightEstimate *light_estimate, + int64_t *out_timestamp_ns); + +/// @ingroup ArLightEstimate +/// Returns the direction of the main directional light based on the inferred +/// Environmental HDR Lighting Estimation. If +/// @c #AR_LIGHT_ESTIMATION_MODE_ENVIRONMENTAL_HDR mode is not set, returns +/// [0.0, 1.0, 0.0], representing a light shining straight down from above. +/// @param[in] session The ARCore session. +/// @param[in] light_estimate The ArLightEstimate. +/// @param[out] out_direction_3 Output lighting direction. +/// This array stores the normalized output lighting direction as 3 floats [x, +/// y, z]. +void ArLightEstimate_getEnvironmentalHdrMainLightDirection( + const ArSession *session, + const ArLightEstimate *light_estimate, + float *out_direction_3); + +/// @ingroup ArLightEstimate +/// Returns the intensity of the main directional light based on the inferred +/// Environmental HDR Lighting Estimation. All return values are larger or equal +/// to zero. If @c #AR_LIGHT_ESTIMATION_MODE_ENVIRONMENTAL_HDR mode is not set, +/// returns zero for all elements of the array. +/// @param[in] session The ARCore session. +/// @param[in] light_estimate The ArLightEstimate. +/// @param[out] out_intensity_3 Output lighting intensity. +/// This array stores the output lighting intensity as 3 floats [r, g, b]. +void ArLightEstimate_getEnvironmentalHdrMainLightIntensity( + const ArSession *session, + const ArLightEstimate *light_estimate, + float *out_intensity_3); -// === ArAnchorList methods === +/// @ingroup ArLightEstimate +/// Gets the spherical harmonics coefficients for the ambient illumination based +/// on the inferred Environmental HDR Lighting Estimation. +/// @param[in] session The ARCore session. +/// @param[in] light_estimate The ArLightEstimate. +/// @param[out] out_coefficients_27 The output spherical harmonics +/// coefficients for the ambient illumination. This array contains 9 sets of +/// per-channel coefficients, or a total of 27 values of 32-bit floating +/// point type. The coefficients are stored in a channel-major fashion e.g. +/// [r0, g0, b0, r1, g1, b1, ... , r8, g8, b8]. If +/// @c #AR_LIGHT_ESTIMATION_MODE_ENVIRONMENTAL_HDR mode is not set, returns +/// zero for all 27 coefficients. +void ArLightEstimate_getEnvironmentalHdrAmbientSphericalHarmonics( + const ArSession *session, + const ArLightEstimate *light_estimate, + float *out_coefficients_27); + +/// @ingroup ArLightEstimate +/// Gets the 6 cubemap textures in OpenGL texture format based on the inferred +/// Environmental HDR lighting. +/// @param[in] session The ARCore session. +/// @param[in] light_estimate The ArLightEstimate. +/// @param[out] out_textures_6 The fixed size array for 6 cubemap textures. +/// @c ::ArImageCubemap type has been created to +/// facilitate representing the array of +/// @c ::ArImage pointers. +/// out_textures_6 contains 6 images in @c AIMAGE_FORMAT_RGBA_FP16 format for +/// the HDR cubemap. The memory layout for the image data is identical to +/// @c GL_RGBA16F. The pixel values are in linear color space. The order of the +/// images corresponds to the cubemap order as follows: +/// out_textures_6[0]: GL_TEXTURE_CUBE_MAP_POSITIVE_X +/// out_textures_6[1]: GL_TEXTURE_CUBE_MAP_NEGATIVE_X +/// out_textures_6[2]: GL_TEXTURE_CUBE_MAP_POSITIVE_Y +/// out_textures_6[3]: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y +/// out_textures_6[4]: GL_TEXTURE_CUBE_MAP_POSITIVE_Z +/// out_textures_6[5]: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z +/// If @c #AR_LIGHT_ESTIMATION_MODE_ENVIRONMENTAL_HDR mode is not set, all +/// textures will be assigned with zero pixel values. All 6 acquired images must +/// be released with @c ::ArImage_release once they are no longer needed. +void ArLightEstimate_acquireEnvironmentalHdrCubemap( + const ArSession *session, + const ArLightEstimate *light_estimate, + ArImageCubemap out_textures_6); -/// @addtogroup anchor -/// @{ +// === ArAnchorList functions === +/// @ingroup ArAnchor /// Creates an anchor list object. void ArAnchorList_create(const ArSession *session, ArAnchorList **out_anchor_list); +/// @ingroup ArAnchor /// Releases the memory used by an anchor list object, along with all the anchor /// references it holds. void ArAnchorList_destroy(ArAnchorList *anchor_list); +/// @ingroup ArAnchor /// Retrieves the number of anchors in this list. void ArAnchorList_getSize(const ArSession *session, const ArAnchorList *anchor_list, int32_t *out_size); +/// @ingroup ArAnchor /// Acquires a reference to an indexed entry in the list. This call must -/// eventually be matched with a call to ArAnchor_release(). +/// eventually be matched with a call to @c ::ArAnchor_release. void ArAnchorList_acquireItem(const ArSession *session, const ArAnchorList *anchor_list, int32_t index, ArAnchor **out_anchor); -// === ArAnchor methods === +// === ArAnchor functions === +/// @ingroup ArAnchor /// Retrieves the pose of the anchor in the world coordinate space. This pose -/// produced by this call may change each time ArSession_update() is called. -/// This pose should only be used for rendering if ArAnchor_getTrackingState() -/// returns #AR_TRACKING_STATE_TRACKING. +/// produced by this call may change each time @c ::ArSession_update is called. +/// This pose should only be used for rendering if +/// @c ::ArAnchor_getTrackingState returns @c #AR_TRACKING_STATE_TRACKING. /// /// @param[in] session The ARCore session. /// @param[in] anchor The anchor to retrieve the pose of. -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArAnchor_getPose(const ArSession *session, const ArAnchor *anchor, ArPose *out_pose); +/// @ingroup ArAnchor /// Retrieves the current state of the pose of this anchor. +/// +/// Note: Starting in ARCore 1.12, changing the active camera config using +/// @c ::ArSession_setCameraConfig may cause the tracking state on certain +/// devices to become permanently @c #AR_TRACKING_STATE_PAUSED. For consistent +/// behavior across all supported devices, release any previously created +/// anchors and trackables when setting a new camera config. void ArAnchor_getTrackingState(const ArSession *session, const ArAnchor *anchor, ArTrackingState *out_tracking_state); +/// @ingroup ArAnchor /// Tells ARCore to stop tracking and forget this anchor. This call does not /// release any references to the anchor - that must be done separately using -/// ArAnchor_release(). +/// @c ::ArAnchor_release. void ArAnchor_detach(ArSession *session, ArAnchor *anchor); +/// @ingroup ArAnchor /// Releases a reference to an anchor. To stop tracking for this anchor, call -/// ArAnchor_detach() first. +/// @c ::ArAnchor_detach first. /// -/// This method may safely be called with @c nullptr - it will do nothing. +/// This function may safely be called with @c NULL - it will do nothing. void ArAnchor_release(ArAnchor *anchor); -/// Acquires the cloud anchor ID of the anchor. The ID acquired is an ASCII +/// @ingroup ArAnchor +/// Acquires the Cloud Anchor ID of the anchor. The ID acquired is an ASCII /// null-terminated string. The acquired ID must be released after use by the -/// @c ArString_release function. For anchors with cloud state -/// #AR_CLOUD_ANCHOR_STATE_NONE or #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS, this -/// will always be an empty string. +/// @c ::ArString_release function. For anchors with cloud state +/// @c #AR_CLOUD_ANCHOR_STATE_NONE or #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS, +/// this will always be an empty string. /// /// @param[in] session The ARCore session. /// @param[in] anchor The anchor to retrieve the cloud ID of. @@ -2466,8 +4735,9 @@ void ArAnchor_acquireCloudAnchorId(ArSession *session, ArAnchor *anchor, char **out_cloud_anchor_id); -/// Gets the current cloud anchor state of the anchor. This state is guaranteed -/// not to change until update() is called. +/// @ingroup ArAnchor +/// Gets the current Cloud Anchor state of the anchor. This state is guaranteed +/// not to change until @c ::ArSession_update is called. /// /// @param[in] session The ARCore session. /// @param[in] anchor The anchor to retrieve the cloud state of. @@ -2476,53 +4746,63 @@ void ArAnchor_getCloudAnchorState(const ArSession *session, const ArAnchor *anchor, ArCloudAnchorState *out_state); -/// @} - -// === ArTrackableList methods === - -/// @addtogroup trackable -/// @{ +// === ArTrackableList functions === +/// @ingroup ArTrackable /// Creates a trackable list object. void ArTrackableList_create(const ArSession *session, ArTrackableList **out_trackable_list); +/// @ingroup ArTrackable /// Releases the memory used by a trackable list object, along with all the /// anchor references it holds. void ArTrackableList_destroy(ArTrackableList *trackable_list); +/// @ingroup ArTrackable /// Retrieves the number of trackables in this list. void ArTrackableList_getSize(const ArSession *session, const ArTrackableList *trackable_list, int32_t *out_size); +/// @ingroup ArTrackable /// Acquires a reference to an indexed entry in the list. This call must -/// eventually be matched with a call to ArTrackable_release(). +/// eventually be matched with a call to @c ::ArTrackable_release. void ArTrackableList_acquireItem(const ArSession *session, const ArTrackableList *trackable_list, int32_t index, ArTrackable **out_trackable); -// === ArTrackable methods === +// === ArTrackable functions === +/// @ingroup ArTrackable /// Releases a reference to a trackable. This does not mean that the trackable /// will necessarily stop tracking. The same trackable may still be included in -/// from other calls, for example ArSession_getAllTrackables(). +/// from other calls, for example @c ::ArSession_getAllTrackables. /// -/// This method may safely be called with @c nullptr - it will do nothing. +/// This function may safely be called with @c NULL - it will do nothing. void ArTrackable_release(ArTrackable *trackable); -/// Retrieves the type of the trackable. See ::ArTrackableType for valid types. +/// @ingroup ArTrackable +/// Retrieves the type of the trackable. See @c ::ArTrackableType for valid +/// types. void ArTrackable_getType(const ArSession *session, const ArTrackable *trackable, ArTrackableType *out_trackable_type); +/// @ingroup ArTrackable /// Retrieves the current state of ARCore's knowledge of the pose of this /// trackable. +/// +/// Note: Starting in ARCore 1.12, changing the active camera config using +/// @c ::ArSession_setCameraConfig may cause the tracking state on certain +/// devices to become permanently @c #AR_TRACKING_STATE_PAUSED. For consistent +/// behavior across all supported devices, release any previously created +/// trackables when setting a new camera config. void ArTrackable_getTrackingState(const ArSession *session, const ArTrackable *trackable, ArTrackingState *out_tracking_state); +/// @ingroup ArTrackable /// Creates an Anchor at the given pose in the world coordinate space, attached /// to this Trackable, and acquires a reference to it. The type of Trackable /// will determine the semantics of attachment and how the Anchor's pose will be @@ -2530,57 +4810,56 @@ void ArTrackable_getTrackingState(const ArSession *session, /// the pose of multiple Anchors attached to a Trackable may adjust slightly /// over time as ARCore updates its model of the world. /// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_NOT_TRACKING if the trackable's tracking state was not -/// #AR_TRACKING_STATE_TRACKING -/// - #AR_ERROR_SESSION_PAUSED if the session was paused -/// - #AR_ERROR_RESOURCE_EXHAUSTED if too many anchors exist -/// - #AR_ERROR_ILLEGAL_STATE if this trackable doesn't support anchors +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_NOT_TRACKING if the trackable's tracking state was not +/// @c #AR_TRACKING_STATE_TRACKING +/// - @c #AR_ERROR_SESSION_PAUSED if the session was paused +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if too many anchors exist +/// - @c #AR_ERROR_ILLEGAL_STATE if this trackable doesn't support anchors ArStatus ArTrackable_acquireNewAnchor(ArSession *session, ArTrackable *trackable, ArPose *pose, ArAnchor **out_anchor); +/// @ingroup ArTrackable /// Gets the set of anchors attached to this trackable. /// /// @param[in] session The ARCore session /// @param[in] trackable The trackable to query the anchors of. /// @param[inout] out_anchor_list The list to fill. This list must have -/// already been allocated with ArAnchorList_create(). If previously +/// already been allocated with @c ::ArAnchorList_create. If previously /// used, the list will first be cleared. void ArTrackable_getAnchors(const ArSession *session, const ArTrackable *trackable, ArAnchorList *out_anchor_list); -/// @} - -// === ArPlane methods === - -/// @addtogroup plane -/// @{ +// === ArPlane functions === +/// @ingroup ArPlane /// Acquires a reference to the plane subsuming this plane. /// /// Two or more planes may be automatically merged into a single parent plane, -/// resulting in this method acquiring the parent plane when called with each +/// resulting in this function acquiring the parent plane when called with each /// child plane. A subsumed plane becomes identical to the parent plane, and /// will continue behaving as if it were independently tracked, for example -/// being included in the output of ArFrame_getUpdatedTrackables(). +/// being included in the output of @c ::ArFrame_getUpdatedTrackables. /// /// In cases where a subsuming plane is itself subsumed, this function /// will always return the topmost non-subsumed plane. /// -/// Note: this function will set @c *out_subsumed_by to NULL if the plane is not -/// subsumed. +/// Note: this function will set @p *out_subsumed_by to @c NULL if the plane is +/// not subsumed. void ArPlane_acquireSubsumedBy(const ArSession *session, const ArPlane *plane, ArPlane **out_subsumed_by); -/// Retrieves the type (orientation) of the plane. See ::ArPlaneType. +/// @ingroup ArPlane +/// Retrieves the type (orientation) of the plane. See @c ::ArPlaneType. void ArPlane_getType(const ArSession *session, const ArPlane *plane, ArPlaneType *out_plane_type); +/// @ingroup ArPlane /// Returns the pose of the center position of the plane's bounding rectangle. /// The pose's transformed +Y axis will be a normal vector pointing out of /// plane. The transformed +X and +Z axes represent right and up relative to the @@ -2588,113 +4867,146 @@ void ArPlane_getType(const ArSession *session, /// /// @param[in] session The ARCore session. /// @param[in] plane The plane for which to retrieve center pose. -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArPlane_getCenterPose(const ArSession *session, const ArPlane *plane, ArPose *out_pose); +/// @ingroup ArPlane /// Retrieves the length of this plane's bounding rectangle measured along the /// local X-axis of the coordinate space defined by the output of -/// ArPlane_getCenterPose(). +/// @c ::ArPlane_getCenterPose. void ArPlane_getExtentX(const ArSession *session, const ArPlane *plane, float *out_extent_x); +/// @ingroup ArPlane /// Retrieves the length of this plane's bounding rectangle measured along the /// local Z-axis of the coordinate space defined by the output of -/// ArPlane_getCenterPose(). +/// @c ::ArPlane_getCenterPose. void ArPlane_getExtentZ(const ArSession *session, const ArPlane *plane, float *out_extent_z); +/// @ingroup ArPlane /// Retrieves the number of elements (not vertices) in the boundary polygon. -/// The number of vertices is 1/2 this size. +/// The number of vertices is half this size. void ArPlane_getPolygonSize(const ArSession *session, const ArPlane *plane, int32_t *out_polygon_size); +/// @ingroup ArPlane /// Returns the 2D vertices of a convex polygon approximating the detected -/// plane, in the form [x1, z1, x2, z2, ...]. These X-Z values are in -/// the plane's local x-z plane (y=0) and must be transformed by the pose -/// (ArPlane_getCenterPose()) to get the boundary in world coordinates. +/// plane, in the form [x1, z1, x2, z2, ...]. These @c x and @c z +/// values are in the plane's local X-Z plane (@c y=0) and must be transformed +/// by the pose (@c ::ArPlane_getCenterPose) to get the boundary in world +/// coordinates. /// /// @param[in] session The ARCore session. /// @param[in] plane The plane to retrieve the polygon from. /// @param[inout] out_polygon_xz A pointer to an array of floats. The length of -/// this array must be at least that reported by ArPlane_getPolygonSize(). +/// this array must be at least that reported by @c +/// ::ArPlane_getPolygonSize. void ArPlane_getPolygon(const ArSession *session, const ArPlane *plane, float *out_polygon_xz); -/// Sets @c *out_pose_in_extents to non-zero if the given pose (usually obtained -/// from a HitResult) is in the plane's rectangular extents. +/// @ingroup ArPlane +/// Sets @p *out_pose_in_extents to non-zero if the given pose (usually obtained +/// from an @c ::ArHitResult) is in the plane's rectangular extents. void ArPlane_isPoseInExtents(const ArSession *session, const ArPlane *plane, const ArPose *pose, int32_t *out_pose_in_extents); -/// Sets @c *out_pose_in_extents to non-zero if the given pose (usually obtained -/// from a HitResult) is in the plane's polygon. +/// @ingroup ArPlane +/// Sets @p *out_pose_in_extents to non-zero if the given pose (usually obtained +/// from an @c ::ArHitResult) is in the plane's polygon. void ArPlane_isPoseInPolygon(const ArSession *session, const ArPlane *plane, const ArPose *pose, int32_t *out_pose_in_polygon); -/// @} - -// === ArPoint methods === - -/// @addtogroup point -/// @{ +// === ArPoint functions === +/// @ingroup ArPoint /// Returns the pose of the point. -/// If ArPoint_getOrientationMode() returns ESTIMATED_SURFACE_NORMAL, the -/// orientation will follow the behavior described in ArHitResult_getHitPose(). -/// If ArPoint_getOrientationMode() returns INITIALIZED_TO_IDENTITY, then -/// returns an orientation that is identity or close to identity. +/// If @c ::ArPoint_getOrientationMode returns +/// @c #AR_POINT_ORIENTATION_ESTIMATED_SURFACE_NORMAL, the orientation will +/// follow the behavior described in @c ::ArHitResult_getHitPose. If +/// @c ::ArPoint_getOrientationMode returns +/// @c #AR_POINT_ORIENTATION_INITIALIZED_TO_IDENTITY, then returns an +/// orientation that is identity or close to identity. /// @param[in] session The ARCore session. /// @param[in] point The point to retrieve the pose of. -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArPoint_getPose(const ArSession *session, const ArPoint *point, ArPose *out_pose); -/// Returns the OrientationMode of the point. For @c Point objects created by -/// ArFrame_hitTest(). -/// If OrientationMode is ESTIMATED_SURFACE_NORMAL, then normal of the surface -/// centered around the ArPoint was estimated successfully. +/// @ingroup ArPoint +/// Returns the @c ::ArPointOrientationMode of the point. For ::ArPoint objects +/// created by +/// @c ::ArFrame_hitTest. +/// If @c ::ArPointOrientationMode is +/// @c #AR_POINT_ORIENTATION_ESTIMATED_SURFACE_NORMAL, then normal of the +/// surface centered around the @c ::ArPoint was estimated successfully. /// /// @param[in] session The ARCore session. /// @param[in] point The point to retrieve the pose of. /// @param[inout] out_orientation_mode OrientationMode output result for the -/// the point. +/// point. void ArPoint_getOrientationMode(const ArSession *session, const ArPoint *point, ArPointOrientationMode *out_orientation_mode); -/// @} +/// @ingroup ArInstantPlacementPoint +/// Returns the pose of the @c ::ArInstantPlacementPoint. +/// @param[in] session The ARCore session. +/// @param[in] instant_placement_point The Instant Placement point to +/// retrieve the pose of. +/// @param[inout] out_pose An @c ::ArPose object already-allocated via +/// @c ::ArPose_create into which the pose will be stored. +void ArInstantPlacementPoint_getPose( + const ArSession *session, + const ArInstantPlacementPoint *instant_placement_point, + ArPose *out_pose); -// === ArAugmentedImage methods === +/// @ingroup ArInstantPlacementPoint +/// Returns the tracking method of the @c ::ArInstantPlacementPoint. +/// @param[in] session The ARCore session. +/// @param[in] instant_placement_point The Instant Placement point to +/// retrieve the tracking method of. +/// @param[inout] out_tracking_method An already-allocated +/// @c ::ArInstantPlacementPointTrackingMethod object into which the +/// tracking method will be stored. +void ArInstantPlacementPoint_getTrackingMethod( + const ArSession *session, + const ArInstantPlacementPoint *instant_placement_point, + ArInstantPlacementPointTrackingMethod *out_tracking_method); -/// @addtogroup augmented_image -/// @{ +// === ArAugmentedImage functions === -/// Returns the pose of the center of the detected image. The pose's +Y axis -/// will be a normal vector pointing out of the face of the image. The +X and +Z -/// axes represent right and up relative to the image. +/// @ingroup ArAugmentedImage +/// Returns the pose of the center of the Augmented Image, in world coordinates. +/// The pose's transformed +Y axis will be the normal out of the plane. The +/// pose's transformed +X axis points from left to right on the image, and the +/// transformed +Z axis points from top to bottom on the image. /// -/// If the tracking state is PAUSED/STOPPED, this returns the pose when the -/// image state was last TRACKING, or the identity pose if the image state has -/// never been TRACKING. +/// If the tracking state is @c #AR_TRACKING_STATE_PAUSED or +/// @c #AR_TRACKING_STATE_STOPPED, this returns the pose when the image state +/// was last @c #AR_TRACKING_STATE_TRACKING, or the identity pose if the image +/// state has never been @c #AR_TRACKING_STATE_TRACKING. void ArAugmentedImage_getCenterPose(const ArSession *session, const ArAugmentedImage *augmented_image, ArPose *out_pose); +/// @ingroup ArAugmentedImage /// Retrieves the estimated width, in metres, of the corresponding physical /// image, as measured along the local X-axis of the coordinate space with -/// origin and axes as defined by ArAugmentedImage_getCenterPose(). +/// origin and axes as defined by @c ::ArAugmentedImage_getCenterPose. /// /// ARCore will attempt to estimate the physical image's width and continuously /// update this estimate based on its understanding of the world. If the @@ -2702,17 +5014,20 @@ void ArAugmentedImage_getCenterPose(const ArSession *session, /// process will happen more quickly. However, the estimated size may be /// different from the originally specified size. /// -/// If the tracking state is PAUSED/STOPPED, this returns the estimated width -/// when the image state was last TRACKING. If the image state has never been -/// TRACKING, this returns 0, even the image has a specified physical size in -/// the image database. +/// If the tracking state is +/// @c #AR_TRACKING_STATE_PAUSED/#AR_TRACKING_STATE_STOPPED, this returns the +/// estimated width when the image state was last @c +/// #AR_TRACKING_STATE_TRACKING. If the image state has never been @c +/// #AR_TRACKING_STATE_TRACKING, this returns 0, even the image has a specified +/// physical size in the image database. void ArAugmentedImage_getExtentX(const ArSession *session, const ArAugmentedImage *augmented_image, float *out_extent_x); +/// @ingroup ArAugmentedImage /// Retrieves the estimated height, in metres, of the corresponding physical /// image, as measured along the local Z-axis of the coordinate space with -/// origin and axes as defined by ArAugmentedImage_getCenterPose(). +/// origin and axes as defined by @c ::ArAugmentedImage_getCenterPose. /// /// ARCore will attempt to estimate the physical image's height and continuously /// update this estimate based on its understanding of the world. If an optional @@ -2720,14 +5035,17 @@ void ArAugmentedImage_getExtentX(const ArSession *session, /// will happen more quickly. However, the estimated size may be different from /// the originally specified size. /// -/// If the tracking state is PAUSED/STOPPED, this returns the estimated height -/// when the image state was last TRACKING. If the image state has never been -/// TRACKING, this returns 0, even the image has a specified physical size in -/// the image database. +/// If the tracking state is +/// @c #AR_TRACKING_STATE_PAUSED/#AR_TRACKING_STATE_STOPPED, this returns the +/// estimated height when the image state was last @c +/// #AR_TRACKING_STATE_TRACKING. If the image state has never been @c +/// #AR_TRACKING_STATE_TRACKING, this returns 0, even the image has a specified +/// physical size in the image database. void ArAugmentedImage_getExtentZ(const ArSession *session, const ArAugmentedImage *augmented_image, float *out_extent_z); +/// @ingroup ArAugmentedImage /// Returns the zero-based positional index of this image from its originating /// image database. /// @@ -2736,38 +5054,36 @@ void ArAugmentedImage_getIndex(const ArSession *session, const ArAugmentedImage *augmented_image, int32_t *out_index); +/// @ingroup ArAugmentedImage /// Returns the name of this image. /// /// The image name is not guaranteed to be unique. /// /// This function will allocate memory for the name string, and set /// *out_augmented_image_name to point to that string. The caller must release -/// the string using ArString_release when the string is no longer needed. +/// the string using @c ::ArString_release when the string is no longer needed. void ArAugmentedImage_acquireName(const ArSession *session, const ArAugmentedImage *augmented_image, char **out_augmented_image_name); +/// @ingroup ArAugmentedImage /// Returns the current method being used to track this Augmented Image. void ArAugmentedImage_getTrackingMethod( const ArSession *session, const ArAugmentedImage *image, ArAugmentedImageTrackingMethod *out_tracking_method); -/// @} - -// === ArAugmentedFace methods === - -/// @addtogroup augmented_face -/// @{ +// === ArAugmentedFace functions === +/// @ingroup ArAugmentedFace /// Returns a pointer to an array of 3D vertices in (x, y, z) packing. These /// vertices are relative to the center pose of the face with units in meters. /// -/// The pointer returned by this function is valid until ArTrackable_release() -/// or the next ArSession_update() is called. The application must copy the -/// data if they wish to retain it for longer. +/// The pointer returned by this function is valid until +/// @c ::ArTrackable_release or the next @c ::ArSession_update is called. The +/// application must copy the data if they wish to retain it for longer. /// -/// If the face's tracking state is AR_TRACKING_STATE_PAUSED, then the +/// If the face's tracking state is @c #AR_TRACKING_STATE_PAUSED, then the /// value of the size of the returned array is 0. /// /// @param[in] session The ARCore session. @@ -2775,23 +5091,24 @@ void ArAugmentedImage_getTrackingMethod( /// @param[out] out_vertices A pointer to an array of 3D vertices in /// (x, y, z) packing. /// @param[out] out_number_of_vertices The number of vertices in the mesh. The -/// returned pointer will point to an array of size out_number_of_vertices * -/// 3 or @c nullptr if the size is 0. +/// returned pointer will point to an array of size +/// @p out_number_of_vertices * 3 or @c NULL if the size is 0. void ArAugmentedFace_getMeshVertices(const ArSession *session, const ArAugmentedFace *face, const float **out_vertices, int32_t *out_number_of_vertices); +/// @ingroup ArAugmentedFace /// Returns a pointer to an array of 3D normals in (x, y, z) packing, where each /// (x, y, z) is a unit vector of the normal to the surface at each vertex. /// There is exactly one normal vector for each vertex. These normals are /// relative to the center pose of the face. /// -/// The pointer returned by this function is valid until ArTrackable_release() -/// or the next ArSession_update() is called. The application must copy the -/// data if they wish to retain it for longer. +/// The pointer returned by this function is valid until +/// @c ::ArTrackable_release or the next @c ::ArSession_update is called. The +/// application must copy the data if they wish to retain it for longer. /// -/// If the face's tracking state is AR_TRACKING_STATE_PAUSED, then the +/// If the face's tracking state is @c #AR_TRACKING_STATE_PAUSED, then the /// value of the size of the returned array is 0. /// /// @param[in] session The ARCore session. @@ -2799,22 +5116,23 @@ void ArAugmentedFace_getMeshVertices(const ArSession *session, /// @param[out] out_normals A pointer to an array of 3D normals in /// (x, y, z) packing. /// @param[out] out_number_of_normals The number of normals in the mesh. The -/// returned pointer will point to an array of size out_number_of_normals * -/// 3, or @c nullptr if the size is 0. +/// returned pointer will point to an array of size +/// @p out_number_of_normals * 3, or @c NULL if the size is 0. void ArAugmentedFace_getMeshNormals(const ArSession *session, const ArAugmentedFace *face, const float **out_normals, int32_t *out_number_of_normals); +/// @ingroup ArAugmentedFace /// Returns a pointer to an array of UV texture coordinates in (u, v) packing. /// There is a pair of texture coordinates for each vertex. These values /// never change. /// -/// The pointer returned by this function is valid until ArTrackable_release() -/// or the next ArSession_update() is called. The application must copy the -/// data if they wish to retain it for longer. +/// The pointer returned by this function is valid until +/// @c ::ArTrackable_release or the next @c ::ArSession_update is called. The +/// application must copy the data if they wish to retain it for longer. /// -/// If the face's tracking state is AR_TRACKING_STATE_PAUSED, then the +/// If the face's tracking state is @c #AR_TRACKING_STATE_PAUSED, then the /// value of the size of the returned array is 0. /// /// @param[in] session The ARCore session. @@ -2824,14 +5142,15 @@ void ArAugmentedFace_getMeshNormals(const ArSession *session, /// coordinates in (u, v) packing. /// @param[out] out_number_of_texture_coordinates The number of texture /// coordinates in the mesh. The returned pointer will point to an array of -/// size out_number_of_texture_coordinates * 2, or @c nullptr if the size is -/// 0. +/// size @p out_number_of_texture_coordinates * 2, +/// or @c NULL if the size is 0. void ArAugmentedFace_getMeshTextureCoordinates( const ArSession *session, const ArAugmentedFace *face, const float **out_texture_coordinates, int32_t *out_number_of_texture_coordinates); +/// @ingroup ArAugmentedFace /// Returns a pointer to an array of triangles indices in consecutive triplets. /// /// Every three consecutive values are indices that represent a triangle. The @@ -2839,11 +5158,11 @@ void ArAugmentedFace_getMeshTextureCoordinates( /// face of each triangle is defined by the face where the vertices are in /// counter clockwise winding order. These values never change. /// -/// The pointer returned by this function is valid until ArTrackable_release() -/// or the next ArSession_update() is called. The application must copy the -/// data if they wish to retain it for longer. +/// The pointer returned by this function is valid until +/// @c ::ArTrackable_release or the next @c ::ArSession_update is called. The +/// application must copy the data if they wish to retain it for longer. /// -/// If the face's tracking state is AR_TRACKING_STATE_PAUSED, then the +/// If the face's tracking state is @c #AR_TRACKING_STATE_PAUSED, then the /// value of the size of the returned array is 0. /// /// @param[in] session The ARCore session. @@ -2852,24 +5171,25 @@ void ArAugmentedFace_getMeshTextureCoordinates( /// @param[out] out_triangle_indices A pointer to an array of triangle /// indices packed in consecutive triplets. /// @param[out] out_number_of_triangles The number of triangles in the mesh. The -/// returned pointer will point to an array of size out_number_of_triangles -/// * 3, or @c nullptr if the size is 0. +/// returned pointer will point to an array of size +/// @p out_number_of_triangles * 3, or @c NULL if the size is 0. void ArAugmentedFace_getMeshTriangleIndices( const ArSession *session, const ArAugmentedFace *face, const uint16_t **out_triangle_indices, int32_t *out_number_of_triangles); +/// @ingroup ArAugmentedFace /// Returns the pose of a face region in world coordinates when the face -/// trackable state is #AR_TRACKING_STATE_TRACKING. When face trackable state is -/// #AR_TRACKING_STATE_PAUSED, the identity pose will be returned. +/// trackable state is @c #AR_TRACKING_STATE_TRACKING. When face trackable state +/// is @c #AR_TRACKING_STATE_PAUSED, the identity pose will be returned. /// /// @param[in] session The ARCore session. /// @param[in] face The face for which to retrieve face region pose. /// @param[in] region_type The face region for which to get the pose. /// @param[out] out_pose The Pose of the selected region when -/// #AR_TRACKING_STATE_TRACKING, or an identity pose when -/// #AR_TRACKING_STATE_PAUSED. +/// @c #AR_TRACKING_STATE_TRACKING, or an identity pose when +/// @c #AR_TRACKING_STATE_PAUSED. void ArAugmentedFace_getRegionPose(const ArSession *session, const ArAugmentedFace *face, const ArAugmentedFaceRegionType region_type, @@ -2877,41 +5197,37 @@ void ArAugmentedFace_getRegionPose(const ArSession *session, /// @} -/// @addtogroup augmented_face -/// @{ - +/// @ingroup ArAugmentedFace /// Returns the pose of the center of the face. /// /// @param[in] session The ARCore session. /// @param[in] face The face for which to retrieve center pose. -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArAugmentedFace_getCenterPose(const ArSession *session, const ArAugmentedFace *face, ArPose *out_pose); -/// @} - -// === ArAugmentedImageDatabase methods === - -/// @addtogroup augmented_image_database -/// @{ +// === ArAugmentedImageDatabase functions === +/// @ingroup ArAugmentedImageDatabase /// Creates a new empty image database. void ArAugmentedImageDatabase_create( const ArSession *session, ArAugmentedImageDatabase **out_augmented_image_database); +/// @ingroup ArAugmentedImageDatabase /// Creates a new image database from a byte array. The contents of the byte /// array must have been generated by the command-line database generation tool -/// provided in the SDK, or at runtime from ArAugmentedImageDatabase_serialize. +/// provided in the SDK, or at runtime from +/// @c ::ArAugmentedImageDatabase_serialize. /// /// Note: this function takes about 10-20ms for a 5MB byte array. Run this in a /// background thread if this affects your application. /// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_DATA_INVALID_FORMAT - the bytes are in an invalid format. -/// - #AR_ERROR_DATA_UNSUPPORTED_VERSION - the database is not supported by +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_DATA_INVALID_FORMAT - the bytes are in an invalid format. +/// - @c #AR_ERROR_DATA_UNSUPPORTED_VERSION - the database is not supported by /// this version of the SDK. ArStatus ArAugmentedImageDatabase_deserialize( const ArSession *session, @@ -2919,40 +5235,48 @@ ArStatus ArAugmentedImageDatabase_deserialize( int64_t database_raw_bytes_size, ArAugmentedImageDatabase **out_augmented_image_database); +/// @ingroup ArAugmentedImageDatabase /// Serializes an image database to a byte array. /// /// This function will allocate memory for the serialized raw byte array, and -/// set *out_image_database_raw_bytes to point to that byte array. The caller is -/// expected to release the byte array using ArByteArray_release when the byte -/// array is no longer needed. +/// set @p *out_image_database_raw_bytes to point to that byte array. The caller +/// is expected to release the byte array using @c ::ArByteArray_release when +/// the byte array is no longer needed. void ArAugmentedImageDatabase_serialize( const ArSession *session, const ArAugmentedImageDatabase *augmented_image_database, uint8_t **out_image_database_raw_bytes, int64_t *out_image_database_raw_bytes_size); +/// @ingroup ArAugmentedImageDatabase /// Adds a single named image of unknown physical size to an image database, /// from an array of grayscale pixel values. Returns the zero-based positional /// index of the image within the image database. /// /// If the physical size of the image is known, use -/// ArAugmentedImageDatabase_addImageWithPhysicalSize instead, to improve image -/// detection time. +/// @c ::ArAugmentedImageDatabase_addImageWithPhysicalSize instead, to improve +/// image detection time. /// -/// For images added via ArAugmentedImageDatabase_addImage, ARCore estimates the -/// physical image's size and pose at runtime when the physical image is visible -/// and is being tracked. This extra estimation step will require the user to -/// move their device to view the physical image from different viewpoints -/// before the size and pose of the physical image can be estimated. +/// For images added via @c ::ArAugmentedImageDatabase_addImage, ARCore +/// estimates the physical image's size and pose at runtime when the physical +/// image is visible and is being tracked. This extra estimation step will +/// require the user to move their device to view the physical image from +/// different viewpoints before the size and pose of the physical image can be +/// estimated. /// -/// This function takes time to perform non-trivial image processing (20ms - -/// 30ms), and should be run on a background thread. +/// This function takes time to perform non-trivial image processing (20-30ms), +/// and should be run on a background thread. /// /// The image name is expected to be a null-terminated string in UTF-8 format. /// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_IMAGE_INSUFFICIENT_QUALITY - image quality is insufficient, e.g. -/// because of lack of features in the image. +/// Currently, only images for which the stride is equal to the width are +/// supported. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_IMAGE_INSUFFICIENT_QUALITY - image quality is insufficient, +/// e.g. because of lack of features in the image. +/// - @c #AR_ERROR_INVALID_ARGUMENT - if @p image_stride_in_pixels is not equal +/// to @p image_width_in_pixels. ArStatus ArAugmentedImageDatabase_addImage( const ArSession *session, ArAugmentedImageDatabase *augmented_image_database, @@ -2963,31 +5287,36 @@ ArStatus ArAugmentedImageDatabase_addImage( int32_t image_stride_in_pixels, int32_t *out_index); +/// @ingroup ArAugmentedImageDatabase /// Adds a single named image to an image database, from an array of grayscale /// pixel values, along with a positive physical width in meters for this image. /// Returns the zero-based positional index of the image within the image /// database. /// /// If the physical size of the image is not known, use -/// ArAugmentedImageDatabase_addImage instead, at the expense of an increased -/// image detection time. +/// @c ::ArAugmentedImageDatabase_addImage instead, at the expense of an +/// increased image detection time. /// -/// For images added via ArAugmentedImageDatabase_addImageWithPhysicalSize, +/// For images added via @c ::ArAugmentedImageDatabase_addImageWithPhysicalSize, /// ARCore can estimate the pose of the physical image at runtime as soon as /// ARCore detects the physical image, without requiring the user to move the /// device to view the physical image from different viewpoints. Note that /// ARCore will refine the estimated size and pose of the physical image as it /// is viewed from different viewpoints. /// -/// This function takes time to perform non-trivial image processing (20ms - -/// 30ms), and should be run on a background thread. +/// This function takes time to perform non-trivial image processing (20-30ms), +/// and should be run on a background thread. /// /// The image name is expected to be a null-terminated string in UTF-8 format. /// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_IMAGE_INSUFFICIENT_QUALITY - image quality is insufficient, e.g. -/// because of lack of features in the image. -/// - #AR_ERROR_INVALID_ARGUMENT - image_width_in_meters is <= 0. +/// Currently, only images for which the stride is equal to the width are +/// supported. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_IMAGE_INSUFFICIENT_QUALITY - image quality is insufficient, +/// e.g. because of lack of features in the image. +/// - @c #AR_ERROR_INVALID_ARGUMENT - @p image_width_in_meters is <= 0 or if +/// image_stride_in_pixels is not equal to @p image_width_in_pixels. ArStatus ArAugmentedImageDatabase_addImageWithPhysicalSize( const ArSession *session, ArAugmentedImageDatabase *augmented_image_database, @@ -2999,36 +5328,37 @@ ArStatus ArAugmentedImageDatabase_addImageWithPhysicalSize( float image_width_in_meters, int32_t *out_index); +/// @ingroup ArAugmentedImageDatabase /// Returns the number of images in the image database. void ArAugmentedImageDatabase_getNumImages( const ArSession *session, const ArAugmentedImageDatabase *augmented_image_database, int32_t *out_number_of_images); +/// @ingroup ArAugmentedImageDatabase /// Releases memory used by an image database. void ArAugmentedImageDatabase_destroy( ArAugmentedImageDatabase *augmented_image_database); -/// @} - -// === ArHitResultList methods === - -/// @addtogroup hit -/// @{ +// === ArHitResultList functions === +/// @ingroup ArHitResult /// Creates a hit result list object. void ArHitResultList_create(const ArSession *session, ArHitResultList **out_hit_result_list); +/// @ingroup ArHitResult /// Releases the memory used by a hit result list object, along with all the /// trackable references it holds. void ArHitResultList_destroy(ArHitResultList *hit_result_list); +/// @ingroup ArHitResult /// Retrieves the number of hit results in this list. void ArHitResultList_getSize(const ArSession *session, const ArHitResultList *hit_result_list, int32_t *out_size); +/// @ingroup ArHitResult /// Copies an indexed entry in the list. This acquires a reference to any /// trackable referenced by the item, and releases any reference currently held /// by the provided result object. @@ -3036,97 +5366,879 @@ void ArHitResultList_getSize(const ArSession *session, /// @param[in] session The ARCore session. /// @param[in] hit_result_list The list from which to copy an item. /// @param[in] index Index of the entry to copy. -/// @param[inout] out_hit_result An already-allocated ArHitResult object into -/// which the result will be copied. +/// @param[inout] out_hit_result An already-allocated @c ::ArHitResult object +/// into which the result will be copied. void ArHitResultList_getItem(const ArSession *session, const ArHitResultList *hit_result_list, int32_t index, ArHitResult *out_hit_result); -// === ArHitResult methods === +// === ArHitResult functions === +/// @ingroup ArHitResult /// Allocates an empty hit result object. void ArHitResult_create(const ArSession *session, ArHitResult **out_hit_result); +/// @ingroup ArHitResult /// Releases the memory used by a hit result object, along with any /// trackable reference it holds. void ArHitResult_destroy(ArHitResult *hit_result); +/// @ingroup ArHitResult /// Returns the distance from the camera to the hit location, in meters. void ArHitResult_getDistance(const ArSession *session, const ArHitResult *hit_result, float *out_distance); +/// @ingroup ArHitResult /// Returns the pose of the intersection between a ray and detected real-world /// geometry. The position is the location in space where the ray intersected /// the geometry. The orientation is a best effort to face the user's device, /// and its exact definition differs depending on the Trackable that was hit. /// -/// ::ArPlane : X+ is perpendicular to the cast ray and parallel to the plane, -/// Y+ points along the plane normal (up, for #AR_PLANE_HORIZONTAL_UPWARD_FACING -/// planes), and Z+ is parallel to the plane, pointing roughly toward the -/// user's device. +/// @c ::ArPlane : X+ is perpendicular to the cast ray and parallel to the +/// plane, Y+ points along the plane normal (up, for @c +/// #AR_PLANE_HORIZONTAL_UPWARD_FACING planes), and Z+ is parallel to the plane, +/// pointing roughly toward the user's device. /// -/// ::ArPoint : +/// @c ::ArPoint : /// Attempt to estimate the normal of the surface centered around the hit test. /// Surface normal estimation is most likely to succeed on textured surfaces /// and with camera motion. -/// If ArPoint_getOrientationMode() returns ESTIMATED_SURFACE_NORMAL, -/// then X+ is perpendicular to the cast ray and parallel to the physical -/// surface centered around the hit test, Y+ points along the estimated surface -/// normal, and Z+ points roughly toward the user's device. If -/// ArPoint_getOrientationMode() returns INITIALIZED_TO_IDENTITY, then X+ is -/// perpendicular to the cast ray and points right from the perspective of the -/// user's device, Y+ points up, and Z+ points roughly toward the user's device. +/// If @c ::ArPoint_getOrientationMode returns +/// @c #AR_POINT_ORIENTATION_ESTIMATED_SURFACE_NORMAL, then X+ is perpendicular +/// to the cast ray and parallel to the physical surface centered around the hit +/// test, Y+ points along the estimated surface normal, and Z+ points roughly +/// toward the user's device. If +/// @c ::ArPoint_getOrientationMode returns +/// @c #AR_POINT_ORIENTATION_INITIALIZED_TO_IDENTITY, then X+ is perpendicular +/// to the cast ray and points right from the perspective of the user's device, +/// Y+ points up, and Z+ points roughly toward the user's device. /// /// If you wish to retain the location of this pose beyond the duration of a -/// single frame, create an anchor using ArHitResult_acquireNewAnchor() to save -/// the pose in a physically consistent way. +/// single frame, create an anchor using @c ::ArHitResult_acquireNewAnchor to +/// save the pose in a physically consistent way. /// /// @param[in] session The ARCore session. /// @param[in] hit_result The hit result to retrieve the pose of. -/// @param[inout] out_pose An already-allocated ArPose object into which the -/// pose will be stored. +/// @param[inout] out_pose An already-allocated @c ::ArPose object into which +/// the pose will be stored. void ArHitResult_getHitPose(const ArSession *session, const ArHitResult *hit_result, ArPose *out_pose); +/// @ingroup ArHitResult /// Acquires reference to the hit trackable. This call must be paired with a -/// call to ArTrackable_release(). +/// call to @c ::ArTrackable_release. void ArHitResult_acquireTrackable(const ArSession *session, const ArHitResult *hit_result, ArTrackable **out_trackable); -/// Creates a new anchor at the hit location. See ArHitResult_getHitPose() for -/// details. This is equivalent to creating an anchor on the hit trackable at -/// the hit pose. -/// -/// @return #AR_SUCCESS or any of: -/// - #AR_ERROR_NOT_TRACKING -/// - #AR_ERROR_SESSION_PAUSED -/// - #AR_ERROR_RESOURCE_EXHAUSTED -/// - #AR_ERROR_DEADLINE_EXCEEDED - hit result must be used before the next call -/// to update(). +/// @ingroup ArHitResult +/// Creates a new anchor at the hit location. See @c ::ArHitResult_getHitPose +/// for details. This is equivalent to creating an anchor on the hit trackable +/// at the hit pose. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_NOT_TRACKING +/// - @c #AR_ERROR_SESSION_PAUSED +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED +/// - @c #AR_ERROR_DEADLINE_EXCEEDED - hit result must be used before the next +/// call to @c ::ArSession_update. ArStatus ArHitResult_acquireNewAnchor(ArSession *session, ArHitResult *hit_result, ArAnchor **out_anchor); -/// @} - -// Utility methods for releasing data. +// === Utility functions for releasing data === +/// @ingroup utility_functions /// Releases a string acquired using an ARCore API function. /// /// @param[in] str The string to be released. void ArString_release(char *str); +/// @ingroup utility_functions /// Releases a byte array created using an ARCore API function. void ArByteArray_release(uint8_t *byte_array); +/// @ingroup ArEarth +/// Describes the current state of @c ::ArEarth. When @c +/// ::ArTrackable_getTrackingState does not become @c +/// #AR_TRACKING_STATE_TRACKING, @c ::ArEarthState may contain the cause of this +/// failure. +/// +/// Obtain using @c ::ArEarth_getEarthState. +AR_DEFINE_ENUM(ArEarthState){ + /// @c ::ArEarth is enabled, and has not encountered any problems. Check @c + /// ::ArTrackable_getTrackingState to determine if it can be used. + AR_EARTH_STATE_ENABLED = 0, + + /// Earth localization has encountered an internal error. The app should not + /// attempt to recover from this error. Please see the Android logs for + /// additional information. + AR_EARTH_STATE_ERROR_INTERNAL = -1, + + /// The given @c ::ArEarth is no longer valid and has @c ::ArTrackingState + /// @c #AR_TRACKING_STATE_STOPPED due to @c #AR_GEOSPATIAL_MODE_DISABLED + /// being set on the @c ::ArSession. The given @c ::ArEarth object should be + /// released by calling @c ::ArTrackable_release. + AR_EARTH_STATE_ERROR_GEOSPATIAL_MODE_DISABLED = -2, + + /// The authorization provided by the application is not valid. + /// - The Google Cloud project may not have enabled the ARCore API. + /// - When using API key authentication, this will happen if the API key in + /// the manifest is invalid or unauthorized. It may also fail if the API + /// key is restricted to a set of apps not including the current one. + /// - When using keyless authentication, this may happen when no OAuth + /// client has been created, or when the signing key and package name + /// combination does not match the values used in the Google Cloud + /// project. It may also fail if Google Play Services isn't installed, + /// is too old, or is malfunctioning for some reason (e.g. killed + /// due to memory pressure). + AR_EARTH_STATE_ERROR_NOT_AUTHORIZED = -3, + + /// The application has exhausted the quota allotted to the given + /// Google Cloud project. The developer should request + /// additional quota for the ARCore API for their project from the + /// Google Cloud Console. + AR_EARTH_STATE_ERROR_RESOURCE_EXHAUSTED = -4, + + /// The APK is older than the supported version. + AR_EARTH_STATE_ERROR_APK_VERSION_TOO_OLD = -5, +}; + +/// @ingroup ArEarth +/// Gets the current @c ::ArEarthState of the @c ::ArEarth. This state is +/// guaranteed not to change until @c ::ArSession_update is called. +/// +/// @param[in] session The ARCore session. +/// @param[in] earth The earth object. +/// @param[inout] out_state The current state of @c ::ArEarth. +void ArEarth_getEarthState(const ArSession *session, + const ArEarth *earth, + ArEarthState *out_state); + +/// @ingroup ArEarth +/// Returns the Earth-relative virtual camera pose for the latest frame. +/// +/// The heading of the obtained @c ::ArGeospatialPose approximates the direction +/// the user is facing, specifically: +/// +/// - When the display is perpendicular to the ground, the back of the device +/// points in the heading direction. +/// - When the display is parallel to the ground and facing upward, heading is +/// along the logical display's up direction, taking into account display +/// rotation. +/// - When the display is parallel to the ground and facing downward, heading is +/// along the logical display's down direction. +/// - In intermediate positions, the heading blends smoothly between the above +/// behaviors. +/// +/// Note: This pose is only valid when @c ::ArTrackable_getTrackingState is @c +/// #AR_TRACKING_STATE_TRACKING. Otherwise, the resulting @c ::ArGeospatialPose +/// will contain default values. +/// +/// @param[in] session The ARCore session. +/// @param[in] earth The @c ::ArEarth object. +/// @param[out] out_camera_geospatial_pose Pointer to a @c ::ArGeospatialPose +/// to receive the geospatial pose. +void ArEarth_getCameraGeospatialPose( + const ArSession *session, + const ArEarth *earth, + ArGeospatialPose *out_camera_geospatial_pose); + +/// @ingroup ArEarth +/// Converts the provided @p pose to a @c ::ArGeospatialPose with respect to the +/// Earth. The @p out_geospatial_pose's rotation quaternion is a rotation with +/// respect to an East-Up-South coordinate frame. An identity quaternion will +/// have the anchor oriented such that X+ points to the east, Y+ points up away +/// from the center of the earth, and Z+ points to the south. +/// +/// The heading value for a @c ::ArGeospatialPose obtained by this function +/// will be 0. See @c ::ArGeospatialPose_getEastUpSouthQuaternion for an +/// orientation in 3D space. +/// +/// @param[in] session The ARCore session. +/// @param[in] earth The @c ::ArEarth handle. +/// @param[in] pose The local pose to translate to an Earth pose. +/// @param[out] out_geospatial_pose Pointer to a @c ::ArGeospatialPose +/// that receives the Geospatial pose. +/// @return @c #AR_SUCCESS, or any of: +/// - @c #AR_ERROR_NOT_TRACKING if the Earth's tracking state is not @c +/// #AR_TRACKING_STATE_TRACKING. +/// - @c #AR_ERROR_INVALID_ARGUMENT if any of the parameters are null. +ArStatus ArEarth_getGeospatialPose(const ArSession *session, + const ArEarth *earth, + const ArPose *pose, + ArGeospatialPose *out_geospatial_pose); + +/// @ingroup ArEarth +/// Converts the provided Earth specified horizontal position, altitude and +/// rotation with respect to an east-up-south coordinate frame to a pose with +/// respect to GL world coordinates. +/// +/// Position near the north pole or south pole is not supported. If the +/// latitude is within 0.1 degrees of the north pole or south pole (90 degrees +/// or -90 degrees), this function will return @c #AR_ERROR_INVALID_ARGUMENT. +/// +/// @param[in] session The ARCore session. +/// @param[in] earth The @c ::ArEarth handle. +/// @param[in] latitude The latitude of the anchor relative to the WGS84 +/// ellipsoid. +/// @param[in] longitude The longitude of the anchor relative to the +/// WGS84 ellipsoid. +/// @param[in] altitude The altitude of the anchor relative to the WGS84 +/// ellipsoid, in meters. +/// @param[in] eus_quaternion_4 The rotation quaternion as {qx, qy, qx, qw}. +/// @param[out] out_pose A pointer to @c ::ArPose of the local pose with the +/// latest frame. +/// @return @c #AR_SUCCESS, or any of: +/// - @c #AR_ERROR_NOT_TRACKING if the Earth's tracking state is not @c +/// #AR_TRACKING_STATE_TRACKING. +/// - @c #AR_ERROR_INVALID_ARGUMENT, if any of the parameters are null or @p +/// latitude is outside the allowable range. +ArStatus ArEarth_getPose(const ArSession *session, + const ArEarth *earth, + double latitude, + double longitude, + double altitude, + const float *eus_quaternion_4, + ArPose *out_pose); + +/// @ingroup ArEarth +/// Creates a new @c ::ArAnchor at the specified geodetic location and +/// orientation relative to the Earth. +/// +/// Latitude and longitude are defined by the +/// WGS84 +/// specification, and altitude values are defined as the elevation above +/// the WGS84 ellipsoid in meters. +/// +/// The rotation provided by @p eus_quaternion_4 is a rotation with respect to +/// an east-up-south coordinate frame. An identity rotation will have the anchor +/// oriented such that X+ points to the east, Y+ points up away from the center +/// of the earth, and Z+ points to the south. +/// +/// To create an anchor that has the +Z axis pointing in the same direction as +/// heading obtained from @c ::ArGeospatialPose, use the following formula: +/// +/// \code +/// {qx, qy, qz, qw} = {0, sin((pi - heading * M_PI / 180.0) / 2), 0, cos((pi - +/// heading * M_PI / 180.0) / 2)}}. +/// \endcode +/// +/// An anchor's @c ::ArTrackingState will be @c #AR_TRACKING_STATE_PAUSED while +/// @c ::ArEarth is @c #AR_TRACKING_STATE_PAUSED. The tracking state will +/// permanently become @c #AR_TRACKING_STATE_STOPPED if the @c ::ArSession +/// configuration is set to @c #AR_GEOSPATIAL_MODE_DISABLED. +/// +/// Creating anchors near the north pole or south pole is not supported. If the +/// latitude is within 0.1 degrees of the north pole or south pole (90 degrees +/// or -90 degrees), this function will return @c #AR_ERROR_INVALID_ARGUMENT and +/// the anchor will fail to be created. +/// +/// @param[in] session The ARCore session. +/// @param[in] earth The @c ::ArEarth handle. +/// @param[in] latitude The latitude of the anchor relative to the WGS84 +/// ellipsoid. +/// @param[in] longitude The longitude of the anchor relative to the +/// WGS84 ellipsoid. +/// @param[in] altitude The altitude of the anchor relative to the WGS84 +/// ellipsoid, in meters. +/// @param[in] eus_quaternion_4 The rotation quaternion as {qx, qy, qx, qw}. +/// @param[out] out_anchor The newly-created @c ::ArAnchor. This will be +/// set to @c NULL if no anchor was created. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_ILLEGAL_STATE if @p earth is @c #AR_TRACKING_STATE_STOPPED +/// due to @c #AR_GEOSPATIAL_MODE_DISABLED configured on the @c ::ArSession. +/// Reacquire @c ::ArEarth if earth mode was reenabled. +/// - @c #AR_ERROR_INVALID_ARGUMENT if @p latitude is outside the allowable +/// range, or if either @p session, @p earth, or @p eus_quaternion_4 is @c +/// NULL. +ArStatus ArEarth_acquireNewAnchor(ArSession *session, + ArEarth *earth, + double latitude, + double longitude, + double altitude, + const float *eus_quaternion_4, + ArAnchor **out_anchor); + +/// @ingroup ArEarth +/// Creates an anchor at a specified horizontal position and altitude relative +/// to the horizontal position’s terrain. Terrain means the ground, or ground +/// floor inside a building with VPS coverage. For areas not covered by VPS, +/// consider using @c ::ArEarth_acquireNewAnchor to attach anchors to Earth. +/// +/// The specified altitude is interpreted to be relative to the Earth's terrain +/// (or floor) at the specified latitude/longitude geodetic coordinates, rather +/// than relative to the WGS-84 ellipsoid. Specifying an altitude of 0 will +/// position the anchor directly on the terrain (or floor) whereas specifying a +/// positive altitude will position the anchor above the terrain (or floor), +/// against the direction of gravity. +/// +/// This creates a new @c ::ArAnchor and schedules a task to resolve the +/// anchor's pose using the given parameters. You may resolve multiple anchors +/// at a time, but a session cannot be tracking more than 100 Terrain Anchors at +/// time. Attempting to resolve more than 100 Terrain Anchors will result in +/// resolve calls returning status @c #AR_ERROR_RESOURCE_EXHAUSTED. +/// +/// If this function returns @c #AR_SUCCESS, the terrain anchor state of @p +/// out_terrain_anchor will be @c #AR_TERRAIN_ANCHOR_STATE_TASK_IN_PROGRESS, and +/// its tracking state will be @c #AR_TRACKING_STATE_PAUSED. This anchor +/// remains in this state until its pose has been successfully resolved. If +/// the resolving task results in an error, the tracking state will be set to @c +/// #AR_TRACKING_STATE_STOPPED. If the return value is not @c #AR_SUCCESS, then +/// @p out_cloud_anchor will be set to @c NULL. +/// +/// Creating a terrain anchor requires an active @c ::ArEarth for which the @c +/// ::ArEarthState is @c #AR_EARTH_STATE_ENABLED and @c ::ArTrackingState is @c +/// #AR_TRACKING_STATE_TRACKING. If it is not, then this function returns @c +/// #AR_ERROR_ILLEGAL_STATE. This call also requires a working internet +/// connection to communicate with the ARCore API on Google Cloud. ARCore will +/// continue to retry if it is unable to establish a connection to the ARCore +/// service. +/// +/// Latitude and longitude are defined by the +/// WGS84 +/// specification. +/// +/// The rotation provided by @p eus_quaternion_4 is a rotation with respect to +/// an east-up-south coordinate frame. An identity rotation will have the anchor +/// oriented such that X+ points to the east, Y+ points up away from the center +/// of the earth, and Z+ points to the south. +/// +/// To create an anchor that has the +Z axis pointing in the same direction as +/// heading obtained from @c ::ArGeospatialPose, use the following formula: +/// +/// \code +/// {qx, qy, qz, qw} = {0, sin((pi - heading * M_PI / 180.0) / 2), 0, cos((pi - +/// heading * M_PI / 180.0) / 2)}}. +/// \endcode +/// +/// @param[in] session The ARCore session. +/// @param[in] earth The @c ::ArEarth handle. +/// @param[in] latitude The latitude of the anchor relative to the +/// WGS-84 ellipsoid. +/// @param[in] longitude The longitude of the anchor relative to the +/// WGS-84 ellipsoid. +/// @param[in] altitude_above_terrain The altitude of the anchor above the +/// Earth's terrain (or floor). +/// @param[in] eus_quaternion_4 The rotation quaternion as {qx, qy, qx, qw}. +/// @param[out] out_anchor The newly-created anchor. +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_ILLEGAL_STATE if ::ArEarthState is not +/// AR_EARTH_STATE_ENABLED. +/// - @c #AR_ERROR_INVALID_ARGUMENT if @p latitude is outside the allowable +/// range, or if either @p session, @p earth, or @p eus_quaternion_4 is @c +/// NULL. +/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if too many terrain anchors are currently +/// held. +ArStatus ArEarth_resolveAndAcquireNewAnchorOnTerrain( + ArSession *session, + ArEarth *earth, + double latitude, + double longitude, + double altitude_above_terrain, + const float *eus_quaternion_4, + ArAnchor **out_anchor); + +/// @ingroup ArAnchor +/// Describes the current Terrain Anchor state of an @c ::ArAnchor. Obtained by +/// @c ::ArAnchor_getTerrainAnchorState. +AR_DEFINE_ENUM(ArTerrainAnchorState){ + /// This is not a Terrain Anchor, or the Terrain Anchor has become invalid + /// due to @c ::ArEarth having @c #AR_TRACKING_STATE_STOPPED + /// due to @c #AR_GEOSPATIAL_MODE_DISABLED being set on the @c ::ArSession. + /// All Terrain Anchors transition to @c #AR_TERRAIN_ANCHOR_STATE_NONE + /// when @c #AR_GEOSPATIAL_MODE_DISABLED becomes active on the @c + /// ::ArSession. + AR_TERRAIN_ANCHOR_STATE_NONE = 0, + + /// Resolving the Terrain Anchor is in progress. Once the task completes in + /// the background, the anchor will get a new state after the next @c + /// ::ArSession_update call. + AR_TERRAIN_ANCHOR_STATE_TASK_IN_PROGRESS = 1, + + /// A resolving task for this anchor has been successfully resolved. + AR_TERRAIN_ANCHOR_STATE_SUCCESS = 2, + + /// Resolving task for this anchor finished with an internal + /// error. The app should not attempt to recover from this error. + AR_TERRAIN_ANCHOR_STATE_ERROR_INTERNAL = -1, + + /// The authorization provided by the application is not valid. + /// - The Google Cloud project may not have enabled the ARCore API. + /// - When using API key authentication, this will happen if the API key in + /// the manifest is invalid or unauthorized. It may also fail if the API + /// key is restricted to a set of apps not including the current one. + /// - When using keyless authentication, this may happen when no OAuth + /// client has been created, or when the signing key and package name + /// combination does not match the values used in the Google Cloud + /// project. It may also fail if Google Play Services isn't installed, + /// is too old, or is malfunctioning for some reason (e.g. killed + /// due to memory pressure). + AR_TERRAIN_ANCHOR_STATE_ERROR_NOT_AUTHORIZED = -2, + + /// There is no terrain info at this location, such as the center of the + /// ocean. + AR_TERRAIN_ANCHOR_STATE_ERROR_UNSUPPORTED_LOCATION = -3, +}; + +/// @ingroup ArAnchor +/// Gets the current Terrain Anchor state of the anchor. This state is +/// guaranteed not to change until @c ::ArSession_update is called. +/// +/// @param[in] session The ARCore session. +/// @param[in] anchor The anchor to retrieve the terrain anchor state of. +/// @param[inout] out_state The current terrain anchor state of the anchor. +/// Non-terrain anchors will always be in +/// @c #AR_TERRAIN_ANCHOR_STATE_NONE state. +void ArAnchor_getTerrainAnchorState(const ArSession *session, + const ArAnchor *anchor, + ArTerrainAnchorState *out_state); + +/// @ingroup ArVpsAvailabilityFuture +/// The result of @c ::ArSession_checkVpsAvailabilityAsync, obtained by @c +/// ::ArVpsAvailabilityFuture_getResult or from an invocation of an @c +/// #ArCheckVpsAvailabilityCallback. +AR_DEFINE_ENUM(ArVpsAvailability){ + /// The request to the remote service is not yet completed, so the + /// availability is not yet known. + AR_VPS_AVAILABILITY_UNKNOWN = 0, + /// VPS is available at the requested location. + AR_VPS_AVAILABILITY_AVAILABLE = 1, + /// VPS is not available at the requested location. + AR_VPS_AVAILABILITY_UNAVAILABLE = 2, + /// An internal error occurred while determining availability. + AR_VPS_AVAILABILITY_ERROR_INTERNAL = -1, + /// The external service could not be reached due to a network connection + /// error. + AR_VPS_AVAILABILITY_ERROR_NETWORK_CONNECTION = -2, + /// An authorization error occurred when communicating with the Google Cloud + /// ARCore API. See Enable + /// the Geospatial API for troubleshooting steps. + AR_VPS_AVAILABILITY_ERROR_NOT_AUTHORIZED = -3, + /// Too many requests were sent. + AR_VPS_AVAILABILITY_ERROR_RESOURCE_EXHAUSTED = -4, +}; + +/// @ingroup ArVpsAvailabilityFuture +/// Callback definition for @c ::ArSession_checkVpsAvailabilityAsync. The +/// @p context argument will be the same as that passed to +/// @c ::ArSession_checkVpsAvailabilityAsync. The @p availability argument +/// will be the same as the result obtained from the future returned by +/// @c ::ArSession_checkVpsAvailabilityAsync. +/// +/// It is a best practice to free @c context memory provided to @c +/// ::ArSession_checkVpsAvailabilityAsync at the end of the callback +/// implementation. +typedef void (*ArCheckVpsAvailabilityCallback)(void *context, + ArVpsAvailability availability); + +/// @ingroup ArVpsAvailabilityFuture +/// Handle to an asynchronous operation launched by +/// @c ::ArSession_checkVpsAvailabilityAsync. +/// Release with @c ::ArVpsAvailabilityFuture_release. +/// (@ref ownership "reference type, long-lived"). +typedef struct ArVpsAvailabilityFuture_ ArVpsAvailabilityFuture; + +/// @ingroup ArSession +/// Gets the availability of the Visual Positioning System (VPS) at a specified +/// horizontal position. The availability of VPS in a given location helps to +/// improve the quality of Geospatial localization and tracking accuracy. +/// +/// This launches an asynchronous operation used to query the Google Cloud +/// ARCore API. This may be called without first calling @c ::ArSession_resume +/// or @c ::ArSession_configure, for example to present an "Enter AR" button +/// only when VPS is available. +/// +/// The asynchronicity of this operation must be handled in one or +/// both of the following ways: +/// - The operation can be continually polled using @p out_future. When the +/// future is created, its @c #ArFutureState will be set to @c +/// #AR_FUTURE_STATE_PENDING. +/// Use @c ::ArVpsAvailabilityFuture_getState to query the state of the +/// operation. When its state is @c #AR_FUTURE_STATE_DONE, @c +/// ::ArVpsAvailabilityFuture_getResult can be used to obtain the operation's +/// result. The future must eventually be released using @c +/// ::ArVpsAvailabilityFuture_release. +/// - The operation's result can be reported via a callback. When providing a @p +/// callback, ARCore will invoke the given function when the operation is +/// complete, unless the future has been cancelled using @c +/// ::ArVpsAvailabilityFuture_cancel on @p out_future. This callback will be +/// invoked on the main +/// thread. When providing a callback, you may provide a +/// @p context, which will be passed as the first parameter to the callback. +/// It is a best practice to free the memory of @p context at the end of the +/// callback or when @c ::ArVpsAvailabilityFuture_cancel successfully cancels +/// the callback. +/// +/// Your app must be properly set up to communicate with the Google Cloud ARCore +/// API in order to obtain a result from this call. See Check +/// VPS Availability for more details on setup steps and usage examples. +/// +/// @param[in] session The ARCore session. +/// @param[in] latitude_degrees The latitude to query, in degrees. +/// @param[in] longitude_degrees The longitude to query, in degrees. +/// @param[in] context An optional void pointer which is passed as the first +/// parameter to an invocation of @p callback. The app must ensure that the +/// memory remains valid until the callback has run, or the operation has +/// been cancelled. This may be null. +/// @param[in] callback An optional callback function. When the asynchronous +/// operation is complete this callback will be invoked unless the +/// operation has been cancelled. This may be null if no callback is +/// desired, but one of @p callback and @p out_future must be non-null. +/// @param[out] out_future A optional handler that can be used to poll and +/// cancel the asynchronous operation. This argument may be null if no +/// handler is desired, but one of @p callback and @p out_future must be +/// non-null. +/// @return @c #AR_SUCCESS, or any of: +/// - @c #AR_ERROR_INTERNET_PERMISSION_NOT_GRANTED if the @c INTERNET permission +/// has not been granted. +/// - @c #AR_ERROR_INVALID_ARGUMENT if @p session is null, or both @p callback +/// and @p out_future are null. +ArStatus ArSession_checkVpsAvailabilityAsync( + ArSession *session, + double latitude_degrees, + double longitude_degrees, + void *context, + ArCheckVpsAvailabilityCallback callback, + ArVpsAvailabilityFuture **out_future); + +/// @ingroup ArVpsAvailabilityFuture +/// The state of an asynchronous operation. +AR_DEFINE_ENUM(ArFutureState){ + /// The operation is still pending. The result of the operation isn't + /// available yet and any associated callback hasn't yet been dispatched or + /// invoked. + /// + /// Do not use this to check if the operation can be cancelled as the state + /// can change from another thread between the call to + /// @c ::ArVpsAvailabilityFuture_getState and @c + /// ::ArVpsAvailabilityFuture_cancel. + AR_FUTURE_STATE_PENDING = 0, + + /// The operation has been cancelled. Any associated callback will never be + /// invoked. + AR_FUTURE_STATE_CANCELLED = 1, + + /// The operation is complete and the result is available. If a callback was + /// associated with this future, it will soon be invoked with the result on + /// the main thread, if + /// it hasn't been invoked already. + AR_FUTURE_STATE_DONE = 2, +}; + +/// @ingroup ArVpsAvailabilityFuture +/// Gets the state of an asynchronous operation. +/// +/// @param[in] session The ARCore session. +/// @param[in] future The handle for the asynchronous operation. +/// @param[out] out_state The state of the operation. +void ArVpsAvailabilityFuture_getState(const ArSession *session, + const ArVpsAvailabilityFuture *future, + ArFutureState *out_state); + +/// @ingroup ArVpsAvailabilityFuture +/// Returns the result of an asynchronous operation. The returned result is only +/// valid when @c ::ArVpsAvailabilityFuture_getState returns @c +/// #AR_FUTURE_STATE_DONE. +/// +/// @param[in] session The ARCore session. +/// @param[in] future The handle for the asynchronous operation. +/// @param[out] out_result_availability The result of the operation, if the +/// Future's state is @c #AR_FUTURE_STATE_DONE. +void ArVpsAvailabilityFuture_getResult( + const ArSession *session, + const ArVpsAvailabilityFuture *future, + ArVpsAvailability *out_result_availability); + +/// @ingroup ArVpsAvailabilityFuture +/// Tries to cancel execution of this operation. @p out_was_cancelled will be +/// set to 1 if the operation was cancelled by this invocation, and in that case +/// it is a best practice to free @c context memory provided to @c +/// ::ArSession_checkVpsAvailabilityAsync. +/// +/// @param[in] session The ARCore session. +/// @param[in] future The handle for the asynchronous operation. +/// @param[out] out_was_cancelled Set to 1 if this invocation successfully +/// cancelled the operation, 0 otherwise. This may be null. +void ArVpsAvailabilityFuture_cancel(const ArSession *session, + ArVpsAvailabilityFuture *future, + int32_t *out_was_cancelled); + +/// @ingroup ArVpsAvailabilityFuture +/// Releases a reference to a future. This does not mean that the operation will +/// be terminated - see @c ::ArVpsAvailabilityFuture_cancel. +/// +/// This function may safely be called with @c NULL - it will do nothing. +void ArVpsAvailabilityFuture_release(ArVpsAvailabilityFuture *future); + +// === ArGeospatialPose functions === + +/// @ingroup ArGeospatialPose +/// Allocates and initializes a new instance. This function may be used in cases +/// where an instance of this type needs to be created to receive a pose. +/// It must be destroyed with @c ::ArGeospatialPose_destroy after use. +// +/// @param[in] session an @c ::ArSession instance. +/// @param[out] out_pose the new pose. +void ArGeospatialPose_create(const ArSession *session, + ArGeospatialPose **out_pose); + +/// @ingroup ArGeospatialPose +/// Releases memory used by the given @p pose object. +/// +/// @param[in] pose the pose to destroy. +void ArGeospatialPose_destroy(ArGeospatialPose *pose); + +/// @ingroup ArGeospatialPose +/// Gets the @c ::ArGeospatialPose's latitude and longitude in degrees, with +/// positive values being north of the equator and east of the prime meridian, +/// as defined by the WGS84 +/// specification. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_pose The geospatial pose. +/// @param[out] out_latitude_degrees The latitude of the pose in degrees. +/// @param[out] out_longitude_degrees The longitude of the pose in degrees. +void ArGeospatialPose_getLatitudeLongitude( + const ArSession *session, + const ArGeospatialPose *geospatial_pose, + double *out_latitude_degrees, + double *out_longitude_degrees); + +/// @ingroup ArGeospatialPose +/// Gets the @c ::ArGeospatialPose's estimated horizontal accuracy in meters +/// with respect to latitude and longitude. +/// +/// We define horizontal accuracy as the radius of the 68th percentile +/// confidence level around the estimated horizontal location. In other words, +/// if you draw a circle centered at this @c ::ArGeospatialPose's latitude and +/// longitude, and with a radius equal to the horizontal accuracy, then there is +/// a 68% probability that the true location is inside the circle. Larger +/// numbers indicate lower accuracy. +/// +/// For example, if the latitude is 10, longitude is 10, and @p +/// out_horizontal_accuracy_meters is 15, then there is a 68% probability that +/// the true location is within 15 meters of the (10°, 10°) latitude/longitude +/// coordinate. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_pose The geospatial pose. +/// @param[out] out_horizontal_accuracy_meters The estimated horizontal +/// accuracy of this @c ::ArGeospatialPose, radial, in meters. +void ArGeospatialPose_getHorizontalAccuracy( + const ArSession *session, + const ArGeospatialPose *geospatial_pose, + double *out_horizontal_accuracy_meters); + +/// @ingroup ArGeospatialPose +/// Gets the @c ::ArGeospatialPose's altitude in meters as elevation above the +/// WGS84 +/// ellipsoid. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_pose The Geospatial pose. +/// @param[out] out_altitude_meters The altitude of the pose in meters +/// above the WGS84 ellipsoid. +void ArGeospatialPose_getAltitude(const ArSession *session, + const ArGeospatialPose *geospatial_pose, + double *out_altitude_meters); + +/// @ingroup ArGeospatialPose +/// Gets the @c ::ArGeospatialPose's estimated altitude accuracy. +/// +/// We define vertical accuracy as the radius of the 68th percentile confidence +/// level around the estimated altitude. In other words, there is a 68% +/// probability that the true altitude is within @p out_vertical_accuracy_meters +/// of this @c ::ArGeospatialPose's altitude (above or below). Larger numbers +/// indicate lower accuracy. +/// +/// For example, if this @c ::ArGeospatialPose's +/// altitude is 100 meters, and @p out_vertical_accuracy_meters is 20 meters, +/// there is a 68% chance that the true altitude is within 20 meters of 100 +/// meters. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_pose The Geospatial pose. +/// @param[out] out_vertical_accuracy_meters The estimated vertical accuracy in +/// meters. +void ArGeospatialPose_getVerticalAccuracy( + const ArSession *session, + const ArGeospatialPose *geospatial_pose, + double *out_vertical_accuracy_meters); + +/// @ingroup ArGeospatialPose +/// Gets the @c ::ArGeospatialPose's heading. +/// +/// This function will return values for @c ::ArGeospatialPose's +/// from ArEarth_getCameraGeospatialPose() and returns 0 for all other @c +/// ::ArGeospatialPose objects. +/// +/// Heading is specified in degrees clockwise from true north and approximates +/// the direction the device is facing. The value returned when facing north is +/// 0°, when facing east is 90°, when facing south is +/-180°, and when facing +/// west is -90°. +/// +/// The heading approximation is based on the rotation of the device in its +/// current orientation mode (i.e., portrait or landscape) and pitch. For +/// example, when the device is held vertically or upright, the heading is based +/// on the camera optical axis. If the device is held horizontally, looking +/// downwards, the heading is based on the top of the device, with respect to +/// the orientation mode. +/// +/// Note: Heading is currently only supported in the device's default +/// orientation mode, which is portrait mode for most supported devices. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_pose The Geospatial pose. +/// @param[out] out_heading_degrees The heading component of this pose's +/// orientation in [-180.0, 180.0] degree range. +void ArGeospatialPose_getHeading(const ArSession *session, + const ArGeospatialPose *geospatial_pose, + double *out_heading_degrees); + +/// @ingroup ArGeospatialPose +/// Gets the @c ::ArGeospatialPose's estimated heading accuracy. +/// +/// We define heading accuracy as the estimated radius of the 68th percentile +/// confidence level around @c ::ArGeospatialPose_getHeading. In other words, +/// there is a 68% probability that the true heading is within @p +/// out_heading_accuracy_degrees of this @c ::ArGeospatialPose's heading. Larger +/// numbers indicate lower accuracy. +/// +/// For example, if the estimated heading is 60°, and @p +/// out_heading_accuracy_degrees is 10°, then there is a 68% probability of the +/// true heading being between 50° and 70°. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_pose The geospatial pose. +/// @param[out] out_heading_accuracy_degrees The accuracy of the heading +/// confidence in degrees. +void ArGeospatialPose_getHeadingAccuracy( + const ArSession *session, + const ArGeospatialPose *geospatial_pose, + double *out_heading_accuracy_degrees); + +/// @ingroup ArGeospatialPose +/// Extracts the orientation from an Geospatial pose. It represents rotation of +/// the target with respect to the east-up-south coordinates. That is, X+ points +/// east, Y+ points up, and Z+ points south. Right handed coordinate system. +/// +/// @param[in] session The ARCore session. +/// @param[in] geospatial_pose The geospatial pose. +/// @param[out] out_quaternion_4 A pointer of 4 float values, which will store +/// the quaternion values as [x, y, z, w]. +void ArGeospatialPose_getEastUpSouthQuaternion( + const ArSession *session, + const ArGeospatialPose *geospatial_pose, + float *out_quaternion_4); + +/// @ingroup ArImageMetadata +/// Defines a rational data type in @c ::ArImageMetadata_const_entry. +/// +/// Struct matches @c ACameraMetadata_rational in Android NDK r21. +typedef struct ArImageMetadata_rational { + /// Numerator in the rational data type of this metadata entry. + int32_t numerator; + /// Denominator in the rational data type of this metadata entry. + int32_t denominator; +} ArImageMetadata_rational; + +/// @ingroup ArImageMetadata +/// Defines a single read-only image metadata entry. +/// +/// Struct matches @c ACameraMetadata_const_entry in Android NDK r21. +typedef struct ArImageMetadata_const_entry { + /// The tag identifying the entry. + uint32_t tag; + /// The data type of this metadata entry. Determines which data pointer in the + /// @c union below is valid. + uint8_t type; + /// Count of elements (NOT count of bytes) in this metadata entry. + uint32_t count; + + /// Pointers to the data held in this metadata entry. + /// + /// The field @c type defines which union member pointer is valid. + union { + /// Pointer to data of single byte or the first element of the byte array. + const uint8_t *u8; + /// Pointer to data of single 32-bit int or the first element of the 32-bit + /// int array. + const int32_t *i32; + /// Pointer to data of single 32-bit float or the first element of the + /// 32-bit float array. + const float *f; + /// Pointer to data of single 64-bit int or the first element of the 64-bit + /// int array. + const int64_t *i64; + /// Pointer to data of single double or the first element of the double + /// array. + const double *d; + /// Pointer to data of single @c ::ArImageMetadata_rational or the first + /// element of the @c ::ArImageMetadata_rational array. + const ArImageMetadata_rational *r; + } data; +} ArImageMetadata_const_entry; + +/// @ingroup ArImageMetadata +/// Retrieves the list of the supported image metadata tags that can be queried +/// for their value. +/// +/// The @p out_tags list remains valid until @p image_metadata is released via +/// @c ::ArImageMetadata_release. +/// +/// @param[in] session The ARCore session. +/// @param[in] image_metadata @c ::ArImageMetadata struct obtained from +/// @c ::ArFrame_acquireImageMetadata. +/// @param[out] out_number_of_tags Number of metadata tags returned in the +/// list. +/// @param[out] out_tags The data pointer to the beginning of the +/// list of @c uint32_t tags. +// TODO(b/161001774) Finalize documentation +void ArImageMetadata_getAllKeys(const ArSession *session, + const ArImageMetadata *image_metadata, + int32_t *out_number_of_tags, + const uint32_t **out_tags); + +/// @ingroup ArImageMetadata +/// Get a metadata entry for the provided @c ::ArImageMetadata and tag. +/// +/// The returned @p out_metadata_entry remains valid until the provided @p +/// image_metadata is released via @c ::ArFrame_acquireImageMetadata. +/// +/// @param[in] session The ARCore session. +/// @param[in] image_metadata @c ::ArImageMetadata struct obtained from +/// @c ::ArFrame_acquireImageMetadata. +/// @param[in] tag The desired @c uint32_t metadata tag to be +/// retrieved from the provided @c ::ArImageMetadata struct. +/// @param[out] out_metadata_entry The @c ::ArImageMetadata_const_entry struct +/// to which the metadata tag data should be written to, updated only when +/// function returns @c #AR_SUCCESS. +/// +/// @return @c #AR_SUCCESS or any of: +/// - @c #AR_ERROR_INVALID_ARGUMENT - if either @p session, @p image_metadata or +/// @p out_metadata_entry is null. +/// - @c #AR_ERROR_METADATA_NOT_FOUND - if @p image_metadata does not contain an +/// entry of the @p tag value. +// TODO(b/161001774) Finalize documentation +ArStatus ArImageMetadata_getConstEntry( + const ArSession *session, + const ArImageMetadata *image_metadata, + uint32_t tag, + ArImageMetadata_const_entry *out_metadata_entry); + #undef AR_DEFINE_ENUM #ifdef __cplusplus } -#endif +#endif // __cplusplus #endif // ARCORE_C_API_H_ diff --git a/augmentedreality/Common/3rdparty/arcore/libs/jni/arm64-v8a/libarcore_sdk_c.so b/augmentedreality/Common/3rdparty/arcore/libs/jni/arm64-v8a/libarcore_sdk_c.so index 38e23962e..f2ff4507a 100644 Binary files a/augmentedreality/Common/3rdparty/arcore/libs/jni/arm64-v8a/libarcore_sdk_c.so and b/augmentedreality/Common/3rdparty/arcore/libs/jni/arm64-v8a/libarcore_sdk_c.so differ diff --git a/augmentedreality/Common/3rdparty/arcore/libs/jni/arm64-v8a/libarcore_sdk_jni.so b/augmentedreality/Common/3rdparty/arcore/libs/jni/arm64-v8a/libarcore_sdk_jni.so deleted file mode 100644 index 30b975f23..000000000 Binary files a/augmentedreality/Common/3rdparty/arcore/libs/jni/arm64-v8a/libarcore_sdk_jni.so and /dev/null differ diff --git a/augmentedreality/Common/AR.pri b/augmentedreality/Common/AR.pri index 9daf935d1..8f31173d4 100644 --- a/augmentedreality/Common/AR.pri +++ b/augmentedreality/Common/AR.pri @@ -37,7 +37,6 @@ HEADERS += \ SOURCES += \ $$AR_COMMON_SOURCE_PATH/ArcGISArViewInterface.cpp \ $$AR_COMMON_SOURCE_PATH/ArcGISArViewRenderer.cpp \ - $$AR_COMMON_SOURCE_PATH/ArEnums.cpp \ $$AR_COMMON_SOURCE_PATH/ArWrapper.cpp \ $$AR_COMMON_SOURCE_PATH/LocationDataSource.cpp @@ -79,7 +78,7 @@ ios { # Android configuration android { - QT += androidextras + QT += core HEADERS += \ $$AR_COMMON_INCLUDE_PATH/Android/ArCoreWrapper.h \ @@ -108,13 +107,12 @@ android { INCLUDEPATH += $$AR_CORE_INCLUDE_PATH DEPENDPATH += $$AR_CORE_INCLUDE_PATH - LIBS += -larcore_sdk_c -larcore_sdk_jni + LIBS += -larcore_sdk_c # libs foreach platforms contains(ANDROID_TARGET_ARCH, arm64-v8a) { LIBS += -L"$$AR_CORE_LIBS_PATH/jni/arm64-v8a" ANDROID_EXTRA_LIBS += \ - "$$AR_CORE_LIBS_PATH/jni/arm64-v8a/libarcore_sdk_c.so" \ - "$$AR_CORE_LIBS_PATH/jni/arm64-v8a/libarcore_sdk_jni.so" + "$$AR_CORE_LIBS_PATH/jni/arm64-v8a/libarcore_sdk_c.so" } } diff --git a/augmentedreality/Common/include/Android/ArCoreFrameRenderer.h b/augmentedreality/Common/include/Android/ArCoreFrameRenderer.h index 78d8fab0b..b110072ec 100644 --- a/augmentedreality/Common/include/Android/ArCoreFrameRenderer.h +++ b/augmentedreality/Common/include/Android/ArCoreFrameRenderer.h @@ -20,10 +20,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArCoreWrapper; @@ -48,9 +45,6 @@ class ArCoreFrameRenderer : public QOpenGLFunctions GLuint m_attributeUvs = 0; }; -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ArCoreFrameRenderer_H diff --git a/augmentedreality/Common/include/Android/ArCorePlaneRenderer.h b/augmentedreality/Common/include/Android/ArCorePlaneRenderer.h index 28e55bcb4..d7dd991ad 100644 --- a/augmentedreality/Common/include/Android/ArCorePlaneRenderer.h +++ b/augmentedreality/Common/include/Android/ArCorePlaneRenderer.h @@ -21,10 +21,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArCoreWrapper; @@ -56,9 +53,6 @@ class ArCorePlaneRenderer : public QOpenGLFunctions QColor m_planeColor = QColor(255, 0, 0, 10); }; -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ArCorePlaneRenderer_H diff --git a/augmentedreality/Common/include/Android/ArCorePointCloudRenderer.h b/augmentedreality/Common/include/Android/ArCorePointCloudRenderer.h index 7fa2636c0..f59bbefc4 100644 --- a/augmentedreality/Common/include/Android/ArCorePointCloudRenderer.h +++ b/augmentedreality/Common/include/Android/ArCorePointCloudRenderer.h @@ -21,10 +21,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArCoreWrapper; @@ -61,9 +58,6 @@ class ArCorePointCloudRenderer : public QOpenGLFunctions int m_pointCloudSize = 10; }; -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ArCorePointCloudRenderer_H diff --git a/augmentedreality/Common/include/Android/ArCoreWrapper.h b/augmentedreality/Common/include/Android/ArCoreWrapper.h index 4c7a60e74..d6b4dc3ba 100644 --- a/augmentedreality/Common/include/Android/ArCoreWrapper.h +++ b/augmentedreality/Common/include/Android/ArCoreWrapper.h @@ -17,7 +17,7 @@ #ifndef ArCoreWrapper_H #define ArCoreWrapper_H -#include +#include #include #include #include @@ -32,9 +32,7 @@ using ArTrackableList = struct ArTrackableList_; using ArTrackable = struct ArTrackable_; using ArPointCloud = struct ArPointCloud_; -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class ArcGISArViewInterface; @@ -103,7 +101,6 @@ class ArCoreWrapper Q_DISABLE_COPY(ArCoreWrapper) JNIEnv* jniEnvironment(); - jobject applicationActivity(); bool installArCore(); void createArSession(); @@ -115,9 +112,7 @@ class ArCoreWrapper ArcGISArViewInterface* m_arcGISArView = nullptr; - QAndroidJniEnvironment m_jniEnvironment; - - jobject m_applicationActivity = nullptr; + QJniEnvironment m_jniEnvironment; std::unique_ptr m_arCoreFrameRenderer; std::unique_ptr m_arCorePlaneRenderer; @@ -164,8 +159,6 @@ class ArCoreWrapper }; } // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit #endif // ArCoreWrapper_H diff --git a/augmentedreality/Common/include/ArEnums.h b/augmentedreality/Common/include/ArEnums.h index 557aecaea..1c70b2a89 100644 --- a/augmentedreality/Common/include/ArEnums.h +++ b/augmentedreality/Common/include/ArEnums.h @@ -19,22 +19,17 @@ #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { - -class ArEnums +namespace Esri::ArcGISRuntime::Toolkit::ArEnums { - Q_GADGET + Q_NAMESPACE -public: enum class LocationTrackingMode { Ignore = 0, Initial = 1, Continuous = 2 }; - Q_ENUM(LocationTrackingMode) + Q_ENUM_NS(LocationTrackingMode) enum class SensorStatus { @@ -42,14 +37,8 @@ class ArEnums Starting = 1, Started = 2 }; - Q_ENUM(SensorStatus) - - ArEnums(); - ~ArEnums(); -}; + Q_ENUM_NS(SensorStatus) -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::ArEnums #endif // ArEnums_H diff --git a/augmentedreality/Common/include/ArWrapper.h b/augmentedreality/Common/include/ArWrapper.h index bd34b9f1f..5453e32bc 100644 --- a/augmentedreality/Common/include/ArWrapper.h +++ b/augmentedreality/Common/include/ArWrapper.h @@ -28,10 +28,7 @@ #include "ArCoreWrapper.h" #endif -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArcGISArView; @@ -83,9 +80,6 @@ class ArWrapper #endif -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ARWRAPPER_H diff --git a/augmentedreality/Common/include/ArcGISArViewInterface.h b/augmentedreality/Common/include/ArcGISArViewInterface.h index 66b8f7feb..b02a3590f 100644 --- a/augmentedreality/Common/include/ArcGISArViewInterface.h +++ b/augmentedreality/Common/include/ArcGISArViewInterface.h @@ -23,9 +23,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace Internal { class ArWrapper; @@ -125,7 +123,7 @@ class ArcGISArViewInterface : public QQuickFramebufferObject virtual void renderFrameInternal() = 0; protected: - void geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry) override; + void geometryChange(const QRectF& newGeometry, const QRectF& oldGeometry) override; // internals, used by AR view derived classes std::array hitTestInternal(int x, int y) const; @@ -154,8 +152,6 @@ class ArcGISArViewInterface : public QQuickFramebufferObject QMetaObject::Connection m_headingChangedConnection; }; -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit #endif // ArcGISArViewInterface_H diff --git a/augmentedreality/Common/include/ArcGISArViewRenderer.h b/augmentedreality/Common/include/ArcGISArViewRenderer.h index dbc98204d..d62fa5580 100644 --- a/augmentedreality/Common/include/ArcGISArViewRenderer.h +++ b/augmentedreality/Common/include/ArcGISArViewRenderer.h @@ -21,10 +21,7 @@ class QQuickWindow; -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArWrapper; @@ -45,9 +42,6 @@ class ArcGISArViewRenderer : public QQuickFramebufferObject::Renderer Internal::ArWrapper* m_arWrapper = nullptr; }; -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ArcGISArViewRenderer_H diff --git a/augmentedreality/Common/include/LocationDataSource.h b/augmentedreality/Common/include/LocationDataSource.h index fc510dfed..e1a4571ce 100644 --- a/augmentedreality/Common/include/LocationDataSource.h +++ b/augmentedreality/Common/include/LocationDataSource.h @@ -20,12 +20,13 @@ #include #include "ArEnums.h" -class QGeoPositionInfoSource; class QCompass; +class QGeoPositionInfoSource; + +Q_MOC_INCLUDE(QCompass) +Q_MOC_INCLUDE("QGeoPositionInfoSource") -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class LocationDataSource : public QObject { @@ -90,8 +91,6 @@ class LocationDataSource : public QObject ArEnums::LocationTrackingMode m_locationTrackingMode = ArEnums::LocationTrackingMode::Initial; }; -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit #endif // LocationDataSource_H diff --git a/augmentedreality/Common/include/iOS/ArKitFrameRenderer.h b/augmentedreality/Common/include/iOS/ArKitFrameRenderer.h index e9aa50390..2435e4a57 100644 --- a/augmentedreality/Common/include/iOS/ArKitFrameRenderer.h +++ b/augmentedreality/Common/include/iOS/ArKitFrameRenderer.h @@ -22,10 +22,7 @@ class QOpenGLShaderProgram; -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArKitFrameRenderer : public QOpenGLFunctions { @@ -58,9 +55,6 @@ class ArKitFrameRenderer : public QOpenGLFunctions QOpenGLTexture m_textureCbCr; }; -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ArKitFrameRenderer_H diff --git a/augmentedreality/Common/include/iOS/ArKitPlaneRenderer.h b/augmentedreality/Common/include/iOS/ArKitPlaneRenderer.h index 65f6e30d3..0cf7f87d2 100644 --- a/augmentedreality/Common/include/iOS/ArKitPlaneRenderer.h +++ b/augmentedreality/Common/include/iOS/ArKitPlaneRenderer.h @@ -19,10 +19,7 @@ #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArKitWrapper; @@ -39,9 +36,6 @@ class ArKitPlaneRenderer : public QOpenGLFunctions ArKitWrapper* m_arKitWrapper = nullptr; }; -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ArKitPlaneRenderer_H diff --git a/augmentedreality/Common/include/iOS/ArKitPointCloudRenderer.h b/augmentedreality/Common/include/iOS/ArKitPointCloudRenderer.h index d4e292969..aada26a9a 100644 --- a/augmentedreality/Common/include/iOS/ArKitPointCloudRenderer.h +++ b/augmentedreality/Common/include/iOS/ArKitPointCloudRenderer.h @@ -23,10 +23,7 @@ class QOpenGLShaderProgram; -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace Internal { +namespace Esri::ArcGISRuntime::Toolkit::Internal { class ArKitWrapper; @@ -57,9 +54,6 @@ class ArKitPointCloudRenderer : public QOpenGLFunctions int m_pointCloudSize = 10; }; -} // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::Internal #endif // ArKitPointCloudRenderer_H diff --git a/augmentedreality/Common/include/iOS/ArKitUtils.h b/augmentedreality/Common/include/iOS/ArKitUtils.h index 4db9ca90c..fcf2192c4 100644 --- a/augmentedreality/Common/include/iOS/ArKitUtils.h +++ b/augmentedreality/Common/include/iOS/ArKitUtils.h @@ -17,10 +17,7 @@ #import #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { -namespace ArKitUtils { +namespace Esri::ArcGISRuntime::Toolkit::ArKitUtils { QString worldMappingStatusToString(ARWorldMappingStatus status) { @@ -196,7 +193,4 @@ QString arErrorCodeToDescription(ARErrorCode errorCode) } } -} // ArKitUtils namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit::ArKitUtils diff --git a/augmentedreality/Common/include/iOS/ArKitWrapper.h b/augmentedreality/Common/include/iOS/ArKitWrapper.h index eb7f6fb0a..fbb42ca42 100644 --- a/augmentedreality/Common/include/iOS/ArKitWrapper.h +++ b/augmentedreality/Common/include/iOS/ArKitWrapper.h @@ -21,9 +21,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class ArcGISArViewInterface; @@ -92,8 +90,6 @@ class ArKitWrapper }; } // Internal namespace -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit #endif // ArKitWrapper_H diff --git a/augmentedreality/Common/qml/CalibrationSlider.qml b/augmentedreality/Common/qml/CalibrationSlider.qml index 6fdd4d507..a87a15679 100644 --- a/augmentedreality/Common/qml/CalibrationSlider.qml +++ b/augmentedreality/Common/qml/CalibrationSlider.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.2 +import QtQuick +import QtQuick.Controls Item { id: root diff --git a/augmentedreality/Common/qml/CalibrationView.qml b/augmentedreality/Common/qml/CalibrationView.qml index 61596be15..8a9364dd0 100644 --- a/augmentedreality/Common/qml/CalibrationView.qml +++ b/augmentedreality/Common/qml/CalibrationView.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.2 +import QtQuick +import QtQuick.Controls /*! \qmltype CalibrationView diff --git a/augmentedreality/Common/qml/ClippingView.qml b/augmentedreality/Common/qml/ClippingView.qml index 67d279536..3aac643f4 100644 --- a/augmentedreality/Common/qml/ClippingView.qml +++ b/augmentedreality/Common/qml/ClippingView.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.2 +import QtQuick +import QtQuick.Controls /*! \qmltype ClippingView diff --git a/augmentedreality/Common/source/Android/ArCoreWrapper.cpp b/augmentedreality/Common/source/Android/ArCoreWrapper.cpp index 566c62ac9..5ead95987 100644 --- a/augmentedreality/Common/source/Android/ArCoreWrapper.cpp +++ b/augmentedreality/Common/source/Android/ArCoreWrapper.cpp @@ -24,13 +24,15 @@ #include "arcore_c_api.h" // Qt headers -#include +#include #include #include // C++ headers #include +#include + using namespace Esri::ArcGISRuntime; using namespace Esri::ArcGISRuntime::Toolkit::Internal; @@ -243,20 +245,7 @@ void ArCoreWrapper::render() */ JNIEnv* ArCoreWrapper::jniEnvironment() { - return m_jniEnvironment; -} - -/*! - \internal - the jobject referencing the application's current Android Activity. - */ -jobject ArCoreWrapper::applicationActivity() -{ - // note: AR run in different thread, must to create local reference to avoid deleted object. - if (!m_applicationActivity) - m_applicationActivity = jniEnvironment()->NewLocalRef(QtAndroid::androidActivity().object()); - - return m_applicationActivity; + return m_jniEnvironment.jniEnv(); } /*! @@ -269,7 +258,7 @@ bool ArCoreWrapper::installArCore() return true; ArInstallStatus installStatus; - ArStatus error = ArCoreApk_requestInstall(jniEnvironment(), applicationActivity(), m_installRequested, &installStatus); + ArStatus error = ArCoreApk_requestInstall(jniEnvironment(), QNativeInterface::QAndroidApplication::context(), m_installRequested, &installStatus); if (error != AR_SUCCESS) return false; @@ -296,24 +285,31 @@ void ArCoreWrapper::createArSession() if (m_arSession) return; + // request camera permission + auto checkPermissionResultFuture = QtAndroidPrivate::checkPermission(QtAndroidPrivate::PermissionType::Camera); + checkPermissionResultFuture.waitForFinished(); + const auto checkPermissionResult = checkPermissionResultFuture.result(); + if (checkPermissionResult != QtAndroidPrivate::PermissionResult::Authorized) + { + auto requestPermissionResultFuture = QtAndroidPrivate::requestPermission(QtAndroidPrivate::PermissionType::Camera); + requestPermissionResultFuture.waitForFinished(); + const auto requestPermissionResult = requestPermissionResultFuture.result(); + if (requestPermissionResult != QtAndroidPrivate::PermissionResult::Authorized) + { + emit m_arcGISArView->errorOccurred("ARCore failure", "Failed to access to the camera."); + return; + } + } + // try to create the ARCore session. This function can fail if the user reject the authorization // to install ARCore. - auto status = ArSession_create(jniEnvironment(), applicationActivity(), &m_arSession); + auto status = ArSession_create(jniEnvironment(), QNativeInterface::QAndroidApplication::context(), &m_arSession); if (status != AR_SUCCESS || !m_arSession) { emit m_arcGISArView->errorOccurred("ARCore failure", "Failed to create the AR session."); return; } - // request camera permission - const QString permissionKey = QStringLiteral("android.permission.CAMERA"); - const auto permissions = QtAndroid::requestPermissionsSync({ permissionKey }, 5000); - if (permissions[permissionKey] != QtAndroid::PermissionResult::Granted) - { - emit m_arcGISArView->errorOccurred("ARCore failure", "Failed to access to the camera."); - return; - } - // create the ARCore config. ArConfig* arConfig = nullptr; ArConfig_create(m_arSession, &arConfig); diff --git a/augmentedreality/Common/source/ArcGISArViewInterface.cpp b/augmentedreality/Common/source/ArcGISArViewInterface.cpp index f84d88ae8..446e998d8 100644 --- a/augmentedreality/Common/source/ArcGISArViewInterface.cpp +++ b/augmentedreality/Common/source/ArcGISArViewInterface.cpp @@ -22,12 +22,12 @@ #include #include "ArWrapper.h" - -using namespace Esri::ArcGISRuntime::Toolkit; using namespace Esri::ArcGISRuntime::Toolkit::Internal; +namespace Esri::ArcGISRuntime::Toolkit { + /*! - \class ArcGISArViewInterface + \class Esri::ArcGISRuntime::Toolkit::ArcGISArViewInterface \ingroup ArcGISQtToolkit \ingroup ArcGISQtToolkitAR \ingroup ArcGISQtToolkitARCppApi @@ -36,7 +36,7 @@ using namespace Esri::ArcGISRuntime::Toolkit::Internal; \since Esri::ArcGISRuntime 100.6 \brief Base class to impement AR scene view. - This class provides the AR features without using the C++ or QML APIs of the ArcGIS Runtime SDK for Qt. + This class provides the AR features without using the C++ or QML APIs of the ArcGIS Maps SDK for Qt. It is used as a base class to create two API-dependent classes: \l ArcGISArSceneView which uses the C++ API and \l QmlArcGISArSceneView which uses the QML API. */ @@ -110,7 +110,7 @@ bool ArcGISArViewInterface::tracking() const } /*! - \brief Starts or stops the AR scene view tracking. + \brief Sets \a tracking to starts or stops the AR scene view tracking. */ void ArcGISArViewInterface::setTracking(bool tracking) { @@ -129,7 +129,7 @@ bool ArcGISArViewInterface::renderVideoFeed() const } /*! - \brief Sets to \c true when the scene view renders the camera frames in the background. + \brief Sets \a renderVideoFeed to \c true when the scene view renders the camera frames in the background. */ void ArcGISArViewInterface::setRenderVideoFeed(bool renderVideoFeed) { @@ -153,7 +153,7 @@ double ArcGISArViewInterface::translationFactor() const } /*! - \brief The translation factor used to support a table top AR experience. + \brief The \a translationFactor used to support a table top AR experience. All the translation of the device are multiplied by this factor, to have translations in the scene view adapted to the scene zooming. @@ -355,16 +355,9 @@ void ArcGISArViewInterface::setPlaneColor(const QColor& planeColor) /*! \internal */ -void ArcGISArViewInterface::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry) +void ArcGISArViewInterface::geometryChange(const QRectF& newGeometry, const QRectF& oldGeometry) { - // enable detection of orientation changes. - if (window() && window()->screen()) - { - window()->screen()->setOrientationUpdateMask(Qt::LandscapeOrientation | Qt::PortraitOrientation | - Qt::InvertedLandscapeOrientation | Qt::InvertedPortraitOrientation); - } - - QQuickFramebufferObject::geometryChanged(newGeometry, oldGeometry); + QQuickFramebufferObject::geometryChange(newGeometry, oldGeometry); if (newGeometry.size() == oldGeometry.size()) return; @@ -404,24 +397,28 @@ std::array ArcGISArViewInterface::hitTestInternal(int x, int y) const \section1 On iOS + On iOS, the template argument must be one of the types from the following list: + \list - \li \a ARSession - The current AR session object. https://developer.apple.com/documentation/arkit/arsession?language=objc - \li \a ARConfiguration - The AR configuration object used to run the AR session. + \li ARSession - The current AR session object. https://developer.apple.com/documentation/arkit/arsession?language=objc + \li ARConfiguration - The AR configuration object used to run the AR session. https://developer.apple.com/documentation/arkit/arconfiguration?language=objc - \li \a NSObject - The session delegate which received the updates. + \li NSObject - The session delegate which received the updates. https://developer.apple.com/documentation/arkit/arsessiondelegate?language=objc \endlist \section1 On Android + On Android, the template argument must be one of the types from the following list: + \list - \li \a ArSession - The current AR session object. https://developers.google.com/ar/reference/c/group/session - \li \a ArFrame - The last received AR frame object. https://developers.google.com/ar/reference/c/group/frame - \li \a ArCamera - The last received AR camera object. https://developers.google.com/ar/reference/c/group/camera + \li ArSession - The current AR session object. https://developers.google.com/ar/reference/c/group/session + \li ArFrame - The last received AR frame object. https://developers.google.com/ar/reference/c/group/frame + \li ArCamera - The last received AR camera object. https://developers.google.com/ar/reference/c/group/camera \endlist \code - ARSession* arSession = arcGISArView->getAR(); + ArSession* arSession = arcGISArView->arRawPtr(); // ARSession on iOS and ArSession on Android if (arSession) { // use AR session @@ -450,3 +447,5 @@ ArRawPtr* ArcGISArViewInterface::arRawPtr() const \fn void ArcGISArViewInterface::trackingChanged() \brief Signal emitted when the \l tracking property changes. */ + +} // Esri::ArcGISRuntime::Toolkit namespace diff --git a/augmentedreality/Common/source/ArcGISArViewRenderer.cpp b/augmentedreality/Common/source/ArcGISArViewRenderer.cpp index 886a18eda..9690adafe 100644 --- a/augmentedreality/Common/source/ArcGISArViewRenderer.cpp +++ b/augmentedreality/Common/source/ArcGISArViewRenderer.cpp @@ -20,6 +20,8 @@ #include #include +#include + using namespace Esri::ArcGISRuntime::Toolkit::Internal; /*! @@ -74,5 +76,7 @@ void ArcGISArViewRenderer::render() m_arWrapper->render(); if (m_window) - m_window->resetOpenGLState(); + { + QQuickOpenGLUtils::resetOpenGLState(); + } } diff --git a/augmentedreality/Common/source/LocationDataSource.cpp b/augmentedreality/Common/source/LocationDataSource.cpp index 125c102af..9fab8231f 100644 --- a/augmentedreality/Common/source/LocationDataSource.cpp +++ b/augmentedreality/Common/source/LocationDataSource.cpp @@ -15,8 +15,9 @@ ******************************************************************************/ #include "LocationDataSource.h" -#include + #include +#include using namespace Esri::ArcGISRuntime::Toolkit; diff --git a/augmentedreality/CppApi/ArCppApi.pri b/augmentedreality/CppApi/ArCppApi.pri index fe4132e9a..a10e7e5f6 100644 --- a/augmentedreality/CppApi/ArCppApi.pri +++ b/augmentedreality/CppApi/ArCppApi.pri @@ -16,12 +16,14 @@ # This file is a part of the AR features provides in the toolkit. # This file must be imported in the project to use the C++ API of the -# ArcGIS Runtime SDK for Qt. See AR.md for details. +# ArcGIS Maps SDK for Qt. See AR.md for details. isEmpty(ARCGIS_TOOLKIT_PATH) { error(ARCGIS_TOOLKIT_PATH is not set) } +QT += core-private + AUGMENTED_REALITY_PATH = $$ARCGIS_TOOLKIT_PATH/augmentedreality include($$AUGMENTED_REALITY_PATH/Common/AR.pri) diff --git a/augmentedreality/CppApi/include/ArcGISArView.h b/augmentedreality/CppApi/include/ArcGISArView.h index 91b27f21f..3b8853a65 100644 --- a/augmentedreality/CppApi/include/ArcGISArView.h +++ b/augmentedreality/CppApi/include/ArcGISArView.h @@ -21,8 +21,9 @@ #include "Camera.h" #include "SceneQuickView.h" -namespace Esri { -namespace ArcGISRuntime { +Q_MOC_INCLUDE("Point.h") + +namespace Esri::ArcGISRuntime { class TransformationMatrixCameraController; @@ -104,7 +105,6 @@ class ArcGISArView : public ArcGISArViewInterface }; } // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime #endif // ArcGISArView_H diff --git a/augmentedreality/CppApi/source/ArcGISArView.cpp b/augmentedreality/CppApi/source/ArcGISArView.cpp index a904106e0..a89eb4a8c 100644 --- a/augmentedreality/CppApi/source/ArcGISArView.cpp +++ b/augmentedreality/CppApi/source/ArcGISArView.cpp @@ -15,17 +15,22 @@ ******************************************************************************/ #include "ArcGISArView.h" -#include "TransformationMatrix.h" -#include "TransformationMatrixCameraController.h" + +#include +#include +#include +#include + #include #include using namespace Esri::ArcGISRuntime; -using namespace Esri::ArcGISRuntime::Toolkit; using namespace Esri::ArcGISRuntime::Toolkit::Internal; +namespace Esri::ArcGISRuntime::Toolkit { + /*! - \class ArcGISArView + \class Esri::ArcGISRuntime::Toolkit::ArcGISArView \ingroup ArcGISQtToolkit \ingroup ArcGISQtToolkitAR \ingroup ArcGISQtToolkitARCppApi @@ -229,7 +234,7 @@ void ArcGISArView::qmlRegisterTypes() { qmlRegisterType("Esri.ArcGISArToolkit", 1, 0, "ArcGISArView"); qmlRegisterType("Esri.ArcGISArToolkit", 1, 0, "LocationDataSource"); - qmlRegisterUncreatableType("Esri.ArcGISArToolkit", 1, 0, "ArEnums", "ArEnums is not creatable."); + qmlRegisterUncreatableMetaObject(ArEnums::staticMetaObject, "Esri.ArcGISArToolkit", 1, 0, "ArEnums", "ArEnums is not creatable."); // Register enum types. qRegisterMetaType("ArEnums::LocationTrackingMode"); @@ -342,7 +347,7 @@ void ArcGISArView::resetTrackingInternal() /*! \internal - Cast from Qt's screen orientation to ArcGIS Runtime's screen orientation. + Cast from Qt's screen orientation to ArcGIS Maps SDK's screen orientation. */ DeviceOrientation ArcGISArView::toDeviceOrientation(Qt::ScreenOrientations orientation) { @@ -408,3 +413,4 @@ void ArcGISArView::updateTmccOriginCamera() const \brief Signal emitted when the \l sceneView property changes. */ +} // Esri::ArcGISRuntime::Toolkit namespace diff --git a/augmentedreality/Examples/CppArExample/Android/Android.pri b/augmentedreality/Examples/CppArExample/Android/Android.pri index 350ac599e..79635496f 100644 --- a/augmentedreality/Examples/CppArExample/Android/Android.pri +++ b/augmentedreality/Examples/CppArExample/Android/Android.pri @@ -1,5 +1,5 @@ ############################################################################### -# Copyright 2012-2019 Esri +# Copyright 2012-2022 Esri # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,8 +28,5 @@ OTHER_FILES += \ DISTFILES += \ $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.jar \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradlew \ $$ANDROID_PACKAGE_SOURCE_DIR/build.gradle \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.properties \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradlew.bat + $$ANDROID_PACKAGE_SOURCE_DIR/gradle.properties diff --git a/augmentedreality/Examples/CppArExample/Android/AndroidManifest.xml b/augmentedreality/Examples/CppArExample/Android/AndroidManifest.xml index cbbdf8f63..cf6990e87 100644 --- a/augmentedreality/Examples/CppArExample/Android/AndroidManifest.xml +++ b/augmentedreality/Examples/CppArExample/Android/AndroidManifest.xml @@ -1,86 +1,67 @@ - - - - + - - - + + + + + + + + - + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + + + diff --git a/augmentedreality/Examples/CppArExample/Android/build.gradle b/augmentedreality/Examples/CppArExample/Android/build.gradle index 3f3fa8d82..db8997662 100644 --- a/augmentedreality/Examples/CppArExample/Android/build.gradle +++ b/augmentedreality/Examples/CppArExample/Android/build.gradle @@ -1,24 +1,30 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.3' + classpath 'com.android.tools.build:gradle:7.0.2' } } repositories { google() - jcenter() + mavenCentral() } apply plugin: 'com.android.application' +// Create a configuration to mark which aars to extract .so files from +configurations { natives } + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) - implementation 'com.google.ar:core:1.11.0' + + // ARCore (Google Play Services for AR) library. + implementation 'com.google.ar:core:1.34.0' + natives 'com.google.ar:core:1.34.0' } android { @@ -26,7 +32,7 @@ android { * The following variables: * - androidBuildToolsVersion, * - androidCompileSdkVersion - * - qt5AndroidDir - holds the path to qt android files + * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. * @@ -36,23 +42,47 @@ android { *******************************************************/ compileSdkVersion androidCompileSdkVersion.toInteger() - buildToolsVersion androidBuildToolsVersion + ndkVersion androidNdkVersion + + // Extract native libraries from the APK + packagingOptions.jniLibs.useLegacyPackaging true sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] - aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] - res.srcDirs = [qt5AndroidDir + '/res', 'res'] - resources.srcDirs = ['src'] + java.srcDirs = [qtAndroidDir + '/src', 'src', 'java'] + aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl'] + res.srcDirs = [qtAndroidDir + '/res', 'res'] + resources.srcDirs = ['resources'] renderscript.srcDirs = ['src'] assets.srcDirs = ['assets'] jniLibs.srcDirs = ['libs'] } } + tasks.withType(JavaCompile) { + options.incremental = true + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + lintOptions { abortOnError false } + + // Do not compress Qt binary resources file + aaptOptions { + noCompress 'rcc' + } + + defaultConfig { + resConfig "en" + minSdkVersion qtMinSdkVersion + targetSdkVersion qtTargetSdkVersion + ndk.abiFilters = qtTargetAbiList.split(",") + } } diff --git a/augmentedreality/Examples/CppArExample/Android/gradle.properties b/augmentedreality/Examples/CppArExample/Android/gradle.properties new file mode 100644 index 000000000..37a51c273 --- /dev/null +++ b/augmentedreality/Examples/CppArExample/Android/gradle.properties @@ -0,0 +1,16 @@ +# Project-wide Gradle settings. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# Enable building projects in parallel +org.gradle.parallel=true + +# Gradle caching allows reusing the build artifacts from a previous +# build with the same inputs. However, over time, the cache size will +# grow. Uncomment the following line to enable it. +#org.gradle.caching=true + +android.useAndroidX=true diff --git a/augmentedreality/Examples/CppArExample/Android/gradlew b/augmentedreality/Examples/CppArExample/Android/gradlew deleted file mode 100755 index c59450994..000000000 --- a/augmentedreality/Examples/CppArExample/Android/gradlew +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" - -echo "========= 2 =============" diff --git a/augmentedreality/Examples/CppArExample/Android/gradlew.bat b/augmentedreality/Examples/CppArExample/Android/gradlew.bat deleted file mode 100644 index f9553162f..000000000 --- a/augmentedreality/Examples/CppArExample/Android/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/augmentedreality/Examples/CppArExample/CppArExample.cpp b/augmentedreality/Examples/CppArExample/CppArExample.cpp index 4c228b2b5..af0e170aa 100644 --- a/augmentedreality/Examples/CppArExample/CppArExample.cpp +++ b/augmentedreality/Examples/CppArExample/CppArExample.cpp @@ -16,27 +16,36 @@ #include "CppArExample.h" -#include "ArcGISTiledElevationSource.h" -#include "Basemap.h" -#include "Scene.h" -#include "SceneQuickView.h" -#include "IntegratedMeshLayer.h" -#include "ArcGISSceneLayer.h" -#include "ArcGISArView.h" -#include "GeometryEngine.h" -#include "PointCloudLayer.h" -#include "PortalItem.h" -#include "IntegratedMeshLayer.h" -#include "LocationDataSource.h" - -#include #include -#include - #include +#include +#include -#include "SimpleMarkerSceneSymbol.h" -#include "SimpleLineSymbol.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace Esri::ArcGISRuntime; using namespace Esri::ArcGISRuntime::Toolkit; @@ -105,7 +114,7 @@ void CppArExample::setSceneView(SceneQuickView* sceneView) // Ignore multi-touch events. connect(m_sceneView, &SceneQuickView::touched, this, [](QTouchEvent& touchEvent) { - if (touchEvent.touchPoints().size() != 1) + if (touchEvent.points().size() != 1) touchEvent.accept(); }); @@ -332,7 +341,7 @@ void CppArExample::onMouseClicked(QMouseEvent& event) { Q_CHECK_PTR(m_arcGISArView); - const QPoint screenPoint = event.localPos().toPoint(); + const QPoint screenPoint = event.globalPosition().toPoint(); // If "screenToLocation" mode is enabled. if (m_screenToLocationMode) diff --git a/augmentedreality/Examples/CppArExample/CppArExample.h b/augmentedreality/Examples/CppArExample/CppArExample.h index 78db531cf..ec542591f 100644 --- a/augmentedreality/Examples/CppArExample/CppArExample.h +++ b/augmentedreality/Examples/CppArExample/CppArExample.h @@ -20,13 +20,11 @@ #include #include "ArcGISArView.h" -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class Scene; class SceneQuickView; class GraphicsOverlay; -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime class CppArExample : public QObject { diff --git a/augmentedreality/Examples/CppArExample/CppArExample.pro b/augmentedreality/Examples/CppArExample/CppArExample.pro index 9af0e512d..91c19f1b2 100644 --- a/augmentedreality/Examples/CppArExample/CppArExample.pro +++ b/augmentedreality/Examples/CppArExample/CppArExample.pro @@ -17,11 +17,25 @@ TEMPLATE = app QT += core gui opengl network positioning sensors qml quick multimedia -CONFIG += c++14 + +CONFIG += c++17 TARGET = CppArExample -ARCGIS_RUNTIME_VERSION = 100.15.0 +lessThan(QT_MAJOR_VERSION, 6) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") +} + +equals(QT_MAJOR_VERSION, 6) { + lessThan(QT_MINOR_VERSION, 2) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } + equals(QT_MINOR_VERSION, 2) : lessThan(QT_PATCH_VERSION, 4) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } +} + +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/arcgisruntime.pri) HEADERS += \ diff --git a/augmentedreality/Examples/CppArExample/iOS/Info.plist b/augmentedreality/Examples/CppArExample/iOS/Info.plist index aaf5cccbf..0de19f417 100644 --- a/augmentedreality/Examples/CppArExample/iOS/Info.plist +++ b/augmentedreality/Examples/CppArExample/iOS/Info.plist @@ -65,7 +65,7 @@ CFBundleVersion 1.0 NOTE - Built with ArcGIS Runtime SDK for Qt. + Built with ArcGIS Maps SDK for Qt. UIFileSharingEnabled FALSE UIRequiresPersistentWiFi diff --git a/augmentedreality/Examples/CppArExample/main.cpp b/augmentedreality/Examples/CppArExample/main.cpp index a8b6c9dda..278ccbb39 100644 --- a/augmentedreality/Examples/CppArExample/main.cpp +++ b/augmentedreality/Examples/CppArExample/main.cpp @@ -22,15 +22,14 @@ #include "AppInfo.h" #include "CppArExample.h" -#include "ArcGISRuntimeEnvironment.h" -#include "SceneQuickView.h" - #include #include -#include +#include #include #include -#include + +#include +#include // Include the AR view from toolkit #include "ArcGISArView.h" @@ -50,6 +49,9 @@ using namespace Esri::ArcGISRuntime; int main(int argc, char *argv[]) { + // Enforce OpenGL + qputenv("QSG_RHI_BACKEND", "opengl"); + // There are some conflicts between the AR frameworks and the Qt's rendering thread. // This code enables the non-threaded render loop mode in Qt. // See SceneView::renderFrame documentation and Qt's documentation @@ -67,7 +69,6 @@ int main(int argc, char *argv[]) QSurfaceFormat::setDefaultFormat(fmt); #endif - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QCoreApplication::setApplicationName(kApplicationName); @@ -80,16 +81,14 @@ int main(int argc, char *argv[]) #endif QSettings::setDefaultFormat(kSettingsFormat); - // Before initializing ArcGIS Runtime, first set the - // ArcGIS Runtime license setting required for your application. + // Before initializing this application, first set the + // the required license setting. // ArcGISRuntimeEnvironment::setLicense("Place license string in here"); // use this code to check for initialization errors // QObject::connect(ArcGISRuntimeEnvironment::instance(), &ArcGISRuntimeEnvironment::errorOccurred, [](const Error& error){ - // QMessageBox msgBox; - // msgBox.setText(error.message); - // msgBox.exec(); + // qDebug() << error.message() << error.additionalMessage(); // }); // if (ArcGISRuntimeEnvironment::initialize() == false) diff --git a/augmentedreality/Examples/CppArExample/qml/Message.qml b/augmentedreality/Examples/CppArExample/qml/Message.qml index 200146a91..f9d40d536 100644 --- a/augmentedreality/Examples/CppArExample/qml/Message.qml +++ b/augmentedreality/Examples/CppArExample/qml/Message.qml @@ -1,6 +1,6 @@ -import QtQuick 2.6 -import QtQuick.Controls 2.2 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISArToolkit Rectangle { property alias text: label.text diff --git a/augmentedreality/Examples/CppArExample/qml/SettingsWindow.qml b/augmentedreality/Examples/CppArExample/qml/SettingsWindow.qml index b6e1f026b..f8d4ffad6 100644 --- a/augmentedreality/Examples/CppArExample/qml/SettingsWindow.qml +++ b/augmentedreality/Examples/CppArExample/qml/SettingsWindow.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.2 +import QtQuick +import QtQuick.Controls Item { id: root diff --git a/augmentedreality/Examples/CppArExample/qml/main.qml b/augmentedreality/Examples/CppArExample/qml/main.qml index 400717d53..f3c5f8b41 100644 --- a/augmentedreality/Examples/CppArExample/qml/main.qml +++ b/augmentedreality/Examples/CppArExample/qml/main.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.2 -import Esri.CppArExample 1.0 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import QtQuick.Controls +import Esri.CppArExample +import Esri.ArcGISArToolkit ApplicationWindow { visible: true diff --git a/augmentedreality/Examples/QmlArExample/Android/Android.pri b/augmentedreality/Examples/QmlArExample/Android/Android.pri index 350ac599e..79635496f 100644 --- a/augmentedreality/Examples/QmlArExample/Android/Android.pri +++ b/augmentedreality/Examples/QmlArExample/Android/Android.pri @@ -1,5 +1,5 @@ ############################################################################### -# Copyright 2012-2019 Esri +# Copyright 2012-2022 Esri # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,8 +28,5 @@ OTHER_FILES += \ DISTFILES += \ $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.jar \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradlew \ $$ANDROID_PACKAGE_SOURCE_DIR/build.gradle \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradle/wrapper/gradle-wrapper.properties \ - $$ANDROID_PACKAGE_SOURCE_DIR/gradlew.bat + $$ANDROID_PACKAGE_SOURCE_DIR/gradle.properties diff --git a/augmentedreality/Examples/QmlArExample/Android/AndroidManifest.xml b/augmentedreality/Examples/QmlArExample/Android/AndroidManifest.xml index 793f1e26b..538eb3ff4 100644 --- a/augmentedreality/Examples/QmlArExample/Android/AndroidManifest.xml +++ b/augmentedreality/Examples/QmlArExample/Android/AndroidManifest.xml @@ -1,86 +1,67 @@ - - - - + - - - + + + + + + + + - + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + + + diff --git a/augmentedreality/Examples/QmlArExample/Android/build.gradle b/augmentedreality/Examples/QmlArExample/Android/build.gradle index 3f3fa8d82..db8997662 100644 --- a/augmentedreality/Examples/QmlArExample/Android/build.gradle +++ b/augmentedreality/Examples/QmlArExample/Android/build.gradle @@ -1,24 +1,30 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.3.3' + classpath 'com.android.tools.build:gradle:7.0.2' } } repositories { google() - jcenter() + mavenCentral() } apply plugin: 'com.android.application' +// Create a configuration to mark which aars to extract .so files from +configurations { natives } + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) - implementation 'com.google.ar:core:1.11.0' + + // ARCore (Google Play Services for AR) library. + implementation 'com.google.ar:core:1.34.0' + natives 'com.google.ar:core:1.34.0' } android { @@ -26,7 +32,7 @@ android { * The following variables: * - androidBuildToolsVersion, * - androidCompileSdkVersion - * - qt5AndroidDir - holds the path to qt android files + * - qtAndroidDir - holds the path to qt android files * needed to build any Qt application * on Android. * @@ -36,23 +42,47 @@ android { *******************************************************/ compileSdkVersion androidCompileSdkVersion.toInteger() - buildToolsVersion androidBuildToolsVersion + ndkVersion androidNdkVersion + + // Extract native libraries from the APK + packagingOptions.jniLibs.useLegacyPackaging true sourceSets { main { manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] - aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] - res.srcDirs = [qt5AndroidDir + '/res', 'res'] - resources.srcDirs = ['src'] + java.srcDirs = [qtAndroidDir + '/src', 'src', 'java'] + aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl'] + res.srcDirs = [qtAndroidDir + '/res', 'res'] + resources.srcDirs = ['resources'] renderscript.srcDirs = ['src'] assets.srcDirs = ['assets'] jniLibs.srcDirs = ['libs'] } } + tasks.withType(JavaCompile) { + options.incremental = true + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + lintOptions { abortOnError false } + + // Do not compress Qt binary resources file + aaptOptions { + noCompress 'rcc' + } + + defaultConfig { + resConfig "en" + minSdkVersion qtMinSdkVersion + targetSdkVersion qtTargetSdkVersion + ndk.abiFilters = qtTargetAbiList.split(",") + } } diff --git a/augmentedreality/Examples/QmlArExample/Android/gradle.properties b/augmentedreality/Examples/QmlArExample/Android/gradle.properties new file mode 100644 index 000000000..37a51c273 --- /dev/null +++ b/augmentedreality/Examples/QmlArExample/Android/gradle.properties @@ -0,0 +1,16 @@ +# Project-wide Gradle settings. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# Enable building projects in parallel +org.gradle.parallel=true + +# Gradle caching allows reusing the build artifacts from a previous +# build with the same inputs. However, over time, the cache size will +# grow. Uncomment the following line to enable it. +#org.gradle.caching=true + +android.useAndroidX=true diff --git a/augmentedreality/Examples/QmlArExample/Android/gradlew b/augmentedreality/Examples/QmlArExample/Android/gradlew deleted file mode 100755 index c59450994..000000000 --- a/augmentedreality/Examples/QmlArExample/Android/gradlew +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" - -echo "========= 2 =============" diff --git a/augmentedreality/Examples/QmlArExample/Android/gradlew.bat b/augmentedreality/Examples/QmlArExample/Android/gradlew.bat deleted file mode 100644 index f9553162f..000000000 --- a/augmentedreality/Examples/QmlArExample/Android/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/augmentedreality/Examples/QmlArExample/QmlArExample.pro b/augmentedreality/Examples/QmlArExample/QmlArExample.pro index 23b68f4ff..5d26339f5 100644 --- a/augmentedreality/Examples/QmlArExample/QmlArExample.pro +++ b/augmentedreality/Examples/QmlArExample/QmlArExample.pro @@ -20,11 +20,24 @@ mac { #------------------------------------------------------------------------------- -CONFIG += c++14 +CONFIG += c++17 QT += core gui opengl network positioning sensors qml quick -ARCGIS_RUNTIME_VERSION = 100.15.0 +lessThan(QT_MAJOR_VERSION, 6) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") +} + +equals(QT_MAJOR_VERSION, 6) { + lessThan(QT_MINOR_VERSION, 2) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } + equals(QT_MINOR_VERSION, 2) : lessThan(QT_PATCH_VERSION, 4) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } +} + +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/arcgisruntime.pri) TEMPLATE = app @@ -50,7 +63,7 @@ OTHER_FILES += \ #------------------------------------------------------------------------------- # AR configuration -# The path to the ArcGIS runtime toolkit for Qt sources, corresponding to the files downloaded +# The path to the ArcGIS Maps SDK toolkit for Qt sources, corresponding to the files downloaded # from the GitHub repo: https://github.com/Esri/arcgis-runtime-toolkit-qt ARCGIS_TOOLKIT_PATH = # must be set to the root path of the toolkit folder diff --git a/augmentedreality/Examples/QmlArExample/iOS/Info.plist b/augmentedreality/Examples/QmlArExample/iOS/Info.plist index 7d9dc3e96..2be784da1 100644 --- a/augmentedreality/Examples/QmlArExample/iOS/Info.plist +++ b/augmentedreality/Examples/QmlArExample/iOS/Info.plist @@ -2,99 +2,99 @@ - CFBundleDisplayName - QmlArExample - CFBundleExecutable - QmlArExample - CFBundleGetInfoString - ArcGIS - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - Icon_29.png - Icon_40.png - Icon_50.png - Icon_57.png - Icon_58.png - Icon_72.png - Icon_76.png - Icon_80.png - Icon_100.png - Icon_114.png - Icon_120.png - Icon_144.png - Icon_152.png - - - - CFBundleIcons~ipad - - CFBundlePrimaryIcon - - CFBundleIconFiles - - Icon_29.png - Icon_40.png - Icon_50.png - Icon_57.png - Icon_58.png - Icon_72.png - Icon_76.png - Icon_80.png - Icon_100.png - Icon_114.png - Icon_120.png - Icon_144.png - Icon_152.png - - - - CFBundleIdentifier - com.esri.${PRODUCT_NAME:rfc1034identifier} - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NOTE - Built with ArcGIS Runtime SDK for Qt. - UIFileSharingEnabled - FALSE - UIRequiresPersistentWiFi - NO - LSRequiresIPhoneOS - - NSLocationAlwaysUsageDescription - - NSLocationWhenInUseUsageDescription - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIRequiresFullScreen - - UILaunchStoryboardName - LaunchScreen - NSCameraUsageDescription - Camera access is needed for AR testing + CFBundleDisplayName + QmlArExample + CFBundleExecutable + QmlArExample + CFBundleGetInfoString + ArcGIS + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon_29.png + Icon_40.png + Icon_50.png + Icon_57.png + Icon_58.png + Icon_72.png + Icon_76.png + Icon_80.png + Icon_100.png + Icon_114.png + Icon_120.png + Icon_144.png + Icon_152.png + + + + CFBundleIcons~ipad + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon_29.png + Icon_40.png + Icon_50.png + Icon_57.png + Icon_58.png + Icon_72.png + Icon_76.png + Icon_80.png + Icon_100.png + Icon_114.png + Icon_120.png + Icon_144.png + Icon_152.png + + + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NOTE + Built with ArcGIS Maps SDK for Qt. + NSCameraUsageDescription + Camera access is needed for AR testing + NSLocationAlwaysUsageDescription + + NSLocationWhenInUseUsageDescription + + UIFileSharingEnabled + FALSE + UILaunchStoryboardName + LaunchScreen + UIRequiresFullScreen + + UIRequiresPersistentWiFi + NO + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + diff --git a/augmentedreality/Examples/QmlArExample/main.cpp b/augmentedreality/Examples/QmlArExample/main.cpp index adea26ffc..c6d63f7a6 100644 --- a/augmentedreality/Examples/QmlArExample/main.cpp +++ b/augmentedreality/Examples/QmlArExample/main.cpp @@ -54,6 +54,9 @@ int main(int argc, char *argv[]) { + // Enforce OpenGL + qputenv("QSG_RHI_BACKEND", "opengl"); + // There are some conflicts between the AR frameworks and the Qt's rendering thread. // This code enables the non-threaded render loop mode in Qt. // See SceneView::renderFrame documentation and Qt's documentation @@ -71,7 +74,6 @@ int main(int argc, char *argv[]) QSurfaceFormat::setDefaultFormat(fmt); #endif - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QCoreApplication::setApplicationName(kApplicationName); diff --git a/augmentedreality/Examples/QmlArExample/qml/Message.qml b/augmentedreality/Examples/QmlArExample/qml/Message.qml index 5ab992840..fa7daf176 100644 --- a/augmentedreality/Examples/QmlArExample/qml/Message.qml +++ b/augmentedreality/Examples/QmlArExample/qml/Message.qml @@ -1,7 +1,7 @@ -import QtQuick 2.6 -import QtQuick.Controls 2.2 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit Rectangle { property alias text: label.text diff --git a/augmentedreality/Examples/QmlArExample/qml/SettingsWindow.qml b/augmentedreality/Examples/QmlArExample/qml/SettingsWindow.qml index b6e1f026b..f8d4ffad6 100644 --- a/augmentedreality/Examples/QmlArExample/qml/SettingsWindow.qml +++ b/augmentedreality/Examples/QmlArExample/qml/SettingsWindow.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.2 +import QtQuick +import QtQuick.Controls Item { id: root diff --git a/augmentedreality/Examples/QmlArExample/qml/main.qml b/augmentedreality/Examples/QmlArExample/qml/main.qml index fd86780cd..1266c423e 100644 --- a/augmentedreality/Examples/QmlArExample/qml/main.qml +++ b/augmentedreality/Examples/QmlArExample/qml/main.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import QtQuick.Controls 2.2 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit ApplicationWindow { id: appWindow @@ -66,7 +66,7 @@ ApplicationWindow { // If screenToLocationMode is true, create and place a 3D sphere in the scene. Otherwise set the // initial transformation based on the screen position. - onMouseClicked: { + onMouseClicked: (mouse) => { // If "screenToLocation" mode is enabled. if (screenToLocationMode) { // Get the real world location for screen point from AR view. @@ -96,7 +96,7 @@ ApplicationWindow { } } - onMousePositionChanged: mouse.accepted = true; + onMousePositionChanged: (mouse) => { mouse.accepted = true; } // Get or create graphic overlay function getOrCreateGraphicsOverlay() { @@ -154,7 +154,7 @@ ApplicationWindow { id: calibrationView width: parent.width visible: false - onTriggered: updateOriginCamera(latitude, longitude, altitude, heading); + onTriggered: (latitude, longitude, altitude, heading) => updateOriginCamera(latitude, longitude, altitude, heading); } ClippingView { @@ -183,7 +183,7 @@ ApplicationWindow { onResetCalibrationClicked: calibrationView.reset(); onScreenToLocationClicked: screenToLocationMode = !screenToLocationMode; - onShowPointCloud: { + onShowPointCloud: (visible) => { if (visible) arcGISArView.pointCloudColor = Qt.rgba(0.39, 0.39, 1.0, 1.0); else diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/BerlinScene.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/BerlinScene.qml index 0563ba513..da63c43fc 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/BerlinScene.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/BerlinScene.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit // Creates a scene centered on Berlin (Germany) // Mode: Tabletop AR diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/BrestScene.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/BrestScene.qml index 0482d7757..6d153d103 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/BrestScene.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/BrestScene.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit // Creates a scene centered on Brest (France) // Mode: Tabletop AR diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/EmptyScene.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/EmptyScene.qml index 6031921a9..25cd50988 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/EmptyScene.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/EmptyScene.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit // Creates an empty scene with an elevation source. // Mode: Full-Scale AR diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/ImageryScene.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/ImageryScene.qml index 0037a2adc..3b468452f 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/ImageryScene.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/ImageryScene.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit // Creates a scene based on the ImageryWithLabels base map. // Mode: Full-Scale AR @@ -29,8 +29,7 @@ Item { SceneWithElevation { id:scene - BasemapImageryWithLabels { - } + initBasemapStyle: Enums.BasemapStyleArcGISImageryLabels } LocationDataSource { diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/SceneWithElevation.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/SceneWithElevation.qml index e28ca890a..98ebe6961 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/SceneWithElevation.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/SceneWithElevation.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 +import QtQuick +import Esri.ArcGISRuntime Scene { Surface { diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/StreetsScene.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/StreetsScene.qml index fa0252bd8..d6ef6c4bc 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/StreetsScene.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/StreetsScene.qml @@ -14,23 +14,23 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit // Creates a scene based on the Streets base map. // Mode: Full-Scale AR Item { property alias scene: scene + property alias initBasemapStyle : initBasemapStyle property Camera originCamera: null property alias locationDataSource: locationDataSource property double translationFactor: 1.0 SceneWithElevation { id:scene - BasemapStreets { - } + initBasemapStyle: Enums.BasemapStyleArcGISStreets } LocationDataSource { diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestScene.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestScene.qml index 73b37b12b..f50f75ff8 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestScene.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestScene.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit // Creates a tabletop test scene. // Mode: Tabletop AR diff --git a/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestSceneGraphic.qml b/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestSceneGraphic.qml index f01e20289..d81fb5b09 100644 --- a/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestSceneGraphic.qml +++ b/augmentedreality/Examples/QmlArExample/qml/scenes/TabletopTestSceneGraphic.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.6 -import Esri.ArcGISRuntime 100.15 +import QtQuick +import Esri.ArcGISRuntime // Creates a graphic with sympbol for the tabletop test scene. diff --git a/augmentedreality/QmlApi/ArQmlApi.pri b/augmentedreality/QmlApi/ArQmlApi.pri index 22eb5fed8..5de5f6320 100644 --- a/augmentedreality/QmlApi/ArQmlApi.pri +++ b/augmentedreality/QmlApi/ArQmlApi.pri @@ -16,12 +16,14 @@ # This file is a part of the AR features provides in the toolkit. # This file must be imported in the project to use the QML API of the -# ArcGIS Runtime SDK for Qt. See AR.md for details. +# ArcGIS Maps SDK for Qt. See AR.md for details. isEmpty(ARCGIS_TOOLKIT_PATH) { error(ARCGIS_TOOLKIT_PATH is not set) } +QT += core-private + AUGMENTED_REALITY_PATH = $$ARCGIS_TOOLKIT_PATH/augmentedreality include($$AUGMENTED_REALITY_PATH/Common/AR.pri) diff --git a/augmentedreality/QmlApi/include/QmlArcGISArView.h b/augmentedreality/QmlApi/include/QmlArcGISArView.h index 86255e31f..3cc19e17b 100644 --- a/augmentedreality/QmlApi/include/QmlArcGISArView.h +++ b/augmentedreality/QmlApi/include/QmlArcGISArView.h @@ -20,9 +20,7 @@ #include "ArcGISArViewInterface.h" #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class QmlArcGISArView : public ArcGISArViewInterface { @@ -100,8 +98,6 @@ class QmlArcGISArView : public ArcGISArViewInterface mutable QPointer m_tmcc; }; -} // Toolkit namespace -} // ArcGISRuntime namespace -} // Esri namespace +} // Esri::ArcGISRuntime::Toolkit #endif // QmlArcGISArView_H diff --git a/augmentedreality/QmlApi/qml/ArcGISArView.qml b/augmentedreality/QmlApi/qml/ArcGISArView.qml index 9e01aac1d..0d527f452 100644 --- a/augmentedreality/QmlApi/qml/ArcGISArView.qml +++ b/augmentedreality/QmlApi/qml/ArcGISArView.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISArToolkit 1.0 +import QtQuick +import QtQuick.Window +import Esri.ArcGISRuntime +import Esri.ArcGISArToolkit ArcGISArViewInternal { id: root @@ -45,7 +45,13 @@ ArcGISArViewInternal { // Update the initial transformation, using the hit matrix. property TransformationMatrix initialTransformationMatrix: null - onInitialTransformationChanged: { + onInitialTransformationChanged: (quaternionX, + quaternionY, + quaternionZ, + quaternionW, + translationX, + translationY, + translationZ) => { // Set the `initialTransformationMatrix` as the TransformationMatrix.identity - hit test matrix. const hitMatrix = Factory.TransformationMatrix.createWithQuaternionAndTranslation( quaternionX, quaternionY, quaternionZ, quaternionW, @@ -57,7 +63,13 @@ ArcGISArViewInternal { // It's not possible to create the TransformationMatrix object directly in C++. This function // is used to create the TM object and assign it to the TMCC. - onTransformationMatrixChanged: { + onTransformationMatrixChanged: (quaternionX, + quaternionY, + quaternionZ, + quaternionW, + translationX, + translationY, + translationZ) => { const matrix = Factory.TransformationMatrix.createWithQuaternionAndTranslation( quaternionX, quaternionY, quaternionZ, quaternionW, translationX, translationY, translationZ); @@ -72,7 +84,12 @@ ArcGISArViewInternal { // It's not possible to call setFieldOfViewFromLensIntrinsics directly from the C++ code, due to // the orientation device enumeration. This function is used to converts the orientation (int) to // deviceOrientation (enum). - onFieldOfViewChanged: { + onFieldOfViewChanged: (xFocalLength, + yFocalLength, + xPrincipal, + yPrincipal, + xImageSize, + yImageSize) => { if (!sceneView) return; @@ -92,7 +109,9 @@ ArcGISArViewInternal { } // Update the location. - onLocationChanged: { + onLocationChanged: (latitude, + longitude, + altitude) => { const location = ArcGISRuntimeEnvironment.createObject("Point", { y: latitude, x: longitude, z: altitude }); // Save location camera parameters. @@ -114,7 +133,7 @@ ArcGISArViewInternal { } // Update the heading. - onHeadingChanged: { + onHeadingChanged: (heading) => { // Save location camera parameters. if (!locationCameraInternal) { const location = ArcGISRuntimeEnvironment.createObject("Point", { y: 0.0, x: 0.0, z: 0.0 }); @@ -165,7 +184,7 @@ ArcGISArViewInternal { /*! \internal - Cast from Qt's screen orientation to ArcGIS Runtime's screen orientation. + Cast from Qt's screen orientation to ArcGIS Maps SDK's screen orientation. */ function toDeviceOrientation(orientation) { switch(Screen.orientation) { diff --git a/augmentedreality/QmlApi/source/QmlArcGISArView.cpp b/augmentedreality/QmlApi/source/QmlArcGISArView.cpp index 494316f16..0c47da03d 100644 --- a/augmentedreality/QmlApi/source/QmlArcGISArView.cpp +++ b/augmentedreality/QmlApi/source/QmlArcGISArView.cpp @@ -16,17 +16,17 @@ #include "QmlArcGISArView.h" -using namespace Esri::ArcGISRuntime::Toolkit; +namespace Esri::ArcGISRuntime::Toolkit { /*! \qmltype ArcGISArView - \instantiates QmlArcGISArView + \instantiates Esri::ArcGISRuntime::Toolkit::QmlArcGISArView \inherits ArcGISArViewInterface \ingroup ArcGISQtToolkitAR \ingroup ArcGISQtToolkitARQmlApi \ingroup ArcGISQtToolkit \ingroup ArcGISQtToolkitQmlApi - \inmodule ArcGISQtToolkit + \inqmlmodule ArcGISQtToolkit \since Esri::ArcGISArToolkit 100.6 \brief A scene view for displaying ARKit/ARCore features on mobile devices using the QML API. @@ -167,7 +167,7 @@ void QmlArcGISArView::qmlRegisterTypes() { qmlRegisterType("Esri.ArcGISArToolkit", 1, 0, "ArcGISArViewInternal"); qmlRegisterType("Esri.ArcGISArToolkit", 1, 0, "LocationDataSource"); - qmlRegisterUncreatableType("Esri.ArcGISArToolkit", 1, 0, "ArEnums", "ArEnums is not creatable."); + qmlRegisterUncreatableMetaObject(ArEnums::staticMetaObject, "Esri.ArcGISArToolkit", 1, 0, "ArEnums", "ArEnums is not creatable."); // Register enum types. qRegisterMetaType("ArEnums::LocationTrackingMode"); @@ -280,3 +280,5 @@ bool QmlArcGISArView::assertClassName(QObject* object, const QString& className) \fn void QmlArcGISArView::sceneViewChanged(); \brief Signal emitted when the \l sceneView property changes. */ + +} // Esri::ArcGISRuntime::Toolkit namespace diff --git a/augmentedreality/README.md b/augmentedreality/README.md index 2d6e146b0..6f996426d 100644 --- a/augmentedreality/README.md +++ b/augmentedreality/README.md @@ -1,16 +1,15 @@ # Augmented Reality toolkit components The Augmented Reality (AR) toolkit components provide support for ARKit for iOS -apps and ARCore for Android apps written using ArcGIS Runtime SDK for Qt. This +apps and ARCore for Android apps written using ArcGIS Maps SDK for Qt. This documentation describes the installation and uses of the AR toolkit components. ## Overview Augmented reality experiences augment the physical world with -virtual content that respects real world scale, position, and orientation of a -device. In the case of Runtime, a `SceneView` object displays 3D -geographic AR data as virtual content on top of a camera feed of the real, -physical world. +virtual content that respects real world scale, position, and +orientation of a device. A `SceneView` object displays 3D geographic AR +data as virtual content on top of a camera feed of the real, physical world. The AR toolkit components facilitates integrating AR into your apps for a wide variety of scenarios. The toolkit recognizes the @@ -34,7 +33,7 @@ street, to displaying waypoints for navigation. The AR toolkit components include the `ArcGISArView` class, a subclass of `QQuickItem`, which contains the functionality your app needs to display an AR experience. `ArcGISArView` uses ARKit (iOS) or ARCore (Android) augmented reality framework to display the live camera feed -and handle real world tracking and synchronization with the Runtime SDK's +and handle real world tracking and synchronization with the `SceneView` class. The `ArcGISArView` class is responsible for starting and managing an ARKit or ARCore session. `ArcGISArView` also uses a `LocationDataSource` class for getting an initial GPS location when GPS tracking is required. @@ -61,9 +60,9 @@ documentation](https://developer.apple.com/augmented-reality). Android 7.0 64-bit (armv8) is the minimum requirement. 32-bit (armv7) is not supported. Devices must support ARCore. For details about using ARCore, please refer to [Google's documentation](https://developers.google.com/ar/). -The latest ArcGIS Runtime SDK for Qt is required to use this toolkit component. +The latest ArcGIS Maps SDK for Qt is required to use this toolkit component. -## Creating a new AR app using ArcGIS Runtime AR toolkit +## Creating a new AR app using ArcGIS Maps AR toolkit ### Creating a new C++ app @@ -73,15 +72,15 @@ An example C++ app with AR support can be found in the folder Note: In the following explanation, `` refers to the project name used to create the Qt project. -1. Install the ArcGIS Runtime SDK for Qt. See -[ArcGIS Runtime SDK for Qt](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt.htm) +1. Install the ArcGIS Maps SDK for Qt. See +[ArcGIS Maps SDK for Qt](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt.htm) for details. 2. Download from GitHub the source files of the -[ArcGIS Runtime API Toolkit](https://github.com/Esri/arcgis-runtime-toolkit-qt). +[ArcGIS Maps SDK for Qt Toolkit](https://github.com/Esri/arcgis-runtime-toolkit-qt). 3. In Qt Creator, create a new project and select the app template named -"ArcGIS Runtime 100.6 Qt Quick C++ app". Select the option "3D project" in the +"ArcGIS Maps 200.0.0 Qt Quick C++ app". Select the option "3D project" in the "Details" dialog. 4. In the newly created project, add the following lines anywhere in the app's project (`.pro`) @@ -97,14 +96,15 @@ include($$ARCGIS_TOOLKIT_PATH/augmentedreality/CppApi/ArCppApi.pri) - Set the environment variable `QSG_RENDER_LOOP` to `basic` in the beginning of the `main` function. See [Note for performance issues] for details. -``` +```cpp #if defined(Q_OS_IOS) || defined(Q_OS_ANDROID) qputenv("QSG_RENDER_LOOP", "basic"); #endif ``` - Include the header `ArcGISArView.h`. -``` + +```cpp #include "ArcGISArView.h" ``` @@ -112,12 +112,14 @@ include($$ARCGIS_TOOLKIT_PATH/augmentedreality/CppApi/ArCppApi.pri) engine, to register with the QML engine the`ArcGISArView` and `LocationDataSource` C++ classes . This is necessary to allow you to create objects of these types in QML. -``` + +```cpp Esri::ArcGISRuntime::Toolkit::ArcGISArView::qmlRegisterTypes(); ``` 6. In the `.h` file, add a new property to access the AR view: -``` + +```cpp #include "ArcGISArView.h" ... @@ -145,7 +147,8 @@ private: `arcGISArView` property. In the setter, set the properties `originCamera`, `translationFactor`, and `setLocationDataSource`. An example of settings for world-scale mode is given in the following code. -``` + +```cpp using namespace Esri::ArcGISRuntime::Toolkit; ... @@ -171,7 +174,8 @@ void ::setArcGISArView(ArcGISArView* arcGISArView) ``` An example of parameters for tabletop AR app is given in the following code: -``` + +```cpp m_arcGISArView->setOriginCamera(Camera(latitude, longitude, altitude, 0.0, 90.0, 0.0)); m_arcGISArView->setTranslationFactor(1000.0); m_arcGISArView->setLocationDataSource(nullptr); @@ -186,12 +190,14 @@ The default Scene is suitable for full scale mode. 8. In the `Form.qml` file, make the following changes: - Import the AR toolkit: -``` + +```js import Esri.ArcGISArToolkit 1.0 ``` - Create an AR view in the back of the `SceneView` (then before the declaration of `SceneView` in the QML file): -``` + +```js ArcGISArView { id: arcGISArView anchors.fill: parent @@ -201,11 +207,13 @@ ArcGISArView { ``` - In the declaration of `` component, bind the AR view to the `arcGISArView` property: -``` + +```js { id: model arcGISArView: arcGISArView ... +} ``` ### Creating a new QML app with AR support @@ -213,13 +221,13 @@ ArcGISArView { An example of QML app with AR support can be found in the folder `Examples\QmlArExample` in the toolkit repo. -1. Install the ArcGIS Runtime SDK for Qt. See -[ArcGIS Runtime SDK for Qt Guide](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt.htm) +1. Install the ArcGIS Maps SDK for Qt. See +[ArcGIS Maps SDK for Qt Guide](https://developers.arcgis.com/qt/latest/qml/guide/arcgis-runtime-sdk-for-qt.htm) for details. -2. Download the sources of the [ArcGIS Runtime API Toolkit](https://github.com/Esri/arcgis-runtime-toolkit-qt) from GitHub. +2. Download the sources of the [ArcGIS Maps SDK for Qt Toolkit](https://github.com/Esri/arcgis-runtime-toolkit-qt) from GitHub. -3. In Qt Creator, create a new project and select "ArcGIS Runtime 100.6 Qt Quick QML app". +3. In Qt Creator, create a new project and select "ArcGIS Maps 200.0.0 Qt Quick QML app". Select the option "3D project" in the "Details" step. 4. In the created project, add the following lines anywhere in the app's project @@ -235,35 +243,41 @@ include($$ARCGIS_TOOLKIT_PATH/augmentedreality/QmlApi/ArQmlApi.pri) - Set the environment variable `QSG_RENDER_LOOP` to `basic` in the beginning of the `main` function. See [Note for performance issues] for details. -``` + +```cpp #if defined(Q_OS_IOS) || defined(Q_OS_ANDROID) qputenv("QSG_RENDER_LOOP", "basic"); #endif ``` - Include the header `QmlArcGISArView.h`. -``` + +```cpp #include "QmlArcGISArView.h" ``` - Call the `QmlArcGISArView::qmlRegisterTypes()` before the creation of the QML engine, to register the `ArcGISArView` and `LocationDataSource` QML types in QML engine. This is necessary to create an object of these types in QML. -``` + +```cpp Esri::ArcGISRuntime::Toolkit::QmlArcGISArView::qmlRegisterTypes(); ``` 6. In the `main.qml` file, make the following changes: - Import the AR toolkit: -``` + +```js import Esri.ArcGISArToolkit 1.0 ``` - Create an AR view before the declaration of `SceneView` in the QML file. + The following code show an example of initialization for the properties `originCamera`, `translationFactor` and `locationDataSource` used for world-scale mode. -``` + +```js ArcGISArView { id: arcGISArView anchors.fill: parent @@ -276,7 +290,8 @@ ArcGISArView { ``` The following code show an example for tabletop mode. -``` + +```js originCamera: Camera { location: Point { y: latitude @@ -303,7 +318,7 @@ app. 1. In the `Info.plist` file, add the following key at the end of the file, just before ``. This gives ARKit access to the device's camera. -``` +```xml NSCameraUsageDescription Camera access is needed for AR testing ``` @@ -333,7 +348,7 @@ on the filename and select "Open With" then "Plain Text Editor"). - Under the line ``, add the following line to enable ARCore support. -``` +```xml ``` @@ -347,12 +362,14 @@ For details, see [Google's Enable ARCore documentation](https://developers.googl - Under the line ``, add the following line to give permission to access the camera to ARCore. -``` + +```xml ``` - Indicate that your app will be checking for the existence of arcore. -``` + +```xml @@ -361,12 +378,14 @@ permission to access the camera to ARCore. - Set the minimum SDK version `android:minSdkVersion` to 24 for AR required app and 14 for AR optional app. -``` + +```xml ``` 3. In the `build.gradle` file, in `dependencies`, add the ARCore dependency: -``` + +```xml dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation 'com.google.ar:core:1.11.0' @@ -387,7 +406,7 @@ for more information. The following lines of code enable the non-threaded render loop mode in Qt: -``` +```cpp #if defined(Q_OS_IOS) && defined(Q_OS_ANDROID) qputenv("QSG_RENDER_LOOP", "basic"); #endif diff --git a/calcite-qml/Calcite/ApplicationWindow.qml b/calcite-qml/Calcite/ApplicationWindow.qml index 3ea3b4945..06ea33562 100644 --- a/calcite-qml/Calcite/ApplicationWindow.qml +++ b/calcite-qml/Calcite/ApplicationWindow.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.ApplicationWindow { id: window diff --git a/calcite-qml/Calcite/BusyIndicator.qml b/calcite-qml/Calcite/BusyIndicator.qml index 437616d01..c48317650 100644 --- a/calcite-qml/Calcite/BusyIndicator.qml +++ b/calcite-qml/Calcite/BusyIndicator.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Layouts 1.15 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Layouts T.BusyIndicator { id: control diff --git a/calcite-qml/Calcite/BusyIndicatorAnimation.qml b/calcite-qml/Calcite/BusyIndicatorAnimation.qml index ccdb3ff57..50a2eaae9 100644 --- a/calcite-qml/Calcite/BusyIndicatorAnimation.qml +++ b/calcite-qml/Calcite/BusyIndicatorAnimation.qml @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 +import QtQuick SequentialAnimation { id: anim diff --git a/calcite-qml/Calcite/Button.qml b/calcite-qml/Calcite/Button.qml index 386f24e42..72bc61ec2 100644 --- a/calcite-qml/Calcite/Button.qml +++ b/calcite-qml/Calcite/Button.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Button { id: control diff --git a/calcite-qml/Calcite/Calcite.qml b/calcite-qml/Calcite/Calcite.qml index 82642d3a7..c545e3b4e 100644 --- a/calcite-qml/Calcite/Calcite.qml +++ b/calcite-qml/Calcite/Calcite.qml @@ -16,7 +16,7 @@ ******************************************************************************/ pragma Singleton -import QtQuick 2.0 +import QtQuick /*! diff --git a/calcite-qml/Calcite/CheckBox.qml b/calcite-qml/Calcite/CheckBox.qml index 050c5d874..502b24189 100644 --- a/calcite-qml/Calcite/CheckBox.qml +++ b/calcite-qml/Calcite/CheckBox.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.CheckBox { id: control diff --git a/calcite-qml/Calcite/CheckDelegate.qml b/calcite-qml/Calcite/CheckDelegate.qml index 4a49ddcbc..32321b55a 100644 --- a/calcite-qml/Calcite/CheckDelegate.qml +++ b/calcite-qml/Calcite/CheckDelegate.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.CheckDelegate { id: control diff --git a/calcite-qml/Calcite/CheckIndicator.qml b/calcite-qml/Calcite/CheckIndicator.qml index e5a390f9a..d65bf8e44 100644 --- a/calcite-qml/Calcite/CheckIndicator.qml +++ b/calcite-qml/Calcite/CheckIndicator.qml @@ -13,8 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtGraphicalEffects 1.12 +import QtQuick Rectangle { property var control; @@ -36,13 +35,6 @@ Rectangle { margins: control.checkState === Qt.Checked ? -2 : 2 } source: control.checkState === Qt.Checked ? "images/check.svg": "images/line-solid.svg" - visible: false - } - - ColorOverlay { - anchors.fill: checkmark - source: checkmark - color: Calcite.textInverse - visible: control.checkState !== Qt.Unchecked + visible: true } } diff --git a/calcite-qml/Calcite/ComboBox.qml b/calcite-qml/Calcite/ComboBox.qml index 38af4e513..b717eab4c 100644 --- a/calcite-qml/Calcite/ComboBox.qml +++ b/calcite-qml/Calcite/ComboBox.qml @@ -13,10 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T -import QtGraphicalEffects 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.ComboBox { id: control @@ -39,13 +38,7 @@ T.ComboBox { x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding y: control.topPadding + (control.availableHeight - height) / 2 source: "images/caret-double-vertical.svg" - visible: false - } - - ColorOverlay { - anchors.fill: indicator - source: indicator - color: Calcite.text3 + visible: true } contentItem: Text { diff --git a/calcite-qml/Calcite/Dialog.qml b/calcite-qml/Calcite/Dialog.qml index 67e57ce82..164a94dd3 100644 --- a/calcite-qml/Calcite/Dialog.qml +++ b/calcite-qml/Calcite/Dialog.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.Dialog { id: control diff --git a/calcite-qml/Calcite/DialogButtonBox.qml b/calcite-qml/Calcite/DialogButtonBox.qml index ebb4067de..a342ba3d5 100644 --- a/calcite-qml/Calcite/DialogButtonBox.qml +++ b/calcite-qml/Calcite/DialogButtonBox.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.DialogButtonBox { id: control diff --git a/calcite-qml/Calcite/Drawer.qml b/calcite-qml/Calcite/Drawer.qml index fcd52282c..bf6f8f1ea 100644 --- a/calcite-qml/Calcite/Drawer.qml +++ b/calcite-qml/Calcite/Drawer.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Templates as T T.Drawer { id: control diff --git a/calcite-qml/Calcite/Frame.qml b/calcite-qml/Calcite/Frame.qml index 0d038a945..f31135de4 100644 --- a/calcite-qml/Calcite/Frame.qml +++ b/calcite-qml/Calcite/Frame.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.Frame { id: control diff --git a/calcite-qml/Calcite/GroupBox.qml b/calcite-qml/Calcite/GroupBox.qml index 5c1df4fc9..1929c81ef 100644 --- a/calcite-qml/Calcite/GroupBox.qml +++ b/calcite-qml/Calcite/GroupBox.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.GroupBox { id: control diff --git a/calcite-qml/Calcite/ItemDelegate.qml b/calcite-qml/Calcite/ItemDelegate.qml index d199effe4..8db36c419 100644 --- a/calcite-qml/Calcite/ItemDelegate.qml +++ b/calcite-qml/Calcite/ItemDelegate.qml @@ -13,11 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.15 as T -import QtGraphicalEffects 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ItemDelegate { id: control @@ -44,12 +43,6 @@ T.ItemDelegate { visible: control.highlighted source: "images/check.svg" - ColorOverlay { - anchors.fill: indicator - source: indicator - color: control.color - visible: indicator.visible - } } contentItem: IconLabel { spacing: control.spacing diff --git a/calcite-qml/Calcite/Label.qml b/calcite-qml/Calcite/Label.qml index 66fcb3f11..4874524df 100644 --- a/calcite-qml/Calcite/Label.qml +++ b/calcite-qml/Calcite/Label.qml @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick.Templates 2.15 as T +import QtQuick.Templates as T T.Label { id: control diff --git a/calcite-qml/Calcite/Menu.qml b/calcite-qml/Calcite/Menu.qml index 7fc102939..47079b238 100644 --- a/calcite-qml/Calcite/Menu.qml +++ b/calcite-qml/Calcite/Menu.qml @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.Menu { id: control diff --git a/calcite-qml/Calcite/MenuItem.qml b/calcite-qml/Calcite/MenuItem.qml index 8b88b087b..639a35a79 100644 --- a/calcite-qml/Calcite/MenuItem.qml +++ b/calcite-qml/Calcite/MenuItem.qml @@ -13,9 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T -import QtGraphicalEffects 1.12 +import QtQuick +import QtQuick.Templates as T T.MenuItem { id: control @@ -47,11 +46,6 @@ T.MenuItem { visible: control.checked source: control.checkable ? "images/check.svg" : "" - ColorOverlay { - anchors.fill: parent - source: parent - color: control.contentItem.color - } } background: Item { diff --git a/calcite-qml/Calcite/MenuSeparator.qml b/calcite-qml/Calcite/MenuSeparator.qml index 470e1c3df..0888c3a27 100644 --- a/calcite-qml/Calcite/MenuSeparator.qml +++ b/calcite-qml/Calcite/MenuSeparator.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.MenuSeparator { id: control diff --git a/calcite-qml/Calcite/Page.qml b/calcite-qml/Calcite/Page.qml index e78c4b7a0..84c156023 100644 --- a/calcite-qml/Calcite/Page.qml +++ b/calcite-qml/Calcite/Page.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.Page { id: control diff --git a/calcite-qml/Calcite/PageIndicator.qml b/calcite-qml/Calcite/PageIndicator.qml index 59d68e059..8ac9f7501 100644 --- a/calcite-qml/Calcite/PageIndicator.qml +++ b/calcite-qml/Calcite/PageIndicator.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.PageIndicator { id: control diff --git a/calcite-qml/Calcite/Pane.qml b/calcite-qml/Calcite/Pane.qml index d106e7048..907fe81d9 100644 --- a/calcite-qml/Calcite/Pane.qml +++ b/calcite-qml/Calcite/Pane.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.Pane { id: control diff --git a/calcite-qml/Calcite/Popup.qml b/calcite-qml/Calcite/Popup.qml index 2e6f796ce..1cb74cb28 100644 --- a/calcite-qml/Calcite/Popup.qml +++ b/calcite-qml/Calcite/Popup.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.Popup { id: control diff --git a/calcite-qml/Calcite/RadioButton.qml b/calcite-qml/Calcite/RadioButton.qml index c2bf6d7b3..34a5063c6 100644 --- a/calcite-qml/Calcite/RadioButton.qml +++ b/calcite-qml/Calcite/RadioButton.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.RadioButton { id: control diff --git a/calcite-qml/Calcite/RadioDelegate.qml b/calcite-qml/Calcite/RadioDelegate.qml index e0cf10324..f162584eb 100644 --- a/calcite-qml/Calcite/RadioDelegate.qml +++ b/calcite-qml/Calcite/RadioDelegate.qml @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtGraphicalEffects 1.15 -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T +import Qt5Compat.GraphicalEffects +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.RadioDelegate { id: control @@ -62,13 +62,6 @@ T.RadioDelegate { sourceSize: Qt.size(24, 24) width: sourceSize.width height: sourceSize.height - ColorOverlay { - anchors.fill: indicator - source: indicator - color: control.checked - || control.highlighted ? Calcite.brand : control.hovered ? Calcite.border1 : "transparent" - visible: indicator.visible - } } background: Rectangle { diff --git a/calcite-qml/Calcite/RadioIndicator.qml b/calcite-qml/Calcite/RadioIndicator.qml index cda64cf8f..fa0c34bbc 100644 --- a/calcite-qml/Calcite/RadioIndicator.qml +++ b/calcite-qml/Calcite/RadioIndicator.qml @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 +import QtQuick Rectangle { diff --git a/calcite-qml/Calcite/RangeSlider.qml b/calcite-qml/Calcite/RangeSlider.qml index 3b4712296..c61648464 100644 --- a/calcite-qml/Calcite/RangeSlider.qml +++ b/calcite-qml/Calcite/RangeSlider.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls 2.15 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls T.RangeSlider { id: control @@ -30,7 +30,6 @@ T.RangeSlider { x: control.leftPadding + Math.round(control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + Math.round(control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) - palette: control.palette pressed: control.first.pressed hovered: control.hovered vertical: control.vertical @@ -42,7 +41,6 @@ T.RangeSlider { x: control.leftPadding + Math.round(control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + Math.round(control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height)) - palette: control.palette pressed: control.second.pressed hovered: control.hovered vertical: control.vertical diff --git a/calcite-qml/Calcite/RoundButton.qml b/calcite-qml/Calcite/RoundButton.qml index e5588dccc..8805747c1 100644 --- a/calcite-qml/Calcite/RoundButton.qml +++ b/calcite-qml/Calcite/RoundButton.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Controls.impl 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Controls.impl +import QtQuick.Templates as T T.RoundButton { id: control diff --git a/calcite-qml/Calcite/ScrollBar.qml b/calcite-qml/Calcite/ScrollBar.qml index 96137e750..a9017c933 100644 --- a/calcite-qml/Calcite/ScrollBar.qml +++ b/calcite-qml/Calcite/ScrollBar.qml @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Controls.impl 2.12 -import QtQuick.Templates 2.12 as T +import QtQuick +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T T.ScrollBar { id: control diff --git a/calcite-qml/Calcite/Slider.qml b/calcite-qml/Calcite/Slider.qml index 1380a2cb5..ca5d8d8a0 100644 --- a/calcite-qml/Calcite/Slider.qml +++ b/calcite-qml/Calcite/Slider.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.Slider { id: control @@ -28,7 +28,6 @@ T.Slider { x: control.leftPadding + Math.round(control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + Math.round(control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) - palette: control.palette pressed: control.pressed hovered: control.hovered vertical: control.vertical diff --git a/calcite-qml/Calcite/SliderGroove.qml b/calcite-qml/Calcite/SliderGroove.qml index 0d63f0572..8eabf8d77 100644 --- a/calcite-qml/Calcite/SliderGroove.qml +++ b/calcite-qml/Calcite/SliderGroove.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls Rectangle { id: groove diff --git a/calcite-qml/Calcite/SliderHandle.qml b/calcite-qml/Calcite/SliderHandle.qml index df7d5f1c2..efb640cb1 100644 --- a/calcite-qml/Calcite/SliderHandle.qml +++ b/calcite-qml/Calcite/SliderHandle.qml @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 +import QtQuick Rectangle { id: handle @@ -41,8 +41,8 @@ Rectangle { anchors.fill: parent hoverEnabled: true propagateComposedEvents: true - onPressed: mouse.accepted = false - onReleased: mouse.accepted = false - onPositionChanged: mouse.accepted = false + onPressed: mouse => mouse.accepted = false + onReleased: mouse => mouse.accepted = false + onPositionChanged: mouse => mouse.accepted = false } } diff --git a/calcite-qml/Calcite/SpinBox.qml b/calcite-qml/Calcite/SpinBox.qml index 5c9c02f28..d21d6de2d 100644 --- a/calcite-qml/Calcite/SpinBox.qml +++ b/calcite-qml/Calcite/SpinBox.qml @@ -13,9 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T -import QtGraphicalEffects 1.12 +import QtQuick +import QtQuick.Templates as T T.SpinBox { id: control @@ -81,12 +80,6 @@ T.SpinBox { sourceSize.width: parent.width sourceSize.height: parent.width } - - ColorOverlay { - anchors.fill : upIndicatorImage - source: upIndicatorImage - color: up.hovered ? Calcite.text1 : Calcite.text3 - } } } @@ -116,12 +109,6 @@ T.SpinBox { sourceSize.width: parent.width sourceSize.height: parent.height } - - ColorOverlay { - anchors.fill : downIndicatorImage - source: downIndicatorImage - color: down.hovered ? Calcite.text1 : Calcite.text3 - } } } diff --git a/calcite-qml/Calcite/Switch.qml b/calcite-qml/Calcite/Switch.qml index 89046721a..1c042b098 100644 --- a/calcite-qml/Calcite/Switch.qml +++ b/calcite-qml/Calcite/Switch.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.Switch { id: control diff --git a/calcite-qml/Calcite/TextField.qml b/calcite-qml/Calcite/TextField.qml index f597ba0ec..fc7d6306d 100644 --- a/calcite-qml/Calcite/TextField.qml +++ b/calcite-qml/Calcite/TextField.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T +import QtQuick +import QtQuick.Templates as T T.TextField { id: control diff --git a/calcite-qml/Calcite/ToolBar.qml b/calcite-qml/Calcite/ToolBar.qml index a2877baa2..526911c2b 100644 --- a/calcite-qml/Calcite/ToolBar.qml +++ b/calcite-qml/Calcite/ToolBar.qml @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.ToolBar { id: control diff --git a/calcite-qml/Calcite/ToolButton.qml b/calcite-qml/Calcite/ToolButton.qml index fc35087fc..f6e0cb197 100644 --- a/calcite-qml/Calcite/ToolButton.qml +++ b/calcite-qml/Calcite/ToolButton.qml @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.ToolButton { id: control diff --git a/calcite-qml/Calcite/ToolSeparator.qml b/calcite-qml/Calcite/ToolSeparator.qml index 156d23b24..6ea4879bd 100644 --- a/calcite-qml/Calcite/ToolSeparator.qml +++ b/calcite-qml/Calcite/ToolSeparator.qml @@ -14,10 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQuick.Templates 2.15 as T -import QtQuick.Controls 2.15 -import QtQuick.Controls.impl 2.15 +import QtQuick +import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.ToolSeparator { id: control diff --git a/calcite-qml/demo/calcite_test.pro b/calcite-qml/demo/calcite_test.pro index 52eb8f680..b50de3ef9 100644 --- a/calcite-qml/demo/calcite_test.pro +++ b/calcite-qml/demo/calcite_test.pro @@ -18,28 +18,28 @@ mac { #------------------------------------------------------------------------------- -CONFIG += c++14 +CONFIG += c++17 # additional modules are pulled in via arcgisruntime.pri QT += opengl qml quick quickcontrols2 -ARCGIS_RUNTIME_VERSION = 100.15.0 +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/arcgisruntime.pri) TEMPLATE = app TARGET = calcite_test -equals(QT_MAJOR_VERSION, 5) { - lessThan(QT_MINOR_VERSION, 15) { - error("$$TARGET requires Qt 5.15.2") - } - equals(QT_MINOR_VERSION, 15) : lessThan(QT_PATCH_VERSION, 2) { - error("$$TARGET requires Qt 5.15.2") - } +lessThan(QT_MAJOR_VERSION, 6) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") } equals(QT_MAJOR_VERSION, 6) { - error("This version of the ArcGIS Runtime SDK for Qt is incompatible with Qt 6") + lessThan(QT_MINOR_VERSION, 2) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } + equals(QT_MINOR_VERSION, 2) : lessThan(QT_PATCH_VERSION, 4) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } } #------------------------------------------------------------------------------- diff --git a/calcite-qml/demo/iOS/Info.plist b/calcite-qml/demo/iOS/Info.plist index a60098191..273a9bf98 100644 --- a/calcite-qml/demo/iOS/Info.plist +++ b/calcite-qml/demo/iOS/Info.plist @@ -65,7 +65,7 @@ CFBundleVersion 1.0 NOTE - Built with ArcGIS Runtime SDK for Qt. + Built with ArcGIS Maps SDK for Qt. UIFileSharingEnabled FALSE UIRequiresPersistentWiFi diff --git a/calcite-qml/demo/main.cpp b/calcite-qml/demo/main.cpp index 1e7e9ce0c..e262d6800 100644 --- a/calcite-qml/demo/main.cpp +++ b/calcite-qml/demo/main.cpp @@ -26,7 +26,6 @@ main(int argc, char* argv[]) { qDebug() << "Initializing application"; - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); // Use of Esri location services, including basemaps and geocoding, requires @@ -52,18 +51,13 @@ main(int argc, char* argv[]) apiKey); } - // Production deployment of applications built with ArcGIS Runtime requires - // you to license ArcGIS Runtime functionality. For more information see + // Production deployment of applications built with ArcGIS Maps SDK for Native Apps + // requires you to license its functionality. For more information see // https://links.esri.com/arcgis-runtime-license-and-deploy. // QCoreApplication::instance()->setProperty("Esri.ArcGISRuntime.license", // "licenseString"); - // This is how we make the style visible to our application! - // We can now apply the style via the `qtquickcontrol2.conf` file. - // See `README.md` for details. - QQuickStyle::addStylePath("qrc:///esri.com/imports/"); - // Intialize application window QQmlApplicationEngine appEngine; appEngine.addImportPath("qrc:///esri.com/imports/"); diff --git a/calcite-qml/demo/qml/main.qml b/calcite-qml/demo/qml/main.qml index 6e07815d6..d0efe37a9 100644 --- a/calcite-qml/demo/qml/main.qml +++ b/calcite-qml/demo/qml/main.qml @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Calcite 1.0 as C -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Calcite as C +import QtQuick.Layouts ApplicationWindow { id: appWindow diff --git a/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/BasemapGalleryItemUnitTest.pro b/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/BasemapGalleryItemUnitTest.pro index b43353cba..fe5448196 100644 --- a/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/BasemapGalleryItemUnitTest.pro +++ b/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/BasemapGalleryItemUnitTest.pro @@ -14,7 +14,7 @@ QT += testlib QT -= gui -CONFIG += qt console warn_on depend_includepath testcase c++14 +CONFIG += qt console warn_on depend_includepath testcase c++17 TEMPLATE = app @@ -27,7 +27,7 @@ QT += testlib QT -= gui QT += core gui opengl xml testlib network positioning sensors multimedia quick -ARCGIS_RUNTIME_VERSION = 100.15.0 +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/../arcgisruntime.pri) include($$PWD/../../../../../uitools/toolkitcpp.pri) diff --git a/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/tst_basemapgalleryitemunittest.h b/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/tst_basemapgalleryitemunittest.h index fce0ae590..3cbd4cb7a 100644 --- a/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/tst_basemapgalleryitemunittest.h +++ b/tests/uitools/cpp_quick/unit_tests/BasemapGalleryItemUnitTest/tst_basemapgalleryitemunittest.h @@ -18,15 +18,13 @@ #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class Basemap; class Map; namespace Toolkit { } -} -} +} // Esri::ArcGISRuntime class BasemapGalleryItemUnitTest : public QObject { diff --git a/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/FloorFilterControllerFuncTest.pro b/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/FloorFilterControllerFuncTest.pro index ba41f2ce8..498438eba 100644 --- a/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/FloorFilterControllerFuncTest.pro +++ b/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/FloorFilterControllerFuncTest.pro @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -CONFIG += c++14 warn_on qmltestcase +CONFIG += c++17 warn_on qmltestcase TEMPLATE = app -ARCGIS_RUNTIME_VERSION = 100.15.0 +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/../../shared/arcgisruntime.pri) include($$PWD/../../../../../uitools/toolkitqml.pri) diff --git a/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/tst_floorfiltercontroller.qml b/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/tst_floorfiltercontroller.qml index 26f30c2cd..b26c57744 100644 --- a/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/tst_floorfiltercontroller.qml +++ b/tests/uitools/qml_quick/functional_tests/FloorFilterControllerFuncTest/tst_floorfiltercontroller.qml @@ -14,12 +14,12 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.0 -import QtTest 1.0 +import QtQuick +import QtTest -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import Esri.ArcGISRuntime.Toolkit.Controller TestCase { id: floorFilterControllerFuncTest diff --git a/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/FloorFilterFuncTest.pro b/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/FloorFilterFuncTest.pro index a117b64f8..9b472a448 100644 --- a/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/FloorFilterFuncTest.pro +++ b/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/FloorFilterFuncTest.pro @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -CONFIG += c++14 warn_on qmltestcase +CONFIG += c++17 warn_on qmltestcase TEMPLATE = app -ARCGIS_RUNTIME_VERSION = 100.15.0 +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/../../shared/arcgisruntime.pri) include($$PWD/../../../../../uitools/toolkitqml.pri) diff --git a/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/tst_floorfilter.qml b/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/tst_floorfilter.qml index 5122704a0..7bcdafd8b 100644 --- a/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/tst_floorfilter.qml +++ b/tests/uitools/qml_quick/functional_tests/FloorFilterFuncTest/tst_floorfilter.qml @@ -15,14 +15,14 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.0 -import QtQuick.Controls 2.15 -import QtTest 1.0 +import QtQuick +import QtQuick.Controls +import QtTest -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 -import utils 1.0 +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import Esri.ArcGISRuntime.Toolkit.Controller +import utils Rectangle { id: root @@ -367,7 +367,7 @@ Rectangle { // pan mapview mouseDrag(viewMulti, viewMulti.width / 2, viewMulti.height / 2, 30, 0); // spy on the setViewpoint - let spyViewpoint = createTemporaryQmlObject('import QtQuick 2.0; SignalSpy { target: viewMulti; signalName : "setViewpointCompleted" }', root); + let spyViewpoint = createTemporaryQmlObject('import QtQuick; SignalSpy { target: viewMulti; signalName : "setViewpointCompleted" }', root); mouseClick(zoom); spyViewpoint.wait(); // select site again, go to facility view @@ -429,7 +429,7 @@ Rectangle { // if floorManager already loaded, skip the wait. Otherwise wait for the signal if(ff.controller.floorManager != null ? ff.controller.floorManager.loadStatus !== Enums.LoadStatusLoaded : true) ff.controller.spy.wait(10000); - let spyViewpoint = createTemporaryQmlObject('import QtQuick 2.0; SignalSpy { signalName : "setViewpointCompleted" }', root); + let spyViewpoint = createTemporaryQmlObject('import QtQuick; SignalSpy { signalName : "setViewpointCompleted" }', root); spyViewpoint.target = ff.geoView; // reset by zooming out let builder = ArcGISRuntimeEnvironment.createObject('EnvelopeBuilder', { diff --git a/tests/uitools/qml_quick/shared/utils.cpp b/tests/uitools/qml_quick/shared/utils.cpp index d424d0ab7..b6bf77ca7 100644 --- a/tests/uitools/qml_quick/shared/utils.cpp +++ b/tests/uitools/qml_quick/shared/utils.cpp @@ -23,8 +23,6 @@ QString Utils::urlFileName(const QString& urlName) /*! \internal \brief Creates a Singleton Instance that can be accesses without instantiating the class. - \param engine - \param scriptEngine */ QObject* Utils::createSingletonInstance(QQmlEngine* engine, QJSEngine* scriptEngine) { diff --git a/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/FloorFilterControllerUnitTest.pro b/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/FloorFilterControllerUnitTest.pro index 891572a29..5426846de 100644 --- a/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/FloorFilterControllerUnitTest.pro +++ b/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/FloorFilterControllerUnitTest.pro @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -CONFIG += c++14 warn_on qmltestcase +CONFIG += c++17 warn_on qmltestcase TEMPLATE = app -ARCGIS_RUNTIME_VERSION = 100.15.0 +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/../../shared/arcgisruntime.pri) include($$PWD/../../../../../uitools/toolkitqml.pri) diff --git a/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/tst_floorfiltercontroller.qml b/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/tst_floorfiltercontroller.qml index 3ec489981..962743fba 100644 --- a/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/tst_floorfiltercontroller.qml +++ b/tests/uitools/qml_quick/unit_tests/FloorFilterControllerUnitTest/tst_floorfiltercontroller.qml @@ -14,12 +14,12 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.0 -import QtTest 1.0 +import QtQuick +import QtTest -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import Esri.ArcGISRuntime.Toolkit.Controller TestCase { id: floorFilterControllerUnitTest @@ -151,7 +151,7 @@ TestCase { function test_setSelectedLevelId() { var control = loadFloorManagerMultiple(); var ffLevelIdSpy = createTemporaryQmlObject( - 'import QtQuick 2.0; SignalSpy {signalName: "onSelectedLevelIdChanged"}', floorFilterControllerUnitTest); + 'import QtQuick; SignalSpy {signalName: "onSelectedLevelIdChanged"}', floorFilterControllerUnitTest); ffLevelIdSpy.target = control var level = control.floorManager.levels[1]; control.setSelectedLevelId(level.levelId); diff --git a/uitools/CONTRIBUTING.md b/uitools/CONTRIBUTING.md index d7904c3d6..0031de330 100644 --- a/uitools/CONTRIBUTING.md +++ b/uitools/CONTRIBUTING.md @@ -7,16 +7,16 @@ guidelines see [here](/CONTRIBUTING.md). - The [Building a better toolkit](https://community.esri.com/t5/arcgis-runtime-sdks-blog/building-a-better-toolkit/ba-p/888826) Esri community blog. -- The [Qt ArcGIS Runtime API Reference](https://developers.arcgis.com/qt/api-reference/). Which includes: +- The [ArcGIS Maps SDK for Qt Reference](https://developers.arcgis.com/qt/api-reference/). Which includes: - [Qt Toolkit API](https://developers.arcgis.com/qt/toolkit/api-reference/). - [QML API](https://developers.arcgis.com/qt/qml/api-reference/). - [C++ API](https://developers.arcgis.com/qt/cpp/api-reference/). -- The [Qt ArcGIS Runtime Guide](https://developers.arcgis.com/qt/). +- The [ArcGIS Maps SDK for Qt Guide](https://developers.arcgis.com/qt/). ## UI Tools Architecture -ArcGIS Runtime for Qt provides 3 different GUI workflows. +ArcGIS Maps SDK for Qt provides 3 different GUI workflows. 1. **QtQuick/QML** The QML workflow is for applications written in pure QML. Used successfully in [AppStudio](https://www.esri.com/en-us/arcgis/products/arcgis-appstudio/overview). The overall philosophy of this API is that the developer should touch as little C++ code as possible. This workflow targets desktop and mobile devices. @@ -24,7 +24,7 @@ ArcGIS Runtime for Qt provides 3 different GUI workflows. 1. **Widgets/C++** The Widgets/C++ workflow is for applications written in pure C++ with a Qt widget front-end. Often used by users who care about performance/control. This workflow targets desktop **only**. -Of these, `QtQuick/QML` exposed an ArcGIS Runtime QML API, incompatible with C++ ArcGIS Runtime API used in `Widgets/C++` & `QtQuick/C++`. +Of these, `QtQuick/QML` exposes the API for QML, whic is incompatible with the API for C++ used in `Widgets/C++` & `QtQuick/C++`. The challenge of writing UI tools then, is to target all these workflows with as minimum repetition as possible. The worst case scenario would be writing three separate implementations for each workflow, leading to subtle differences and code duplication. @@ -33,7 +33,7 @@ As such this module is split up into `Controller` and `View` components like so: ![UI Tools Architecture diagram](images/docs/architecture_uitools.svg) -The Controller layer handles consuming an ArcGIS Runtime API and communicating with an API-agnostic View layer. +The Controller layer handles consuming the Maps SDK and communicating with an API-agnostic View layer. A QML View will use either a QML Controller or C++ Controller dependent on what workflow it is compiled for. A Widget View will always use the C++ Controller, thus sharing the same business logic with the Qt Quick/C++ workflow. @@ -85,8 +85,8 @@ What follows is general advice to be effective in writing tools. 2. Make use of the [Adaptor](https://refactoring.guru/design-patterns/adapter) pattern. - Exposing an ArcGIS Runtime class to to QML can be tricky because the C++ types don't expose properties for - free. The best way around this is to wrap an ArcGIS Runtime type in an adaptor, which exposes the required + Exposing a Maps SDK class to to QML can be tricky because the C++ types don't expose properties for + free. The best way around this is to wrap a Maps SDK type in an adaptor, which exposes the required properties in a QML friendly-way. For example, [FloorFilterSiteItem](cpp/Esri//ArcGISRuntime/Toolkit/FloorFilterSiteItem.h), wraps and exposes the properties of [FloorSite](https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-floorsite.html). diff --git a/uitools/README.md b/uitools/README.md index 08f35b2b0..0e87f6d5a 100644 --- a/uitools/README.md +++ b/uitools/README.md @@ -1,6 +1,6 @@ ## Introduction -This toolkit is an open source resource intended for use with the ArcGIS Runtime +This toolkit is an open source resource intended for use with the ArcGIS Maps SDK for Qt. It provides ready made UI components to complement mapping and GIS applications. Because it is open source you are encouraged to modify these tools and add your own. @@ -22,6 +22,7 @@ In the [API Documentation](https://developers.arcgis.com/qt/toolkit/api-referenc |Scalebar|[✔](https://developers.arcgis.com/qt/toolkit/api-reference/qml-scalebar.html)||| |Search view|[✔](https://developers.arcgis.com/qt/toolkit/api-reference/qml-searchview.html)|[✔](https://developers.arcgis.com/qt/toolkit/api-reference/qml-searchview.html)|| |Time slider|[✔](https://developers.arcgis.com/qt/toolkit/api-reference/qml-timeslider.html)|[✔](https://developers.arcgis.com/qt/toolkit/api-reference/qml-timeslider.html)|| +|Utility Network Trace |✔ | | | ## Showcase - Demo app @@ -30,7 +31,7 @@ In the [examples](examples) folder, there can be found three demo applications p ## Structure This repo contains 3 toolkit projects, each intended for use with a different -flavor of the ArcGIS Runtime SDK for Qt: +flavor of the ArcGIS Maps SDK for Qt: - toolkitqml (for use with QML only apps) - toolkitcpp (for use with C++ apps which use a QtQuick UI) @@ -46,7 +47,7 @@ project. A good way to start using the toolkit is to use one of the template apps which get added to QtCreator when you install the ArcGIS Runime SDK for Qt. -- In QtCreator choose `File/New file or project/ArcGIS/ArcGIS Runtime 100.15 Quick QML App` +- In QtCreator choose `File/New file or project/ArcGIS/ArcGIS Maps 200.0.0 Quick QML App` - choose settings to match the platform etc. you are building for - in the `.pro` file of your new app, add a line to add the toolkit for your QML application. For example: @@ -74,14 +75,14 @@ Once you have successfully imported the toolkit, you can access individual tools in your own QML files. - add an import statement for the toolkit: - `import Esri.ArcGISRuntime.Toolkit 100.15` + `import Esri.ArcGISRuntime.Toolkit` - declare the tool you wish to use. Generally you will also have to supply the `GeoView` etc. you wish the tool to work with. For example, to add a `NorthArrow`: ```qml -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit MapView { id: mapView @@ -110,7 +111,7 @@ MapView { A good way to start using the toolkit is to use one of the template apps which get added to QtCreator when you install the ArcGIS Runime SDK for Qt. -- In QtCreator choose `File/New file or project/ArcGIS/ArcGIS Runtime 100.15 Qt Quick C++ App` +- In QtCreator choose `File/New file or project/ArcGIS/ArcGIS Maps 200.0.0 Qt Quick C++ App` - choose settings to match the platform etc. you are building for - in the `.pro` file of your new app, add a line to add the library for your QML plugin - for example: @@ -141,12 +142,12 @@ Once you have successfully imported the toolkit, you can access individual tools in your own QML files. - add an import statement for the toolkit: -`import Esri.ArcGISRuntime.Toolkit 100.15` +`import Esri.ArcGISRuntime.Toolkit` - declare the tool you wish to use. Generally you will also have to supply the `GeoView` etc. you wish the tool to work with. For example, to add a `NorthArrow`: ```qml -import Esri.ArcGISRuntime.Toolkit 100.15 +import Esri.ArcGISRuntime.Toolkit MapView { id: mapView @@ -169,9 +170,9 @@ MapView { #### Importing the toolkit (toolkitwidgets.pri) A good way to start using the toolkit is to use one of the template apps which -get added to QtCreator when you install the ArcGIS Runtime SDK for Qt. +get added to QtCreator when you install the ArcGIS Maps SDK for Qt. -- In QtCreator choose `File/New file or project/ArcGIS/ArcGIS Runtime 100.15 Qt Widgets App` +- In QtCreator choose `File/New file or project/ArcGIS/ArcGIS Maps 200.0.0 Qt Widgets App` - choose settings to match the platform etc. you are building for - in the `.pro` file of your new app, add a line to add the library for your QML plugin - for example: @@ -201,4 +202,4 @@ in your own widgets files. ## API Key requirements Some of the toolkit components and examples utilize ArcGIS Platform services which require an API Key. -Please see the [setup guide](https://developers.arcgis.com/qt/get-started/#3-access-services-and-content-with-an-api-key) for more information. \ No newline at end of file +Please see the [setup guide](https://developers.arcgis.com/qt/get-started/#3-access-services-and-content-with-an-api-key) for more information. diff --git a/uitools/common.pri b/uitools/common.pri index 8f1f412bf..0a888a2ff 100644 --- a/uitools/common.pri +++ b/uitools/common.pri @@ -48,7 +48,13 @@ HEADERS += $$CPPPATH/AuthenticationController.h \ $$CPPPATH/SearchSuggestion.h \ $$CPPPATH/SearchViewController.h \ $$CPPPATH/SmartLocatorSearchSource.h \ - $$CPPPATH/TimeSliderController.h + $$CPPPATH/TimeSliderController.h \ + $$CPPPATH/UtilityNetworkFunctionTraceResult.h \ + $$CPPPATH/UtilityNetworkFunctionTraceResultsModel.h \ + $$CPPPATH/UtilityNetworkListItem.h \ + $$CPPPATH/UtilityNetworkTraceController.h \ + $$CPPPATH/UtilityNetworkTraceStartingPoint.h \ + $$CPPPATH/UtilityNetworkTraceStartingPointsModel.h SOURCES += $$CPPPATH/AuthenticationController.cpp \ $$CPPPATH/BasemapGalleryController.cpp \ @@ -78,4 +84,10 @@ SOURCES += $$CPPPATH/AuthenticationController.cpp \ $$CPPPATH/SearchSuggestion.cpp \ $$CPPPATH/SearchViewController.cpp \ $$CPPPATH/SmartLocatorSearchSource.cpp \ - $$CPPPATH/TimeSliderController.cpp + $$CPPPATH/TimeSliderController.cpp \ + $$CPPPATH/UtilityNetworkFunctionTraceResult.cpp \ + $$CPPPATH/UtilityNetworkFunctionTraceResultsModel.cpp \ + $$CPPPATH/UtilityNetworkListItem.cpp \ + $$CPPPATH/UtilityNetworkTraceController.cpp \ + $$CPPPATH/UtilityNetworkTraceStartingPoint.cpp \ + $$CPPPATH/UtilityNetworkTraceStartingPointsModel.cpp diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.cpp index 6148ea238..ba71675dc 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.cpp @@ -18,12 +18,7 @@ // ArcGISRuntime headers #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::AuthenticationController @@ -359,6 +354,4 @@ void AuthenticationController::cleanup() \brief List of strings representing the certificates held by the AuthenticationManager. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.h index 5fbed77d0..535f0ef6b 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/AuthenticationController.h @@ -24,13 +24,7 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ - -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class AuthenticationController : public QObject { @@ -93,8 +87,6 @@ class AuthenticationController : public QObject bool m_deleteChallengeOnProcessed = true; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_AUTHENTICATIONCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.cpp index 55c3c837e..5f4ec143e 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.cpp @@ -21,16 +21,23 @@ #include "Internal/SingleShotConnection.h" // ArcGISRuntime headers +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include // Qt headers #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { /*! @@ -725,6 +732,4 @@ namespace Toolkit { \sa Esri::ArcGISRuntime::Toolkit::BasemapGalleryController::gallery() */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.h index b9b55cd91..b5a8d7d9d 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.h @@ -31,9 +31,7 @@ // Qt forward declarations class QAbstractListModel; -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class BasemapGalleryController : public QObject { @@ -83,8 +81,6 @@ namespace Toolkit { GenericListModel* m_gallery = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_BASEMAPGALLERYCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.cpp index db1d2d32d..b86faa8a8 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.cpp @@ -22,6 +22,9 @@ // ArcGISRuntime headers #include +#include +#include +#include // Qt headers #include @@ -31,9 +34,7 @@ #include #endif // CPP_ARCGISRUNTIME_TOOLKIT -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { #ifdef CPP_ARCGISRUNTIME_TOOLKIT @@ -374,6 +375,4 @@ namespace Toolkit { \sa Esri::ArcGISRuntime::Toolkit::BasemapGalleryItem::thumbnailUrl() */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.h index cd936df24..aa3117d95 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BasemapGalleryItem.h @@ -25,10 +25,9 @@ #include #include #include +#include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class BasemapGalleryItem : public QObject { @@ -82,8 +81,6 @@ namespace Toolkit { QUuid m_id; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_BASEMAPGALLERYCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.cpp index c28c82be5..4a269a96b 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.cpp @@ -18,94 +18,90 @@ // ArcGISRuntime headers #include -namespace Esri { - namespace ArcGISRuntime { - namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { - /*! + /*! \inmodule EsriArcGISRuntimeToolkit \class Esri::ArcGISRuntime::Toolkit::BookmarkListItem \brief An item contained within \l BookmarksViewController::bookmarks. This class wraps a \c Bookmark for easy manipulation/inspection within an AbstractItemModel. */ - /*! + /*! \brief Constructs a new empty BookmarkListItem object with a given \a parent. */ - BookmarkListItem::BookmarkListItem(QObject* parent) : - BookmarkListItem(nullptr, parent) - { - } + BookmarkListItem::BookmarkListItem(QObject* parent) : + BookmarkListItem(nullptr, parent) + { + } - /*! + /*! \brief Constructs a new BookmarkListItem object with a given \a bookmark and \a parent. */ - BookmarkListItem::BookmarkListItem(Bookmark* bookmark, QObject* parent) : - QObject(parent), - m_bookmark(bookmark) - { - connect(this, &BookmarkListItem::bookmarkChanged, this, &BookmarkListItem::nameChanged); - } + BookmarkListItem::BookmarkListItem(Bookmark* bookmark, QObject* parent) : + QObject(parent), + m_bookmark(bookmark) + { + connect(this, &BookmarkListItem::bookmarkChanged, this, &BookmarkListItem::nameChanged); + } - /*! + /*! \brief Destructor. */ - BookmarkListItem::~BookmarkListItem() = default; + BookmarkListItem::~BookmarkListItem() = default; - /*! + /*! \brief Change the underlying item to \a bookmark. */ - void BookmarkListItem::setBookmark(Bookmark* bookmark) + void BookmarkListItem::setBookmark(Bookmark* bookmark) + { + if (m_bookmark == bookmark) { - if (m_bookmark == bookmark) - { - return; - } - - m_bookmark = bookmark; - emit bookmarkChanged(); + return; } - /*! + m_bookmark = bookmark; + emit bookmarkChanged(); + } + + /*! \brief Returns the current \c bookmark. */ - Bookmark* BookmarkListItem::bookmark() const - { - return m_bookmark; - } + Bookmark* BookmarkListItem::bookmark() const + { + return m_bookmark; + } - /*! + /*! \property Esri::ArcGISRuntime::Toolkit::BookmarkListItem::name \brief Returns the name of the item. */ - QString BookmarkListItem::name() const - { - return m_bookmark ? m_bookmark->name() : QString{}; - } + QString BookmarkListItem::name() const + { + return m_bookmark ? m_bookmark->name() : QString{}; + } - /*! + /*! \brief Sets the underlying item to \a name. */ - void BookmarkListItem::setName(const QString& name) + void BookmarkListItem::setName(const QString& name) + { + if (m_bookmark && m_bookmark->name() != name) { - if (m_bookmark && m_bookmark->name() != name) - { - m_bookmark->setName(name); - emit nameChanged(); - } + m_bookmark->setName(name); + emit nameChanged(); } + } - /*! + /*! \fn void Esri::ArcGISRuntime::Toolkit::BookmarkListItem::bookmarkChanged() \brief Signal emitted when the \l bookmark changes. */ - /*! + /*! \fn void Esri::ArcGISRuntime::Toolkit::BookmarkListItem::nameChanged() \brief Signal emitted when the \l bookmark name changes. */ - } // Toolkit - } // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.h index a094caec4..dc8a4ef36 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarkListItem.h @@ -20,37 +20,36 @@ #include #include -namespace Esri { - namespace ArcGISRuntime { - class Bookmark; - - namespace Toolkit { - class BookmarkListItem : public QObject - { - Q_OBJECT - Q_PROPERTY(QString name READ name NOTIFY nameChanged) - - public: - Q_INVOKABLE explicit BookmarkListItem(QObject* parent = nullptr); - Q_INVOKABLE explicit BookmarkListItem(Bookmark* bookmark, QObject* parent = nullptr); - ~BookmarkListItem() override; - - void setBookmark(Bookmark* bookmark); - Bookmark* bookmark() const; - - QString name() const; - void setName(const QString& name); - - signals: - void bookmarkChanged(); - void nameChanged(); - - private: - QPointer m_bookmark; - }; - - } // Toolkit - } // ArcGISRuntime -} // Esri +namespace Esri::ArcGISRuntime { + + class Bookmark; + + namespace Toolkit { + class BookmarkListItem : public QObject + { + Q_OBJECT + Q_PROPERTY(QString name READ name NOTIFY nameChanged) + + public: + Q_INVOKABLE explicit BookmarkListItem(QObject* parent = nullptr); + Q_INVOKABLE explicit BookmarkListItem(Bookmark* bookmark, QObject* parent = nullptr); + ~BookmarkListItem() override; + + void setBookmark(Bookmark* bookmark); + Bookmark* bookmark() const; + + QString name() const; + void setName(const QString& name); + + signals: + void bookmarkChanged(); + void nameChanged(); + + private: + QPointer m_bookmark; + }; + + } // Toolkit +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_BOOKMARKLISTITEM_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.cpp index e0b30682a..f3707b4be 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.cpp @@ -26,12 +26,12 @@ // ArcGISRuntime headers #include +#include #include #include +#include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { void setupBookmarks(BookmarkListModel* sourceModel, GenericListModel* targetModel) @@ -245,7 +245,7 @@ namespace Toolkit { } /*! - \brief Updates the \c GeoView camera to point to the current bookmark's + \brief Updates the \c GeoView camera to point to the current \a bookmark's location on the map. */ void BookmarksViewController::zoomToBookmarkExtent(BookmarkListItem* bookmark) @@ -271,9 +271,7 @@ namespace Toolkit { /*! \property Esri::ArcGISRuntime::Toolkit::BookmarksViewController::geoView \brief The geoView the controller is utilizing for interactions. - \sa Esri::ArcGISRuntime::Toolkit::BookmarksViewController::geoView() const + \sa Esri::ArcGISRuntime::Toolkit::BookmarksViewController::geoView */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.h index 652be00f0..e91c91b1c 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/BookmarksViewController.h @@ -23,41 +23,38 @@ // ArcGISRuntime headers #include #include + // Qt headers #include -namespace Esri { - namespace ArcGISRuntime { - namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { - class BookmarksViewController : public QObject - { - Q_OBJECT - Q_PROPERTY(QObject* geoView READ geoView WRITE setGeoView NOTIFY geoViewChanged) - Q_PROPERTY(QAbstractListModel* bookmarks READ bookmarks CONSTANT) - public: - Q_INVOKABLE BookmarksViewController(QObject* parent = nullptr); + class BookmarksViewController : public QObject + { + Q_OBJECT + Q_PROPERTY(QObject* geoView READ geoView WRITE setGeoView NOTIFY geoViewChanged) + Q_PROPERTY(QAbstractListModel* bookmarks READ bookmarks CONSTANT) + public: + Q_INVOKABLE BookmarksViewController(QObject* parent = nullptr); - ~BookmarksViewController() override; + ~BookmarksViewController() override; - QObject* geoView() const; + QObject* geoView() const; - void setGeoView(QObject* mapView); + void setGeoView(QObject* mapView); - GenericListModel* bookmarks() const; + GenericListModel* bookmarks() const; - Q_INVOKABLE void zoomToBookmarkExtent(Esri::ArcGISRuntime::Toolkit::BookmarkListItem* bookmark); + Q_INVOKABLE void zoomToBookmarkExtent(Esri::ArcGISRuntime::Toolkit::BookmarkListItem* bookmark); - signals: - void geoViewChanged(); + signals: + void geoViewChanged(); - private: - QObject* m_geoView = nullptr; - GenericListModel* m_bookmarks = nullptr; - }; + private: + QObject* m_geoView = nullptr; + GenericListModel* m_bookmarks = nullptr; + }; - } // Toolkit - } // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_BOOKMARKSVIEWCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.cpp index c27c23228..7e73babd5 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.cpp @@ -15,14 +15,7 @@ ******************************************************************************/ #include "CoordinateConversionConstants.h" -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ -namespace CoordinateConversionConstants -{ +namespace Esri::ArcGISRuntime::Toolkit::CoordinateConversionConstants { const QString DECIMAL_DEGREES_FORMAT = QStringLiteral("DD"); const QString DEGREES_DECIMAL_MINUTES_FORMAT = QStringLiteral("DDM"); @@ -33,7 +26,4 @@ const QString MGRS_FORMAT = QStringLiteral("MGRS"); const QString USNG_FORMAT = QStringLiteral("USNG"); const QString UTM_FORMAT = QStringLiteral("UTM"); -} // CoordinateConversionConstants -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit::CoordinateConversionConstants diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.h index 913c87c1a..f8c197c47 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionConstants.h @@ -18,14 +18,7 @@ #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ -namespace CoordinateConversionConstants -{ +namespace Esri::ArcGISRuntime::Toolkit::CoordinateConversionConstants { extern const QString DECIMAL_DEGREES_FORMAT; extern const QString DEGREES_DECIMAL_MINUTES_FORMAT; @@ -36,9 +29,6 @@ extern const QString MGRS_FORMAT; extern const QString USNG_FORMAT; extern const QString UTM_FORMAT; -} // CoordinateConversionConstants -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit::CoordinateConversionConstants #endif // ESRI_ARCGISRUNTIME_TOOLKIT_COORDINATECONVERSIONCONSTANTS_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.cpp index 655c976f9..9d5cfe174 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.cpp @@ -21,17 +21,19 @@ #include "Internal/GeoViews.h" // Qt headers +#include #include +#include // ArcGISRuntime headers +#include #include +#include +#include +#include +#include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { namespace { @@ -157,7 +159,7 @@ void CoordinateConversionController::setGeoView(QObject* geoView) if (m_inPickingMode && (!m_screenToLocationTask.isValid() || m_screenToLocationTask.isDone())) { - m_screenToLocationTask = sceneView->screenToLocation(event.x(), event.y()); + m_screenToLocationTask = sceneView->screenToLocation(event.pos().x(), event.pos().y()); event.accept(); } }); @@ -178,7 +180,7 @@ void CoordinateConversionController::setGeoView(QObject* geoView) { if (m_inPickingMode) { - setCurrentPoint(mapView->screenToLocation(event.x(), event.y())); + setCurrentPoint(mapView->screenToLocation(event.pos().x(), event.pos().y())); event.accept(); } }); @@ -509,6 +511,4 @@ void CoordinateConversionController::setInPickingMode(bool mode) \sa Esri::ArcGISRuntime::Toolkit::CoordinateConversionController::inPickingMode() */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.h index d5fdd8f52..b3f33eb49 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionController.h @@ -32,10 +32,7 @@ class QAbstractListModel; #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ +namespace Esri::ArcGISRuntime { class GeoView; @@ -113,7 +110,6 @@ public slots: }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_COORDINATECONVERSIONCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.cpp index e2aeb9244..ba365613b 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.cpp @@ -19,12 +19,7 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption @@ -441,6 +436,4 @@ Point CoordinateConversionOption::pointFromString(const QString& point, const Sp \sa Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption::garsConversionMode() */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.h index 546dc7655..002c16db3 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionOption.h @@ -24,13 +24,7 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ - -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class CoordinateConversionOption : public QObject { @@ -135,8 +129,6 @@ class CoordinateConversionOption : public QObject GarsConversionMode m_garsConvesrionMode = GarsConversionMode::Center; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_COORDINATECONVERSIONOPTION_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.cpp index e312ad2b2..9bdb1c435 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.cpp @@ -22,12 +22,7 @@ // ArcGISRuntime headers #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::CoordinateConversionResult @@ -187,6 +182,4 @@ void CoordinateConversionResult::copyNotationToClipboard() const \property Esri::ArcGISRuntime::Toolkit::CoordinateConversionResult::type */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.h index 94984efbb..1736f36b3 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateConversionResult.h @@ -26,13 +26,7 @@ // ArcGISRuntime headers #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ - +namespace Esri::ArcGISRuntime::Toolkit { class CoordinateConversionResult : public QObject { @@ -74,8 +68,6 @@ public slots: QPointer m_type; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_COORDINATECONVERSIONRESULT_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.cpp index af64b2b40..210e6cf0f 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.cpp @@ -17,12 +17,7 @@ #include "CoordinateConversionConstants.h" -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { CoordinateConversionOption* createDecimalDegrees(QObject* parent) { @@ -89,6 +84,4 @@ CoordinateConversionOption* createGars(GarsConversionMode mode, QObject* parent) return option; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.h index 42c0ea2df..45ace39c9 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.h @@ -18,12 +18,7 @@ #include "CoordinateConversionOption.h" -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { CoordinateConversionOption* createDecimalDegrees(QObject* parent = nullptr); @@ -39,8 +34,6 @@ CoordinateConversionOption* createUtm(UtmConversionMode mode = UtmConversionMode CoordinateConversionOption* createGars(GarsConversionMode mode = GarsConversionMode::Center, QObject* parent = nullptr); -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_COORDIANTEOPTIONDEFAULTS_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.qdoc b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.qdoc index c83db7bb6..62a17cd04 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.qdoc +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults.qdoc @@ -1,5 +1,6 @@ /*! * \headerfile Esri/ArcGISRuntime/Toolkit/CoordinateOptionDefaults +* \inmodule ArcGISRuntimeToolkit * This file contains several function to instantiate several kinds of common * CoordinateConversionOption objects used by a CoordinateConversionController. * \sa Esri::ArcGISRuntime::Toolkit::CoordinateConversionOption diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.cpp index 95844989a..2433d96c0 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.cpp @@ -23,8 +23,11 @@ #include #include #include +#include #include #include +#include +#include // Toolkit headers #include "FloorFilterFacilityItem.h" @@ -38,9 +41,7 @@ // stl headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { @@ -914,17 +915,17 @@ namespace Toolkit { */ /*! - \fn void Esri::ArcGISRuntime::Toolkit::FloorFilterController::selectedSiteIdChanged(QString oldId, QString newId) + \fn void Esri::ArcGISRuntime::Toolkit::FloorFilterController::selectedSiteIdChanged(const QString& oldId, const QString& newId) \brief Emitted when the selectedSiteId has changed from \a oldId to \a newId. */ /*! - \fn void Esri::ArcGISRuntime::Toolkit::FloorFilterController::selectedFacilityIdChanged(QString oldId, QString newId) + \fn void Esri::ArcGISRuntime::Toolkit::FloorFilterController::selectedFacilityIdChanged(const QString& oldId, const QString& newId) \brief Emitted when the selectedFacilityId has changed from \a oldId to \a newId. */ /*! - \fn void Esri::ArcGISRuntime::Toolkit::FloorFilterController::selectedLevelIdChanged(QString oldId, QString newId) + \fn void Esri::ArcGISRuntime::Toolkit::FloorFilterController::selectedLevelIdChanged(const QString& oldId, const QString& newId) \brief Emitted when the selectedLevelId has changed from \a oldId to \a newId. */ @@ -943,6 +944,4 @@ namespace Toolkit { \brief Emitted when the automaticSelectionModeChanged flag has changed. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.h index c822a418a..cbd750db9 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterController.h @@ -25,8 +25,7 @@ // Qt headers #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class Envelope; @@ -144,7 +143,6 @@ namespace ArcGISRuntime { }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_FLOORFILTERCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.cpp index 0951cebf7..c932115a9 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.cpp @@ -19,9 +19,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -119,6 +117,4 @@ namespace Toolkit { \brief Signal emitted when the wrapped \l floorFacility changes. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.h index fc163240c..53980e6d0 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterFacilityItem.h @@ -19,8 +19,8 @@ // Qt headers #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { + class FloorFacility; namespace Toolkit { @@ -52,7 +52,6 @@ namespace ArcGISRuntime { }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_FLOORFITLERFACILITYITEM_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.cpp index 0f6a57a44..2d97ea524 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.cpp @@ -18,9 +18,7 @@ // ArcGISRuntime headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -106,6 +104,4 @@ namespace Toolkit { \brief Signal emitted when the wrapped \l floorLevel changes. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.h index 32d915a95..aa9270b42 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterLevelItem.h @@ -19,8 +19,8 @@ // Qt headers #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { + class FloorLevel; namespace Toolkit { @@ -51,7 +51,6 @@ namespace ArcGISRuntime { }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_FLOORFITLERFLOORITEM_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.cpp index 8ecf1bc8f..bbe3e32b5 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.cpp @@ -18,9 +18,7 @@ // ArcGISRuntime headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -97,6 +95,4 @@ namespace Toolkit { \brief Signal emitted when the wrapped \l floorSite changes. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.h index 3a342097f..f29c69271 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/FloorFilterSiteItem.h @@ -19,8 +19,8 @@ // Qt headers #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { + class FloorSite; namespace Toolkit { @@ -48,7 +48,6 @@ namespace ArcGISRuntime { }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_FLOORFITLERFSITEITEM_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.cpp index 41f65c15c..c8c21c0d6 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.cpp @@ -22,11 +22,10 @@ // ArcGISRuntime headers #include +// Qt headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { #ifdef CPP_ARCGISRUNTIME_TOOLKIT namespace { @@ -233,12 +232,10 @@ namespace Toolkit { */ QQuickImageResponse* BasemapGalleryImageProvider::requestImageResponse(const QString& id, const QSize& requestedSize) { - auto itemIt = m_itemMap.find(id); + auto itemIt = m_itemMap.find(QUuid::fromString(id)); return new BasemapGalleryImageResponse(itemIt == std::end(m_itemMap) ? nullptr : itemIt.value(), requestedSize); } #endif // CPP_ARCGISRUNTIME_TOOLKIT -} // namespace Toolkit -} // namespace ArcGISRuntime -} // namespace Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.h index b2cb656bc..fc48eecc2 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/BasemapGalleryImageProvider.h @@ -20,9 +20,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class BasemapGalleryItem; @@ -45,9 +43,7 @@ namespace Toolkit { QObject* m_internalObject; QMap m_itemMap; }; -} // namespace Toolkit -} // namespace ArcGISRuntime -} // namespace Esri +} // Esri::ArcGISRuntime::Toolkit #endif // CPP_ARCGISRUNTIME_TOOLKIT #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_BASEMAPGALLERYIMAGEPROVIDER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DisconnectOnSignal.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DisconnectOnSignal.h index b8bdc7158..0e794d731 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DisconnectOnSignal.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DisconnectOnSignal.h @@ -22,9 +22,7 @@ // Qt headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /* \internal @@ -43,8 +41,6 @@ namespace Toolkit { }); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_DISCONNECTONSIGNAL_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DoOnLoad.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DoOnLoad.h index c56ead7b9..05b50eebd 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DoOnLoad.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/DoOnLoad.h @@ -18,6 +18,7 @@ // ArcGISRuntime headers #include +#include // Qt headers #include @@ -25,9 +26,7 @@ // C++ headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /* \internal @@ -77,8 +76,6 @@ namespace Toolkit { } } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_DOONLOAD_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.cpp index 2321c58a4..f8a203c8e 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.cpp @@ -19,9 +19,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -792,6 +790,4 @@ namespace Toolkit { \brief The current number of elements in this list model. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.h index 515fd7c59..4d0733079 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.h @@ -21,12 +21,7 @@ #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class GenericListModel : public QAbstractListModel { @@ -111,8 +106,6 @@ class GenericListModel : public QAbstractListModel std::function m_flagsCallback; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_GENERICLISTMODEL_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.cpp index d23f88ebb..3c6fbeade 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.cpp @@ -19,12 +19,7 @@ #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { namespace { @@ -294,8 +289,8 @@ QVariant GenericTableProxyModel::headerData(int section, Qt::Orientation orienta if (role != Qt::DisplayRole) return QVariant(); -if (Qt::Orientation::Vertical == orientation) - return section + 1; + if (Qt::Orientation::Vertical == orientation) + return section + 1; const auto roles = m_sourceModel ? m_sourceModel->roleNames() : QHash(); auto it = roles.find(section + Qt::UserRole + 1); @@ -381,6 +376,4 @@ bool GenericTableProxyModel::append(QObject* object) return m_sourceModel ? m_sourceModel->append(object) : false; } -} -} -} +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.h index 008517755..8f2938c15 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericTableProxyModel.h @@ -19,12 +19,7 @@ // Qt headers #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class GenericListModel; @@ -65,8 +60,6 @@ class GenericTableProxyModel : public QAbstractTableModel GenericListModel* m_sourceModel = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_GENERICTABLEPROXYMODEL_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.h index cf2660b1b..bd4e0bde7 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.h @@ -21,34 +21,24 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { using SceneViewToolkit = SceneGraphicsView; using MapViewToolkit = MapGraphicsView; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #else #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { using SceneViewToolkit = SceneQuickView; using MapViewToolkit = MapQuickView; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { inline Map* getGeoModel(MapViewToolkit* mapView) { return mapView ? mapView->map() : nullptr; @@ -68,8 +58,6 @@ namespace Toolkit { { return &SceneViewToolkit::sceneChanged; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_GEOVIEWS_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.qdoc b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.qdoc index 1df50e1f8..ad18f2344 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.qdoc +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GeoViews.qdoc @@ -78,4 +78,4 @@ \internal \fn auto getGeoModelChangedSignal(SceneViewToolkit*) \brief Returns the geoModelChanged signal from the Geoview. Helper overload. -*/ \ No newline at end of file +*/ diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.cpp index 68f4e1df1..2489a8a1f 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.cpp @@ -15,12 +15,7 @@ ******************************************************************************/ #include "MetaElement.h" -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \internal @@ -100,6 +95,4 @@ void MetaElement::emitDataChanged() \c QMetaMethod connection purposes. */ -} // Esri -} // ArcGISRuntime -} // Toolkit +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.h index d365f73d0..6011f95eb 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/MetaElement.h @@ -23,12 +23,7 @@ class QAbstractItemModel; -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class MetaElement : public QObject { @@ -49,8 +44,6 @@ private slots: QAbstractItemModel* m_parentModel = nullptr; }; -} // Esri -} // ArcGISRuntime -} // Toolkit +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_METAELEMENT_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/SingleShotConnection.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/SingleShotConnection.h index 3d984e140..74140a37d 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/SingleShotConnection.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/SingleShotConnection.h @@ -22,9 +22,7 @@ // C++ headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /* \internal @@ -44,8 +42,6 @@ namespace Toolkit { return *connection; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_SINGLESHOTCONNECTION_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.cpp index 96217fddf..5a5c39b02 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.cpp @@ -15,18 +15,27 @@ ******************************************************************************/ #include "LocatorSearchSource.h" +// Qt headers +#include +#include + // ArcGISRuntime headers +#include +#include +#include #include +#include +#include #include +#include #include // Toolkit headers #include "Internal/DoOnLoad.h" #include "SearchResult.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { + namespace { const char* MAP_PIN = "qrc:///esri.com/imports/Esri/ArcGISRuntime/Toolkit/images/pin-tear.svg"; @@ -271,6 +280,4 @@ namespace Toolkit { m_searchTask = m_locatorTask->geocodeWithParameters(searchString, params); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.h index e5cef46d4..9784c5057 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/LocatorSearchSource.h @@ -29,9 +29,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class LocatorSearchSource : public SearchSourceInterface { @@ -72,8 +70,6 @@ namespace Toolkit { }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_LOCATORSEARCHSOURCE_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.cpp index 4a7415826..9aa63511c 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.cpp @@ -17,12 +17,13 @@ #include "Internal/GeoViews.h" +#include "Camera.h" +#include "TaskWatcher.h" + // std headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::NorthArrowController @@ -145,6 +146,4 @@ namespace Toolkit { \property Esri::ArcGISRuntime::Toolkit::NorthArrowController::heading */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.h index 42b7be37d..a03267bd6 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/NorthArrowController.h @@ -19,12 +19,7 @@ // Qt headers #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class NorthArrowController : public QObject { @@ -53,8 +48,6 @@ public slots: QObject* m_geoView = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_NORTHARROWCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.cpp index d659ad416..7fbfaf27a 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.cpp @@ -18,21 +18,27 @@ #include "Internal/SingleShotConnection.h" // ArcGISRuntime headers +#include #include +#include #include +#include #include #include +#include +#include +#include #include #include #include +#include #include // Qt headers #include +#include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -412,6 +418,4 @@ namespace Toolkit { \sa Esri::ArcGISRuntime::Toolkit::OverviewMapController::scaleFactor() */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.h index 408fdf903..85767b58d 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/OverviewMapController.h @@ -25,16 +25,12 @@ // Qt headers #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class Graphic; class Symbol; -} -} +} // Esri::ArcGISRuntime -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class OverviewMapController : public QObject { @@ -81,8 +77,6 @@ namespace Toolkit { TaskWatcher m_updateGeoViewpointTask; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_OVERVIEWMAPCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.cpp index 1d6dfb744..154c218cf 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.cpp @@ -15,12 +15,14 @@ ******************************************************************************/ #include "PopupViewController.h" -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +#include + +#include "PopupAttachmentListModel.h" +#include "PopupAttachmentManager.h" +#include "PopupAttributeListModel.h" +#include "PopupManager.h" + +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::PopupViewController @@ -297,6 +299,4 @@ void PopupViewController::setAttachmentThumbnailHeight(int height) \property Esri::ArcGISRuntime::Toolkit::PopupViewController::title */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.h index 7ff3669ca..3c09cf4e7 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/PopupViewController.h @@ -24,10 +24,12 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ +Q_MOC_INCLUDE("PopupAttachmentListModel.h") + +namespace Esri::ArcGISRuntime { + +class PopupAttachmentListModel; +class PopupManager; namespace Toolkit { @@ -90,7 +92,6 @@ class PopupViewController : public QObject }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_POPUPVIEWCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.cpp index ff99fa2aa..d46b02cdc 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.cpp @@ -19,12 +19,14 @@ #include // ArcGISRuntime headers +#include #include +#include +#include #include +#include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { /* @@ -325,6 +327,4 @@ namespace Toolkit { \brief The current units system of this controller. Can be imperial or metric. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.h index a22bdb709..77a18f809 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/ScalebarController.h @@ -26,9 +26,7 @@ // Toolkit headers #include "Internal/GeoViews.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class ScalebarController : public QObject { @@ -67,8 +65,6 @@ namespace Toolkit { LinearUnit m_baseUnit{LinearUnitId::Meters}; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_NORTHARROWCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.cpp index 5730c6066..37032ccd6 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.cpp @@ -15,9 +15,7 @@ ******************************************************************************/ #include "SearchResult.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -220,6 +218,4 @@ namespace Toolkit { \property Esri::ArcGISRuntime::Toolkit::SearchResult::owningSource */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.h index 4d6987da1..a99184269 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchResult.h @@ -28,9 +28,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class SearchResult : public QObject { @@ -79,8 +77,6 @@ namespace Toolkit { Viewpoint m_selectionViewpoint; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_SEARCHRESULT_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.cpp index 1a08f5519..776983c6c 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.cpp @@ -15,9 +15,7 @@ ******************************************************************************/ #include "SearchSourceInterface.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -134,6 +132,4 @@ namespace Toolkit { \property Esri::ArcGISRuntime::Toolkit::SearchSourceInterface::displayName */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.h index eebb3d4da..172597c11 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSourceInterface.h @@ -25,27 +25,28 @@ #include #include #include +#include + +Q_MOC_INCLUDE("SearchResult.h") // Forward declarations -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class SuggestListModel; class SuggestResult; namespace Toolkit { class SearchResult; } -} -} +} // Esri::ArcGISRuntime -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class SearchSourceInterface : public QObject { Q_OBJECT + QML_INTERFACE Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged) + public: SearchSourceInterface(QObject* parent = nullptr); ~SearchSourceInterface() override; @@ -77,8 +78,8 @@ namespace Toolkit { QString m_displayName; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit + +Q_DECLARE_INTERFACE(Esri::ArcGISRuntime::Toolkit::SearchSourceInterface, "Esri::ArcGISRuntime::Toolkit::SearchSourceInterface") #endif // ESRI_ARCGISRUNTIME_TOOLKIT_SEARCHSOURCEINTERFACE_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.cpp index bac0f1728..a3e2555f0 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.cpp @@ -15,9 +15,7 @@ ******************************************************************************/ #include "SearchSuggestion.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \inmodule EsriArcGISRuntimeToolkit @@ -183,6 +181,4 @@ namespace Toolkit { /*! \property Esri::ArcGISRuntime::Toolkit::SearchSuggestion::collection */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.h index 91487b536..2a507244b 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchSuggestion.h @@ -27,9 +27,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class SearchSuggestion: public QObject { @@ -72,9 +70,7 @@ namespace Toolkit { SuggestResult m_suggestResult; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_SEARCHSUGGESTION_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.cpp index c34061e91..658044ae3 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.cpp @@ -23,16 +23,20 @@ #include "SmartLocatorSearchSource.h" // ArcGISRuntime headers +#include +#include #include #include #include +#include +#include +#include +#include #include #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { const char* DEFAULT_DEFAULT_PLACEHOLDER = "Find a place or address"; @@ -902,6 +906,4 @@ namespace Toolkit { /*! \property Esri::ArcGISRuntime::Toolkit::SearchViewController::automaticConfigurationEnabled */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.h index 8ffc97489..21fda2340 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SearchViewController.h @@ -31,20 +31,16 @@ #include // Forward declarations -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class Map; class Scene; class SymbolStyle; class GeocodeResult; class Graphic; class GraphicsOverlay; -} -} +} // Esri::ArcGISRuntime -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class SearchViewController : public QObject { @@ -159,8 +155,6 @@ namespace Toolkit { double m_thresholdRatioRepeatSearch{0.25}; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_SEARCHVIEWCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.cpp index aea92b8e1..41df518f3 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.cpp @@ -16,11 +16,15 @@ ******************************************************************************/ #include "SmartLocatorSearchSource.h" +#include + #include "Internal/SingleShotConnection.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +#include "GeocodeResult.h" +#include "SuggestListModel.h" +#include "SuggestResult.h" + +namespace Esri::ArcGISRuntime::Toolkit { namespace { constexpr int DEFAULT_REPEAT_SEARCH_RESULT_THRESHOLD = 1; @@ -189,6 +193,4 @@ namespace Toolkit { LocatorSearchSource::search(searchString, area); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.h index cc396c5f7..6bd96127b 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/SmartLocatorSearchSource.h @@ -26,9 +26,7 @@ // Qt headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class SmartLocatorSearchSource : public LocatorSearchSource { @@ -57,8 +55,6 @@ namespace Toolkit { int m_repeatSearchSuggestThreshold; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_SMARTLOCATORSEARCHSOURCE_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.cpp index 6943eda91..4e8337b9a 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.cpp +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.cpp @@ -19,20 +19,24 @@ #include "Internal/GeoViews.h" // ArcGISRuntime headers +#include +#include +#include #include +#include #include +#include #include +#include +// std headers #include +// Qt headers +#include #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { namespace { @@ -277,10 +281,10 @@ void TimeSliderController::initializeTimeProperties(LayerListModel* opLayers) if (!m_operationalLayers) return; - connect(m_operationalLayers.data(), &LayerListModel::layerAdded, + connect(m_operationalLayers.data(), &LayerListModel::itemAdded, this, qOverload<>(&TimeSliderController::initializeTimeProperties)); - connect(m_operationalLayers.data(), &LayerListModel::layerRemoved, + connect(m_operationalLayers.data(), &LayerListModel::itemRemoved, this, qOverload<>(&TimeSliderController::initializeTimeProperties)); for (auto layer : *m_operationalLayers) @@ -524,6 +528,4 @@ std::pair TimeSliderController::stepsForGeoViewExtent() const \property Esri::ArcGISRuntime::Toolkit::TimeSliderController::endStep */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.h index 8eb01559a..d11d7dc99 100644 --- a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.h +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/TimeSliderController.h @@ -21,13 +21,11 @@ #include // Qt headers +#include #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ +namespace Esri::ArcGISRuntime { class GeoView; class LayerListModel; @@ -89,7 +87,6 @@ private slots: }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_TIMESLIDERCONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResult.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResult.cpp new file mode 100644 index 000000000..982d938f8 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResult.cpp @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#include "UtilityNetworkFunctionTraceResult.h" + +namespace Esri::ArcGISRuntime::Toolkit { + +UtilityNetworkFunctionTraceResult::UtilityNetworkFunctionTraceResult(const QString& name, + UtilityTraceFunctionType type, + double value) : + m_name(name), + m_type(type), + m_value(value) +{ + // +} + +UtilityNetworkFunctionTraceResult::~UtilityNetworkFunctionTraceResult() = default; + +QString UtilityNetworkFunctionTraceResult::name() const +{ + return m_name; +} + +UtilityTraceFunctionType UtilityNetworkFunctionTraceResult::type() const +{ + return m_type; +} + +QString UtilityNetworkFunctionTraceResult::typeAsLabel() const +{ + switch(m_type) + { + case UtilityTraceFunctionType::Add: + return "Add"; + case UtilityTraceFunctionType::Average: + return "Average"; + case UtilityTraceFunctionType::Count: + return "Count"; + case UtilityTraceFunctionType::Max: + return "Max"; + case UtilityTraceFunctionType::Min: + return "Min"; + case UtilityTraceFunctionType::Subtract: + return "Subtract"; + default: + return "N/a"; + } +} + +double UtilityNetworkFunctionTraceResult::value() const +{ + return m_value; +} + +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResult.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResult.h new file mode 100644 index 000000000..9c7414b29 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResult.h @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef UTILITYNETWORKFUNCTIONTRACERESULT_H +#define UTILITYNETWORKFUNCTIONTRACERESULT_H + +// Toolkit headers +#include "Internal/GenericListModel.h" + +#include + +// Qt headers +#include + +namespace Esri::ArcGISRuntime::Toolkit { + +class UtilityNetworkFunctionTraceResult +{ + +public: + explicit UtilityNetworkFunctionTraceResult(); + UtilityNetworkFunctionTraceResult(const QString& name, + const UtilityTraceFunctionType type, + double value); + ~UtilityNetworkFunctionTraceResult(); + + QString name() const; + UtilityTraceFunctionType type() const; + QString typeAsLabel() const; + double value() const; + +private: + QString m_name; + UtilityTraceFunctionType m_type; + double m_value; +}; + +} // Esri::ArcGISRuntime::Toolkit + +#endif // UTILITYNETWORKFUNCTIONTRACERESULT_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResultsModel.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResultsModel.cpp new file mode 100644 index 000000000..760bda323 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResultsModel.cpp @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#include "UtilityNetworkFunctionTraceResultsModel.h" + +namespace Esri::ArcGISRuntime::Toolkit { + +UtilityNetworkFunctionTraceResultsModel::UtilityNetworkFunctionTraceResultsModel(QObject* parent) + : QAbstractListModel(parent) +{ + setupRoles(); +} + +Qt::ItemFlags UtilityNetworkFunctionTraceResultsModel::flags(const QModelIndex& index) const +{ + return QAbstractListModel::flags(index); +} + +int UtilityNetworkFunctionTraceResultsModel::rowCount(const QModelIndex& /*parent*/) const +{ + return static_cast(m_data.size()); +} + +QVariant UtilityNetworkFunctionTraceResultsModel::data(const QModelIndex& index, int role) const +{ + if (index.row() < 0 || index.row() >= rowCount()) + return QVariant(); + + const auto& functionResult = m_data[static_cast(index.row())]; + + switch (role) + { + case NameRole: + return functionResult.name(); + case TypeRole: + return functionResult.typeAsLabel(); + case ValueRole: + return functionResult.value(); + default: + qDebug() << "Incorrect UtilityNetworkFunctionTraceResultsModel data."; + } + + return {}; +} + +void UtilityNetworkFunctionTraceResultsModel::addFunctionResult(const UtilityNetworkFunctionTraceResult& functionResult) +{ + const int count = static_cast(m_data.size()); + beginInsertRows(QModelIndex(), count, count); + + m_data.push_back(functionResult); + + endInsertRows(); +} + +void UtilityNetworkFunctionTraceResultsModel::clear() +{ + beginResetModel(); + m_data.clear(); + endResetModel(); +} + +int UtilityNetworkFunctionTraceResultsModel::size() const +{ + return m_data.size(); +} + +QHash UtilityNetworkFunctionTraceResultsModel::roleNames() const +{ + return m_roles; +} + +void Esri::ArcGISRuntime::Toolkit::UtilityNetworkFunctionTraceResultsModel::setupRoles() +{ + m_roles[NameRole] = "name"; + m_roles[TypeRole] = "type"; + m_roles[ValueRole] = "value"; +} +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResultsModel.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResultsModel.h new file mode 100644 index 000000000..77fc67861 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkFunctionTraceResultsModel.h @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef UTILITYNETWORKFUNCTIONTRACERESULTSMODEL_H +#define UTILITYNETWORKFUNCTIONTRACERESULTSMODEL_H + +#include + +#include "UtilityNetworkFunctionTraceResult.h" + +namespace Esri::ArcGISRuntime { + +class UtilityElement; + +namespace Toolkit { + +class UtilityNetworkFunctionTraceResultsModel : public QAbstractListModel +{ + Q_OBJECT + +public: + explicit UtilityNetworkFunctionTraceResultsModel(QObject* parent = nullptr); + + enum StartingPointRoles + { + NameRole = Qt::UserRole + 1, + TypeRole = Qt::UserRole + 2, + ValueRole = Qt::UserRole + 3, + }; + + Qt::ItemFlags flags(const QModelIndex& index) const override; + + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + + void addFunctionResult(const UtilityNetworkFunctionTraceResult& functionResult); + + void clear(); + + int size() const; + + private: + QHash roleNames() const override; + + void setupRoles(); + + QHash m_roles; + QList m_data; +}; +} // namespace Toolkit +}// namespace Esri::ArcGISRuntime + +#endif // UTILITYNETWORKFUNCTIONTRACERESULTSMODEL_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkListItem.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkListItem.cpp new file mode 100644 index 000000000..83485f03a --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkListItem.cpp @@ -0,0 +1,95 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#include "UtilityNetworkListItem.h" + +// ArcGISRuntime headers +#include + +namespace Esri::ArcGISRuntime::Toolkit { + +/*! + \inmodule EsriArcGISRuntimeToolkit + \class Esri::ArcGISRuntime::Toolkit::UtilityNetworkListItem + \brief An item contained within \l UtilityNetworkTraceController::utilityNetworks. This class wraps + a \c UtilityNetwork for easy manipulation/inspection within an AbstractItemModel. + */ + +/*! + \brief Constructs a new empty UtilityNetworkListItem object with a given \a parent. + */ +UtilityNetworkListItem::UtilityNetworkListItem(QObject* parent) : + UtilityNetworkListItem(nullptr, parent) +{ +} + +/*! + \brief Constructs a new UtilityNetworkListItem object with a given \a utilityNetwork and + \a parent. + */ +UtilityNetworkListItem::UtilityNetworkListItem(UtilityNetwork* utilityNetwork, QObject* parent) : + QObject(parent), + m_utilityNetwork(utilityNetwork) +{ + connect(this, &UtilityNetworkListItem::utilityNetworkChanged, this, &UtilityNetworkListItem::nameChanged); +} + +/*! + \brief Destructor. + */ +UtilityNetworkListItem::~UtilityNetworkListItem() = default; + +/*! + \brief Change the underlying item to \a utilityNetwork. + */ +void UtilityNetworkListItem::setUtilityNetwork(UtilityNetwork* utilityNetwork) +{ + if (m_utilityNetwork == utilityNetwork) + { + return; + } + + m_utilityNetwork = utilityNetwork; + emit utilityNetworkChanged(); +} + +/*! + \brief Returns the current \c utilityNetwork. + */ +UtilityNetwork* UtilityNetworkListItem::utilityNetwork() const +{ + return m_utilityNetwork; +} + +/*! + \property Esri::ArcGISRuntime::Toolkit::UtilityNetworkListItem::name + \brief Returns the name of the item. + */ +QString UtilityNetworkListItem::name() const +{ + return m_utilityNetwork ? m_utilityNetwork->name() : QString{}; +} + +/*! + \fn void Esri::ArcGISRuntime::Toolkit::UtilityNetworkListItem::utilityNetworkChanged() + \brief Signal emitted when the \l utilityNetwork changes. + */ + +/*! + \fn void Esri::ArcGISRuntime::Toolkit::UtilityNetworkListItem::nameChanged() + \brief Signal emitted when the \l utilityNetwork name changes. + */ + +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkListItem.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkListItem.h new file mode 100644 index 000000000..bcd5b9f5f --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkListItem.h @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#ifndef ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKLISTITEM_H +#define ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKLISTITEM_H + +// Qt headers +#include +#include + +namespace Esri::ArcGISRuntime { +class UtilityNetwork; + +namespace Toolkit { +class UtilityNetworkListItem : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString name READ name NOTIFY nameChanged) + +public: + Q_INVOKABLE explicit UtilityNetworkListItem(QObject* parent = nullptr); + Q_INVOKABLE explicit UtilityNetworkListItem(UtilityNetwork* utilityNetwork, QObject* parent = nullptr); + ~UtilityNetworkListItem() override; + + void setUtilityNetwork(UtilityNetwork* utilityNetwork); + UtilityNetwork* utilityNetwork() const; + + QString name() const; + +signals: + void utilityNetworkChanged(); + void nameChanged(); + +private: + QPointer m_utilityNetwork; +}; + +} // Toolkit +} // Esri::ArcGISRuntime + +#endif // ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKLISTITEM_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceController.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceController.cpp new file mode 100644 index 000000000..29ab9a3a5 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceController.cpp @@ -0,0 +1,910 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#include "UtilityNetworkTraceController.h" + +// ArcGISRuntime headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Toolkit headers +#include "Internal/DisconnectOnSignal.h" +#include "Internal/DoOnLoad.h" +#include "Internal/GeoViews.h" +#include "UtilityNetworkFunctionTraceResult.h" +#include "UtilityNetworkFunctionTraceResultsModel.h" +#include "UtilityNetworkListItem.h" +#include "UtilityNetworkTraceStartingPoint.h" +#include "UtilityNetworkTraceStartingPointsModel.h" + +// Qt headers +#include +#include + +// std headers +#include + +namespace Esri::ArcGISRuntime::Toolkit { + +namespace { +/*! + \internal + \brief Manages the connection between Controller \a self and GeoView \a geoView. + Attempts to call functor `f` if/when the UtilityNetwork within the geoModel is loaded. + This may also cause the geoModel itself to load. + Will continue to call `f` every time a mapChanged signal is triggered on + the GeoView. + */ +template +void connectToGeoView(GeoViewToolkit* geoView, UtilityNetworkTraceController* self, Func&& f) +{ + static_assert( + std::is_same::value, + "Must be connected to a MapView"); + + auto connectToGeoModel = [self, geoView, f = std::forward(f)] + { + auto model = getGeoModel(geoView); + if (!model) + { + return; + } + + // Here we attempt to call `f` if/when both the GeoModel and UtilityNetwork are loaded. + // This may happen immediately or asyncnronously. This can be interrupted if GeoView or + // GeoModel changes in the interim. + auto c = doOnLoaded(model, self, [self, model, geoView, f = std::move(f)]() + { + auto utilityNetworks = model->utilityNetworks(); + + for (const auto utilityNetwork : *utilityNetworks) + { + if (!utilityNetwork) + continue; + + auto c2 = doOnLoaded(utilityNetwork, self, [f = std::move(f)] + { + f(); + }); + // Destroy the connection `c` if the map changes, or the geoView changes. + // This means the connection is only relevant for as long as the model/view is relavant to + // the UtilityNetworkTraceController. + disconnectOnSignal(geoView, getGeoModelChangedSignal(geoView), self, c2); + disconnectOnSignal(self, &UtilityNetworkTraceController::geoViewChanged, self, c2); + } + }); + + // Destroy the connection `c` if the map changes, or the geoView changes. This means + // the connection is only relevant for as long as the model/view is relavant to the UtilityNetworkTraceController. + disconnectOnSignal(geoView, getGeoModelChangedSignal(geoView), self, c); + disconnectOnSignal(self, &UtilityNetworkTraceController::geoViewChanged, self, c); + }; + + // Hooks up to any geoModels that appear when the mapView changed signal is called. + QObject::connect(geoView, getGeoModelChangedSignal(geoView), self, connectToGeoModel); + connectToGeoModel(); +} +} + +/*! +\class Esri::ArcGISRuntime::Toolkit::UtilityNetworkTraceController +\ingroup ArcGISQtToolkitUiCppControllers +\inmodule EsriArcGISRuntimeToolkit + +\brief In MVC architecture, this is the controller for the corresponding + Utility Network Trace that enables trace analysis to be performed on a Utility Network with the + selected named trace configuration and starting points. +*/ + +/*! +\brief Constructor. +\list + \li \a parent owning parent object. +\endlist +*/ +UtilityNetworkTraceController::UtilityNetworkTraceController(QObject* parent) : + QObject(parent), + m_startingPointParent(new QObject(this)), + m_startingPointsGraphicsOverlay(new GraphicsOverlay(m_startingPointParent)), + m_startingPoints(new UtilityNetworkTraceStartingPointsModel(this)), + m_functionResults(new UtilityNetworkFunctionTraceResultsModel(this)), + m_isAddingStartingPointEnabled(false), + m_isAddingStartingPointInProgress(false), + m_startingPointSymbol(new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Cross, QColor(Qt::green), 20.0f, this)), + m_resultsGraphicsOverlay(new GraphicsOverlay(this)), + m_resultPointSymbol(new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, + QColor(0, 0, 255, 126), + 20, + this)), + m_resultLineSymbol(new SimpleLineSymbol(SimpleLineSymbolStyle::Dot, + QColor(0, 0, 255, 126), + 5, + this)), + m_resultFillSymbol(new SimpleFillSymbol(SimpleFillSymbolStyle::ForwardDiagonal, + QColor(0, 0, 255, 126), + new SimpleLineSymbol(SimpleLineSymbolStyle::Solid, + QColor(0, 0, 255, 126), + 2, + this), + this)) +{ + // +} + +UtilityNetworkTraceController::~UtilityNetworkTraceController() = default; + +/*! + \brief Returns the \c GeoView as a \c QObject. + */ +QObject* UtilityNetworkTraceController::geoView() const +{ + return m_geoView; +} + +/*! + \brief Set the GeoView object this Controller uses. + + Internally this is cast to a \c MapView using \c qobject_cast, + which is why the paremeter is of form \c QObject and not \c GeoView. + + \list + \li \a geoView \c Object which must inherit from \c{GeoView*} and + \c{QObject*}. + \endlist + */ +void UtilityNetworkTraceController::setGeoView(QObject* geoView) +{ + if (geoView == m_geoView) + return; + + if (m_geoView) + { + disconnect(m_geoView, nullptr, this, nullptr); + + if (auto sceneView = qobject_cast(m_geoView)) + { + // scene does not have utility networks + return; + } + } + + m_geoView = geoView; + + // Important that this emit happens before the below connections, + // as this emit will destroy the connections set up below. + emit geoViewChanged(); + + if (auto mapView = qobject_cast(m_geoView)) + { + connect(this, + &UtilityNetworkTraceController::selectedUtilityNetworkChanged, // this should've already been handled and newValue used + this, + [this](UtilityNetwork* newValue) // when it's used, we also need to use it + { + if (newValue) + { + // have the connection, but the internal logic should be done when (or where) the newValue is handled. + auto c = connect(m_selectedUtilityNetwork, + &UtilityNetwork::queryNamedTraceConfigurationsCompleted, + this, + [this](QUuid taskId, const QList& utilityNamedTraceConfigurationResults) + { + const auto findIter = m_traceConfigConnection.constFind(taskId); + if (findIter != m_traceConfigConnection.cend()) + { + disconnect(*findIter); + m_traceConfigConnection.erase(findIter); + } + + m_traceConfigurations.clear(); + m_traceConfigurations = utilityNamedTraceConfigurationResults; + std::sort(std::begin(m_traceConfigurations), + std::end(m_traceConfigurations), + [](const auto& a, const auto& b) + { + return a->name() < b->name(); + }); + + QStringList traceConfigNamesTemp{}; + + for (const auto& traceConfig : m_traceConfigurations) + { + traceConfigNamesTemp.append(traceConfig->name()); + } + + setTraceConfigurationNames(traceConfigNamesTemp); + + if (!m_traceConfigurations.isEmpty()) + { + // select the first trace configuration by default + m_selectedTraceConfiguration = m_traceConfigurations.at(0); + } + }); + + auto traceConfigs = m_selectedUtilityNetwork->queryNamedTraceConfigurations(nullptr); + m_traceConfigConnection.insert(traceConfigs.taskId(), c); + } + else + { + refresh(); + } + }); + + mapView->graphicsOverlays()->append(m_startingPointsGraphicsOverlay); + mapView->graphicsOverlays()->append(m_resultsGraphicsOverlay); + + // handle the identify results + connect(mapView, &MapViewToolkit::identifyLayersCompleted, this, [this](QUuid, const QList& results) + { + for (const auto& layer : results) + { + for (const auto& geoElement : layer->geoElements()) + { + const auto ft = dynamic_cast(geoElement); + + if (geoElement) + addStartingPoint(ft, this->m_mapPoint); + } + } + + qDeleteAll(results); + + setIsAddingStartingPointInProgress(false); + }); + + // identify symbols on mouse click + connect(mapView, &MapViewToolkit::mouseClicked, this, [this, mapView](QMouseEvent& mouseEvent) + { + if (isAddingStartingPointInProgress() || !isAddingStartingPointEnabled()) + return; + + setIsAddingStartingPointEnabled(false); + setIsAddingStartingPointInProgress(true); + + const double tolerance = 10.0; + const bool returnPopups = false; + m_mapPoint = mapView->screenToLocation(mouseEvent.pos().x(), mouseEvent.pos().y()); + + mapView->identifyLayers(mouseEvent.pos().x(), mouseEvent.pos().y(), tolerance, returnPopups); + }); + + connect(this, &UtilityNetworkTraceController::selectedTraceConfigurationChanged, this, [this]() + { + this->applyStartingPointWarnings(); + }); + + connect(this, &UtilityNetworkTraceController::startingPointsChanged, this, [this]() + { + this->applyStartingPointWarnings(); + }); + + setupUtilityNetworks(); + } +} + +UtilityNetwork* UtilityNetworkTraceController::selectedUtilityNetwork() const +{ + return m_selectedUtilityNetwork; +} + +void UtilityNetworkTraceController::setSelectedUtilityNetwork(UtilityNetwork* selectedUtilityNetwork) +{ + if (m_selectedUtilityNetwork == selectedUtilityNetwork) + return; + + disconnect(m_selectedUtilityNetwork, nullptr, this, nullptr); + + m_selectedUtilityNetwork = selectedUtilityNetwork; + + connect(m_selectedUtilityNetwork, &UtilityNetwork::traceCompleted, this, &UtilityNetworkTraceController::onTraceCompleted); + connect(m_selectedUtilityNetwork, &UtilityNetwork::errorOccurred, this, &UtilityNetworkTraceController::onSelectedUtilityNetworkError); + connect(m_selectedUtilityNetwork, &UtilityNetwork::featuresForElementsCompleted, this, &UtilityNetworkTraceController::onFeaturesForElementsCompleted); + + emit selectedUtilityNetworkChanged(m_selectedUtilityNetwork); +} + +QAbstractItemModel* UtilityNetworkTraceController::startingPoints() const +{ + return m_startingPoints; +} + +QAbstractItemModel* UtilityNetworkTraceController::functionResults() const +{ + return m_functionResults; +} + +QStringList UtilityNetworkTraceController::traceConfigurationNames() const +{ + return m_traceConfigurationNames; +} + +void UtilityNetworkTraceController::setTraceConfigurationNames(const QStringList& traceConfigurationNames) +{ + if (m_traceConfigurationNames == traceConfigurationNames) + return; + + m_traceConfigurationNames = traceConfigurationNames; + emit traceConfigurationNamesChanged(); +} + +UtilityNamedTraceConfiguration* UtilityNetworkTraceController::selectedTraceConfiguration() const +{ + return m_selectedTraceConfiguration; +} + +void UtilityNetworkTraceController::setSelectedTraceConfiguration(UtilityNamedTraceConfiguration* selectedTraceConfiguration) +{ + if (m_selectedTraceConfiguration == selectedTraceConfiguration) + return; + + m_selectedTraceConfiguration = selectedTraceConfiguration; + emit selectedTraceConfigurationChanged(); +} + +bool UtilityNetworkTraceController::isTraceInProgress() const +{ + return m_isTraceInProgress; +} + +void UtilityNetworkTraceController::setIsTraceInProgress(const bool isTraceInProgress) +{ + if (m_isTraceInProgress == isTraceInProgress) + return; + + m_isTraceInProgress = isTraceInProgress; + emit isTraceInProgressChanged(); +} + +bool UtilityNetworkTraceController::isAddingStartingPointEnabled() const +{ + return m_isAddingStartingPointEnabled; +} + +void UtilityNetworkTraceController::setIsAddingStartingPointEnabled(const bool isAddingStartingPointEnabled) +{ + if (m_isAddingStartingPointEnabled == isAddingStartingPointEnabled) + return; + + m_isAddingStartingPointEnabled = isAddingStartingPointEnabled; + emit isAddingStartingPointEnabledChanged(); +} + +bool UtilityNetworkTraceController::isAddingStartingPointInProgress() const +{ + return m_isAddingStartingPointInProgress; +} + +void UtilityNetworkTraceController::setIsAddingStartingPointInProgress(const bool isAddingStartingPointInProgress) +{ + if (m_isAddingStartingPointInProgress == isAddingStartingPointInProgress) + return; + + m_isAddingStartingPointInProgress = isAddingStartingPointInProgress; + emit isAddingStartingPointInProgressChanged(); +} + +Symbol* UtilityNetworkTraceController::startingPointSymbol() const +{ + return m_startingPointSymbol; +} + +void UtilityNetworkTraceController::setStartingPointSymbol(Symbol* startingPointSymbol) +{ + if (m_startingPointSymbol == startingPointSymbol) + return; + + m_startingPointSymbol = startingPointSymbol; + emit startingPointSymbolChanged(); +} + +bool UtilityNetworkTraceController::isInsufficientStartingPoints() const +{ + return m_isInsufficientStartingPoints; +} + +void UtilityNetworkTraceController::setIsInsufficientStartingPoints(bool isInsufficientStartingPoints) +{ + if (m_isInsufficientStartingPoints == isInsufficientStartingPoints) + return; + + m_isInsufficientStartingPoints = isInsufficientStartingPoints; + emit isInsufficientStartingPointsChanged(); +} + +bool UtilityNetworkTraceController::isAboveMinimumStartingPoint() const +{ + return m_isAboveMinimumStartingPoint; +} + +void UtilityNetworkTraceController::setIsAboveMinimumStartingPoint(bool isAboveMinimumStartingPoint) +{ + if (m_isAboveMinimumStartingPoint == isAboveMinimumStartingPoint) + return; + + m_isAboveMinimumStartingPoint = isAboveMinimumStartingPoint; + emit isAboveMinimumStartingPointChanged(); +} + +bool UtilityNetworkTraceController::isResetResultsEnabled() const +{ + return m_isResetResultsEnabled; +} + +void UtilityNetworkTraceController::setIsResetResultsEnabled(bool isResetResultsEnabled) +{ + if (m_isResetResultsEnabled == isResetResultsEnabled) + return; + + m_isResetResultsEnabled = isResetResultsEnabled; + emit isResetResultsEnabledChanged(); +} + +void UtilityNetworkTraceController::runTrace(const QString& /*name*/) +{ + if (isTraceInProgress()) + return; + + resetTraceResults(); + + setIsTraceInProgress(true); + + if (m_utilityTraceParameters) + { + delete m_utilityTraceParameters; + m_utilityTraceParameters = nullptr; + } + + m_utilityTraceParameters = new UtilityTraceParameters(m_selectedTraceConfiguration, m_startingPoints->utilityElements(), this); + + // Async UtilityNetwork::trace + m_selectedUtilityNetwork->trace(m_utilityTraceParameters); +} + +QList UtilityNetworkTraceController::traceConfigurations() const +{ + return m_traceConfigurations; +} + +UtilityTraceResultListModel* UtilityNetworkTraceController::traceResults() +{ + return m_traceResults; +} + +void UtilityNetworkTraceController::refresh() +{ + delete m_selectedUtilityNetwork; + m_selectedUtilityNetwork = nullptr; + delete m_selectedTraceConfiguration; + m_selectedTraceConfiguration = nullptr; + m_traceConfigurations.clear(); + m_startingPoints->clear(); + m_functionResults->clear(); + m_startingPointsGraphicsOverlay->graphics()->clear(); + m_resultsGraphicsOverlay->graphics()->clear(); + m_isTraceInProgress = false; + m_isAddingStartingPointEnabled = false; + m_isAddingStartingPointInProgress = false; + m_isInsufficientStartingPoints = true; + m_isAboveMinimumStartingPoint = false; + m_isResetResultsEnabled = false; + emit startingPointsChanged(); + + if (m_startingPointParent) + { + delete m_startingPointParent; + m_startingPointParent = nullptr; + } + + m_startingPointParent = new QObject(this); + + setupUtilityNetworks(); +} + +void UtilityNetworkTraceController::addStartingPoint(ArcGISFeature* identifiedFeature, const Point& mapPoint) +{ + auto geometry = identifiedFeature->geometry(); + + if (!m_selectedUtilityNetwork) + return; + + auto utilityElement = m_selectedUtilityNetwork->createElementWithArcGISFeature(identifiedFeature); + + if (!utilityElement) + { + // This input feature does not belong to this utility network. + return; + } + + const auto startingPointAlreadyExists = m_startingPoints->doesItemAlreadyExist(utilityElement); + + // skip if starting point already exists for the selected utility element + if (!startingPointAlreadyExists) + { + if (utilityElement->networkSource()->sourceType() == UtilityNetworkSourceType::Edge && + geometry.geometryType() == GeometryType::Polyline) + { + auto polyline = geometry_cast(geometry); + if (polyline.hasZ()) + { + // get the geometry of the identified feature as a polyline, and remove the z component + polyline = geometry_cast(GeometryEngine::removeZ(polyline)); + } + + if (mapPoint.spatialReference() != polyline.spatialReference()) + { + polyline = geometry_cast(GeometryEngine::project(polyline, mapPoint.spatialReference())); + } + + geometry = polyline; + // compute how far the clicked location is along the edge feature + double fractionAlongEdge = GeometryEngine::fractionAlong(polyline, mapPoint, -1); + if (!std::isnan(fractionAlongEdge)) + { + // set the fraction along edge + utilityElement->setFractionAlongEdge(fractionAlongEdge); + } + } + else if (utilityElement->networkSource()->sourceType() == UtilityNetworkSourceType::Junction && + utilityElement->assetType()->terminalConfiguration() != nullptr) + { + auto utilityTerminalConfiguration = utilityElement->assetType()->terminalConfiguration(); + QList terminals = utilityTerminalConfiguration->terminals(); + if (terminals.size() > 1) + { + // The user can select between multiple terminals, but by default the first one is selected + utilityElement->setTerminal(utilityElement->assetType()->terminalConfiguration()->terminals().at(0)); + } + } + + auto graphic = new Graphic(geometry, m_startingPointParent); + graphic->attributes()->insertAttribute("GlobalId", utilityElement->globalId()); + graphic->setSymbol(m_startingPointSymbol); + auto featureLayer = dynamic_cast(identifiedFeature->featureTable()->layer()); + auto symbol = featureLayer->renderer()->symbol(identifiedFeature); + + m_startingPointsGraphicsOverlay->graphics()->append(graphic); + if (symbol == nullptr) + { + // Adding with null symbol + m_startingPoints->addStartingPoint(new UtilityNetworkTraceStartingPoint(utilityElement, graphic, symbol, featureLayer->fullExtent(), m_startingPointParent)); + emit startingPointsChanged(); + } + else + { + // Adding with extent + m_startingPoints->addStartingPoint(new UtilityNetworkTraceStartingPoint(utilityElement, graphic, symbol, graphic->geometry().extent(), m_startingPointParent)); + emit startingPointsChanged(); + } + } +} + +void UtilityNetworkTraceController::removeStartingPoint(int index) +{ + m_startingPoints->removeAt(index); + m_startingPointsGraphicsOverlay->graphics()->removeAt(index); + emit startingPointsChanged(); +} + +void UtilityNetworkTraceController::zoomToStartingPoint(int index) +{ + if (auto mapView = qobject_cast(m_geoView)) + { + const Viewpoint currVP = mapView->currentViewpoint(ViewpointType::CenterAndScale); + const Viewpoint newViewPoint(m_startingPoints->pointAt(index), currVP.targetScale()); + mapView->setViewpoint(newViewPoint, 1.0); + } +} + +void UtilityNetworkTraceController::removeAllStartingPoints() +{ + m_startingPointsGraphicsOverlay->graphics()->clear(); + m_startingPoints->clear(); + emit startingPointsChanged(); +} + +void UtilityNetworkTraceController::setSelectedTraceConfigurationNameByIndex(int index) +{ + if (m_traceConfigurations.size() > index) + setSelectedTraceConfiguration(m_traceConfigurations.at(index)); +} + +void UtilityNetworkTraceController::resetTraceResults() +{ + setIsResetResultsEnabled(false); + + // Clearing GEOMETRY TRACE RESULTS + auto graphics = m_resultsGraphicsOverlay->graphics(); + for (int i = 0; i < graphics->size(); ++i) + { + delete graphics->at(i); + } + m_resultsGraphicsOverlay->graphics()->clear(); + + // Clearing FUNCTION TRACE RESULTS + m_functionResults->clear(); + + // Clearing ELEMENT TRACE RESULTS + auto featuresList = m_selectedUtilityNetwork->featuresForElementsResult(); + QHash> layerToFeatures; + for (const auto f : *featuresList) + { + auto featureLayer = static_cast(f->featureTable()->layer()); + + auto findLayer = layerToFeatures.find(featureLayer); + if (findLayer == std::end(layerToFeatures)) + { + layerToFeatures[featureLayer] = {f}; + } + else + { + findLayer.value().append(f); + } + } + + const auto layerKeys = layerToFeatures.keys(); + for (const auto lyr : layerKeys) + { + lyr->unselectFeatures(layerToFeatures[lyr]); + } +} + +void UtilityNetworkTraceController::onTraceCompleted() +{ + m_traceResults = m_selectedUtilityNetwork->traceResult(); + + QList allElements; + + for (const auto result : *m_traceResults) + { + const auto type = result->traceResultObjectType(); + + switch (type) + { + case UtilityTraceResultObjectType::UtilityElementTraceResult: + { + // Trace completed with Element Result + setIsResetResultsEnabled(true); + auto elementResult = static_cast(result); + allElements.append(elementResult->elements()); + break; + } + case UtilityTraceResultObjectType::UtilityFunctionTraceResult: + { + // Trace completed with Function Result + setIsResetResultsEnabled(true); + const auto functionResult = static_cast(result); + const auto outputList = functionResult->functionOutputs(); + + for (const auto o : outputList) + { + m_functionResults->addFunctionResult(UtilityNetworkFunctionTraceResult(o->function()->networkAttribute()->name(), + o->function()->functionType(), + o->result().toDouble())); + } + + break; + } + case UtilityTraceResultObjectType::UtilityGeometryTraceResult: + { + // Trace completed with Geometry Result + setIsResetResultsEnabled(true); + auto geometryTraceResult = static_cast(result); + + auto multipoint = geometryTraceResult->multipoint(); + if (!multipoint.isEmpty()) + { + // will be deleted in resetTraceResults() + auto graphic = new Graphic(multipoint, + m_resultPointSymbol, + this); + m_resultsGraphicsOverlay->graphics()->append(graphic); + } + + auto polyline = geometryTraceResult->polyline(); + if (!polyline.isEmpty()) + { + // will be deleted in resetTraceResults() + auto graphic = new Graphic(polyline, + m_resultLineSymbol, + this); + m_resultsGraphicsOverlay->graphics()->append(graphic); + } + + auto polygon = geometryTraceResult->polygon(); + if (!polygon.isEmpty()) + { + // will be deleted in resetTraceResults() + auto graphic = new Graphic(polygon, + m_resultFillSymbol, + this); + m_resultsGraphicsOverlay->graphics()->append(graphic); + } + + break; + } + default: + { + qDebug() << "Trace completed without usable object type"; + break; + } + } + + } + + if (!allElements.isEmpty()) + { + // calling async featuresForElements with elements + m_selectedUtilityNetwork->featuresForElements(allElements); + } + else + { + // when the above async completes, the run trace in-progress will be set to false + setIsTraceInProgress(false); + } +} + +void UtilityNetworkTraceController::onSelectedUtilityNetworkError(const Error& e) +{ + qDebug() << "selectedUtilityNetwork Error Occurred" << e.message() << "||" << e.additionalMessage(); + setIsTraceInProgress(false); +} + +void UtilityNetworkTraceController::onFeaturesForElementsCompleted() +{ + auto featuresList = m_selectedUtilityNetwork->featuresForElementsResult(); + QHash> layerToFeatures; + for (const auto f : *featuresList) + { + auto featureLayer = static_cast(f->featureTable()->layer()); + + auto findLayer = layerToFeatures.find(featureLayer); + if (findLayer == std::end(layerToFeatures)) + { + layerToFeatures[featureLayer] = {f}; + } + else + { + findLayer.value().append(f); + } + } + + const auto layerKeys = layerToFeatures.keys(); + for (const auto lyr : layerKeys) + { + lyr->selectFeatures(layerToFeatures[lyr]); + } + + setIsTraceInProgress(false); +} + +void UtilityNetworkTraceController::setupUtilityNetworks() +{ + const auto mapView = qobject_cast(m_geoView); + // first check if there's a map + if (mapView->map() != nullptr) + { + connect(mapView->map(), &Map::doneLoading, this, [this, mapView]() + { + const auto& map = mapView->map(); + + if (!map->utilityNetworks()->isEmpty()) + { + // TODO append all UNs into a list and allow the user to select which one to load + // User can load any of them during the app's lifetime. + // Load the first one by default. + setSelectedUtilityNetwork(map->utilityNetworks()->at(0)); + + for (const auto un : qAsConst(*map->utilityNetworks())) + { + if (un->loadStatus() == LoadStatus::NotLoaded) + { + //single shot connection + QMetaObject::Connection* const connection = new QMetaObject::Connection; + *connection = connect(un, &UtilityNetwork::doneLoading, this, [connection](const Error& e) + { + if (!e.isEmpty()) + { + qDebug() << "Utility Network done loading with error:" << e.message() << e.additionalMessage(); + return; + } + // append UN with explicit loading + QObject::disconnect(*connection); + delete connection; + }); + un->load(); + } + } + } + else + { + qDebug() << "There are no Utility Networks associated with the ArcGIS Map attached " + << "to the MapView. Utility Network Trace will not be displayed. Call " + << "UtilityNetworkTrace.refresh() after updating the ArcGIS Map to try again."; + } + }); + + if (mapView->map()->loadStatus() != LoadStatus::Loaded) + { + // load the map if it is not already loaded + mapView->map()->load(); + } + } + else + { + qDebug() << "There is no ArcGIS Map attached to the MapView. Utility Network Trace will not be" + << " displayed. Call UtilityNetworkTrace.refresh() after updating the ArcGIS Map to try again."; + } +} + +void UtilityNetworkTraceController::applyStartingPointWarnings() +{ + if (selectedTraceConfiguration() != nullptr) + { + auto minimumStartingLocations = selectedTraceConfiguration()->minimumStartingLocations(); + auto minimum = 1; + if (minimumStartingLocations == UtilityMinimumStartingLocations::Many) + { + minimum = 2; + } + + setIsInsufficientStartingPoints(m_startingPoints->size() < minimum); + setIsAboveMinimumStartingPoint(m_startingPoints->size() > minimum); + } +} + +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceController.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceController.h new file mode 100644 index 000000000..af74f99d9 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceController.h @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#ifndef ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKTRACECONTROLLER_H +#define ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKTRACECONTROLLER_H + +// ArcGISRuntime headers +#include + +// Toolkit headers +#include "Internal/GenericListModel.h" +#include "Internal/GeoViews.h" + +// Qt headers +#include + +Q_MOC_INCLUDE("UtilityNetwork.h") +Q_MOC_INCLUDE("UtilityNetworkTraceStartingPoint.h") +Q_MOC_INCLUDE("UtilityNamedTraceConfiguration.h") +Q_MOC_INCLUDE("Symbol.h") + +namespace Esri::ArcGISRuntime { + +class ArcGISFeature; +class GraphicsOverlay; +class SimpleFillSymbol; +class SimpleLineSymbol; +class SimpleMarkerSymbol; +class Symbol; +class UtilityElementTraceResult; +class UtilityNamedTraceConfiguration; +class UtilityNetwork; +class UtilityNetworkListModel; +class UtilityTraceParameters; +class UtilityTraceResultListModel; + +namespace Toolkit { + +class UtilityNetworkFunctionTraceResultsModel; +class UtilityNetworkTraceStartingPoint; +class UtilityNetworkTraceStartingPointsModel; + +class UtilityNetworkTraceController : public QObject +{ + Q_OBJECT + Q_PROPERTY(QObject* geoView READ geoView WRITE setGeoView NOTIFY geoViewChanged) + Q_PROPERTY(UtilityNetwork* selectedUtilityNetwork READ selectedUtilityNetwork WRITE setSelectedUtilityNetwork NOTIFY selectedUtilityNetworkChanged) + Q_PROPERTY(UtilityNamedTraceConfiguration* selectedTraceConfiguration READ selectedTraceConfiguration WRITE setSelectedTraceConfiguration NOTIFY selectedTraceConfigurationChanged) + Q_PROPERTY(bool isTraceInProgress READ isTraceInProgress WRITE setIsTraceInProgress NOTIFY isTraceInProgressChanged) + Q_PROPERTY(bool isAddingStartingPointEnabled READ isAddingStartingPointEnabled WRITE setIsAddingStartingPointEnabled NOTIFY isAddingStartingPointEnabledChanged) + Q_PROPERTY(bool isAddingStartingPointInProgress READ isAddingStartingPointInProgress WRITE setIsAddingStartingPointInProgress NOTIFY isAddingStartingPointInProgressChanged) + Q_PROPERTY(Symbol* startingPointSymbol READ startingPointSymbol WRITE setStartingPointSymbol NOTIFY startingPointSymbolChanged) + Q_PROPERTY(QAbstractItemModel* startingPoints READ startingPoints CONSTANT) + Q_PROPERTY(QAbstractItemModel* functionResults READ functionResults CONSTANT) + Q_PROPERTY(QStringList traceConfigurationNames READ traceConfigurationNames NOTIFY traceConfigurationNamesChanged) + Q_PROPERTY(bool isInsufficientStartingPoints READ isInsufficientStartingPoints WRITE setIsInsufficientStartingPoints NOTIFY isInsufficientStartingPointsChanged) + Q_PROPERTY(bool isAboveMinimumStartingPoint READ isAboveMinimumStartingPoint WRITE setIsAboveMinimumStartingPoint NOTIFY isAboveMinimumStartingPointChanged) + Q_PROPERTY(bool isResetResultsEnabled READ isResetResultsEnabled WRITE setIsResetResultsEnabled NOTIFY isResetResultsEnabledChanged) + +public: + Q_INVOKABLE explicit UtilityNetworkTraceController(QObject* parent = nullptr); + + ~UtilityNetworkTraceController() override; + + QObject* geoView() const; + void setGeoView(QObject* mapView); + + UtilityNetwork* selectedUtilityNetwork() const; + void setSelectedUtilityNetwork(UtilityNetwork* selectedUtilityNetwork); + + QAbstractItemModel* startingPoints() const; + + QAbstractItemModel* functionResults() const; + + QStringList traceConfigurationNames() const; + void setTraceConfigurationNames(const QStringList& traceConfigurationNames); + + UtilityNamedTraceConfiguration* selectedTraceConfiguration() const; + void setSelectedTraceConfiguration(UtilityNamedTraceConfiguration* selectedTraceConfiguration); + + bool isTraceInProgress() const; + void setIsTraceInProgress(const bool isTraceInProgress); + + bool isAddingStartingPointEnabled() const; + void setIsAddingStartingPointEnabled(const bool isAddingStartingPointEnabled); + + bool isAddingStartingPointInProgress() const; + void setIsAddingStartingPointInProgress(const bool isAddingStartingPointInProgress); + + Symbol* startingPointSymbol() const; + void setStartingPointSymbol(Symbol* startingPointSymbol); + + bool isInsufficientStartingPoints() const; + void setIsInsufficientStartingPoints(bool isInsufficientStartingPoints); + + bool isAboveMinimumStartingPoint() const; + void setIsAboveMinimumStartingPoint(bool isAboveMinimumStartingPoint); + + bool isResetResultsEnabled() const; + void setIsResetResultsEnabled(bool isResetResultsEnabled); + + Q_INVOKABLE void runTrace(const QString& name); + + QList traceConfigurations() const; + + Q_INVOKABLE UtilityTraceResultListModel* traceResults(); + + Q_INVOKABLE void refresh(); + + Q_INVOKABLE void removeStartingPoint(int index); + + Q_INVOKABLE void zoomToStartingPoint(int index); + + Q_INVOKABLE void removeAllStartingPoints(); + + Q_INVOKABLE void setSelectedTraceConfigurationNameByIndex(int index); + + Q_INVOKABLE void resetTraceResults(); + +signals: + void geoViewChanged(); + void selectedUtilityNetworkChanged(Esri::ArcGISRuntime::UtilityNetwork* newValue); + void startingPointsChanged(); + void traceConfigurationNamesChanged(); + void selectedTraceConfigurationChanged(); + void isTraceInProgressChanged(); + void isAddingStartingPointEnabledChanged(); + void isAddingStartingPointInProgressChanged(); + void startingPointSymbolChanged(); + void isInsufficientStartingPointsChanged(); + void isAboveMinimumStartingPointChanged(); + void isResetResultsEnabledChanged(); + +private slots: + void onTraceCompleted(); + void onSelectedUtilityNetworkError(const Esri::ArcGISRuntime::Error& e); + void onFeaturesForElementsCompleted(); + +private: + void addStartingPoint(ArcGISFeature* identifiedFeature, const Point& mapPoint); + void setupUtilityNetworks(); + void applyStartingPointWarnings(); + + QObject* m_geoView = nullptr; + QObject* m_startingPointParent = nullptr; + GraphicsOverlay* m_startingPointsGraphicsOverlay = nullptr; + UtilityNetwork* m_selectedUtilityNetwork = nullptr; + QStringList m_traceConfigurationNames; + QList m_traceConfigurations; + UtilityNamedTraceConfiguration* m_selectedTraceConfiguration = nullptr; + UtilityNetworkTraceStartingPointsModel* m_startingPoints; + UtilityNetworkFunctionTraceResultsModel* m_functionResults; + UtilityTraceResultListModel* m_traceResults = nullptr; + bool m_isTraceInProgress = false; + bool m_isAddingStartingPointEnabled = false; // if so, user can select points on the map to become starting points + bool m_isAddingStartingPointInProgress = false; // if so, it's processing selected points on the map to be starting points + Symbol* m_startingPointSymbol; + Point m_mapPoint; + QMap m_traceConfigConnection; + bool m_isInsufficientStartingPoints = true; // during initialization, it cannot be sufficient + bool m_isAboveMinimumStartingPoint = false; // during initialization, it cannot be more than minimum + bool m_isResetResultsEnabled = false; + UtilityTraceParameters* m_utilityTraceParameters = nullptr; + GraphicsOverlay* m_resultsGraphicsOverlay = nullptr; + + // these won't get refreshed in refresh() because they shouldn't change + SimpleMarkerSymbol* m_resultPointSymbol = nullptr; + SimpleLineSymbol* m_resultLineSymbol = nullptr; + SimpleFillSymbol* m_resultFillSymbol = nullptr; +}; + +} // Toolkit +} // // Esri::ArcGISRuntime + +#endif // ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKTRACECONTROLLER_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPoint.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPoint.cpp new file mode 100644 index 000000000..9f37d0382 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPoint.cpp @@ -0,0 +1,176 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#include "UtilityNetworkTraceStartingPoint.h" + +// ArcGISRuntime headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Esri::ArcGISRuntime::Toolkit { + +UtilityNetworkTraceStartingPoint::UtilityNetworkTraceStartingPoint(QObject* parent) : + QObject(parent) +{ + // +} + +UtilityNetworkTraceStartingPoint::UtilityNetworkTraceStartingPoint(UtilityElement* utilityElement, + Graphic* selectionGraphic, + Symbol* featureSymbol, + Envelope extent, + QObject* parent) : + QObject(parent), + m_utilityElement(utilityElement), + m_selectionGraphic(selectionGraphic), + m_featureSymbol(featureSymbol), + m_extent(extent) +{ + if (m_utilityElement->assetType()->terminalConfiguration() != nullptr && + m_utilityElement->assetType()->terminalConfiguration()->terminals().size() > 1) + { + m_hasMultipleTerminals = true; + + m_multipleTerminals = m_utilityElement->assetType()->terminalConfiguration()->terminals(); + + QStringList multipleTerminalsTemp{}; + + for (const auto& terminal : m_multipleTerminals) + { + multipleTerminalsTemp.append(terminal->name()); + } + + m_multipleTerminalNames = multipleTerminalsTemp; + } + + if (m_selectionGraphic != nullptr && + m_utilityElement->networkSource()->sourceType() == UtilityNetworkSourceType::Edge && + m_selectionGraphic->geometry().geometryType() == GeometryType::Polyline) + { + m_hasFractionAlongEdge = true; + setFractionAlongEdge(m_utilityElement->fractionAlongEdge()); + + const auto polyline = static_cast(m_selectionGraphic->geometry()); + m_selectionGraphic->setGeometry( + GeometryEngine::createPointAlong(polyline, GeometryEngine::length(polyline) * fractionAlongEdge())); + + connect(this, + &UtilityNetworkTraceStartingPoint::fractionAlongEdgeChanged, + this, + [this, polyline](double newValue, double /*oldValue*/) + { + m_selectionGraphic->setGeometry( + GeometryEngine::createPointAlong(polyline, GeometryEngine::length(polyline) * fractionAlongEdge())); + m_utilityElement->setFractionAlongEdge(newValue); + }); + } +} + +UtilityNetworkTraceStartingPoint::~UtilityNetworkTraceStartingPoint() = default; + +Graphic* UtilityNetworkTraceStartingPoint::selectionGraphic() const +{ + return m_selectionGraphic; +} + +UtilityElement* UtilityNetworkTraceStartingPoint::utilityElement() const +{ + return m_utilityElement; +} + +Symbol* UtilityNetworkTraceStartingPoint::featureSymbol() const +{ + return m_featureSymbol; +} + +bool UtilityNetworkTraceStartingPoint::hasMultipleTerminals() const +{ + return m_hasMultipleTerminals; +} + +QStringList UtilityNetworkTraceStartingPoint::multipleTerminalNames() const +{ + return m_multipleTerminalNames; +} + +void UtilityNetworkTraceStartingPoint::setMultipleTerminalNames(const QStringList& multipleTerminalNames) +{ + if (m_multipleTerminalNames == multipleTerminalNames) + return; + + m_multipleTerminalNames = multipleTerminalNames; + emit multipleTerminalNamesChanged(); +} + +int UtilityNetworkTraceStartingPoint::selectedTerminalIndex() const +{ + return m_selectedTerminalIndex; +} + +void UtilityNetworkTraceStartingPoint::setSelectedTerminalNameByIndex(int index) +{ + if (m_multipleTerminalNames.size() > index) + { + m_selectedMultipleTerminal = m_multipleTerminals.at(index); + m_selectedTerminalIndex = index; + } +} + +bool UtilityNetworkTraceStartingPoint::hasFractionAlongEdge() const +{ + return m_hasFractionAlongEdge; +} + +double UtilityNetworkTraceStartingPoint::fractionAlongEdge() const +{ + return m_fractionAlongEdge; +} + +void UtilityNetworkTraceStartingPoint::setFractionAlongEdge(double fractionAlongEdge) +{ + if (m_fractionAlongEdge == fractionAlongEdge) + return; + + const auto oldValue = m_fractionAlongEdge; + m_fractionAlongEdge = fractionAlongEdge; + emit fractionAlongEdgeChanged(m_fractionAlongEdge, oldValue); +} + +Envelope UtilityNetworkTraceStartingPoint::extent() const +{ + return m_extent; +} + +QString UtilityNetworkTraceStartingPoint::groupName() const +{ + return utilityElement()->assetGroup()->name(); +} + +QString UtilityNetworkTraceStartingPoint::sourceName() const +{ + return utilityElement()->networkSource()->name(); +} + +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPoint.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPoint.h new file mode 100644 index 000000000..5fb8e4bd3 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPoint.h @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#ifndef ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKTRACESTARTINGPOINT_H +#define ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKTRACESTARTINGPOINT_H + +// Toolkit headers +#include "Internal/GenericListModel.h" + +// ArcGISRuntime headers +#include +#include +#include + +// Qt headers +#include + +namespace Esri::ArcGISRuntime { +class Graphic; +class Symbol; +} // Esri::ArcGISRuntime + +namespace Esri::ArcGISRuntime::Toolkit { + +class UtilityNetworkTraceStartingPoint : public QObject +{ + Q_OBJECT + +public: + Q_INVOKABLE explicit UtilityNetworkTraceStartingPoint(QObject* parent = nullptr); + Q_INVOKABLE UtilityNetworkTraceStartingPoint(Esri::ArcGISRuntime::UtilityElement* utilityElement, + Esri::ArcGISRuntime::Graphic* selectionGraphic, + Esri::ArcGISRuntime::Symbol* featureSymbol, + Esri::ArcGISRuntime::Envelope extent, + QObject* parent = nullptr); + ~UtilityNetworkTraceStartingPoint() override; + + Graphic* selectionGraphic() const; + + UtilityElement* utilityElement() const; + + Symbol* featureSymbol() const; + + bool hasMultipleTerminals() const; + + QStringList multipleTerminalNames() const; + void setMultipleTerminalNames(const QStringList& multipleTerminals); + int selectedTerminalIndex() const; + void setSelectedTerminalNameByIndex(int index); + + bool hasFractionAlongEdge() const; + + double fractionAlongEdge() const; + void setFractionAlongEdge(double fractionAlongEdge); + + Envelope extent() const; + + QString groupName() const; + QString sourceName() const; + +signals: + void multipleTerminalNamesChanged(); + void fractionAlongEdgeChanged(double newValue, double oldValue); + +private: + UtilityElement* m_utilityElement = nullptr; + Graphic* m_selectionGraphic = nullptr; + Symbol* m_featureSymbol = nullptr; + Envelope m_extent; + bool m_hasMultipleTerminals = false; + QStringList m_multipleTerminalNames; + QList m_multipleTerminals; + UtilityTerminal* m_selectedMultipleTerminal = nullptr; + int m_selectedTerminalIndex = 0; + bool m_hasFractionAlongEdge = false; + double m_fractionAlongEdge = 0.0; +}; + +} // Esri::ArcGISRuntime::Toolkit + +#endif // ESRI_ARCGISRUNTIME_TOOLKIT_UTILITYNETWORKTRACESTARTINGPOINT_H diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPointsModel.cpp b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPointsModel.cpp new file mode 100644 index 000000000..301620574 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPointsModel.cpp @@ -0,0 +1,183 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#include "UtilityNetworkTraceStartingPointsModel.h" + +#include + +#include "UtilityNetworkTraceStartingPoint.h" + +namespace Esri::ArcGISRuntime::Toolkit { + +UtilityNetworkTraceStartingPointsModel::UtilityNetworkTraceStartingPointsModel(QObject* parent) + : QAbstractListModel(parent) +{ + setupRoles(); +} + +Qt::ItemFlags UtilityNetworkTraceStartingPointsModel::flags(const QModelIndex& index) const +{ + return QAbstractListModel::flags(index); +} + +int UtilityNetworkTraceStartingPointsModel::rowCount(const QModelIndex& /*parent*/) const +{ + return static_cast(m_data.size()); +} + +QVariant UtilityNetworkTraceStartingPointsModel::data(const QModelIndex& index, int role) const +{ + if (index.row() < 0 || index.row() >= rowCount()) + return QVariant(); + + const auto& startingPoint = m_data[static_cast(index.row())]; + + switch (role) + { + case SourceNameRole: + return startingPoint->sourceName(); + case GroupNameRole: + return startingPoint->groupName(); + case HasFractionAlongEdgeRole: + return startingPoint->hasFractionAlongEdge(); + case FractionAlongEdgeRole: + return startingPoint->fractionAlongEdge(); + case HasMultipleTerminalsRole: + return startingPoint->hasMultipleTerminals(); + case MultipleTerminalNamesRole: + return startingPoint->multipleTerminalNames(); + case SelectedTerminalIndexRole: + return startingPoint->selectedTerminalIndex(); + default: + qDebug() << "Incorrect UtilityNetworkTraceStartingPointsModel data."; + } + + return {}; +} + +bool UtilityNetworkTraceStartingPointsModel::setData(const QModelIndex& index, const QVariant& value, int role) +{ + if (index.row() < 0 || index.row() >= rowCount()) + return false; + + auto& startingPoint = m_data[static_cast(index.row())]; + + switch (role) + { + case SourceNameRole: + break; + case GroupNameRole: + break; + case HasFractionAlongEdgeRole: + break; + case FractionAlongEdgeRole: + { + bool success = false; + double fraction = value.toDouble(&success); + if (success) + startingPoint->setFractionAlongEdge(fraction); + return success; + } + case HasMultipleTerminalsRole: + break; + case MultipleTerminalNamesRole: + break; + case SelectedTerminalIndexRole: + { + bool success = false; + int i = value.toInt(&success); + if (success) + startingPoint->setSelectedTerminalNameByIndex(i); + return success; + } + } + + return false; +} + +void UtilityNetworkTraceStartingPointsModel::addStartingPoint(UtilityNetworkTraceStartingPoint* startingPoint) +{ + const int count = static_cast(m_data.size()); + beginInsertRows(QModelIndex(), count, count); + + m_data.push_back(startingPoint); + + endInsertRows(); +} + +QList UtilityNetworkTraceStartingPointsModel::utilityElements() const +{ + QList utilityElementsForStartingPoints; + for (const auto& sp : m_data) + { + utilityElementsForStartingPoints.append(sp->utilityElement()); + } + + return utilityElementsForStartingPoints; +} + +void UtilityNetworkTraceStartingPointsModel::clear() +{ + beginResetModel(); + m_data.clear(); + endResetModel(); +} + +bool UtilityNetworkTraceStartingPointsModel::doesItemAlreadyExist(UtilityElement* utilityElement) const +{ + auto utilityElementId = utilityElement->objectId(); + for (const auto& startingPoint : m_data) + { + if (startingPoint->utilityElement()->objectId() == utilityElementId) + { + return true; + } + } + return false; +} + +void UtilityNetworkTraceStartingPointsModel::removeAt(int index) +{ + beginRemoveRows(QModelIndex(),index,index); + m_data.remove(index); + endRemoveRows(); +} + +Esri::ArcGISRuntime::Point UtilityNetworkTraceStartingPointsModel::pointAt(int index) +{ + return m_data.at(index)->extent().center(); +} + +int UtilityNetworkTraceStartingPointsModel::size() const +{ + return m_data.size(); +} + +QHash UtilityNetworkTraceStartingPointsModel::roleNames() const +{ + return m_roles; +} + +void UtilityNetworkTraceStartingPointsModel::setupRoles() +{ + m_roles[SourceNameRole] = "sourceName"; + m_roles[GroupNameRole] = "groupName"; + m_roles[HasFractionAlongEdgeRole] = "hasFractionAlongEdge"; + m_roles[FractionAlongEdgeRole] = "fractionAlongEdge"; + m_roles[HasMultipleTerminalsRole] = "hasMultipleTerminals"; + m_roles[MultipleTerminalNamesRole] = "multipleTerminalNames"; + m_roles[SelectedTerminalIndexRole] = "selectedTerminalIndex"; +} +} // namespace Esri::ArcGISRuntime::Toolkit diff --git a/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPointsModel.h b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPointsModel.h new file mode 100644 index 000000000..24d1c43b9 --- /dev/null +++ b/uitools/cpp/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTraceStartingPointsModel.h @@ -0,0 +1,82 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef UTILITYNETWORKTRACESTARTINGPOINTSMODEL_H +#define UTILITYNETWORKTRACESTARTINGPOINTSMODEL_H + +#include + +// ArcGISRuntime headers +#include + +namespace Esri::ArcGISRuntime { + +class UtilityElement; + +namespace Toolkit { +class UtilityNetworkTraceStartingPoint; + +class UtilityNetworkTraceStartingPointsModel : public QAbstractListModel +{ + Q_OBJECT + +public: + explicit UtilityNetworkTraceStartingPointsModel(QObject* parent = nullptr); + + enum StartingPointRoles + { + SourceNameRole = Qt::UserRole + 1, + GroupNameRole = Qt::UserRole + 2, + HasFractionAlongEdgeRole = Qt::UserRole + 3, + FractionAlongEdgeRole = Qt::UserRole + 4, + HasMultipleTerminalsRole = Qt::UserRole + 5, + MultipleTerminalNamesRole = Qt::UserRole + 6, + SelectedTerminalIndexRole = Qt::UserRole + 7, + }; + + Qt::ItemFlags flags(const QModelIndex& index) const override; + + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role) override; + + void addStartingPoint(UtilityNetworkTraceStartingPoint* startingPoint); + + QList utilityElements() const; + + void clear(); + + bool doesItemAlreadyExist(UtilityElement* utilityElement) const; + + void removeAt(int index); + + Point pointAt(int index); + + int size() const; + + private: + QHash roleNames() const override; + + void setupRoles(); + + QHash m_roles; + QList m_data; +}; +} // namespace Toolkit +} // namespace Esri::ArcGISRuntime + +#endif // UTILITYNETWORKTRACESTARTINGPOINTSMODEL_H diff --git a/uitools/examples/cpp_quick/cpp_quick.pro b/uitools/examples/cpp_quick/cpp_quick.pro index d0d18960a..d6d36be6a 100644 --- a/uitools/examples/cpp_quick/cpp_quick.pro +++ b/uitools/examples/cpp_quick/cpp_quick.pro @@ -16,7 +16,7 @@ TEMPLATE = app -CONFIG += c++14 qmltypes +CONFIG += c++17 qmltypes # additional modules are pulled in via arcgisruntime.pri QT += opengl qml quick @@ -26,20 +26,20 @@ QML_IMPORT_MAJOR_VERSION = 1 TARGET = cpp_quick -equals(QT_MAJOR_VERSION, 5) { - lessThan(QT_MINOR_VERSION, 15) { - error("$$TARGET requires Qt 5.15.2") - } - equals(QT_MINOR_VERSION, 15) : lessThan(QT_PATCH_VERSION, 2) { - error("$$TARGET requires Qt 5.15.2") - } +lessThan(QT_MAJOR_VERSION, 6) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") } equals(QT_MAJOR_VERSION, 6) { - error("This version of the ArcGIS Runtime SDK for Qt is incompatible with Qt 6") + lessThan(QT_MINOR_VERSION, 2) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } + equals(QT_MINOR_VERSION, 2) : lessThan(QT_PATCH_VERSION, 4) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } } -ARCGIS_RUNTIME_VERSION = 100.15.0 +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/arcgisruntime.pri) include($$PWD/../../toolkitcpp.pri) diff --git a/uitools/examples/cpp_quick/iOS/Info.plist b/uitools/examples/cpp_quick/iOS/Info.plist index 0a80e94ca..23bdc68d5 100644 --- a/uitools/examples/cpp_quick/iOS/Info.plist +++ b/uitools/examples/cpp_quick/iOS/Info.plist @@ -65,7 +65,7 @@ CFBundleVersion 1.0 NOTE - Built with ArcGIS Runtime SDK for Qt. + Built with ArcGIS Maps SDK for Qt. UIFileSharingEnabled FALSE UIRequiresPersistentWiFi diff --git a/uitools/examples/cpp_quick/src/BaseDemo.cpp b/uitools/examples/cpp_quick/src/BaseDemo.cpp index c6776746f..becc8f650 100644 --- a/uitools/examples/cpp_quick/src/BaseDemo.cpp +++ b/uitools/examples/cpp_quick/src/BaseDemo.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include diff --git a/uitools/examples/cpp_quick/src/BaseDemo.h b/uitools/examples/cpp_quick/src/BaseDemo.h index 31073c84f..85a1e0ad7 100644 --- a/uitools/examples/cpp_quick/src/BaseDemo.h +++ b/uitools/examples/cpp_quick/src/BaseDemo.h @@ -20,16 +20,14 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class GeoView; class GeoModel; class Map; class MapQuickView; class Scene; class SceneQuickView; -} -} +} // Esri::ArcGISRuntime class BaseDemo : public QObject { diff --git a/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemo.cpp b/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemo.cpp index 14d45dce7..295e266cc 100644 --- a/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemo.cpp +++ b/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemo.cpp @@ -17,6 +17,7 @@ #include "AuthenticationViewDemo.h" #include "Map.h" +#include "PortalItem.h" #include "Scene.h" AuthenticationViewDemo::AuthenticationViewDemo(QObject* parent) : diff --git a/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemoForm.qml b/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemoForm.qml index 7da240525..4663a6df8 100644 --- a/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/AuthenticationViewDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { mapViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.cpp b/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.cpp index b0fd657c3..31427b2c3 100644 --- a/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.cpp +++ b/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.cpp @@ -18,11 +18,12 @@ #include "Esri/ArcGISRuntime/Toolkit/BasemapGalleryController.h" -#include -#include -#include -#include -#include +#include "BasemapListModel.h" +#include "GeoView.h" +#include "Map.h" +#include "MapViewTypes.h" +#include "Portal.h" +#include "Scene.h" BasemapGalleryDemo::BasemapGalleryDemo(QObject* parent) : BaseDemo(parent), diff --git a/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.h b/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.h index 13bf1fd73..ba01c45c2 100644 --- a/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.h +++ b/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemo.h @@ -22,13 +22,11 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +Q_MOC_INCLUDE("BasemapGalleryController.h") + +namespace Esri::ArcGISRuntime::Toolkit { class BasemapGalleryController; -} -} -} +} // Esri::ArcGISRuntime::Toolkit class BasemapGalleryDemo : public BaseDemo { diff --git a/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemoForm.qml b/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemoForm.qml index 7d2adb1ef..026184921 100644 --- a/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/BasemapGalleryDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/BookmarksViewDemo.cpp b/uitools/examples/cpp_quick/src/demos/BookmarksViewDemo.cpp index 3f3bc5b5b..5a0dd5b9f 100644 --- a/uitools/examples/cpp_quick/src/demos/BookmarksViewDemo.cpp +++ b/uitools/examples/cpp_quick/src/demos/BookmarksViewDemo.cpp @@ -16,6 +16,7 @@ #include "BookmarksViewDemo.h" #include "Map.h" +#include "PortalItem.h" #include "Scene.h" using namespace Esri::ArcGISRuntime; diff --git a/uitools/examples/cpp_quick/src/demos/BookmarksViewDemoForm.qml b/uitools/examples/cpp_quick/src/demos/BookmarksViewDemoForm.qml index 558297ba7..92ee2b06e 100644 --- a/uitools/examples/cpp_quick/src/demos/BookmarksViewDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/BookmarksViewDemoForm.qml @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { mapViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/CalloutDemo.cpp b/uitools/examples/cpp_quick/src/demos/CalloutDemo.cpp index 468e603f4..eb9efd030 100644 --- a/uitools/examples/cpp_quick/src/demos/CalloutDemo.cpp +++ b/uitools/examples/cpp_quick/src/demos/CalloutDemo.cpp @@ -16,10 +16,13 @@ #include "CalloutDemo.h" +#include + +#include "CalloutData.h" #include "GeoView.h" #include "MapQuickView.h" #include "MapView.h" -#include "SceneQuickView.h" +#include "Point.h" using namespace Esri::ArcGISRuntime; @@ -51,10 +54,10 @@ void CalloutDemo::setUp() callData->setVisible(false); else { - Point mapPoint(mv->screenToLocation(mouse.x(), mouse.y())); + Point mapPoint(mv->screenToLocation(mouse.pos().x(), mouse.pos().y())); //atm the position is not working correctly with the setLocation callData->setLocation(mapPoint); - callData->setDetail("x: " + QString::number(mouse.x()) + " y: " + QString::number(mouse.y())); + callData->setDetail("x: " + QString::number(mouse.pos().x()) + " y: " + QString::number(mouse.pos().y())); callData->setVisible(true); } }); diff --git a/uitools/examples/cpp_quick/src/demos/CalloutDemoForm.qml b/uitools/examples/cpp_quick/src/demos/CalloutDemoForm.qml index 0ced73aad..7e14e8164 100644 --- a/uitools/examples/cpp_quick/src/demos/CalloutDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/CalloutDemoForm.qml @@ -14,12 +14,12 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { mapViewContents: Component { @@ -30,6 +30,15 @@ DemoPage { id: callout calloutData : view.calloutData //binding to parent. Any change is reflected on this accessoryButtonVisible: false + implicitHeight: 100 + leaderPosition: Callout.LeaderPosition.Automatic + maxWidth: 250 + background: Rectangle { + radius: 5 + border.width: 2 + border.color: "black" + } + palette.windowText: "black" } CalloutDemo { geoView: view diff --git a/uitools/examples/cpp_quick/src/demos/CoordinateConversionDemoForm.qml b/uitools/examples/cpp_quick/src/demos/CoordinateConversionDemoForm.qml index 980a37c22..6f55b187d 100644 --- a/uitools/examples/cpp_quick/src/demos/CoordinateConversionDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/CoordinateConversionDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/FloorFilterDemoForm.qml b/uitools/examples/cpp_quick/src/demos/FloorFilterDemoForm.qml index 6461670ff..2cbcda995 100644 --- a/uitools/examples/cpp_quick/src/demos/FloorFilterDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/FloorFilterDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { mapViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/NorthArrowDemoForm.qml b/uitools/examples/cpp_quick/src/demos/NorthArrowDemoForm.qml index 685167e20..a98a72367 100644 --- a/uitools/examples/cpp_quick/src/demos/NorthArrowDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/NorthArrowDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/OverviewMapDemoForm.qml b/uitools/examples/cpp_quick/src/demos/OverviewMapDemoForm.qml index de761154e..d1b13ab07 100644 --- a/uitools/examples/cpp_quick/src/demos/OverviewMapDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/OverviewMapDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/PopupViewDemo.cpp b/uitools/examples/cpp_quick/src/demos/PopupViewDemo.cpp index 371d0f029..c4c1b32ed 100644 --- a/uitools/examples/cpp_quick/src/demos/PopupViewDemo.cpp +++ b/uitools/examples/cpp_quick/src/demos/PopupViewDemo.cpp @@ -16,15 +16,29 @@ #include "PopupViewDemo.h" -#include "GeoView.h" +#include "Envelope.h" +#include "Error.h" +#include "Feature.h" +#include "GeoElement.h" +#include "IdentifyLayerResult.h" +#include "LayerListModel.h" #include "Map.h" +#include "MapTypes.h" #include "MapQuickView.h" +#include "MapViewTypes.h" +#include "Popup.h" +#include "PopupDefinition.h" #include "PopupManager.h" #include "Scene.h" #include "SceneQuickView.h" +#include "TaskWatcher.h" #include "ServiceFeatureTable.h" +#include "SpatialReference.h" +#include "Viewpoint.h" #include +#include +#include using namespace Esri::ArcGISRuntime; @@ -86,7 +100,7 @@ void PopupViewDemo::setUp() if (layer->layerType() == LayerType::FeatureLayer) { m_featureLayer = static_cast(layer); - geoView->identifyLayer(m_featureLayer, mouse.x(), mouse.y(), 12, false); + geoView->identifyLayer(m_featureLayer, mouse.pos().x(), mouse.pos().y(), 12, false); } else { diff --git a/uitools/examples/cpp_quick/src/demos/PopupViewDemoForm.qml b/uitools/examples/cpp_quick/src/demos/PopupViewDemoForm.qml index 046a616de..68deb14e1 100644 --- a/uitools/examples/cpp_quick/src/demos/PopupViewDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/PopupViewDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/ScalebarDemoForm.qml b/uitools/examples/cpp_quick/src/demos/ScalebarDemoForm.qml index d9aee558b..3871dcf04 100644 --- a/uitools/examples/cpp_quick/src/demos/ScalebarDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/ScalebarDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { mapViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/SearchViewDemoForm.qml b/uitools/examples/cpp_quick/src/demos/SearchViewDemoForm.qml index 7f7740f29..0b5de6ac2 100644 --- a/uitools/examples/cpp_quick/src/demos/SearchViewDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/SearchViewDemoForm.qml @@ -14,17 +14,18 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { - sceneViewContents: Component { - SceneView { + mapViewContents: Component { + MapView { id: view SearchView { + id: searchView geoView: parent anchors { top: parent.top @@ -38,8 +39,8 @@ DemoPage { } } - mapViewContents: Component { - MapView { + sceneViewContents: Component { + SceneView { id: view SearchView { geoView: parent diff --git a/uitools/examples/cpp_quick/src/demos/TimeSliderDemo.cpp b/uitools/examples/cpp_quick/src/demos/TimeSliderDemo.cpp index 8ef6e67bc..7f916021c 100644 --- a/uitools/examples/cpp_quick/src/demos/TimeSliderDemo.cpp +++ b/uitools/examples/cpp_quick/src/demos/TimeSliderDemo.cpp @@ -17,7 +17,9 @@ #include "TimeSliderDemo.h" #include "ArcGISMapImageLayer.h" +#include "LayerListModel.h" #include "Map.h" +#include "MapTypes.h" #include "Scene.h" using namespace Esri::ArcGISRuntime; diff --git a/uitools/examples/cpp_quick/src/demos/TimeSliderDemoForm.qml b/uitools/examples/cpp_quick/src/demos/TimeSliderDemoForm.qml index 1b8e6ca4f..002276864 100644 --- a/uitools/examples/cpp_quick/src/demos/TimeSliderDemoForm.qml +++ b/uitools/examples/cpp_quick/src/demos/TimeSliderDemoForm.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import DemoApp 1.0 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemo.cpp b/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemo.cpp new file mode 100644 index 000000000..ecc5af10a --- /dev/null +++ b/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemo.cpp @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#include "UtilityNetworkTraceDemo.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace Esri::ArcGISRuntime; + +UtilityNetworkTraceDemo::UtilityNetworkTraceDemo(QObject* parent) : + BaseDemo(parent) +{ + connect(AuthenticationManager::instance(), + &AuthenticationManager::authenticationChallenge, + this, + [parent](AuthenticationChallenge* challenge) + { + challenge->continueWithCredential(new Credential("viewer01", "I68VGU^nMurF", parent)); + }); +} + +UtilityNetworkTraceDemo::~UtilityNetworkTraceDemo() = default; + +Map* UtilityNetworkTraceDemo::initMap_(QObject* parent) const +{ + return new Map(QUrl{"https://www.arcgis.com/home/item.html?id=471eb0bf37074b1fbb972b1da70fb310"}, parent); +} + +Scene* UtilityNetworkTraceDemo::initScene_(QObject* /*parent*/) const +{ + return nullptr; +} diff --git a/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemo.h b/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemo.h new file mode 100644 index 000000000..f3fae6eb4 --- /dev/null +++ b/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemo.h @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +#ifndef ARCGIS_RUNTIME_TOOLKIT_CPP_QUICK_DEMO_UTILITYNETWORKTRACEDEMO_H +#define ARCGIS_RUNTIME_TOOLKIT_CPP_QUICK_DEMO_UTILITYNETWORKTRACEDEMO_H + +#include "BaseDemo.h" + +#include +#include + +class UtilityNetworkTraceDemo : public BaseDemo +{ + Q_OBJECT + QML_ELEMENT +public: + Q_INVOKABLE UtilityNetworkTraceDemo(QObject* parent = nullptr); + ~UtilityNetworkTraceDemo() override; + +protected: + Esri::ArcGISRuntime::Map* initMap_(QObject* parent) const override; + Esri::ArcGISRuntime::Scene* initScene_(QObject* parent) const override; +}; + +#endif // ARCGIS_RUNTIME_TOOLKIT_CPP_QUICK_DEMO_UTILITYNETWORKTRACEDEMO_H diff --git a/augmentedreality/Common/source/ArEnums.cpp b/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemoForm.qml similarity index 54% rename from augmentedreality/Common/source/ArEnums.cpp rename to uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemoForm.qml index 1f0421e07..0a1402c7e 100644 --- a/augmentedreality/Common/source/ArEnums.cpp +++ b/uitools/examples/cpp_quick/src/demos/UtilityNetworkTraceDemoForm.qml @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright 2012-2019 Esri + * Copyright 2012-2022 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,15 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import DemoApp -#include "ArEnums.h" - -using namespace Esri::ArcGISRuntime::Toolkit; - -ArEnums::ArEnums() -{ -} - -ArEnums::~ArEnums() -{ +DemoPage { + mapViewContents: Component { + MapView { + id: view + UtilityNetworkTrace { + id: utilityNetworkTrace + geoView: view + anchors { + left: parent.left + top: parent.top + margins: 10 + } + } + UtilityNetworkTraceDemo { + id: demo + geoView: view + } + } + } } diff --git a/uitools/examples/cpp_quick/src/demos/demos.pri b/uitools/examples/cpp_quick/src/demos/demos.pri index 95fa19c74..d1ec88691 100644 --- a/uitools/examples/cpp_quick/src/demos/demos.pri +++ b/uitools/examples/cpp_quick/src/demos/demos.pri @@ -29,7 +29,8 @@ HEADERS += $$PWD/AuthenticationViewDemo.h \ $$PWD/PopupViewDemo.h \ $$PWD/ScalebarDemo.h \ $$PWD/SearchViewDemo.h \ - $$PWD/TimeSliderDemo.h + $$PWD/TimeSliderDemo.h \ + $$PWD/UtilityNetworkTraceDemo.h SOURCES += $$PWD/AuthenticationViewDemo.cpp \ $$PWD/BasemapGalleryDemo.cpp \ @@ -42,4 +43,5 @@ SOURCES += $$PWD/AuthenticationViewDemo.cpp \ $$PWD/PopupViewDemo.cpp \ $$PWD/ScalebarDemo.cpp \ $$PWD/SearchViewDemo.cpp \ - $$PWD/TimeSliderDemo.cpp + $$PWD/TimeSliderDemo.cpp \ + $$PWD/UtilityNetworkTraceDemo.cpp diff --git a/uitools/examples/cpp_quick/src/demos/demos.qrc b/uitools/examples/cpp_quick/src/demos/demos.qrc index 88cea56ae..5e1b4a740 100644 --- a/uitools/examples/cpp_quick/src/demos/demos.qrc +++ b/uitools/examples/cpp_quick/src/demos/demos.qrc @@ -12,6 +12,7 @@ ScalebarDemoForm.qml SearchViewDemoForm.qml TimeSliderDemoForm.qml + UtilityNetworkTraceDemoForm.qml diff --git a/uitools/examples/cpp_quick/src/main.cpp b/uitools/examples/cpp_quick/src/main.cpp index 7237ad3a1..1d898d7b8 100644 --- a/uitools/examples/cpp_quick/src/main.cpp +++ b/uitools/examples/cpp_quick/src/main.cpp @@ -35,8 +35,10 @@ //------------------------------------------------------------------------------ int main(int argc, char* argv[]) { + // Enforce OpenGL + qputenv("QSG_RHI_BACKEND", "opengl"); + QtWebView::initialize(); - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); // Use of Esri location services, including basemaps and geocoding, requires @@ -61,21 +63,19 @@ int main(int argc, char* argv[]) Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::setApiKey(apiKey); } - QQuickStyle::addStylePath("qrc:///esri.com/imports/"); - // Register ArcGIS types with QML. qmlRegisterExtendedType("Esri.ArcGISRuntime", 100, 15, "MapView"); + MapQuickViewProxy>("Esri.ArcGISRuntime", 200, 0, "MapView"); qmlRegisterExtendedType("Esri.ArcGISRuntime", 100, 15, "SceneView"); + SceneQuickViewProxy>("Esri.ArcGISRuntime", 200, 0, "SceneView"); qmlRegisterUncreatableType("Esri.ArcGISRuntime", - 100, - 15, + 200, + 0, "Map", "Map not creatable in QML."); qmlRegisterUncreatableType("Esri.ArcGISRuntime", - 100, - 15, + 200, + 0, "Scene", "Scene not creatable in QML."); @@ -90,8 +90,8 @@ int main(int argc, char* argv[]) }); qmlRegisterSingletonType("Esri.ArcGISRuntime", - 100, - 15, + 200, + 0, "Enums", [](QQmlEngine* engine, QJSEngine*) -> QObject* { diff --git a/uitools/examples/cpp_quick/src/main.qml b/uitools/examples/cpp_quick/src/main.qml index 0fd84add2..6c6f632e4 100644 --- a/uitools/examples/cpp_quick/src/main.qml +++ b/uitools/examples/cpp_quick/src/main.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ApplicationWindow { id: appWindow diff --git a/uitools/examples/cpp_quick/src/proxies/GeoModelProxy.h b/uitools/examples/cpp_quick/src/proxies/GeoModelProxy.h index f73aaf7b4..1f530ffc2 100644 --- a/uitools/examples/cpp_quick/src/proxies/GeoModelProxy.h +++ b/uitools/examples/cpp_quick/src/proxies/GeoModelProxy.h @@ -21,11 +21,9 @@ #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class GeoModel; -} -} +} // Esri::ArcGISRuntime class GeoModelProxy : public QObject { diff --git a/uitools/examples/cpp_quick/src/proxies/MapQuickViewProxy.h b/uitools/examples/cpp_quick/src/proxies/MapQuickViewProxy.h index b5a67d6eb..3807752e0 100644 --- a/uitools/examples/cpp_quick/src/proxies/MapQuickViewProxy.h +++ b/uitools/examples/cpp_quick/src/proxies/MapQuickViewProxy.h @@ -22,11 +22,9 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class MapQuickView; -} -} +} // Esri::ArcGISRuntime class MapQuickViewProxy : public QObject { diff --git a/uitools/examples/cpp_quick/src/proxies/SceneQuickViewProxy.h b/uitools/examples/cpp_quick/src/proxies/SceneQuickViewProxy.h index 54ffb62fc..d3e972dce 100644 --- a/uitools/examples/cpp_quick/src/proxies/SceneQuickViewProxy.h +++ b/uitools/examples/cpp_quick/src/proxies/SceneQuickViewProxy.h @@ -22,11 +22,9 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class SceneQuickView; -} -} +} // Esri::ArcGISRuntime class SceneQuickViewProxy : public QObject { diff --git a/uitools/examples/qml_quick/iOS/Info.plist b/uitools/examples/qml_quick/iOS/Info.plist index cbaec497d..a3a979089 100644 --- a/uitools/examples/qml_quick/iOS/Info.plist +++ b/uitools/examples/qml_quick/iOS/Info.plist @@ -65,7 +65,7 @@ CFBundleVersion 1.0 NOTE - Built with ArcGIS Runtime SDK for Qt. + Built with ArcGIS Maps SDK for Qt. UIFileSharingEnabled FALSE UIRequiresPersistentWiFi diff --git a/uitools/examples/qml_quick/qml_quick.pro b/uitools/examples/qml_quick/qml_quick.pro index 0a8543667..8b64bedf0 100644 --- a/uitools/examples/qml_quick/qml_quick.pro +++ b/uitools/examples/qml_quick/qml_quick.pro @@ -19,29 +19,29 @@ mac { #------------------------------------------------------------------------------- -CONFIG += c++14 +CONFIG += c++17 # additional modules are pulled in via arcgisruntime.pri QT += opengl qml quick -ARCGIS_RUNTIME_VERSION = 100.15.0 +ARCGIS_RUNTIME_VERSION = 200.0.0 include($$PWD/arcgisruntime.pri) include($$PWD/../../toolkitqml.pri) TEMPLATE = app TARGET = qml_quick -equals(QT_MAJOR_VERSION, 5) { - lessThan(QT_MINOR_VERSION, 15) { - error("$$TARGET requires Qt 5.15.2") - } - equals(QT_MINOR_VERSION, 15) : lessThan(QT_PATCH_VERSION, 2) { - error("$$TARGET requires Qt 5.15.2") - } +lessThan(QT_MAJOR_VERSION, 6) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") } equals(QT_MAJOR_VERSION, 6) { - error("This version of the ArcGIS Runtime SDK for Qt is incompatible with Qt 6") + lessThan(QT_MINOR_VERSION, 2) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } + equals(QT_MINOR_VERSION, 2) : lessThan(QT_PATCH_VERSION, 4) { + error("This version of the ArcGIS Maps SDK for Qt requires at least Qt 6.2.4") + } } #------------------------------------------------------------------------------- diff --git a/uitools/examples/qml_quick/src/demos/AuthenticationViewDemoForm.qml b/uitools/examples/qml_quick/src/demos/AuthenticationViewDemoForm.qml index 9aae61822..c2e3e6471 100644 --- a/uitools/examples/qml_quick/src/demos/AuthenticationViewDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/AuthenticationViewDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { readonly property string exampleUrl: "https://www.arcgis.com/sharing/rest/content/items/e5039444ef3c48b8a8fdc9227f9be7c1/data" diff --git a/uitools/examples/qml_quick/src/demos/BasemapGalleryDemoForm.qml b/uitools/examples/qml_quick/src/demos/BasemapGalleryDemoForm.qml index ed238944f..43bbcf481 100644 --- a/uitools/examples/qml_quick/src/demos/BasemapGalleryDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/BasemapGalleryDemoForm.qml @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/qml_quick/src/demos/BookmarksViewDemoForm.qml b/uitools/examples/qml_quick/src/demos/BookmarksViewDemoForm.qml index 7f8aa53e9..700f3905c 100644 --- a/uitools/examples/qml_quick/src/demos/BookmarksViewDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/BookmarksViewDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { mapViewContents: Component { @@ -26,10 +26,11 @@ DemoPage { Map { PortalItem { - itemId: "16f1b8ba37b44dc3884afc8d5f454dd2" + itemId: "16f1b8ba37b44dc3884afc8d5f454dd2" } } + //! [Set up Bookmark QML] BookmarksView { id: bookmarksView geoView: view @@ -39,6 +40,7 @@ DemoPage { margins: 10 } } + //! [Set up Bookmark QML] } } } diff --git a/uitools/examples/qml_quick/src/demos/CalloutDemoForm.qml b/uitools/examples/qml_quick/src/demos/CalloutDemoForm.qml index 01d60179a..ca57d7766 100644 --- a/uitools/examples/qml_quick/src/demos/CalloutDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/CalloutDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { property real xClickLoc @@ -36,12 +36,21 @@ DemoPage { detail: "x: " + xClickLoc + " y: " + yClickLoc } - Callout{ + Callout { id:callout calloutData: view.calloutData accessoryButtonVisible: false + implicitHeight: 100 + leaderPosition: Callout.LeaderPosition.Automatic + maxWidth: 250 + background: Rectangle { + radius: 5 + border.width: 2 + border.color: "black" + } + palette.windowText: "black" } - onMouseClicked : { + onMouseClicked : (mouse) => { if (calloutData.visible) { callout.dismiss(); } else { diff --git a/uitools/examples/qml_quick/src/demos/CoordinateConversionDemoForm.qml b/uitools/examples/qml_quick/src/demos/CoordinateConversionDemoForm.qml index 92edf0370..8b2df8860 100644 --- a/uitools/examples/qml_quick/src/demos/CoordinateConversionDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/CoordinateConversionDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/qml_quick/src/demos/FloorFilterDemoForm.qml b/uitools/examples/qml_quick/src/demos/FloorFilterDemoForm.qml index 54efdb1a3..d77dc80fa 100644 --- a/uitools/examples/qml_quick/src/demos/FloorFilterDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/FloorFilterDemoForm.qml @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { mapViewContents: Component { diff --git a/uitools/examples/qml_quick/src/demos/NorthArrowDemoForm.qml b/uitools/examples/qml_quick/src/demos/NorthArrowDemoForm.qml index 27206e89f..45551d4ed 100644 --- a/uitools/examples/qml_quick/src/demos/NorthArrowDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/NorthArrowDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { sceneViewContents: Component { diff --git a/uitools/examples/qml_quick/src/demos/OverviewMapDemoForm.qml b/uitools/examples/qml_quick/src/demos/OverviewMapDemoForm.qml index 51accaecb..5ce6eb4c6 100644 --- a/uitools/examples/qml_quick/src/demos/OverviewMapDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/OverviewMapDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { diff --git a/uitools/examples/qml_quick/src/demos/PopupViewDemoForm.qml b/uitools/examples/qml_quick/src/demos/PopupViewDemoForm.qml index 45da8d7d3..53d463bd5 100644 --- a/uitools/examples/qml_quick/src/demos/PopupViewDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/PopupViewDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { @@ -50,7 +50,7 @@ DemoPage { renderingMode: Enums.FeatureRenderingModeDynamic } } - onMouseClicked: { + onMouseClicked: mouse => { //get the feature layer from the map featureLayer = sceneView.scene.operationalLayers.get(0); sceneView.identifyLayer(featureLayer, mouse.x, mouse.y , 12, false); @@ -81,7 +81,7 @@ DemoPage { initUrl: "https://runtime.maps.arcgis.com/home/webmap/viewer.html?webmap=e4c6eb667e6c43b896691f10cc2f1580" } - onMouseClicked: { + onMouseClicked: mouse => { //get the feature layer from the map featureLayer = mapView.map.operationalLayers.get(0); mapView.identifyLayer(featureLayer, mouse.x, mouse.y , 12, false); diff --git a/uitools/examples/qml_quick/src/demos/SearchViewDemoForm.qml b/uitools/examples/qml_quick/src/demos/SearchViewDemoForm.qml index 9e6e5f0f5..afa9a2247 100644 --- a/uitools/examples/qml_quick/src/demos/SearchViewDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/SearchViewDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { diff --git a/uitools/examples/qml_quick/src/demos/TimeSliderDemoForm.qml b/uitools/examples/qml_quick/src/demos/TimeSliderDemoForm.qml index 358efd5fe..ba74a98a0 100644 --- a/uitools/examples/qml_quick/src/demos/TimeSliderDemoForm.qml +++ b/uitools/examples/qml_quick/src/demos/TimeSliderDemoForm.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit DemoPage { readonly property string dataUrl: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer" diff --git a/uitools/examples/qml_quick/src/main.cpp b/uitools/examples/qml_quick/src/main.cpp index 5b20d9537..c8768a8a8 100644 --- a/uitools/examples/qml_quick/src/main.cpp +++ b/uitools/examples/qml_quick/src/main.cpp @@ -27,8 +27,10 @@ int main(int argc, char* argv[]) { + // Enforce OpenGL + qputenv("QSG_RHI_BACKEND", "opengl"); + QtWebView::initialize(); - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); // Use of Esri location services, including basemaps and geocoding, requires @@ -53,9 +55,6 @@ int main(int argc, char* argv[]) QCoreApplication::instance()->setProperty("Esri.ArcGISRuntime.apiKey", apiKey); } - - QQuickStyle::addStylePath("qrc:///esri.com/imports/"); - // Intialize application window QQmlApplicationEngine engine; Esri::ArcGISRuntime::Toolkit::registerComponents(engine); diff --git a/uitools/examples/qml_quick/src/main.qml b/uitools/examples/qml_quick/src/main.qml index 987106863..ac9056fea 100644 --- a/uitools/examples/qml_quick/src/main.qml +++ b/uitools/examples/qml_quick/src/main.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQuick +import QtQuick.Controls ApplicationWindow { id: appWindow diff --git a/uitools/examples/shared/qml/DemoApp.qml b/uitools/examples/shared/qml/DemoApp.qml index effe23198..9c035ca01 100644 --- a/uitools/examples/shared/qml/DemoApp.qml +++ b/uitools/examples/shared/qml/DemoApp.qml @@ -14,10 +14,10 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 +import QtQuick +import QtQuick.Controls +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit import "tools.js" as T Item { diff --git a/uitools/examples/shared/qml/DemoPage.qml b/uitools/examples/shared/qml/DemoPage.qml index 7a58c709c..4771da94c 100644 --- a/uitools/examples/shared/qml/DemoPage.qml +++ b/uitools/examples/shared/qml/DemoPage.qml @@ -14,13 +14,13 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.15 -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.15 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import Calcite 1.0 as C +import QtQml +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import Calcite as C Control { id: demoPage diff --git a/uitools/examples/shared/qml/tools.js b/uitools/examples/shared/qml/tools.js index d124d1c2c..f0fc2a7be 100644 --- a/uitools/examples/shared/qml/tools.js +++ b/uitools/examples/shared/qml/tools.js @@ -23,6 +23,10 @@ const TOOLS = [ "name" : "Floor filter", "url" : "FloorFilterDemoForm.qml" }, + { + "name" : "Utility network trace", + "url" : "UtilityNetworkTraceDemoForm.qml" + }, { "name": "Search view", "url": "SearchViewDemoForm.qml" diff --git a/uitools/images/esri_arcgisruntime_toolkit_images.qrc b/uitools/images/esri_arcgisruntime_toolkit_images.qrc index bd9e895b2..0b558a915 100644 --- a/uitools/images/esri_arcgisruntime_toolkit_images.qrc +++ b/uitools/images/esri_arcgisruntime_toolkit_images.qrc @@ -22,6 +22,7 @@ plus-circle.svg reverse.svg search.svg + trash.svg x.svg zoom-to-object.svg diff --git a/uitools/images/trash.svg b/uitools/images/trash.svg new file mode 100644 index 000000000..990ec6860 --- /dev/null +++ b/uitools/images/trash.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/AuthenticationView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/AuthenticationView.qml index 3caf8f7d9..859a32f36 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/AuthenticationView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/AuthenticationView.qml @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQml 2.12 -import QtQuick 2.12 -import QtQuick.Controls 2.12 +import QtQml +import QtQuick +import QtQuick.Controls /*! \qmltype AuthenticationView diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/BasemapGallery.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/BasemapGallery.qml index 0d2da7d97..c6217b255 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/BasemapGallery.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/BasemapGallery.qml @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.15 -import QtQml 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.15 +import QtQuick +import QtQml +import QtQuick.Controls +import QtQuick.Layouts /*! \qmltype BasemapGallery diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/BookmarksView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/BookmarksView.qml index 7f04bfb26..3a7856e85 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/BookmarksView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/BookmarksView.qml @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.15 -import QtQml 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.15 +import QtQuick +import QtQml +import QtQuick.Controls +import QtQuick.Layouts /*! \qmltype BookmarksView diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Callout.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Callout.qml index 9e4449b99..8e9bef267 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Callout.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Callout.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.12 -import QtQuick.Shapes 1.15 +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Shapes /*! \qmltype Callout @@ -54,11 +54,13 @@ import QtQuick.Shapes 1.15 \newcode Callout { calloutData: myCalloutData - titleTextColor: "#000000" - backgroundColor: "#ffffff" - borderColor: "#000000" - borderWidth: 2 - cornerRadius: 5 + palette.windowText: "#000000" + background: Rectangle { + color: "#ffffff" + border.color: "#000000" + border.width: 2 + radius: 5 + } leaderHeight: 10 leaderWidth: 20 leaderPosition: Callout.LeaderPosition.Bottom @@ -156,18 +158,6 @@ Pane { */ property bool accessoryButtonVisible: true - /*! - \obsolete - - \brief A QML Item to display in the Callout. - - The default is \c null. - - This property is obsolete, to replace the Callout's content - set \c{contentItem} instead. - */ - property Component calloutContent: null - /*! \brief The CalloutData to display in the Callout. @@ -207,86 +197,6 @@ Pane { */ property real maxWidth: 300 - /*! - \obsolete - Use \c{implicitHeight} instead. - */ - property alias calloutHeight: root.implicitHeight - - /*! - \obsolete - Use \c{background.border.color} instead. - */ - property color borderColor - onBorderColorChanged: { - background.border.color = borderColor; - internal.leaderColor = borderColor; - } - - /*! - \obsolete - Use \c{Callout.LeaderPosition} instead. - */ - property var leaderPositionEnum: { return { - UpperLeft: 0, - Top: 1, - UpperRight: 2, - Right: 3, - LowerRight: 4, - Bottom: 5, - LowerLeft: 6, - Left: 7, - Automatic: 8 - } } - - /*! - \obsolete - Use \l maxWidth instead. - */ - property alias calloutWidth: root.maxWidth - - /*! - \obsolete - Use \c{background.border.width} instead. - */ - property int borderWidth - onBorderWidthChanged: background.border.width = borderWidth; - - /*! - \obsolete - Use \c{background.color} instead. - */ - property color backgroundColor - onBackgroundColorChanged: background.color = backgroundColor - - /*! - \obsolete - Use \c{palette.windowText} instead. - */ - property color titleTextColor - onTitleTextColorChanged: palette.windowText = titleTextColor - - /*! - \obsolete - Use \c{palette.windowText} instead. - */ - property color detailTextColor - onDetailTextColorChanged: palette.windowText = detailTextColor - - /*! - \obsolete - Use \c{accessoryButtonVisible} instead. - */ - property bool accessoryButtonHidden: false - onAccessoryButtonHiddenChanged: accessoryButtonVisible = !accessoryButtonHidden - - /*! - \obsolete - Use \c{background.radius} instead. - */ - property int cornerRadius - onCornerRadiusChanged: background.radius = cornerRadius - /*! \brief The signal emitted when the accessory button is clicked. */ @@ -364,16 +274,7 @@ Pane { columns: 3 rows: 2 columnSpacing: 7 - Loader { - sourceComponent: calloutContent - clip: true - Layout.columnSpan: 3 - Layout.rowSpan: 2 - Layout.fillWidth: true - Layout.preferredWidth: autoAdjustWidth ? -1 : root.maxWidth - Layout.maximumWidth: autoAdjustWidth ? root.maxWidth : -1 - visible: calloutContent - } + Image { id: image source: calloutData ? calloutData.imageUrl : "" @@ -382,17 +283,18 @@ Pane { Layout.fillHeight: true Layout.preferredWidth: 40 fillMode : Image.PreserveAspectFit - visible: !calloutContent && source && source.toString() !== "" + visible: source && source.toString() !== "" } Label { id: title text: calloutData ? calloutData.title : "" + color: palette.windowText wrapMode: Text.Wrap clip: true elide: Text.ElideRight // Is visible (even when empty) if detail is visible, otherise // row & columnspan offsets go askew. - visible: !calloutContent && (text || detail.visible) + visible: text || detail.visible Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true Layout.fillHeight: true @@ -434,7 +336,7 @@ Pane { rightPadding: 0 flat: true radius: 32 - visible: accessoryButtonVisible && !calloutContent && icon.source.toString() !== "" + visible: accessoryButtonVisible && icon.source.toString() !== "" onClicked: accessoryButtonClicked() icon.source: { if (accessoryButtonType === "Info") @@ -450,10 +352,11 @@ Pane { Label { id: detail text: calloutData ? calloutData.detail : "" + color: palette.windowText wrapMode: Text.Wrap elide: Text.ElideRight clip: true - visible: !calloutContent && text + visible: text Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true Layout.fillHeight: true @@ -544,7 +447,7 @@ Pane { // Draws the tail portion emitting from the pane. id: tail fillColor: root.background.color - strokeColor: internal.leaderColor + strokeColor: root.background.border.color strokeWidth: parent.border.width capStyle: ShapePath.RoundCap startX: { @@ -657,11 +560,6 @@ Pane { id: internal property real anchorPointX: (calloutData ? calloutData.screenPoint.x : 0) + screenOffsetX property real anchorPointY: (calloutData ? calloutData.screenPoint.y : 0) + screenOffsetY - // QML bug workaround here: `background.border.color` always comes out as black by default, - // even if it is transparent. We keep the leader color as transparent until explicilty set via - // `borderColor`. This supports old behaviour, and also supports all current known styles where - // Pane does not have an initial background border color. - property color leaderColor: "transparent" // Is either the contents of root.leaderPosition, or a calculated LeaderPosition if root.leaderPosition // is set to \c Automatic. property int leaderPosition: { diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/ClientCertificateView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/ClientCertificateView.qml index be9cad01f..2633a9407 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/ClientCertificateView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/ClientCertificateView.qml @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import Qt.labs.platform 1.1 as P +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import Qt.labs.platform as P Dialog { id: clientCertificateView diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/AuthenticationController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/AuthenticationController.qml index 27cb72fa6..1fbe9754c 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/AuthenticationController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/AuthenticationController.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml -import Esri.ArcGISRuntime 100.8 +import Esri.ArcGISRuntime /*! \qmltype AuthenticationController diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryController.qml index 33dfb7df8..d2b8256f6 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryController.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.15 -import Esri.ArcGISRuntime 100.15 -import QtQml.Models 2.15 +import QtQml +import Esri.ArcGISRuntime +import QtQml.Models /*! \qmltype BasemapGalleryController @@ -127,8 +127,8 @@ QtObject { this, { basemap: basemap, - thumbnailUrlOverride: thumbnailUrl, - tooltipOverride: tooltip + thumbnailUrlOverride: thumbnailUrl ? thumbnailUrl : "", + tooltipOverride: tooltip ? tooltip : "" }) }); return true; diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryItem.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryItem.qml index 7664e409d..63682668c 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryItem.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryItem.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.12 -import QtQuick 2.12 -import Esri.ArcGISRuntime 100.15 +import QtQml +import QtQuick +import Esri.ArcGISRuntime /*! \qmltype BasemapGalleryItem diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BookmarksViewController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BookmarksViewController.qml index 5d45aa1a8..4f7cbc26b 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BookmarksViewController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BookmarksViewController.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.15 -import Esri.ArcGISRuntime 100.15 -import QtQml.Models 2.15 +import QtQml +import Esri.ArcGISRuntime +import QtQml.Models /*! \qmltype BookmarkController diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionController.qml index 2b3618508..7f0c2f6f5 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionController.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.12 -import Esri.ArcGISRuntime 100.8 +import QtQml +import Esri.ArcGISRuntime /*! \qmltype CoordinateConversionController @@ -71,7 +71,7 @@ QtObject { */ property list results - /*! \brief Emitted when the currentPoint has changed. */ + /*! \brief Emitted when the current \a point has changed. */ signal currentPointChanged(Point point) /*! diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionOption.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionOption.qml index b3b70630f..7c229b217 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionOption.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionOption.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml -import Esri.ArcGISRuntime 100.8 +import Esri.ArcGISRuntime /*! \qmltype CoordinateConversionOption diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionResult.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionResult.qml index af7a04b36..b9996c364 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionResult.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CoordinateConversionResult.qml @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml /*! \qmltype CoordinateConversionResult diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CurrentVersion.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CurrentVersion.qml index a51d2e9bb..42bd209f9 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CurrentVersion.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/CurrentVersion.qml @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml /*! \internal diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/FloorFilterController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/FloorFilterController.qml index 76cea0f4b..dbcd50ce9 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/FloorFilterController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/FloorFilterController.qml @@ -14,8 +14,8 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import Esri.ArcGISRuntime 100.15 +import QtQuick +import Esri.ArcGISRuntime /*! \qmltype FloorFilterController diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/LocatorSearchSource.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/LocatorSearchSource.qml index da7b99934..03eed8668 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/LocatorSearchSource.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/LocatorSearchSource.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 -import Esri.ArcGISRuntime 100.15 -import QtQml.Models 2.15 +import QtQml +import Esri.ArcGISRuntime +import QtQml.Models /*! \qmltype LocatorSearchSource @@ -124,10 +124,10 @@ QtObject { } signal suggestionsAdded(var source, int first, int last) - onRowsInserted: suggestionsAdded(this, first, last) + onRowsInserted: (first, last) => suggestionsAdded(this, first, last) signal suggestionsRemoved(var source, int first, int last) - onRowsAboutToBeRemoved: suggestionsRemoved(this, first, last) + onRowsAboutToBeRemoved: (first, last) => suggestionsRemoved(this, first, last) } /*! diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/NorthArrowController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/NorthArrowController.qml index 390771bc3..bac8fdaac 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/NorthArrowController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/NorthArrowController.qml @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml /*! \qmltype NorthArrowController diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/OverviewMapController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/OverviewMapController.qml index 864738585..e20d7f018 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/OverviewMapController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/OverviewMapController.qml @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQml 2.12 -import Esri.ArcGISRuntime 100.15 +import QtQml +import Esri.ArcGISRuntime /*! \qmltype OverviewMapController @@ -132,45 +132,45 @@ QtObject { internal.updateInsetViewpointTaskInProgress = false; } - onKeyPressed: { + onKeyPressed: key => { // Disable all key preesses key.accepted = true; } - onKeyReleased: { + onKeyReleased: key => { // Disable all key releases key.accepted = true; } - onMouseWheelChanged: { + onMouseWheelChanged: wheel => { // Disable all wheel events if navigation is not enabled. if (!navigationEnabled) wheel.accepted = true; } - onMouseClicked: { + onMouseClicked: mouse => { // Disable mouse clicks if navigation is not enabled. if (!navigationEnabled) mouse.accepted = true; } - onMouseDoubleClicked: { + onMouseDoubleClicked: mouse => { // Disable mouse double clicks if navigation is not enabled. if (!navigationEnabled) mouse.accepted = true; } - onMousePositionChanged: { + onMousePositionChanged: mouse => { // Disable mouse position changes if navigation is not enabled. if (!navigationEnabled) mouse.accepted = true; } - onMousePressedAndHeld: { + onMousePressedAndHeld: mouse => { // Disable mouse press and hold if navigation is not enabled. if (!navigationEnabled) mouse.accepted = true; } - onMousePressed: { + onMousePressed: mouse => { // Disable mouse press, if navigation is not enabled. if (!navigationEnabled) mouse.accepted = true; } - onMouseReleased: { + onMouseReleased: mouse => { // Disable mouse release if navigation is not enabled. if (!navigationEnabled) mouse.accepted = true; diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/PopupViewController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/PopupViewController.qml index 6860132ce..251631620 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/PopupViewController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/PopupViewController.qml @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml /*! \qmltype PopupViewController diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/ScalebarController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/ScalebarController.qml index fdd7ec878..a8f1fd324 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/ScalebarController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/ScalebarController.qml @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml /*! \internal diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SearchViewController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SearchViewController.qml index b19e110a1..0c8832353 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SearchViewController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SearchViewController.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 -import Esri.ArcGISRuntime 100.15 -import Esri.ArcGISRuntime.Toolkit 100.15 -import QtQml.Models 2.15 -import QtQuick 2.15 +import QtQml +import Esri.ArcGISRuntime +import Esri.ArcGISRuntime.Toolkit +import QtQml.Models +import QtQuick /*! \qmltype SearchViewController @@ -296,7 +296,7 @@ QtObject { property Point queryCenter: null property ListModel sources: ListModel { - onRowsInserted: { + onRowsInserted: (parent, first, last) =>{ for (let i = first; i <= last; ++i) { const source = sources.get(i).modelData; if (source) { diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SmartLocatorSearchSource.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SmartLocatorSearchSource.qml index 7c390d669..774b2d144 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SmartLocatorSearchSource.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/SmartLocatorSearchSource.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 -import Esri.ArcGISRuntime 100.15 -import QtQml.Models 2.15 +import QtQml +import Esri.ArcGISRuntime +import QtQml.Models /*! \qmltype SmartLocatorSearchSource diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/TimeSliderController.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/TimeSliderController.qml index d238e907d..b77eb3d49 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/TimeSliderController.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/TimeSliderController.qml @@ -14,9 +14,9 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml -import Esri.ArcGISRuntime 100.9 +import Esri.ArcGISRuntime /*! \qmltype TimeSliderController diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/qmldir b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/qmldir index 3ec2bd992..b60f6a938 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/qmldir +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/qmldir @@ -15,22 +15,38 @@ module Esri.ArcGISRuntime.Toolkit.Controller # Current version increment -CurrentVersion 100.15 CurrentVersion.qml +CurrentVersion 200.0 CurrentVersion.qml # Controller components AuthenticationController 100.10 AuthenticationController.qml +AuthenticationController 200.0 AuthenticationController.qml BasemapGalleryController 100.12 BasemapGalleryController.qml +BasemapGalleryController 200.0 BasemapGalleryController.qml BasemapGalleryItem 100.12 BasemapGalleryItem.qml +BasemapGalleryItem 200.0 BasemapGalleryItem.qml BookmarksViewController 100.15 BookmarksViewController.qml +BookmarksViewController 200.0 BookmarksViewController.qml CoordinateConversionController 100.10 CoordinateConversionController.qml +CoordinateConversionController 200.0 CoordinateConversionController.qml CoordinateConversionOption 100.10 CoordinateConversionOption.qml +CoordinateConversionOption 200.0 CoordinateConversionOption.qml CoordinateConversionResult 100.10 CoordinateConversionResult.qml +CoordinateConversionResult 200.0 CoordinateConversionResult.qml FloorFilterController 100.14 FloorFilterController.qml +FloorFilterController 200.0 FloorFilterController.qml LocatorSearchSource 100.13 LocatorSearchSource.qml +LocatorSearchSource 200.0 LocatorSearchSource.qml NorthArrowController 100.10 NorthArrowController.qml +NorthArrowController 200.0 NorthArrowController.qml OverviewMapController 100.12 OverviewMapController.qml +OverviewMapController 200.0 OverviewMapController.qml PopupViewController 100.10 PopupViewController.qml +PopupViewController 200.0 PopupViewController.qml ScalebarController 100.13 ScalebarController.qml +ScalebarController 200.0 ScalebarController.qml SearchViewController 100.13 SearchViewController.qml +SearchViewController 200.0 SearchViewController.qml SmartLocatorSearchSource 100.13 SmartLocatorSearchSource.qml +SmartLocatorSearchSource 200.0 SmartLocatorSearchSource.qml TimeSliderController 100.10 TimeSliderController.qml +TimeSliderController 200.0 TimeSliderController.qml diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.qml index 002c8d154..5f93cfe16 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.qml @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.12 +import QtQuick -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick.Controls +import QtQuick.Layouts /*! \qmltype CoordinateConversion diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/CurrentVersion.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/CurrentVersion.qml index a51d2e9bb..42bd209f9 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/CurrentVersion.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/CurrentVersion.qml @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************/ -import QtQml 2.12 +import QtQml /*! \internal diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/FlashImage.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/FlashImage.qml index ae14445ef..50ea97d3e 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/FlashImage.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/FlashImage.qml @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 +import QtQuick /*! * \internal diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/FloorFilter.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/FloorFilter.qml index 7f0b6f2b7..a277a7247 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/FloorFilter.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/FloorFilter.qml @@ -13,12 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 -import QtQuick 2.12 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.15 -import QtQml.Models 2.15 -import QtGraphicalEffects 1.12 +import Esri.ArcGISRuntime.Toolkit.Controller +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQml.Models /*! \qmltype FloorFilter @@ -54,7 +53,7 @@ Control { \qmlproperty FloorFilterController controller \brief The controller handles binding logic between the FloorFilter, \c GeoModel, \c FloorManager and the flooraware layers. - + The QML controller is documented \l{FloorFilterController}{here} and the CPP controller is documented \l{Esri::ArcGISRuntime::Toolkit::FloorFilterController}{here}. */ property var controller: FloorFilterController {} @@ -159,14 +158,14 @@ Control { onClicked: { switch(internal.currentVisibileListView){ case FloorFilter.VisibleListView.Site: - controller.zoomToSite(controller.selectedSiteId); + controller.zoomToSite(controller.selectedSiteId); break; case FloorFilter.VisibleListView.Facility: controller.zoomToFacility(controller.selectedFacilityId); break; default: console.error("extra enum not accounted for."); - } + } } } @@ -175,7 +174,7 @@ Control { orientation: Qt.Horizontal } - //Layout width: fill the parent Layout if is larger than the `contentItem.width`. + //Layout width: fill the parent Layout if is larger than the `contentItem.width`. // If `contentItem.width` is larger, stretch to keep all its items without resizing them (don't elide text children). Flickable { id: flickable @@ -321,7 +320,7 @@ Control { id: searchImg sourceSize.width: 32 sourceSize.height: 32 - visible: false + visible: true source: "images/search.svg" width: height anchors { @@ -331,11 +330,6 @@ Control { margins: 4 } } - ColorOverlay { - anchors.fill: searchImg - source: searchImg - color: noResultsFoundLabel.color - } } Label { @@ -422,7 +416,7 @@ Control { } ] // sort the items in filteredGroup when in facility view. - items.onChanged: { + items.onChanged: { if(internal.currentVisibileListView === FloorFilter.VisibleListView.Facility){ var elements = []; // populate js array diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/NorthArrow.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/NorthArrow.qml index d47466016..1b4478765 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/NorthArrow.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/NorthArrow.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.12 +import QtQuick /*! \qmltype NorthArrow diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/OAuth2View.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/OAuth2View.qml index 31fab4b54..4206afb8a 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/OAuth2View.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/OAuth2View.qml @@ -14,12 +14,12 @@ * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.11 -import QtQuick.Controls 2.11 -import QtWebView 1.1 -import QtQuick.Window 2.12 +import QtQuick +import QtQuick.Controls +import QtWebView +import QtQuick.Window Dialog { id: oAuthView @@ -52,7 +52,7 @@ Dialog { url: controller.currentChallengeUrl - onLoadingChanged: { + onLoadingChanged: (loadRequest) => { if (loadRequest.status === WebView.LoadSucceededStatus) { forceActiveFocus(); } else if (loadRequest.status === WebView.LoadFailedStatus) { diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/OverviewMap.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/OverviewMap.qml index ac8eabacd..c979074d4 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/OverviewMap.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/OverviewMap.qml @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.12 -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import QtQuick +import Esri.ArcGISRuntime.Toolkit.Controller /*! \qmltype OverviewMap diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupStackView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupStackView.qml index 2c11188e8..a838e2454 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupStackView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupStackView.qml @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ -import QtQuick 2.11 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts /*! @@ -250,7 +250,6 @@ Pane { Layout.alignment: Qt.AlignLeft visible: popupManagers && popupManagers.length > 1 enabled: popupManagers ? stack.depth > 1 : false - palette: popupStackView.palette font: popupStackView.font } @@ -259,7 +258,6 @@ Pane { Layout.columnSpan: popupManagers && popupManagers.length > 1 ? 1 : 3 horizontalAlignment: Text.AlignHCenter text: popupManagers && popupManagers.length > 0 ? `${stack.depth} of ${popupManagers.length}` : "" - palette: popupStackView.palette font: popupStackView.font } @@ -269,7 +267,6 @@ Pane { Layout.alignment: Qt.AlignRight visible: popupManagers && popupManagers.length > 1 enabled: popupManagers ? stack.depth < popupManagers.length : false - palette: popupStackView.palette font: popupStackView.font } @@ -284,7 +281,6 @@ Pane { id: popupViewPage PopupView { popupManager: popupManagers && popupManagers.length >= StackView.index ? popupManagers[StackView.index] : null - palette: popupStackView.palette font: popupStackView.font background: null closeCallback: popupStackView.closeCallback diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupView.qml index 028acf00f..4ef46c3c8 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/PopupView.qml @@ -14,13 +14,13 @@ * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.11 -import QtQuick.Controls 2.11 -import QtQuick.Dialogs 1.2 -import QtQuick.Window 2.11 -import QtQuick.Layouts 1.3 +import QtQuick +import QtQuick.Controls +import QtQuick.Dialogs +import QtQuick.Window +import QtQuick.Layouts /*! @@ -128,7 +128,6 @@ Page { verticalAlignment: Text.AlignVCenter wrapMode: Text.Wrap font: popupView.font - palette: popupView.palette leftPadding: popupView.spacing rightPadding: popupView.spacing } @@ -158,7 +157,6 @@ Page { Layout.maximumWidth: flickable.width / 2 wrapMode: Text.Wrap font: popupView.font - palette: popupView.palette } } @@ -172,7 +170,6 @@ Page { horizontalAlignment: Text.AlignHCenter text: controller.attachmentCount > 0 ? "

Attachments

" : "" font: popupView.font - palette: popupView.palette } // Attachment names @@ -184,7 +181,6 @@ Page { enabled: visible text: name wrapMode: Text.Wrap - palette: popupView.palette font: popupView.font } } @@ -196,7 +192,6 @@ Page { Layout.fillWidth: true text: formattedValue wrapMode: Text.Wrap - palette: popupView.palette font: popupView.font } } diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/Scalebar.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/Scalebar.qml index 40d660e38..f22012ed4 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/Scalebar.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/Scalebar.qml @@ -14,13 +14,13 @@ * limitations under the License. ******************************************************************************/ -import QtQuick 2.15 -import QtQml 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Shapes 1.15 +import QtQuick +import QtQml +import QtQuick.Controls +import QtQuick.Shapes -import Esri.ArcGISRuntime.Toolkit 100.15 -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit +import Esri.ArcGISRuntime.Toolkit.Controller /*! \qmltype Scalebar @@ -106,7 +106,6 @@ Control { implicitWidth: scalebar.implicitWidth implicitHeight: scalebar.implicitHeight font: scalebar.font - palette: scalebar.palette controller: scalebar.controller unitSystem: unitSystem === unitSystem.Dual ? Scalebar.UnitSystem.Metric : unitSystem } diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/ScalebarImpl.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/ScalebarImpl.qml index d20677597..357a9896c 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/ScalebarImpl.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/ScalebarImpl.qml @@ -1,9 +1,9 @@ -import QtQuick 2.15 -import QtQml 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Shapes 1.15 +import QtQuick +import QtQml +import QtQuick.Controls +import QtQuick.Shapes -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller /*! \internal @@ -45,7 +45,6 @@ Control { leftMargin: scalebar.spacing } font: scalebar.font - palette: scalebar.palette text: internal.displayDistance } } diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/SearchView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/SearchView.qml index dd539eab0..b02053727 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/SearchView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/SearchView.qml @@ -14,12 +14,11 @@ * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 -import QtGraphicalEffects 1.15 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts /*! \qmltype SearchView @@ -165,7 +164,7 @@ Pane { } } - Keys.onPressed: { + Keys.onPressed: event => { if (event.key === Qt.Key_Up) { if (list.currentIndex === 0) { list.currentIndex = -1; @@ -287,13 +286,7 @@ Pane { Layout.rowSpan: 2 source: markerImageUrl sourceSize.height: 32 - visible: true - ColorOverlay { - anchors.fill: sourceImage - source: sourceImage - color: textLabel.color - visible: searchView.state !== "searchCommitted" - } + visible: searchView.state !== "searchCommitted" } Label { id: textLabel @@ -301,7 +294,6 @@ Pane { Layout.fillWidth: true text: displayTitle elide: Text.ElideRight - palette: searchView.palette font: searchView.font Layout.rowSpan: displaySubtitle === "" ? 2 : 1 verticalAlignment: Label.AlignVCenter @@ -309,7 +301,6 @@ Pane { Label { Layout.fillWidth: true text: displaySubtitle - palette: searchView.palette font: searchView.font elide: Text.ElideRight } @@ -337,7 +328,6 @@ Pane { // } // contentItem: Label { // text: section -// palette: searchView.palette // horizontalAlignment: Text.AlignHCenter // elide: Text.ElideRight // font.italic: true diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/SslHandshakeView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/SslHandshakeView.qml index 13328be81..a57acc9ab 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/SslHandshakeView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/SslHandshakeView.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts Dialog { diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/TimeSlider.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/TimeSlider.qml index 1aee55d99..a7062adb2 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/TimeSlider.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/TimeSlider.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts /*! \qmltype TimeSlider @@ -184,13 +184,16 @@ Pane { Label { id: startLabel horizontalAlignment: Qt.AlignLeft - palette: timeSlider.palette Connections { target: controller function onExtentsChanged() { + if (controller.timeForStep(0)) { startLabel.text = Qt.formatDateTime( controller.timeForStep(0), fullExtentLabelFormat); + } else { + startLabel.text = ""; + } } } Layout.alignment: Qt.AlignLeft | Qt.AlignBottom @@ -205,7 +208,6 @@ Pane { id: stepBackButton icon.source: "images/reverse.svg" enabled: (!startTimePinned || !endTimePinned) && !playAnimation.running - palette: timeSlider.palette Timer { id: pressedHoldBack repeat: true @@ -224,7 +226,6 @@ Pane { : "images/play.svg" enabled: !startTimePinned || !endTimePinned checkable: true - palette: timeSlider.palette Layout.alignment: Qt.AlignHCenter Layout.margins: 5 Timer { @@ -240,7 +241,6 @@ Pane { id: stepForwardButton icon.source: "images/forward.svg" enabled: (!startTimePinned || !endTimePinned) && !playAnimation.running - palette: timeSlider.palette Timer { id: pressedHoldForward repeat: true @@ -254,11 +254,16 @@ Pane { } Label { - text: Qt.formatDateTime( - controller.timeForStep(controller.numberOfSteps), - fullExtentLabelFormat); + text: { + if (controller.timeForStep(controller.numberOfSteps)) { + Qt.formatDateTime( + controller.timeForStep(controller.numberOfSteps), + fullExtentLabelFormat); + } else { + ""; + } + } horizontalAlignment: Qt.AlignRight - palette: timeSlider.palette Layout.alignment: Qt.AlignRight | Qt.AlignBottom Layout.fillWidth: true Layout.margins: 5 @@ -279,7 +284,6 @@ Pane { id: slider padding: 0 stepSize: 1.0 - palette: timeSlider.palette snapMode: RangeSlider.SnapAlways from: 0 to: controller.numberOfSteps @@ -408,7 +412,6 @@ Pane { text: defaultLabelText; - palette: slider.palette font: slider.font // By default the label mark is only visible on diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/UserCredentialsView.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/UserCredentialsView.qml index c81ea678b..2823b1810 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/UserCredentialsView.qml +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/UserCredentialsView.qml @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import Esri.ArcGISRuntime.Toolkit.Controller 100.15 +import Esri.ArcGISRuntime.Toolkit.Controller -import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtQuick.Layouts 1.12 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts Dialog { id: userCredentialsView diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTrace.qml b/uitools/import/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTrace.qml new file mode 100644 index 000000000..8e7b37c1c --- /dev/null +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/UtilityNetworkTrace.qml @@ -0,0 +1,346 @@ +/******************************************************************************* + * Copyright 2012-2022 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +import Esri.ArcGISRuntime.Toolkit.Controller + +import QtQuick +import QtQml +import QtQuick.Controls +import QtQuick.Layouts + +/*! + \qmltype UtilityNetworkTrace + \inqmlmodule Esri.ArcGISRuntime.Toolkit + \ingroup ArcGISQtToolkitUiQmlViews + \since Esri.ArcGISRuntime 200.0 + \brief The user interface for the UtilityNetworkTrace tool. + + The UI is only displayed if there is at least one Utility Network loaded in the data model. + When there are multiple Utility Networks present in the map, the first one in the list is displayed. + + The UI includes a TabBar with one tab for configuring a new trace and another Tab for displaying results. + + The new trace Tab includes a custom UtilityNetworkTraceStartingPointsModel for displaying the different + properties of starting points in the UI. + + The result Tab itself contains a TabBar of the results made up of custom Tabs defined in + UtilityNetworkFunctionTraceResultsModel. + + Generic styles, displayed in this Qml UI, can be overwritten using the Calcite style. +*/ + +Pane { + id: utilityNetworkTrace + height: 600 + width: implicitWidth * 1.20 + + implicitHeight: 250 + implicitWidth: 300 + + /*! + \qmlproperty UtilityNetworkTraceController controller + \brief Loads a map with utility networks, on which different trace operations can be performed and the + operation's results are shown both on the map and textually in the UI. + + */ + property var controller: UtilityNetworkTraceController { } + + /*! + \qmlproperty GeoView geoView + \brief The \c GeoView for this tool. Currently, it can be a \c Map; but could be extended to use a \c Scene as well. + */ + property var geoView; + + Binding { + target: controller + property: "geoView" + value: geoView + } + + wheelEnabled: true + hoverEnabled: true + + contentItem: ColumnLayout { + + id: root + + TabBar { + id: bar + + Layout.fillWidth: true + + TabButton { + text: qsTr("New Trace") + font.pixelSize: 14 + } + TabButton { + text: qsTr("Trace Result") + font.pixelSize: 14 + } + } + + StackLayout { + + currentIndex: bar.currentIndex + clip: true + + ColumnLayout { + id: gridLayoutTrace + spacing: 5 + width: root.width + + Label { + text: "Trace Configuration" + } + + ComboBox { + Layout.margins: 5 + id: traceConfigurationBox + model: controller.traceConfigurationNames + Layout.fillWidth: true + onCurrentIndexChanged: { + controller.setSelectedTraceConfigurationNameByIndex(currentIndex); + } + } + + Label { + text: "Starting Points" + } + + BusyIndicator { + Layout.alignment: Qt.AlignHCenter + running: controller.isAddingStartingPointInProgress + visible: running + } + + ListView { + id: startPointList + anchors.margins: 4 + width: parent.width + Layout.preferredHeight: 250 + clip: true + ScrollBar.vertical: ScrollBar {} + model: controller.startingPoints + delegate: Pane { + + ColumnLayout { + width: startPointList.width - (startPointList.anchors.margins * 4) + RowLayout { + Layout.fillWidth: true + spacing: 1 + ColumnLayout { + Layout.fillWidth: true + + Label { + Layout.fillWidth: true + elide: Text.ElideRight + text: sourceName + horizontalAlignment: Text.AlignLeft + } + Label { + Layout.fillWidth: true + elide: Text.ElideRight + text: groupName + horizontalAlignment: Text.AlignLeft + } + } + Button { + Layout.preferredWidth: 48 + icon.source: "images/zoom-to-object.svg" + icon.width: 16 + icon.height: 16 + onClicked: controller.zoomToStartingPoint(index) + } + Button { + Layout.preferredWidth: 48 + icon.source: "images/trash.svg" + icon.width: 16 + icon.height: 16 + onClicked: controller.removeStartingPoint(index) + } + } + RowLayout { + spacing: 4 + Layout.fillWidth: true + + ComboBox { + id: multipleTerminalsCombo + Layout.fillWidth: true + padding: 0 + visible: hasMultipleTerminals + model: multipleTerminalNames + onCurrentIndexChanged: { + if (selectedTerminalIndex !== currentIndex) + selectedTerminalIndex = currentIndex; + } + } + + Slider { + id: slider + Layout.fillWidth: true + padding: 0 + stepSize: 0.01 + snapMode: Slider.SnapAlways + from: 0.0 + to: 1.0 + visible: hasFractionAlongEdge + value: fractionAlongEdge + onValueChanged: { + if (fractionAlongEdge !== value) { + fractionAlongEdge = value + } + } + } + Label { + text: slider.value.toFixed(2) + visible: hasFractionAlongEdge + } + } + } + } + } + + Label { + visible: controller.isAddingStartingPointEnabled + text: "Click on the map to identify starting points." + horizontalAlignment: Text.AlignLeft + } + + RowLayout { + Layout.margins: 0 + visible: true + + Button { + id: selectStartingPointButton + text: controller.isAddingStartingPointEnabled ? "Cancel" : "Add Starting Point" + Layout.alignment: Qt.AlignRight + Layout.maximumWidth: Layout.maximumHeight + padding: 0 + onClicked: controller.isAddingStartingPointEnabled = !controller.isAddingStartingPointEnabled + } + + Button { + id: removeAllButton + text: "Remove All" + Layout.alignment: Qt.AlignLeft + Layout.maximumWidth: Layout.maximumHeight + padding: 0 + onClicked: controller.removeAllStartingPoints() + visible: startPointList.count > 0 + } + } + + ColumnLayout { + id: gridLayoutResults + width: root.width + spacing: 0 + + Label { + visible: controller.isInsufficientStartingPoints + text: "The selected trace configuration requires additional starting points." + horizontalAlignment: Text.AlignLeft + width: gridLayoutTrace.width + wrapMode: Text.WordWrap + Layout.fillWidth: true + } + + Label { + visible: controller.isAboveMinimumStartingPoint + text: "There are more starting points than required for the selected trace configuration." + horizontalAlignment: Text.AlignLeft + width: gridLayoutTrace.width + wrapMode: Text.WordWrap + Layout.fillWidth: true + } + + Button { + id: runTrace + text: "Run trace" + Layout.alignment: Qt.AlignCenter + Layout.maximumWidth: Layout.maximumHeight + padding: 0 + implicitWidth: root.width + onClicked: { + bar.currentIndex = 1 + controller.runTrace("n/a") + } + enabled: !controller.isInsufficientStartingPoints + } + } + } + + ColumnLayout { + id: gridLayoutTraceResults + spacing: 5 + width: root.width + + BusyIndicator { + Layout.alignment: Qt.AlignHCenter + running: controller.isTraceInProgress + visible: running + } + + ListView { + id: functionResultsList + anchors.margins: 4 + width: parent.width + Layout.preferredHeight: 250 + clip: true + ScrollBar.vertical: ScrollBar {} + model: controller.functionResults + delegate: Pane { + ColumnLayout { + width: functionResultsList.width - (functionResultsList.anchors.margins * 4) + RowLayout { + Layout.fillWidth: true + spacing: 1 + ColumnLayout { + Layout.fillWidth: true + + Label { + Layout.fillWidth: true + elide: Text.ElideRight + text: name + ": " + value + horizontalAlignment: Text.AlignLeft + } + Label { + Layout.fillWidth: true + elide: Text.ElideRight + text: "Function type: " + type + "" + horizontalAlignment: Text.AlignLeft + } + } + } + } + } + } + + Button { + id: clearTraceResults + text: "Clear results" + Layout.alignment: Qt.AlignCenter | Qt.AlignBottom + Layout.maximumWidth: Layout.maximumHeight + padding: 0 + onClicked: { + bar.currentIndex = 0 + controller.resetTraceResults() + } + enabled: controller.isResetResultsEnabled + visible: true + } + } + } + } +} diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/esri_arcgisruntime_toolkit_view.qrc b/uitools/import/Esri/ArcGISRuntime/Toolkit/esri_arcgisruntime_toolkit_view.qrc index d76a950e4..a48ffbbf0 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/esri_arcgisruntime_toolkit_view.qrc +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/esri_arcgisruntime_toolkit_view.qrc @@ -21,6 +21,7 @@ SslHandshakeView.qml TimeSlider.qml UserCredentialsView.qml + UtilityNetworkTrace.qml qmldir diff --git a/uitools/import/Esri/ArcGISRuntime/Toolkit/qmldir b/uitools/import/Esri/ArcGISRuntime/Toolkit/qmldir index de79c2985..c388ca320 100644 --- a/uitools/import/Esri/ArcGISRuntime/Toolkit/qmldir +++ b/uitools/import/Esri/ArcGISRuntime/Toolkit/qmldir @@ -14,28 +14,47 @@ module Esri.ArcGISRuntime.Toolkit -depends Esri.ArcGISRuntime.Toolkit.Controller 100.15 +depends Esri.ArcGISRuntime.Toolkit.Controller 200.0 # Current version increment -CurrentVersion 100.15 CurrentVersion.qml +CurrentVersion 200.0 CurrentVersion.qml # View components AuthenticationView 100.10 AuthenticationView.qml +AuthenticationView 200.0 AuthenticationView.qml BasemapGallery 100.12 BasemapGallery.qml +BasemapGallery 200.0 BasemapGallery.qml BookmarksView 100.15 BookmarksView.qml +BookmarksView 200.0 BookmarksView.qml Callout 100.10 Callout.qml +Callout 200.0 Callout.qml ClientCertificateView 100.10 ClientCertificateView.qml +ClientCertificateView 200.0 ClientCertificateView.qml CoordinateConversion 100.10 CoordinateConversion.qml +CoordinateConversion 200.0 CoordinateConversion.qml internal FlashImage FlashImage.qml NorthArrow 100.10 NorthArrow.qml +NorthArrow 200.0 NorthArrow.qml OAuth2View 100.10 OAuth2View.qml +OAuth2View 200.0 OAuth2View.qml OverviewMap 100.12 OverviewMap.qml +OverviewMap 200.0 OverviewMap.qml PopupStackView 100.10 PopupStackView.qml +PopupStackView 200.0 PopupStackView.qml PopupView 100.10 PopupView.qml +PopupView 200.0 PopupView.qml Scalebar 100.13 Scalebar.qml +Scalebar 200.0 Scalebar.qml internal ScalebarImpl ScalebarImpl.qml SearchView 100.13 SearchView.qml +SearchView 200.0 SearchView.qml SslHandshakeView 100.10 SslHandshakeView.qml +SslHandshakeView 200.0 SslHandshakeView.qml TimeSlider 100.10 TimeSlider.qml +TimeSlider 200.0 TimeSlider.qml UserCredentialsView 100.10 UserCredentialsView.qml +UserCredentialsView 200.0 UserCredentialsView.qml FloorFilter 100.14 FloorFilter.qml +FloorFilter 200.0 FloorFilter.qml +UtilityNetworkTrace 100.15 UtilityNetworkTrace.qml +UtilityNetworkTrace 200.0 UtilityNetworkTrace.qml diff --git a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.cpp b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.cpp index de2d072e5..08f292f3f 100644 --- a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.cpp +++ b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.cpp @@ -34,11 +34,15 @@ #include "PopupViewController.h" #include "ScalebarController.h" #include "SearchResult.h" -#include "SearchSourceInterface.h" #include "SearchSuggestion.h" #include "SearchViewController.h" #include "SmartLocatorSearchSource.h" #include "TimeSliderController.h" +#include "UtilityNetworkFunctionTraceResultsModel.h" +#include "UtilityNetworkListItem.h" +#include "UtilityNetworkTraceController.h" +#include "UtilityNetworkTraceStartingPoint.h" +#include "UtilityNetworkTraceStartingPointsModel.h" // Internal includes #include "Internal/BasemapGalleryImageProvider.h" @@ -54,9 +58,7 @@ // std includes #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { @@ -64,8 +66,8 @@ namespace Toolkit { constexpr char const* NAMESPACE = "Esri.ArcGISRuntime.Toolkit.Controller"; - constexpr int VERSION_MAJOR = 100; - constexpr int VERSION_MINOR = 15; + constexpr int VERSION_MAJOR = 200; + constexpr int VERSION_MINOR = 0; /* \internal @@ -76,7 +78,7 @@ namespace Toolkit { Provided is the overloaded method: \code - void registerComponentImpl( creationType, int minorVersion, const char* name) + void registerComponentImpl( creationType, int majorVersion, int minorVersion, const char* name) \endcode And the three currently accepted values for the \a creationType parameter. @@ -91,9 +93,9 @@ namespace Toolkit { }; template - void registerComponentImpl(CreationType::Creatable_, int minorVersion, const char* name) + void registerComponentImpl(CreationType::Creatable_, int majorVersion, int minorVersion, const char* name) { - qmlRegisterType(NAMESPACE, VERSION_MAJOR, minorVersion, name); + qmlRegisterType(NAMESPACE, majorVersion, minorVersion, name); } constexpr Creatable_ Creatable = Creatable_{}; @@ -103,61 +105,62 @@ namespace Toolkit { }; template - void registerComponentImpl(CreationType::Uncreatable_, int minorVersion, const char* name) + void registerComponentImpl(CreationType::Uncreatable_, int majorVersion, int minorVersion, const char* name) { - qmlRegisterUncreatableType(NAMESPACE, VERSION_MAJOR, minorVersion, name, "Cannot instantiate type in QML."); + qmlRegisterUncreatableType(NAMESPACE, majorVersion, minorVersion, name, "Cannot instantiate type in QML."); } constexpr Uncreatable_ Uncreatable = Uncreatable_{}; - struct Interface_ - { - }; - - template - void registerComponentImpl(CreationType::Interface_, int /*minorVersion*/, const char* /*name*/) - { - qmlRegisterInterface(NAMESPACE, VERSION_MAJOR); - } - - constexpr Interface_ Interface = Interface_{}; } /* \internal \brief Function for registration. Registers the C++ type Foo as - Foo in QML with the appropriate version and namespace information. + Foo in QML with the 100.10, 200.0 version and namespace information. \list - \li \a minorVersion The version at which the component was created. \li \a Determines how the type is instantiated in QML. Choose between CreationType::Creatable, CreationType::Uncreatable and CreationType::Interface. CreationType::Creatable is assumed by default if not provided. \endlist Example call: \code - registerComponent(13, CreationType::Uncreatable); + registerComponent(CreationType::Uncreatable); \endcode */ template - void registerComponent(int minorVersion, CType creationType = CType{}) + void registerComponent(CType creationType = CType{}) { static_assert(std::is_base_of::value, "Must inherit QObject"); auto name = QString{T::staticMetaObject.className()}; name.remove("Esri::ArcGISRuntime::Toolkit::"); - CreationType::registerComponentImpl(creationType, minorVersion, name.toLatin1()); + // register component on version 100 + CreationType::registerComponentImpl(creationType, 100, 10, name.toLatin1()); + // register component on version 200 + CreationType::registerComponentImpl(creationType, 200, 0, name.toLatin1()); } /* \internal - \brief Ensures a Module revision is available from 100.10 onwards + \brief Ensures a Module revision is available from 100.10 and 200.0 onwards to the current version of the Toolkit. */ void registerModuleRevisions() { - constexpr int START_VERSION = 10; - for (int i = START_VERSION; i <= VERSION_MINOR; ++i) + constexpr int MAJOR_VERSION_100 = 100; + constexpr int START_MINOR_VERSION_100 = 10; + constexpr int END_MINOR_VERSION_100 = 15; + // register version 100 + for (int i = START_MINOR_VERSION_100; i <= END_MINOR_VERSION_100; ++i) + { + qmlRegisterModule(NAMESPACE, MAJOR_VERSION_100, i); + } + // register version 200 onwards + for (int i = 0; i <= VERSION_MINOR; ++i) + { qmlRegisterModule(NAMESPACE, VERSION_MAJOR, i); + } } } // namespace @@ -167,35 +170,38 @@ namespace Toolkit { appEngine.addImageProvider(BasemapGalleryImageProvider::PROVIDER_ID, BasemapGalleryImageProvider::instance()); appEngine.addImportPath(ESRI_COM_PATH); registerModuleRevisions(); - registerComponent(10); - registerComponent(12); - registerComponent(12); - registerComponent(15); - registerComponent(15); - registerComponent(10); - registerComponent(10); - registerComponent(10); - registerComponent(14); - registerComponent(14, CreationType::Uncreatable); - registerComponent(14, CreationType::Uncreatable); - registerComponent(14, CreationType::Uncreatable); - registerComponent(13, CreationType::Uncreatable); - registerComponent(10); - registerComponent(12); - registerComponent(10); - registerComponent(13); - registerComponent(13); - registerComponent(13, CreationType::Interface); - registerComponent(13); - registerComponent(13, CreationType::Creatable); - registerComponent(13, CreationType::Uncreatable); - registerComponent(10); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(CreationType::Uncreatable); + registerComponent(CreationType::Uncreatable); + registerComponent(CreationType::Uncreatable); + registerComponent(CreationType::Uncreatable); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(CreationType::Uncreatable); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); + registerComponent(); // Register ArcGISRuntime types with toolkit. qRegisterMetaType("Esri::ArcGISRuntime::Point"); - qmlRegisterAnonymousType(NAMESPACE, 12); + qmlRegisterAnonymousType(NAMESPACE, 100); + qmlRegisterAnonymousType(NAMESPACE, 200); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.h b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.h index f8176f3ab..4d9a81e3e 100644 --- a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.h +++ b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_cpp.h @@ -18,17 +18,10 @@ class QQmlEngine; -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { void registerComponents_cpp_(QQmlEngine& qmlEngine); -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_REGISTER_CPP_H diff --git a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.cpp b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.cpp index af42865ff..a2a35bb43 100644 --- a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.cpp +++ b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.cpp @@ -20,12 +20,7 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { namespace { @@ -37,6 +32,4 @@ void registerComponents_qml_(QQmlEngine& appEngine) appEngine.addImportPath(ESRI_COM_PATH); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.h b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.h index 01cb24d8c..737afa641 100644 --- a/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.h +++ b/uitools/register/Esri/ArcGISRuntime/Toolkit/internal/register_qml.h @@ -18,17 +18,10 @@ class QQmlEngine; -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { void registerComponents_qml_(QQmlEngine& qmlEngine); -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_REGISTER_QML_H diff --git a/uitools/register/Esri/ArcGISRuntime/Toolkit/register.cpp b/uitools/register/Esri/ArcGISRuntime/Toolkit/register.cpp index 3055d526d..c636d8f04 100644 --- a/uitools/register/Esri/ArcGISRuntime/Toolkit/register.cpp +++ b/uitools/register/Esri/ArcGISRuntime/Toolkit/register.cpp @@ -17,6 +17,7 @@ /*! \headerfile Esri/ArcGISRuntime/Toolkit/register + \inmodule ArcGISRuntimeToolkit This file contains the registration function required to register the toolkit with the `QQmlEngine`. @@ -26,9 +27,9 @@ */ /*! - \fn void Esri::ArcGISRuntime::Toolkit::registerComponents(QmlEngine& engine) + \fn void Esri::ArcGISRuntime::Toolkit::registerComponents(QQmlEngine& engine) \relates Esri/ArcGISRuntime/Toolkit/register - \brief This registration function must be called after the QmlEngine has been + \brief This registration function must be called after the QML \a engine has been declared, but before it is run. This sets up resources and component registration with the `QQmlEngine` and the toolkit. */ @@ -37,39 +38,25 @@ #if defined(CPP_ARCGISRUNTIME_TOOLKIT) # include "internal/register_cpp.h" -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { void registerComponents(QQmlEngine& engine) { registerComponents_cpp_(engine); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #elif defined(QML_ARCGISRUNTIME_TOOLKIT) # include "internal/register_qml.h" -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { void registerComponents(QQmlEngine& engine) { registerComponents_qml_(engine); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif diff --git a/uitools/register/Esri/ArcGISRuntime/Toolkit/register.h b/uitools/register/Esri/ArcGISRuntime/Toolkit/register.h index d8b468489..18163f406 100644 --- a/uitools/register/Esri/ArcGISRuntime/Toolkit/register.h +++ b/uitools/register/Esri/ArcGISRuntime/Toolkit/register.h @@ -18,17 +18,10 @@ class QQmlEngine; -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { void registerComponents(QQmlEngine& engine); -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_REGISTER_H diff --git a/uitools/toolkit.qdocconf b/uitools/toolkit.qdocconf index 8ba4c9155..4afea2924 100644 --- a/uitools/toolkit.qdocconf +++ b/uitools/toolkit.qdocconf @@ -16,7 +16,7 @@ project = EsriArcGISRuntimeToolkit description = Esri ArcGISRuntime Toolkit Documentation -version = 100.15 +version = 200.0 headers.fileextensions = "*.h" diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.cpp index 2e078cb73..a60e30daf 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.cpp @@ -23,9 +23,7 @@ #include "Internal/SslHandshakeView.h" #include "Internal/UserCredentialView.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { QWidget* createWidgetView(AuthenticationController* controller, AuthenticationView* view) @@ -196,6 +194,4 @@ namespace Toolkit { \brief Emitted when the controller used to drive the view changes. */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.h index 65b9fd0c6..de2ee23f7 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/AuthenticationView.h @@ -26,9 +26,7 @@ namespace Ui { class AuthenticationView; } -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class AuthenticationController; @@ -51,8 +49,6 @@ namespace Toolkit { Ui::AuthenticationView* m_ui = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_AUTHENTICATIONVIEW_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.cpp index 00c29a450..299635ac8 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.cpp @@ -20,9 +20,7 @@ // Toolkit headers #include "BasemapGalleryController.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::BasemapGallery @@ -140,6 +138,4 @@ namespace Toolkit { return; m_ui->listView->selectionModel()->select(index, QItemSelectionModel::Select); } -} //Toolkit -} //ArcGISRuntime -} //Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.h index aa3ba25ac..5d2a9fc27 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BasemapGallery.h @@ -22,8 +22,8 @@ namespace Ui { class BasemapGallery; } -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { + class GeoModel; namespace Toolkit { @@ -52,7 +52,6 @@ namespace ArcGISRuntime { }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_BASEMAPGALLERY_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.cpp index b9214c067..965850caf 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.cpp @@ -25,9 +25,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::BookmarksView @@ -105,6 +103,4 @@ namespace Toolkit { { m_controller->setGeoView(sceneView); } -} //Toolkit -} //ArcGISRuntime -} //Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.h index 177d8e6cb..f8e4bb5ff 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/BookmarksView.h @@ -22,8 +22,8 @@ namespace Ui { class BookmarksView; } -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { + class MapGraphicsView; class SceneGraphicsView; @@ -50,7 +50,6 @@ namespace Toolkit { }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_BOOKMARKSVIEW_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.cpp index b56abe1ed..257f6b7c3 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.cpp @@ -39,9 +39,7 @@ // std headers #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::CoordinateConversion @@ -203,6 +201,4 @@ namespace Toolkit { graphicsView->scene()->addWidget(m_flash.data()); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.h index 67d926dde..f7ec39abb 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/CoordinateConversion.h @@ -27,10 +27,8 @@ namespace Ui class CoordinateConversion; } -namespace Esri -{ -namespace ArcGISRuntime -{ +namespace Esri::ArcGISRuntime { + class MapGraphicsView; class SceneGraphicsView; @@ -67,7 +65,6 @@ private slots: }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_COORDIANTECONVERSION_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.cpp index 6b2745c26..bb24aa34f 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.cpp @@ -33,9 +33,7 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { @@ -315,6 +313,4 @@ namespace Toolkit { return m_controller; } -} //Toolkit -} //ArcGISRuntime -} //Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.h index 2c67322d2..fae92991c 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/FloorFilter.h @@ -24,8 +24,7 @@ namespace Ui { class FloorFilter; } -namespace Esri { -namespace ArcGISRuntime { +namespace Esri::ArcGISRuntime { class MapGraphicsView; class SceneGraphicsView; @@ -54,7 +53,6 @@ namespace ArcGISRuntime { bool m_facilitiesUpdatedFromController{false}; }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_TOOLKIT_FLOORFILTER_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.cpp index 222f6ec5f..51cf87cb2 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.cpp @@ -17,16 +17,15 @@ #include "ui_ClientCertificatePasswordDialog.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { - /*! - \brief Constructor. - \list - \li \a parent Parent widget. - \endlist +/*! + \internal + \class Esri::ArcGISRuntime::Toolkit::ClientCertificatePasswordDialog + \inmodule EsriArcGISRuntimeToolkit + \brief This is an implementation of dialog to request password for client certificate. */ + ClientCertificatePasswordDialog::ClientCertificatePasswordDialog(QUrl certificateFile, AuthenticationController* controller, QWidget* parent) : QDialog(parent), m_certificateFile(std::move(certificateFile)), @@ -55,11 +54,12 @@ namespace Toolkit { }); } + /*! + \brief Destructor + */ ClientCertificatePasswordDialog::~ClientCertificatePasswordDialog() { delete m_ui; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.h index 4985042d2..a390fd399 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificatePasswordDialog.h @@ -27,9 +27,7 @@ namespace Ui { class ClientCertificatePasswordDialog; } -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class ClientCertificatePasswordDialog : public QDialog { @@ -44,8 +42,6 @@ namespace Toolkit { Ui::ClientCertificatePasswordDialog* m_ui = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_CLIENTCERTIFICATEPASSWORDDIALOG_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.cpp index a4a4c3e46..10f977cec 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.cpp @@ -22,16 +22,15 @@ #include #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { - - /*! - \brief Constructor. - \list - \li \a parent Parent widget. - \endlist +namespace Esri::ArcGISRuntime::Toolkit { + +/*! + \internal + \class Esri::ArcGISRuntime::Toolkit::ClientCertificateView + \inmodule EsriArcGISRuntimeToolkit + \brief This is an implementation of dialog to select a client certificate. */ + ClientCertificateView::ClientCertificateView(AuthenticationController* controller, QWidget* parent) : QWidget(parent), m_controller(controller), @@ -125,6 +124,4 @@ namespace Toolkit { delete m_ui; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.h index 7e068e2f2..c4cacdeaa 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/ClientCertificateView.h @@ -26,9 +26,7 @@ namespace Ui { class ClientCertificateView; } -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class ClientCertificateView : public QWidget { @@ -42,8 +40,6 @@ namespace Toolkit { Ui::ClientCertificateView* m_ui = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_CLIENTCERTIFICATEVIEW_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.cpp index 54e2cd95c..371131c88 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.cpp @@ -24,12 +24,7 @@ //Qt headers #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \internal @@ -121,6 +116,4 @@ void CoordinateEditDelegate::setModelData( } } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.h index 118c6375a..afa707189 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/CoordinateEditDelegate.h @@ -20,12 +20,7 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class CoordinateConversionController; @@ -48,8 +43,6 @@ class CoordinateEditDelegate : public QItemDelegate QPointer m_controller; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_COORDIANTEEDITDELEGATE_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.cpp index fb95e64c3..c1fca64a1 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.cpp @@ -20,12 +20,7 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \internal @@ -192,6 +187,4 @@ void Flash::play(int duration) \property Esri::ArcGISRuntime::Toolkit::Flash::radius */ -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.h index 5d81d9ee1..26ed49fa4 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/Flash.h @@ -21,12 +21,7 @@ class QPropertyAnimation; -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { class Flash : public QWidget { @@ -74,8 +69,6 @@ public slots: int m_radius = 0; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_TOOLKIT_INTERNAL_FLASH_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.cpp index b89ab2df9..624ba11df 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.cpp @@ -17,9 +17,7 @@ #include "ui_OAuth2View.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { namespace { bool isSuccess(const QString& title) @@ -115,6 +113,4 @@ namespace Toolkit { delete m_ui; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.h index 1b9a3f5ea..e7b0d655e 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/OAuth2View.h @@ -26,9 +26,7 @@ namespace Ui { class OAuth2View; } -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class OAuth2View : public QWidget { @@ -42,8 +40,6 @@ namespace Toolkit { Ui::OAuth2View* m_ui = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_OAUTH2VIEW_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.cpp index 5a73dcd00..d5d838517 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.cpp @@ -17,16 +17,15 @@ #include "ui_SslHandshakeView.h" -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { - - /*! - \brief Constructor. - \list - \li \a parent Parent widget. - \endlist +namespace Esri::ArcGISRuntime::Toolkit { + +/*! + \internal + \class Esri::ArcGISRuntime::Toolkit::SslHandshakeView + \inmodule EsriArcGISRuntimeToolkit + \brief This is an implementation of dialog for SSL handshake. */ + SslHandshakeView::SslHandshakeView(AuthenticationController* controller, QWidget* parent) : QWidget(parent), m_controller(controller), @@ -58,6 +57,4 @@ namespace Toolkit { delete m_ui; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.h index 73aacbc3d..424508c38 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/SslHandshakeView.h @@ -26,9 +26,7 @@ namespace Ui { class SslHandshakeView; } -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class SslHandshakeView : public QWidget { @@ -42,8 +40,6 @@ namespace Toolkit { Ui::SslHandshakeView* m_ui = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_SSLHANDSHAKEVIEW_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.cpp index 1d79a5642..e8cf9c56c 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.cpp @@ -19,9 +19,7 @@ #include -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::UserCredentialView @@ -91,6 +89,4 @@ namespace Toolkit { m_ui->buttonBox->button(QDialogButtonBox::Ok)->setDisabled(m_ui->usernameEdit->text().isEmpty() || m_ui->passwordEdit->text().isEmpty()); } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.h index a0411b88f..428e176bc 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/Internal/UserCredentialView.h @@ -26,9 +26,7 @@ namespace Ui { class UserCredentialView; } -namespace Esri { -namespace ArcGISRuntime { -namespace Toolkit { +namespace Esri::ArcGISRuntime::Toolkit { class UserCredentialView : public QWidget { @@ -46,8 +44,6 @@ namespace Toolkit { Ui::UserCredentialView* m_ui = nullptr; }; -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit #endif // ESRI_ARCGISRUNTIME_USERCREDENTIALVIEW_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.cpp index f6df727b8..8092014cf 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.cpp @@ -26,12 +26,7 @@ #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::NorthArrow @@ -134,6 +129,4 @@ NorthArrowController* NorthArrow::controller() const return m_controller; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.h index 3d7fa815b..c8526f8a8 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/NorthArrow.h @@ -19,10 +19,7 @@ #include #include -namespace Esri -{ -namespace ArcGISRuntime -{ +namespace Esri::ArcGISRuntime { class MapGraphicsView; class SceneGraphicsView; @@ -55,7 +52,6 @@ class NorthArrow : public QLabel }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_NORTHARROW_H diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.cpp b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.cpp index da172d4e9..c720963ab 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.cpp +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.cpp @@ -27,12 +27,7 @@ // Qt headers #include -namespace Esri -{ -namespace ArcGISRuntime -{ -namespace Toolkit -{ +namespace Esri::ArcGISRuntime::Toolkit { /*! \class Esri::ArcGISRuntime::Toolkit::OverviewMap @@ -98,6 +93,4 @@ OverviewMapController* OverviewMap::controller() const return m_controller; } -} // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime::Toolkit diff --git a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.h b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.h index a7bc86220..2fce356d5 100644 --- a/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.h +++ b/uitools/widgets/Esri/ArcGISRuntime/Toolkit/OverviewMap.h @@ -22,10 +22,7 @@ namespace Ui { class OverviewMap; } -namespace Esri -{ -namespace ArcGISRuntime -{ +namespace Esri::ArcGISRuntime { class MapGraphicsView; class SceneGraphicsView; @@ -55,7 +52,6 @@ class OverviewMap : public QWidget }; } // Toolkit -} // ArcGISRuntime -} // Esri +} // Esri::ArcGISRuntime #endif // ESRI_ARCGISRUNTIME_OVERVIEWMAP_H