objc2_ar_kit/generated/
ARSCNFaceGeometry.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#[cfg(feature = "objc2-metal")]
10use objc2_metal::*;
11#[cfg(feature = "objc2-scene-kit")]
12use objc2_scene_kit::*;
13
14use crate::*;
15
16#[cfg(feature = "objc2")]
17extern_class!(
18    /// A SceneKit geometry representing a face.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscnfacegeometry?language=objc)
21    #[unsafe(super(SCNGeometry, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
24    pub struct ARSCNFaceGeometry;
25);
26
27#[cfg(all(
28    feature = "objc2",
29    feature = "objc2-foundation",
30    feature = "objc2-scene-kit"
31))]
32unsafe impl NSCoding for ARSCNFaceGeometry {}
33
34#[cfg(all(
35    feature = "objc2",
36    feature = "objc2-foundation",
37    feature = "objc2-scene-kit"
38))]
39unsafe impl NSCopying for ARSCNFaceGeometry {}
40
41#[cfg(all(
42    feature = "objc2",
43    feature = "objc2-foundation",
44    feature = "objc2-scene-kit"
45))]
46unsafe impl CopyingHelper for ARSCNFaceGeometry {
47    type Result = Self;
48}
49
50#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
51unsafe impl NSObjectProtocol for ARSCNFaceGeometry {}
52
53#[cfg(all(
54    feature = "objc2",
55    feature = "objc2-foundation",
56    feature = "objc2-scene-kit"
57))]
58unsafe impl NSSecureCoding for ARSCNFaceGeometry {}
59
60#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
61unsafe impl SCNAnimatable for ARSCNFaceGeometry {}
62
63#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
64unsafe impl SCNBoundingVolume for ARSCNFaceGeometry {}
65
66#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
67unsafe impl SCNShadable for ARSCNFaceGeometry {}
68
69#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
70impl ARSCNFaceGeometry {
71    extern_methods!(
72        #[cfg(feature = "objc2-metal")]
73        /// Creates a new face geometry using a Metal device.
74        ///
75        ///
76        /// Parameter `device`: A Metal device.
77        ///
78        /// Returns: A new face geometry.
79        #[unsafe(method(faceGeometryWithDevice:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn faceGeometryWithDevice(
82            device: &ProtocolObject<dyn MTLDevice>,
83        ) -> Option<Retained<Self>>;
84
85        #[cfg(feature = "objc2-metal")]
86        /// Creates a new face geometry using a Metal device.
87        ///
88        ///
89        /// By default the regions between the eye lids as well as the region
90        /// between the lips are not covered by geometry. For using the face geometry as an
91        /// occlusion geometry set
92        /// `fillMesh`to YES. This will fill
93        /// in additional geometry into the gaps between the eye lids as well as into the
94        /// gap between the lips.
95        ///
96        /// Parameter `fillMesh`: Whether to fill in additional geometry into the
97        /// gaps between the eye lids as well as into the gap between the lips.
98        ///
99        ///
100        /// Returns: A new face geometry.
101        #[unsafe(method(faceGeometryWithDevice:fillMesh:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn faceGeometryWithDevice_fillMesh(
104            device: &ProtocolObject<dyn MTLDevice>,
105            fill_mesh: bool,
106        ) -> Option<Retained<Self>>;
107
108        #[cfg(feature = "ARFaceGeometry")]
109        /// Updates the geometry with the vertices of a face geometry.
110        ///
111        ///
112        /// Parameter `faceGeometry`: A face geometry.
113        #[unsafe(method(updateFromFaceGeometry:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn updateFromFaceGeometry(&self, face_geometry: &ARFaceGeometry);
116
117        /// Unavailable
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub unsafe fn new() -> Retained<Self>;
125    );
126}
127
128/// Methods declared on superclass `SCNGeometry`.
129#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
130impl ARSCNFaceGeometry {
131    extern_methods!(
132        /// Creates and returns an empty geometry object.
133        ///
134        /// An empty geometry may be used as the lowest level of detail of a geometry.
135        #[unsafe(method(geometry))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn geometry() -> Retained<Self>;
138
139        #[cfg(feature = "objc2-foundation")]
140        /// Creates and returns a new geometry built from geometry sources and geometry elements.
141        ///
142        /// Parameter `sources`: An array of geometry sources. If several geometry sources have the same semantic, only the first one is taken into account.
143        ///
144        /// Parameter `elements`: An array of geometry elements. The sort order in the array determines the mapping between materials and geometry elements.
145        ///
146        /// A geometry is made of geometry sources (at least `SCNGeometrySourceSemanticVertex`) and at least one geometry element. Multiple sources for texture coordinates are accepted. In that case the `mappingChannel` is implicitly set based on the order of the texture sources, starting at index 0.
147        #[unsafe(method(geometryWithSources:elements:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn geometryWithSources_elements(
150            sources: &NSArray<SCNGeometrySource>,
151            elements: Option<&NSArray<SCNGeometryElement>>,
152        ) -> Retained<Self>;
153
154        #[cfg(feature = "objc2-foundation")]
155        /// Creates and returns a new geometry built from geometry sources and geometry elements, with per-source indexed geometry data.
156        ///
157        /// Parameter `sources`: An array of geometry sources. If several geometry sources have the same semantic, only the first one is taken into account.
158        ///
159        /// Parameter `elements`: An array of geometry elements. The sort order in the array determines the mapping between materials and geometry elements.
160        ///
161        /// Parameter `sourceChannels`: An array of indices that describes, for each geometry source, which channel of the geometry elements to use.
162        ///
163        /// ```text
164        /// Example: geometry made of 3 primitives (2 quads, 1 pentagon) using different indices to reference position and UV data (2 channels)
165        ///
166        /// Positions         ┆   POS0           POS3           POS4    ┆             quad   quad   pentagon    quad   quad   pentagon    ┆   SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
167        /// 0 │ (0.0, 0.0, 0.0)   ┆        ┌───────────┬───────────┐        ┆           ┌─────┐ ┌─────┐ ┌───────┐ ┌─────┐ ┌─────┐ ┌───────┐   ┆                                                               primitiveType:SCNGeometryPrimitiveTypePolygon
168        /// 1 │ (0.0, 1.0, 0.0)   ┆        │UV0     UV3│UV0     UV3│        ┆     4 4 5 0 1 2 3 5 4 3 2 7 6 5 2 1 0 1 2 3 2 3 0 1 1 2 3 4 0   ┆                                                              primitiveCount:3
169        /// 2 │ (1.0, 0.0, 0.0)   ┆        │           │           │        ┆     └───┘ └───────────────────────┘ └───────────────────────┘   ┆                                                         indicesChannelCount:2
170        /// 3 │ (1.0, 1.0, 0.0)   ┆        │     A     │     B     │        ┆   polygons        channel 0                 channel 1           ┆                                                  interleavedIndicesChannels:…
171        /// 4 │ (2.0, 0.0, 0.0)   ┆        │           │           │        ┆                  (positions)                  (UVs)             ┆                                                               bytesPerIndex:…];
172        /// 5 │ (2.0, 1.0, 0.0)   ┆        │UV1     UV2│UV1     UV2│        ┆                                                                 ┆
173        /// 6 │ (2.0, 2.0, 0.0)   ┆   POS1 ├───────────┴───────────┤ POS5   ┆                                                                 ┆   SCNGeometry *geometry = [SCNGeometry geometryWithSources:
174        /// @
175        /// [positionSource, texcoordsSource]
176        /// 7 │ (0.0, 2.0, 0.0)   ┆        │UVO       UV4       UV3│        ┆                                                                 ┆                                                   elements:
177        /// @
178        /// [element]
179        /// ┆        │         POS2          │        ┆                quad A          quad B          pentagon C       ┆                                             sourceChannels:
180        /// @
181        /// [0, 1]];
182        /// UVs               ┆        │                       │        ┆           ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐   ┆
183        /// 0 │ (0.0, 0.0)        ┆        │           C           │        ┆     4 4 5 0 0 1 1 2 2 3 3 5 2 4 3 3 0 2 1 7 1 6 2 5 3 2 4 1 0   ┆
184        /// 1 │ (0.0, 1.0)        ┆        │                       │        ┆     └───┘└──────────────────────────────────────────────────┘   ┆
185        /// 2 │ (1.0, 1.0)        ┆        │UV1                 UV2│        ┆   polygons               interleaved  channels                  ┆
186        /// 3 │ (1.0, 0.0)        ┆        └───────────────────────┘        ┆                           (positions and UVs)                   ┆
187        /// 4 │ (0.5, 0.0)        ┆   POS7                          POS6    ┆                                                                 ┆
188        ///
189        /// Example: geometry made of 3 primitives (2 quads, 1 pentagon) using the same indices to reference position and UV data (1 channel)
190        ///
191        /// Positions         ┆   POS0           POS3           POS4    ┆             quad A      quad B      pentagon C                  ┆   SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
192        /// 0 │ (0.0, 4.0, 0.0)   ┆        ┌───────────┬───────────┐        ┆           ┌────────┐  ┌────────┐  ┌───────────┐                 ┆                                                               primitiveType:SCNGeometryPrimitiveTypePolygon
193        /// 1 │ (0.0, 2.0, 0.0)   ┆        │UV0     UV3│UV3     UV4│        ┆     4 4 5 0  1  2  3  5  4  3  2  7  6  5  2  1                 ┆                                                              primitiveCount:3
194        /// 2 │ (2.0, 2.0, 0.0)   ┆        │           │           │        ┆     └───┘ └───────────────────────────────────┘                 ┆                                                               bytesPerIndex:…];
195        /// 3 │ (2.0, 4.0, 0.0)   ┆        │     A     │     B     │        ┆   polygons              channel 0                               ┆
196        /// 4 │ (4.0, 4.0, 0.0)   ┆        │           │           │        ┆                    (positions and UVs)                          ┆   SCNGeometry *geometry = [SCNGeometry geometryWithSources:
197        /// @
198        /// [positionSource, texcoordsSource]
199        /// 5 │ (4.0, 2.0, 0.0)   ┆        │UV1     UV2│UV2     UV5│        ┆                                                                 ┆                                                   elements:
200        /// @
201        /// [element]];
202        /// 6 │ (4.0, 0.0, 0.0)   ┆   POS1 ├───────────┴───────────┤ POS5   ┆                                                                 ┆
203        /// 7 │ (0.0, 0.0, 0.0)   ┆        │UV1       UV2       UV5│        ┆                                                                 ┆                                            === or equivalently ===
204        /// ┆        │         POS2          │        ┆                                                                 ┆
205        /// UVs               ┆        │                       │        ┆                                                                 ┆   SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
206        /// 0 │ (0.0, 0.0)        ┆        │           C           │        ┆                                                                 ┆                                                               primitiveType:SCNGeometryPrimitiveTypePolygon
207        /// 1 │ (0.0, 0.5)        ┆        │                       │        ┆                                                                 ┆                                                              primitiveCount:3
208        /// 2 │ (0.5, 0.5)        ┆        │UV7                 UV6│        ┆                                                                 ┆                                                         indicesChannelCount:1
209        /// 3 │ (0.5, 0.0)        ┆        └───────────────────────┘        ┆                                                                 ┆                                                  interleavedIndicesChannels:…
210        /// 4 │ (1.0, 0.0)        ┆   POS7                          POS6    ┆                                                                 ┆                                                               bytesPerIndex:…];
211        /// 5 │ (1.0, 0.5)        ┆                                         ┆                                                                 ┆
212        /// 6 │ (1.0, 1.0)        ┆                                         ┆                                                                 ┆   SCNGeometry *geometry = [SCNGeometry geometryWithSources:
213        /// @
214        /// [positionSource, texcoordsSource]
215        /// 7 │ (0.0, 1.0)        ┆                                         ┆                                                                 ┆                                                   elements:
216        /// @
217        /// [element]
218        /// ┆                                         ┆                                                                 ┆                                             sourceChannels:
219        /// @
220        /// [0, 0]];                                                                                                                                               ┆
221        /// ```
222        #[unsafe(method(geometryWithSources:elements:sourceChannels:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn geometryWithSources_elements_sourceChannels(
225            sources: &NSArray<SCNGeometrySource>,
226            elements: Option<&NSArray<SCNGeometryElement>>,
227            source_channels: Option<&NSArray<NSNumber>>,
228        ) -> Retained<Self>;
229    );
230}