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