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")]
66unsafe impl NSObjectProtocol for ARHitTestResult {}
67
68#[cfg(feature = "objc2")]
69impl ARHitTestResult {
70    extern_methods!(
71        /// The type of the hit-test result.
72        #[deprecated = "Use raycasting"]
73        #[unsafe(method(type))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn r#type(&self) -> ARHitTestResultType;
76
77        #[cfg(feature = "objc2-core-foundation")]
78        /// The distance from the camera to the intersection in meters.
79        #[deprecated = "Use raycasting"]
80        #[unsafe(method(distance))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn distance(&self) -> CGFloat;
83
84        #[cfg(feature = "ARAnchor")]
85        /// The anchor that the hit-test intersected.
86        ///
87        ///
88        /// An anchor will only be provided for existing plane result types.
89        #[deprecated = "Use raycasting"]
90        #[unsafe(method(anchor))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn anchor(&self) -> Option<Retained<ARAnchor>>;
93
94        /// Unavailable
95        #[deprecated = "Use raycasting"]
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100        #[deprecated = "Use raycasting"]
101        #[unsafe(method(new))]
102        #[unsafe(method_family = new)]
103        pub unsafe fn new() -> Retained<Self>;
104    );
105}