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        #[unsafe(method(buffer))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn buffer(&self) -> Retained<ProtocolObject<dyn MTLBuffer>>;
53
54        /// The number of vectors in the source.
55        #[unsafe(method(count))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn count(&self) -> NSInteger;
58
59        #[cfg(feature = "objc2-metal")]
60        /// The type of per-vector data in the buffer.
61        #[unsafe(method(format))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn format(&self) -> MTLVertexFormat;
64
65        /// The number of scalar components in each vector.
66        #[unsafe(method(componentsPerVector))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn componentsPerVector(&self) -> NSInteger;
69
70        /// The offset (in bytes) from the beginning of the buffer.
71        #[unsafe(method(offset))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn offset(&self) -> NSInteger;
74
75        /// The number of bytes from a vector to the next one in the buffer.
76        #[unsafe(method(stride))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn stride(&self) -> NSInteger;
79
80        /// Unavailable
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}
90
91/// The primitive that defines how vertices are connected.
92///
93/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeometryprimitivetype?language=objc)
94// NS_ENUM
95#[cfg(feature = "objc2")]
96#[repr(transparent)]
97#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
98pub struct ARGeometryPrimitiveType(pub NSInteger);
99#[cfg(feature = "objc2")]
100impl ARGeometryPrimitiveType {
101    /// The geometry element is a sequence of line segments, where each line segment is described by two new vertices.
102    #[doc(alias = "ARGeometryPrimitiveTypeLine")]
103    pub const Line: Self = Self(0);
104    /// The geometry element is a sequence of triangles, where each triangle is described by three new vertices.
105    #[doc(alias = "ARGeometryPrimitiveTypeTriangle")]
106    pub const Triangle: Self = Self(1);
107}
108
109#[cfg(feature = "objc2")]
110unsafe impl Encode for ARGeometryPrimitiveType {
111    const ENCODING: Encoding = NSInteger::ENCODING;
112}
113
114#[cfg(feature = "objc2")]
115unsafe impl RefEncode for ARGeometryPrimitiveType {
116    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
117}
118
119#[cfg(feature = "objc2")]
120extern_class!(
121    /// A container for index data describing how vertices connect to define a geometry.
122    ///
123    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeometryelement?language=objc)
124    #[unsafe(super(NSObject))]
125    #[derive(Debug, PartialEq, Eq, Hash)]
126    #[cfg(feature = "objc2")]
127    pub struct ARGeometryElement;
128);
129
130#[cfg(feature = "objc2")]
131unsafe impl Send for ARGeometryElement {}
132
133#[cfg(feature = "objc2")]
134unsafe impl Sync for ARGeometryElement {}
135
136#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
137extern_conformance!(
138    unsafe impl NSCoding for ARGeometryElement {}
139);
140
141#[cfg(feature = "objc2")]
142extern_conformance!(
143    unsafe impl NSObjectProtocol for ARGeometryElement {}
144);
145
146#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
147extern_conformance!(
148    unsafe impl NSSecureCoding for ARGeometryElement {}
149);
150
151#[cfg(feature = "objc2")]
152impl ARGeometryElement {
153    extern_methods!(
154        #[cfg(feature = "objc2-metal")]
155        /// A Metal buffer containing index data that defines the geometry.
156        #[unsafe(method(buffer))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn buffer(&self) -> Retained<ProtocolObject<dyn MTLBuffer>>;
159
160        /// The number of primitives in the buffer.
161        #[unsafe(method(count))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn count(&self) -> NSInteger;
164
165        /// The number of bytes that represent an index value.
166        #[unsafe(method(bytesPerIndex))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn bytesPerIndex(&self) -> NSInteger;
169
170        /// The number of indices for each primitive.
171        ///
172        /// See: ARGeometryPrimitiveType
173        ///
174        /// This is based on the primitiveType. For ARGeometryPrimitiveTypeTriangle the value is 3.
175        #[unsafe(method(indexCountPerPrimitive))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn indexCountPerPrimitive(&self) -> NSInteger;
178
179        /// The type of the geometry element.
180        #[unsafe(method(primitiveType))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn primitiveType(&self) -> ARGeometryPrimitiveType;
183
184        /// Unavailable
185        #[unsafe(method(init))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188
189        #[unsafe(method(new))]
190        #[unsafe(method_family = new)]
191        pub unsafe fn new() -> Retained<Self>;
192    );
193}
194
195/// A value describing the classification of a mesh face.
196///
197/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/armeshclassification?language=objc)
198// NS_ENUM
199#[cfg(feature = "objc2")]
200#[repr(transparent)]
201#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
202pub struct ARMeshClassification(pub NSInteger);
203#[cfg(feature = "objc2")]
204impl ARMeshClassification {
205    #[doc(alias = "ARMeshClassificationNone")]
206    pub const None: Self = Self(0);
207    #[doc(alias = "ARMeshClassificationWall")]
208    pub const Wall: Self = Self(1);
209    #[doc(alias = "ARMeshClassificationFloor")]
210    pub const Floor: Self = Self(2);
211    #[doc(alias = "ARMeshClassificationCeiling")]
212    pub const Ceiling: Self = Self(3);
213    #[doc(alias = "ARMeshClassificationTable")]
214    pub const Table: Self = Self(4);
215    #[doc(alias = "ARMeshClassificationSeat")]
216    pub const Seat: Self = Self(5);
217    #[doc(alias = "ARMeshClassificationWindow")]
218    pub const Window: Self = Self(6);
219    #[doc(alias = "ARMeshClassificationDoor")]
220    pub const Door: Self = Self(7);
221}
222
223#[cfg(feature = "objc2")]
224unsafe impl Encode for ARMeshClassification {
225    const ENCODING: Encoding = NSInteger::ENCODING;
226}
227
228#[cfg(feature = "objc2")]
229unsafe impl RefEncode for ARMeshClassification {
230    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
231}
232
233#[cfg(feature = "objc2")]
234extern_class!(
235    /// A three-dimensional shape that represents the geometry of a mesh.
236    ///
237    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/armeshgeometry?language=objc)
238    #[unsafe(super(NSObject))]
239    #[derive(Debug, PartialEq, Eq, Hash)]
240    #[cfg(feature = "objc2")]
241    pub struct ARMeshGeometry;
242);
243
244#[cfg(feature = "objc2")]
245unsafe impl Send for ARMeshGeometry {}
246
247#[cfg(feature = "objc2")]
248unsafe impl Sync for ARMeshGeometry {}
249
250#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
251extern_conformance!(
252    unsafe impl NSCoding for ARMeshGeometry {}
253);
254
255#[cfg(feature = "objc2")]
256extern_conformance!(
257    unsafe impl NSObjectProtocol for ARMeshGeometry {}
258);
259
260#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
261extern_conformance!(
262    unsafe impl NSSecureCoding for ARMeshGeometry {}
263);
264
265#[cfg(feature = "objc2")]
266impl ARMeshGeometry {
267    extern_methods!(
268        /// The vertices of the mesh.
269        #[unsafe(method(vertices))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn vertices(&self) -> Retained<ARGeometrySource>;
272
273        /// Normal of each vertex in the mesh.
274        #[unsafe(method(normals))]
275        #[unsafe(method_family = none)]
276        pub unsafe fn normals(&self) -> Retained<ARGeometrySource>;
277
278        /// A list of all faces in the mesh.
279        #[unsafe(method(faces))]
280        #[unsafe(method_family = none)]
281        pub unsafe fn faces(&self) -> Retained<ARGeometryElement>;
282
283        /// Classification for each face in the mesh.
284        #[unsafe(method(classification))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn classification(&self) -> Option<Retained<ARGeometrySource>>;
287
288        /// Unavailable
289        #[unsafe(method(init))]
290        #[unsafe(method_family = init)]
291        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
292
293        #[unsafe(method(new))]
294        #[unsafe(method_family = new)]
295        pub unsafe fn new() -> Retained<Self>;
296    );
297}