objc2_ar_kit/generated/
ARHitTestResult.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11/// Option set of hit-test result types.
12///
13/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arhittestresulttype?language=objc)
14// NS_OPTIONS
15#[cfg(feature = "objc2")]
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct ARHitTestResultType(pub NSUInteger);
19#[cfg(feature = "objc2")]
20bitflags::bitflags! {
21    impl ARHitTestResultType: NSUInteger {
22/// Result type from intersecting the nearest feature point.
23        #[doc(alias = "ARHitTestResultTypeFeaturePoint")]
24        const FeaturePoint = 1<<0;
25/// Result type from intersecting a horizontal plane estimate, determined for the current frame.
26        #[doc(alias = "ARHitTestResultTypeEstimatedHorizontalPlane")]
27        const EstimatedHorizontalPlane = 1<<1;
28/// Result type from intersecting a vertical plane estimate, determined for the current frame.
29        #[doc(alias = "ARHitTestResultTypeEstimatedVerticalPlane")]
30        const EstimatedVerticalPlane = 1<<2;
31/// Result type from intersecting with an existing plane anchor.
32        #[doc(alias = "ARHitTestResultTypeExistingPlane")]
33        const ExistingPlane = 1<<3;
34/// Result type from intersecting with an existing plane anchor, taking into account the plane’s extent.
35        #[doc(alias = "ARHitTestResultTypeExistingPlaneUsingExtent")]
36        const ExistingPlaneUsingExtent = 1<<4;
37/// Result type from intersecting with an existing plane anchor, taking into account the plane’s geometry.
38        #[doc(alias = "ARHitTestResultTypeExistingPlaneUsingGeometry")]
39        const ExistingPlaneUsingGeometry = 1<<5;
40    }
41}
42
43#[cfg(feature = "objc2")]
44unsafe impl Encode for ARHitTestResultType {
45    const ENCODING: Encoding = NSUInteger::ENCODING;
46}
47
48#[cfg(feature = "objc2")]
49unsafe impl RefEncode for ARHitTestResultType {
50    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
51}
52
53#[cfg(feature = "objc2")]
54extern_class!(
55    /// A result of an intersection found during a hit-test.
56    ///
57    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arhittestresult?language=objc)
58    #[unsafe(super(NSObject))]
59    #[derive(Debug, PartialEq, Eq, Hash)]
60    #[cfg(feature = "objc2")]
61    #[deprecated = "Use raycasting"]
62    pub struct ARHitTestResult;
63);
64
65#[cfg(feature = "objc2")]
66extern_conformance!(
67    unsafe impl NSObjectProtocol for ARHitTestResult {}
68);
69
70#[cfg(feature = "objc2")]
71impl ARHitTestResult {
72    extern_methods!(
73        /// The type of the hit-test result.
74        #[deprecated = "Use raycasting"]
75        #[unsafe(method(type))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn r#type(&self) -> ARHitTestResultType;
78
79        #[cfg(feature = "objc2-core-foundation")]
80        /// The distance from the camera to the intersection in meters.
81        #[deprecated = "Use raycasting"]
82        #[unsafe(method(distance))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn distance(&self) -> CGFloat;
85
86        #[cfg(feature = "ARAnchor")]
87        /// The anchor that the hit-test intersected.
88        ///
89        ///
90        /// An anchor will only be provided for existing plane result types.
91        #[deprecated = "Use raycasting"]
92        #[unsafe(method(anchor))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn anchor(&self) -> Option<Retained<ARAnchor>>;
95
96        /// Unavailable
97        #[deprecated = "Use raycasting"]
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
101
102        #[deprecated = "Use raycasting"]
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new() -> Retained<Self>;
106    );
107}