objc2_ar_kit/generated/
ARPlaneAnchor.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7#[cfg(feature = "objc2-foundation")]
8use objc2_foundation::*;
9
10use crate::*;
11
12/// A value describing the alignment of a plane anchor.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arplaneanchoralignment?language=objc)
15// NS_ENUM
16#[cfg(feature = "objc2")]
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct ARPlaneAnchorAlignment(pub NSInteger);
20#[cfg(feature = "objc2")]
21impl ARPlaneAnchorAlignment {
22    /// A plane that is horizontal with respect to gravity.
23    #[doc(alias = "ARPlaneAnchorAlignmentHorizontal")]
24    pub const Horizontal: Self = Self(0);
25    /// A plane that is vertical with respect to gravity.
26    #[doc(alias = "ARPlaneAnchorAlignmentVertical")]
27    pub const Vertical: Self = Self(1);
28}
29
30#[cfg(feature = "objc2")]
31unsafe impl Encode for ARPlaneAnchorAlignment {
32    const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35#[cfg(feature = "objc2")]
36unsafe impl RefEncode for ARPlaneAnchorAlignment {
37    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40/// A value describing the classification status of a plane anchor.
41///
42/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arplaneclassificationstatus?language=objc)
43// NS_ENUM
44#[cfg(feature = "objc2")]
45#[repr(transparent)]
46#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
47pub struct ARPlaneClassificationStatus(pub NSInteger);
48#[cfg(feature = "objc2")]
49impl ARPlaneClassificationStatus {
50    /// Plane classification is currently unavailable.
51    #[doc(alias = "ARPlaneClassificationStatusNotAvailable")]
52    pub const NotAvailable: Self = Self(0);
53    /// ARKit has not yet determined the classification of this plane.
54    #[doc(alias = "ARPlaneClassificationStatusUndetermined")]
55    pub const Undetermined: Self = Self(1);
56    /// ARKit is confident the plane is not any of the known classes.
57    #[doc(alias = "ARPlaneClassificationStatusUnknown")]
58    pub const Unknown: Self = Self(2);
59    /// ARKit has a classification for the plane it is confident in.
60    #[doc(alias = "ARPlaneClassificationStatusKnown")]
61    pub const Known: Self = Self(3);
62}
63
64#[cfg(feature = "objc2")]
65unsafe impl Encode for ARPlaneClassificationStatus {
66    const ENCODING: Encoding = NSInteger::ENCODING;
67}
68
69#[cfg(feature = "objc2")]
70unsafe impl RefEncode for ARPlaneClassificationStatus {
71    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
72}
73
74/// A value describing the classification of a plane anchor.
75///
76/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arplaneclassification?language=objc)
77// NS_ENUM
78#[cfg(feature = "objc2")]
79#[repr(transparent)]
80#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
81pub struct ARPlaneClassification(pub NSInteger);
82#[cfg(feature = "objc2")]
83impl ARPlaneClassification {
84    /// The classification is not any of the known classes.
85    #[doc(alias = "ARPlaneClassificationNone")]
86    pub const None: Self = Self(0);
87    /// The classification is not any of the known classes.
88    #[doc(alias = "ARPlaneClassificationWall")]
89    pub const Wall: Self = Self(1);
90    /// The classification is not any of the known classes.
91    #[doc(alias = "ARPlaneClassificationFloor")]
92    pub const Floor: Self = Self(2);
93    /// The classification is not any of the known classes.
94    #[doc(alias = "ARPlaneClassificationCeiling")]
95    pub const Ceiling: Self = Self(3);
96    /// The classification is not any of the known classes.
97    #[doc(alias = "ARPlaneClassificationTable")]
98    pub const Table: Self = Self(4);
99    /// The classification is not any of the known classes.
100    #[doc(alias = "ARPlaneClassificationSeat")]
101    pub const Seat: Self = Self(5);
102    /// The classification is not any of the known classes.
103    #[doc(alias = "ARPlaneClassificationWindow")]
104    pub const Window: Self = Self(6);
105    /// The classification is not any of the known classes.
106    #[doc(alias = "ARPlaneClassificationDoor")]
107    pub const Door: Self = Self(7);
108}
109
110#[cfg(feature = "objc2")]
111unsafe impl Encode for ARPlaneClassification {
112    const ENCODING: Encoding = NSInteger::ENCODING;
113}
114
115#[cfg(feature = "objc2")]
116unsafe impl RefEncode for ARPlaneClassification {
117    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
118}
119
120#[cfg(feature = "objc2")]
121extern_class!(
122    /// Represents the extents of a plane.
123    ///
124    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arplaneextent?language=objc)
125    #[unsafe(super(NSObject))]
126    #[derive(Debug, PartialEq, Eq, Hash)]
127    #[cfg(feature = "objc2")]
128    pub struct ARPlaneExtent;
129);
130
131#[cfg(feature = "objc2")]
132unsafe impl Send for ARPlaneExtent {}
133
134#[cfg(feature = "objc2")]
135unsafe impl Sync for ARPlaneExtent {}
136
137#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
138extern_conformance!(
139    unsafe impl NSCoding for ARPlaneExtent {}
140);
141
142#[cfg(feature = "objc2")]
143extern_conformance!(
144    unsafe impl NSObjectProtocol for ARPlaneExtent {}
145);
146
147#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
148extern_conformance!(
149    unsafe impl NSSecureCoding for ARPlaneExtent {}
150);
151
152#[cfg(feature = "objc2")]
153impl ARPlaneExtent {
154    extern_methods!(
155        /// The rotation angle in radians of the extents around the y-axis in the anchor’s coordinate space.
156        ///
157        /// This property is not atomic.
158        ///
159        /// # Safety
160        ///
161        /// This might not be thread-safe.
162        #[unsafe(method(rotationOnYAxis))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn rotationOnYAxis(&self) -> c_float;
165
166        /// The width of the plane. Corresponds to the length of the plane along the x-axis prior to applying .rotationOnYAxis.
167        ///
168        /// This property is not atomic.
169        ///
170        /// # Safety
171        ///
172        /// This might not be thread-safe.
173        #[unsafe(method(width))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn width(&self) -> c_float;
176
177        /// The height the plane. Corresponds to the length of the plane along the z-axis prior to applying .rotationOnYAxis.
178        ///
179        /// This property is not atomic.
180        ///
181        /// # Safety
182        ///
183        /// This might not be thread-safe.
184        #[unsafe(method(height))]
185        #[unsafe(method_family = none)]
186        pub unsafe fn height(&self) -> c_float;
187    );
188}
189
190/// Methods declared on superclass `NSObject`.
191#[cfg(feature = "objc2")]
192impl ARPlaneExtent {
193    extern_methods!(
194        #[unsafe(method(init))]
195        #[unsafe(method_family = init)]
196        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
197
198        #[unsafe(method(new))]
199        #[unsafe(method_family = new)]
200        pub unsafe fn new() -> Retained<Self>;
201    );
202}
203
204#[cfg(feature = "objc2")]
205extern_class!(
206    /// An anchor representing a planar surface in the world.
207    ///
208    /// Planes are defined in the X and Z direction, where Y is the surface’s normal.
209    ///
210    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arplaneanchor?language=objc)
211    #[unsafe(super(ARAnchor, NSObject))]
212    #[derive(Debug, PartialEq, Eq, Hash)]
213    #[cfg(all(feature = "ARAnchor", feature = "objc2"))]
214    pub struct ARPlaneAnchor;
215);
216
217#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
218unsafe impl Send for ARPlaneAnchor {}
219
220#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
221unsafe impl Sync for ARPlaneAnchor {}
222
223#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
224extern_conformance!(
225    unsafe impl ARAnchorCopying for ARPlaneAnchor {}
226);
227
228#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
229extern_conformance!(
230    unsafe impl NSCoding for ARPlaneAnchor {}
231);
232
233#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
234extern_conformance!(
235    unsafe impl NSCopying for ARPlaneAnchor {}
236);
237
238#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
239unsafe impl CopyingHelper for ARPlaneAnchor {
240    type Result = Self;
241}
242
243#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
244extern_conformance!(
245    unsafe impl NSObjectProtocol for ARPlaneAnchor {}
246);
247
248#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
249extern_conformance!(
250    unsafe impl NSSecureCoding for ARPlaneAnchor {}
251);
252
253#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
254impl ARPlaneAnchor {
255    extern_methods!(
256        /// Determines whether plane classification is supported on this device.
257        #[unsafe(method(isClassificationSupported))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn isClassificationSupported() -> bool;
260
261        /// The alignment of the plane.
262        ///
263        /// This property is not atomic.
264        ///
265        /// # Safety
266        ///
267        /// This might not be thread-safe.
268        #[unsafe(method(alignment))]
269        #[unsafe(method_family = none)]
270        pub unsafe fn alignment(&self) -> ARPlaneAnchorAlignment;
271
272        /// The extent of the plane in the anchor’s coordinate space.
273        ///
274        /// This property is not atomic.
275        ///
276        /// # Safety
277        ///
278        /// This might not be thread-safe.
279        #[unsafe(method(planeExtent))]
280        #[unsafe(method_family = none)]
281        pub unsafe fn planeExtent(&self) -> Retained<ARPlaneExtent>;
282
283        #[cfg(feature = "ARPlaneGeometry")]
284        /// Geometry of the plane in the anchor's coordinate space.
285        ///
286        /// This property is not atomic.
287        ///
288        /// # Safety
289        ///
290        /// This might not be thread-safe.
291        #[unsafe(method(geometry))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn geometry(&self) -> Retained<ARPlaneGeometry>;
294
295        /// Classification status of the plane.
296        ///
297        /// This property is not atomic.
298        ///
299        /// # Safety
300        ///
301        /// This might not be thread-safe.
302        #[unsafe(method(classificationStatus))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn classificationStatus(&self) -> ARPlaneClassificationStatus;
305
306        /// Classification of the plane.
307        ///
308        /// This property is not atomic.
309        ///
310        /// # Safety
311        ///
312        /// This might not be thread-safe.
313        #[unsafe(method(classification))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn classification(&self) -> ARPlaneClassification;
316    );
317}
318
319/// Methods declared on superclass `ARAnchor`.
320#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
321impl ARPlaneAnchor {
322    extern_methods!(
323        /// Unavailable
324        #[unsafe(method(init))]
325        #[unsafe(method_family = init)]
326        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
327
328        #[unsafe(method(new))]
329        #[unsafe(method_family = new)]
330        pub unsafe fn new() -> Retained<Self>;
331    );
332}