objc2_ar_kit/generated/
ARMeshGeometry.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-foundation")]
7use objc2_foundation::*;
8#[cfg(feature = "objc2-metal")]
9use objc2_metal::*;
10
11use crate::*;
12
13#[cfg(feature = "objc2")]
14extern_class!(
15    /// A container for vector data of a geometry.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeometrysource?language=objc)
18    #[unsafe(super(NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "objc2")]
21    pub struct ARGeometrySource;
22);
23
24#[cfg(feature = "objc2")]
25unsafe impl Send for ARGeometrySource {}
26
27#[cfg(feature = "objc2")]
28unsafe impl Sync for ARGeometrySource {}
29
30#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
31extern_conformance!(
32    unsafe impl NSCoding for ARGeometrySource {}
33);
34
35#[cfg(feature = "objc2")]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for ARGeometrySource {}
38);
39
40#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
41extern_conformance!(
42    unsafe impl NSSecureCoding for ARGeometrySource {}
43);
44
45#[cfg(feature = "objc2")]
46impl ARGeometrySource {
47    extern_methods!(
48        #[cfg(feature = "objc2-metal")]
49        /// A Metal buffer containing per-vector data for the source.
50        ///
51        /// This property is not atomic.
52        ///
53        /// # Safety
54        ///
55        /// This might not be thread-safe.
56        #[unsafe(method(buffer))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn buffer(&self) -> Retained<ProtocolObject<dyn MTLBuffer>>;
59
60        /// The number of vectors in the source.
61        ///
62        /// This property is not atomic.
63        ///
64        /// # Safety
65        ///
66        /// This might not be thread-safe.
67        #[unsafe(method(count))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn count(&self) -> NSInteger;
70
71        #[cfg(feature = "objc2-metal")]
72        /// The type of per-vector data in the buffer.
73        ///
74        /// This property is not atomic.
75        ///
76        /// # Safety
77        ///
78        /// This might not be thread-safe.
79        #[unsafe(method(format))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn format(&self) -> MTLVertexFormat;
82
83        /// The number of scalar components in each vector.
84        ///
85        /// This property is not atomic.
86        ///
87        /// # Safety
88        ///
89        /// This might not be thread-safe.
90        #[unsafe(method(componentsPerVector))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn componentsPerVector(&self) -> NSInteger;
93
94        /// The offset (in bytes) from the beginning of the buffer.
95        ///
96        /// This property is not atomic.
97        ///
98        /// # Safety
99        ///
100        /// This might not be thread-safe.
101        #[unsafe(method(offset))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn offset(&self) -> NSInteger;
104
105        /// The number of bytes from a vector to the next one in the buffer.
106        ///
107        /// This property is not atomic.
108        ///
109        /// # Safety
110        ///
111        /// This might not be thread-safe.
112        #[unsafe(method(stride))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn stride(&self) -> NSInteger;
115
116        /// Unavailable
117        #[unsafe(method(init))]
118        #[unsafe(method_family = init)]
119        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
120
121        #[unsafe(method(new))]
122        #[unsafe(method_family = new)]
123        pub unsafe fn new() -> Retained<Self>;
124    );
125}
126
127/// The primitive that defines how vertices are connected.
128///
129/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeometryprimitivetype?language=objc)
130// NS_ENUM
131#[cfg(feature = "objc2")]
132#[repr(transparent)]
133#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
134pub struct ARGeometryPrimitiveType(pub NSInteger);
135#[cfg(feature = "objc2")]
136impl ARGeometryPrimitiveType {
137    /// The geometry element is a sequence of line segments, where each line segment is described by two new vertices.
138    #[doc(alias = "ARGeometryPrimitiveTypeLine")]
139    pub const Line: Self = Self(0);
140    /// The geometry element is a sequence of triangles, where each triangle is described by three new vertices.
141    #[doc(alias = "ARGeometryPrimitiveTypeTriangle")]
142    pub const Triangle: Self = Self(1);
143}
144
145#[cfg(feature = "objc2")]
146unsafe impl Encode for ARGeometryPrimitiveType {
147    const ENCODING: Encoding = NSInteger::ENCODING;
148}
149
150#[cfg(feature = "objc2")]
151unsafe impl RefEncode for ARGeometryPrimitiveType {
152    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
153}
154
155#[cfg(feature = "objc2")]
156extern_class!(
157    /// A container for index data describing how vertices connect to define a geometry.
158    ///
159    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeometryelement?language=objc)
160    #[unsafe(super(NSObject))]
161    #[derive(Debug, PartialEq, Eq, Hash)]
162    #[cfg(feature = "objc2")]
163    pub struct ARGeometryElement;
164);
165
166#[cfg(feature = "objc2")]
167unsafe impl Send for ARGeometryElement {}
168
169#[cfg(feature = "objc2")]
170unsafe impl Sync for ARGeometryElement {}
171
172#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
173extern_conformance!(
174    unsafe impl NSCoding for ARGeometryElement {}
175);
176
177#[cfg(feature = "objc2")]
178extern_conformance!(
179    unsafe impl NSObjectProtocol for ARGeometryElement {}
180);
181
182#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
183extern_conformance!(
184    unsafe impl NSSecureCoding for ARGeometryElement {}
185);
186
187#[cfg(feature = "objc2")]
188impl ARGeometryElement {
189    extern_methods!(
190        #[cfg(feature = "objc2-metal")]
191        /// A Metal buffer containing index data that defines the geometry.
192        ///
193        /// This property is not atomic.
194        ///
195        /// # Safety
196        ///
197        /// This might not be thread-safe.
198        #[unsafe(method(buffer))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn buffer(&self) -> Retained<ProtocolObject<dyn MTLBuffer>>;
201
202        /// The number of primitives in the buffer.
203        ///
204        /// This property is not atomic.
205        ///
206        /// # Safety
207        ///
208        /// This might not be thread-safe.
209        #[unsafe(method(count))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn count(&self) -> NSInteger;
212
213        /// The number of bytes that represent an index value.
214        ///
215        /// This property is not atomic.
216        ///
217        /// # Safety
218        ///
219        /// This might not be thread-safe.
220        #[unsafe(method(bytesPerIndex))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn bytesPerIndex(&self) -> NSInteger;
223
224        /// The number of indices for each primitive.
225        ///
226        /// See: ARGeometryPrimitiveType
227        ///
228        /// This is based on the primitiveType. For ARGeometryPrimitiveTypeTriangle the value is 3.
229        ///
230        /// This property is not atomic.
231        ///
232        /// # Safety
233        ///
234        /// This might not be thread-safe.
235        #[unsafe(method(indexCountPerPrimitive))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn indexCountPerPrimitive(&self) -> NSInteger;
238
239        /// The type of the geometry element.
240        ///
241        /// This property is not atomic.
242        ///
243        /// # Safety
244        ///
245        /// This might not be thread-safe.
246        #[unsafe(method(primitiveType))]
247        #[unsafe(method_family = none)]
248        pub unsafe fn primitiveType(&self) -> ARGeometryPrimitiveType;
249
250        /// Unavailable
251        #[unsafe(method(init))]
252        #[unsafe(method_family = init)]
253        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
254
255        #[unsafe(method(new))]
256        #[unsafe(method_family = new)]
257        pub unsafe fn new() -> Retained<Self>;
258    );
259}
260
261/// A value describing the classification of a mesh face.
262///
263/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/armeshclassification?language=objc)
264// NS_ENUM
265#[cfg(feature = "objc2")]
266#[repr(transparent)]
267#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
268pub struct ARMeshClassification(pub NSInteger);
269#[cfg(feature = "objc2")]
270impl ARMeshClassification {
271    #[doc(alias = "ARMeshClassificationNone")]
272    pub const None: Self = Self(0);
273    #[doc(alias = "ARMeshClassificationWall")]
274    pub const Wall: Self = Self(1);
275    #[doc(alias = "ARMeshClassificationFloor")]
276    pub const Floor: Self = Self(2);
277    #[doc(alias = "ARMeshClassificationCeiling")]
278    pub const Ceiling: Self = Self(3);
279    #[doc(alias = "ARMeshClassificationTable")]
280    pub const Table: Self = Self(4);
281    #[doc(alias = "ARMeshClassificationSeat")]
282    pub const Seat: Self = Self(5);
283    #[doc(alias = "ARMeshClassificationWindow")]
284    pub const Window: Self = Self(6);
285    #[doc(alias = "ARMeshClassificationDoor")]
286    pub const Door: Self = Self(7);
287}
288
289#[cfg(feature = "objc2")]
290unsafe impl Encode for ARMeshClassification {
291    const ENCODING: Encoding = NSInteger::ENCODING;
292}
293
294#[cfg(feature = "objc2")]
295unsafe impl RefEncode for ARMeshClassification {
296    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
297}
298
299#[cfg(feature = "objc2")]
300extern_class!(
301    /// A three-dimensional shape that represents the geometry of a mesh.
302    ///
303    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/armeshgeometry?language=objc)
304    #[unsafe(super(NSObject))]
305    #[derive(Debug, PartialEq, Eq, Hash)]
306    #[cfg(feature = "objc2")]
307    pub struct ARMeshGeometry;
308);
309
310#[cfg(feature = "objc2")]
311unsafe impl Send for ARMeshGeometry {}
312
313#[cfg(feature = "objc2")]
314unsafe impl Sync for ARMeshGeometry {}
315
316#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
317extern_conformance!(
318    unsafe impl NSCoding for ARMeshGeometry {}
319);
320
321#[cfg(feature = "objc2")]
322extern_conformance!(
323    unsafe impl NSObjectProtocol for ARMeshGeometry {}
324);
325
326#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
327extern_conformance!(
328    unsafe impl NSSecureCoding for ARMeshGeometry {}
329);
330
331#[cfg(feature = "objc2")]
332impl ARMeshGeometry {
333    extern_methods!(
334        /// The vertices of the mesh.
335        ///
336        /// This property is not atomic.
337        ///
338        /// # Safety
339        ///
340        /// This might not be thread-safe.
341        #[unsafe(method(vertices))]
342        #[unsafe(method_family = none)]
343        pub unsafe fn vertices(&self) -> Retained<ARGeometrySource>;
344
345        /// Normal of each vertex in the mesh.
346        ///
347        /// This property is not atomic.
348        ///
349        /// # Safety
350        ///
351        /// This might not be thread-safe.
352        #[unsafe(method(normals))]
353        #[unsafe(method_family = none)]
354        pub unsafe fn normals(&self) -> Retained<ARGeometrySource>;
355
356        /// A list of all faces in the mesh.
357        ///
358        /// This property is not atomic.
359        ///
360        /// # Safety
361        ///
362        /// This might not be thread-safe.
363        #[unsafe(method(faces))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn faces(&self) -> Retained<ARGeometryElement>;
366
367        /// Classification for each face in the mesh.
368        ///
369        /// This property is not atomic.
370        ///
371        /// # Safety
372        ///
373        /// This might not be thread-safe.
374        #[unsafe(method(classification))]
375        #[unsafe(method_family = none)]
376        pub unsafe fn classification(&self) -> Option<Retained<ARGeometrySource>>;
377
378        /// Unavailable
379        #[unsafe(method(init))]
380        #[unsafe(method_family = init)]
381        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
382
383        #[unsafe(method(new))]
384        #[unsafe(method_family = new)]
385        pub unsafe fn new() -> Retained<Self>;
386    );
387}