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