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