objc2_ar_kit/generated/
ARRaycastQuery.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
7use crate::*;
8
9/// A value describing the target of a ray used for raycasting.
10///
11/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arraycasttarget?language=objc)
12// NS_ENUM
13#[cfg(feature = "objc2")]
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct ARRaycastTarget(pub NSInteger);
17#[cfg(feature = "objc2")]
18impl ARRaycastTarget {
19    /// Ray's target is an already detected plane, considering the plane's estimated size and shape.
20    #[doc(alias = "ARRaycastTargetExistingPlaneGeometry")]
21    pub const ExistingPlaneGeometry: Self = Self(0);
22    /// Ray's target is an already detected plane, without considering the plane's size.
23    #[doc(alias = "ARRaycastTargetExistingPlaneInfinite")]
24    pub const ExistingPlaneInfinite: Self = Self(1);
25    /// Ray's target is a plane that is estimated using the feature points around the ray.
26    /// When alignment is ARRaycastTargetAlignmentAny, alignment of estimated planes is based on the normal of the real world
27    /// surface corresponding to the estimated plane.
28    #[doc(alias = "ARRaycastTargetEstimatedPlane")]
29    pub const EstimatedPlane: Self = Self(2);
30}
31
32#[cfg(feature = "objc2")]
33unsafe impl Encode for ARRaycastTarget {
34    const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37#[cfg(feature = "objc2")]
38unsafe impl RefEncode for ARRaycastTarget {
39    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42/// A value describing the alignment of a target.
43///
44/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arraycasttargetalignment?language=objc)
45// NS_ENUM
46#[cfg(feature = "objc2")]
47#[repr(transparent)]
48#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
49pub struct ARRaycastTargetAlignment(pub NSInteger);
50#[cfg(feature = "objc2")]
51impl ARRaycastTargetAlignment {
52    /// A target that is horizontal with respect to gravity.
53    #[doc(alias = "ARRaycastTargetAlignmentHorizontal")]
54    pub const Horizontal: Self = Self(0);
55    /// A target that is vertical with respect to gravity.
56    #[doc(alias = "ARRaycastTargetAlignmentVertical")]
57    pub const Vertical: Self = Self(1);
58    /// A target that is in any alignment, inclusive of horizontal and vertical.
59    #[doc(alias = "ARRaycastTargetAlignmentAny")]
60    pub const Any: Self = Self(2);
61}
62
63#[cfg(feature = "objc2")]
64unsafe impl Encode for ARRaycastTargetAlignment {
65    const ENCODING: Encoding = NSInteger::ENCODING;
66}
67
68#[cfg(feature = "objc2")]
69unsafe impl RefEncode for ARRaycastTargetAlignment {
70    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73#[cfg(feature = "objc2")]
74extern_class!(
75    /// Representation of a ray and its target which is used for raycasting.
76    ///
77    /// Represents a 3D ray and its target which is used to perform raycasting.
78    ///
79    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arraycastquery?language=objc)
80    #[unsafe(super(NSObject))]
81    #[derive(Debug, PartialEq, Eq, Hash)]
82    #[cfg(feature = "objc2")]
83    pub struct ARRaycastQuery;
84);
85
86#[cfg(feature = "objc2")]
87extern_conformance!(
88    unsafe impl NSObjectProtocol for ARRaycastQuery {}
89);
90
91#[cfg(feature = "objc2")]
92impl ARRaycastQuery {
93    extern_methods!(
94        /// Type of target where the ray should terminate.
95        #[unsafe(method(target))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn target(&self) -> ARRaycastTarget;
98
99        /// The alignment of the target that should be considered for raycasting.
100        #[unsafe(method(targetAlignment))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn targetAlignment(&self) -> ARRaycastTargetAlignment;
103
104        #[unsafe(method(init))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
107
108        #[unsafe(method(new))]
109        #[unsafe(method_family = new)]
110        pub unsafe fn new(&self) -> Retained<Self>;
111    );
112}
113
114/// Methods declared on superclass `NSObject`.
115#[cfg(feature = "objc2")]
116impl ARRaycastQuery {
117    extern_methods!(
118        #[unsafe(method(new))]
119        #[unsafe(method_family = new)]
120        pub unsafe fn new_class() -> Retained<Self>;
121    );
122}