objc2_scene_kit/generated/
SCNGeometry.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-metal")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_metal::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometryprimitivetype?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct SCNGeometryPrimitiveType(pub NSInteger);
20impl SCNGeometryPrimitiveType {
21    #[doc(alias = "SCNGeometryPrimitiveTypeTriangles")]
22    pub const Triangles: Self = Self(0);
23    #[doc(alias = "SCNGeometryPrimitiveTypeTriangleStrip")]
24    pub const TriangleStrip: Self = Self(1);
25    #[doc(alias = "SCNGeometryPrimitiveTypeLine")]
26    pub const Line: Self = Self(2);
27    #[doc(alias = "SCNGeometryPrimitiveTypePoint")]
28    pub const Point: Self = Self(3);
29    #[doc(alias = "SCNGeometryPrimitiveTypePolygon")]
30    pub const Polygon: Self = Self(4);
31}
32
33unsafe impl Encode for SCNGeometryPrimitiveType {
34    const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37unsafe impl RefEncode for SCNGeometryPrimitiveType {
38    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41/// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemantic?language=objc)
42// NS_TYPED_EXTENSIBLE_ENUM
43pub type SCNGeometrySourceSemantic = NSString;
44
45extern "C" {
46    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemanticvertex?language=objc)
47    pub static SCNGeometrySourceSemanticVertex: &'static SCNGeometrySourceSemantic;
48}
49
50extern "C" {
51    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemanticnormal?language=objc)
52    pub static SCNGeometrySourceSemanticNormal: &'static SCNGeometrySourceSemantic;
53}
54
55extern "C" {
56    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemanticcolor?language=objc)
57    pub static SCNGeometrySourceSemanticColor: &'static SCNGeometrySourceSemantic;
58}
59
60extern "C" {
61    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemantictexcoord?language=objc)
62    pub static SCNGeometrySourceSemanticTexcoord: &'static SCNGeometrySourceSemantic;
63}
64
65extern "C" {
66    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemantictangent?language=objc)
67    pub static SCNGeometrySourceSemanticTangent: &'static SCNGeometrySourceSemantic;
68}
69
70extern "C" {
71    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemanticvertexcrease?language=objc)
72    pub static SCNGeometrySourceSemanticVertexCrease: &'static SCNGeometrySourceSemantic;
73}
74
75extern "C" {
76    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemanticedgecrease?language=objc)
77    pub static SCNGeometrySourceSemanticEdgeCrease: &'static SCNGeometrySourceSemantic;
78}
79
80extern "C" {
81    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemanticboneweights?language=objc)
82    pub static SCNGeometrySourceSemanticBoneWeights: &'static SCNGeometrySourceSemantic;
83}
84
85extern "C" {
86    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysourcesemanticboneindices?language=objc)
87    pub static SCNGeometrySourceSemanticBoneIndices: &'static SCNGeometrySourceSemantic;
88}
89
90extern_class!(
91    /// SCNGeometry is an abstract class that represents the geometry that can be attached to a SCNNode.
92    ///
93    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometry?language=objc)
94    #[unsafe(super(NSObject))]
95    #[derive(Debug, PartialEq, Eq, Hash)]
96    pub struct SCNGeometry;
97);
98
99extern_conformance!(
100    unsafe impl NSCoding for SCNGeometry {}
101);
102
103extern_conformance!(
104    unsafe impl NSCopying for SCNGeometry {}
105);
106
107unsafe impl CopyingHelper for SCNGeometry {
108    type Result = Self;
109}
110
111extern_conformance!(
112    unsafe impl NSObjectProtocol for SCNGeometry {}
113);
114
115extern_conformance!(
116    unsafe impl NSSecureCoding for SCNGeometry {}
117);
118
119#[cfg(feature = "SCNAnimation")]
120extern_conformance!(
121    unsafe impl SCNAnimatable for SCNGeometry {}
122);
123
124#[cfg(feature = "SCNBoundingVolume")]
125extern_conformance!(
126    unsafe impl SCNBoundingVolume for SCNGeometry {}
127);
128
129#[cfg(feature = "SCNShadable")]
130extern_conformance!(
131    unsafe impl SCNShadable for SCNGeometry {}
132);
133
134impl SCNGeometry {
135    extern_methods!(
136        /// Creates and returns an empty geometry object.
137        ///
138        /// An empty geometry may be used as the lowest level of detail of a geometry.
139        #[unsafe(method(geometry))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn geometry() -> Retained<Self>;
142
143        /// Determines the name of the receiver.
144        #[unsafe(method(name))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
147
148        /// Setter for [`name`][Self::name].
149        ///
150        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
151        #[unsafe(method(setName:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setName(&self, name: Option<&NSString>);
154
155        #[cfg(feature = "SCNMaterial")]
156        /// Specifies the receiver's materials array.
157        ///
158        /// Each geometry element can be rendered using a different material. The index of the material used for a geometry element is equal to the index of that element modulo the number of materials.
159        #[unsafe(method(materials))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn materials(&self) -> Retained<NSArray<SCNMaterial>>;
162
163        #[cfg(feature = "SCNMaterial")]
164        /// Setter for [`materials`][Self::materials].
165        ///
166        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
167        #[unsafe(method(setMaterials:))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn setMaterials(&self, materials: &NSArray<SCNMaterial>);
170
171        #[cfg(feature = "SCNMaterial")]
172        /// Determines the first material of the geometry. Returns nil if the geometry has no material.
173        ///
174        /// This method is here for convenience. It is equivalent to the first object in the "materials" array above.
175        #[unsafe(method(firstMaterial))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn firstMaterial(&self) -> Option<Retained<SCNMaterial>>;
178
179        #[cfg(feature = "SCNMaterial")]
180        /// Setter for [`firstMaterial`][Self::firstMaterial].
181        #[unsafe(method(setFirstMaterial:))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn setFirstMaterial(&self, first_material: Option<&SCNMaterial>);
184
185        #[cfg(feature = "SCNMaterial")]
186        /// Insert a material in the materials array at the specified index.
187        ///
188        /// Parameter `material`: The material to insert.
189        ///
190        /// Parameter `index`: Index in the materials array to insert the new material.
191        #[unsafe(method(insertMaterial:atIndex:))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn insertMaterial_atIndex(&self, material: &SCNMaterial, index: NSUInteger);
194
195        /// Remove the material at the specified index from the materials array.
196        ///
197        /// Parameter `index`: The index of the material to remove from the 'materials' array.
198        #[unsafe(method(removeMaterialAtIndex:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn removeMaterialAtIndex(&self, index: NSUInteger);
201
202        #[cfg(feature = "SCNMaterial")]
203        /// Remove the material at the index 'index' from the materials array of the receiver and insert 'material' in its position.
204        ///
205        /// Parameter `index`: The index of the material to replace in the materials array.
206        ///
207        /// Parameter `material`: The new material that will replace the previous one.
208        #[unsafe(method(replaceMaterialAtIndex:withMaterial:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn replaceMaterialAtIndex_withMaterial(
211            &self,
212            index: NSUInteger,
213            material: &SCNMaterial,
214        );
215
216        #[cfg(feature = "SCNMaterial")]
217        /// Return the first material from the materials array of the receiver with the specified name.
218        ///
219        /// Parameter `name`: The name of the material to retrieve.
220        #[unsafe(method(materialWithName:))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn materialWithName(&self, name: &NSString) -> Option<Retained<SCNMaterial>>;
223
224        /// Creates and returns a new geometry built from geometry sources and geometry elements.
225        ///
226        /// Parameter `sources`: An array of geometry sources. If several geometry sources have the same semantic, only the first one is taken into account.
227        ///
228        /// Parameter `elements`: An array of geometry elements. The sort order in the array determines the mapping between materials and geometry elements.
229        ///
230        /// 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.
231        #[unsafe(method(geometryWithSources:elements:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn geometryWithSources_elements(
234            sources: &NSArray<SCNGeometrySource>,
235            elements: Option<&NSArray<SCNGeometryElement>>,
236        ) -> Retained<Self>;
237
238        /// Creates and returns a new geometry built from geometry sources and geometry elements, with per-source indexed geometry data.
239        ///
240        /// Parameter `sources`: An array of geometry sources. If several geometry sources have the same semantic, only the first one is taken into account.
241        ///
242        /// Parameter `elements`: An array of geometry elements. The sort order in the array determines the mapping between materials and geometry elements.
243        ///
244        /// Parameter `sourceChannels`: An array of indices that describes, for each geometry source, which channel of the geometry elements to use.
245        ///
246        /// ```text
247        /// Example: geometry made of 3 primitives (2 quads, 1 pentagon) using different indices to reference position and UV data (2 channels)
248        ///
249        /// Positions         ┆   POS0           POS3           POS4    ┆             quad   quad   pentagon    quad   quad   pentagon    ┆   SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
250        /// 0 │ (0.0, 0.0, 0.0)   ┆        ┌───────────┬───────────┐        ┆           ┌─────┐ ┌─────┐ ┌───────┐ ┌─────┐ ┌─────┐ ┌───────┐   ┆                                                               primitiveType:SCNGeometryPrimitiveTypePolygon
251        /// 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
252        /// 2 │ (1.0, 0.0, 0.0)   ┆        │           │           │        ┆     └───┘ └───────────────────────┘ └───────────────────────┘   ┆                                                         indicesChannelCount:2
253        /// 3 │ (1.0, 1.0, 0.0)   ┆        │     A     │     B     │        ┆   polygons        channel 0                 channel 1           ┆                                                  interleavedIndicesChannels:…
254        /// 4 │ (2.0, 0.0, 0.0)   ┆        │           │           │        ┆                  (positions)                  (UVs)             ┆                                                               bytesPerIndex:…];
255        /// 5 │ (2.0, 1.0, 0.0)   ┆        │UV1     UV2│UV1     UV2│        ┆                                                                 ┆
256        /// 6 │ (2.0, 2.0, 0.0)   ┆   POS1 ├───────────┴───────────┤ POS5   ┆                                                                 ┆   SCNGeometry *geometry = [SCNGeometry geometryWithSources:
257        /// @
258        /// [positionSource, texcoordsSource]
259        /// 7 │ (0.0, 2.0, 0.0)   ┆        │UVO       UV4       UV3│        ┆                                                                 ┆                                                   elements:
260        /// @
261        /// [element]
262        /// ┆        │         POS2          │        ┆                quad A          quad B          pentagon C       ┆                                             sourceChannels:
263        /// @
264        /// [0, 1]];
265        /// UVs               ┆        │                       │        ┆           ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐   ┆
266        /// 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   ┆
267        /// 1 │ (0.0, 1.0)        ┆        │                       │        ┆     └───┘└──────────────────────────────────────────────────┘   ┆
268        /// 2 │ (1.0, 1.0)        ┆        │UV1                 UV2│        ┆   polygons               interleaved  channels                  ┆
269        /// 3 │ (1.0, 0.0)        ┆        └───────────────────────┘        ┆                           (positions and UVs)                   ┆
270        /// 4 │ (0.5, 0.0)        ┆   POS7                          POS6    ┆                                                                 ┆
271        ///
272        /// Example: geometry made of 3 primitives (2 quads, 1 pentagon) using the same indices to reference position and UV data (1 channel)
273        ///
274        /// Positions         ┆   POS0           POS3           POS4    ┆             quad A      quad B      pentagon C                  ┆   SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
275        /// 0 │ (0.0, 4.0, 0.0)   ┆        ┌───────────┬───────────┐        ┆           ┌────────┐  ┌────────┐  ┌───────────┐                 ┆                                                               primitiveType:SCNGeometryPrimitiveTypePolygon
276        /// 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
277        /// 2 │ (2.0, 2.0, 0.0)   ┆        │           │           │        ┆     └───┘ └───────────────────────────────────┘                 ┆                                                               bytesPerIndex:…];
278        /// 3 │ (2.0, 4.0, 0.0)   ┆        │     A     │     B     │        ┆   polygons              channel 0                               ┆
279        /// 4 │ (4.0, 4.0, 0.0)   ┆        │           │           │        ┆                    (positions and UVs)                          ┆   SCNGeometry *geometry = [SCNGeometry geometryWithSources:
280        /// @
281        /// [positionSource, texcoordsSource]
282        /// 5 │ (4.0, 2.0, 0.0)   ┆        │UV1     UV2│UV2     UV5│        ┆                                                                 ┆                                                   elements:
283        /// @
284        /// [element]];
285        /// 6 │ (4.0, 0.0, 0.0)   ┆   POS1 ├───────────┴───────────┤ POS5   ┆                                                                 ┆
286        /// 7 │ (0.0, 0.0, 0.0)   ┆        │UV1       UV2       UV5│        ┆                                                                 ┆                                            === or equivalently ===
287        /// ┆        │         POS2          │        ┆                                                                 ┆
288        /// UVs               ┆        │                       │        ┆                                                                 ┆   SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
289        /// 0 │ (0.0, 0.0)        ┆        │           C           │        ┆                                                                 ┆                                                               primitiveType:SCNGeometryPrimitiveTypePolygon
290        /// 1 │ (0.0, 0.5)        ┆        │                       │        ┆                                                                 ┆                                                              primitiveCount:3
291        /// 2 │ (0.5, 0.5)        ┆        │UV7                 UV6│        ┆                                                                 ┆                                                         indicesChannelCount:1
292        /// 3 │ (0.5, 0.0)        ┆        └───────────────────────┘        ┆                                                                 ┆                                                  interleavedIndicesChannels:…
293        /// 4 │ (1.0, 0.0)        ┆   POS7                          POS6    ┆                                                                 ┆                                                               bytesPerIndex:…];
294        /// 5 │ (1.0, 0.5)        ┆                                         ┆                                                                 ┆
295        /// 6 │ (1.0, 1.0)        ┆                                         ┆                                                                 ┆   SCNGeometry *geometry = [SCNGeometry geometryWithSources:
296        /// @
297        /// [positionSource, texcoordsSource]
298        /// 7 │ (0.0, 1.0)        ┆                                         ┆                                                                 ┆                                                   elements:
299        /// @
300        /// [element]
301        /// ┆                                         ┆                                                                 ┆                                             sourceChannels:
302        /// @
303        /// [0, 0]];                                                                                                                                               ┆
304        /// ```
305        #[unsafe(method(geometryWithSources:elements:sourceChannels:))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn geometryWithSources_elements_sourceChannels(
308            sources: &NSArray<SCNGeometrySource>,
309            elements: Option<&NSArray<SCNGeometryElement>>,
310            source_channels: Option<&NSArray<NSNumber>>,
311        ) -> Retained<Self>;
312
313        /// The array of geometry sources of the receiver.
314        #[unsafe(method(geometrySources))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn geometrySources(&self) -> Retained<NSArray<SCNGeometrySource>>;
317
318        /// Returns the geometry sources for a given semantic.
319        ///
320        /// Parameter `semantic`: The semantic of the geometry sources that should be retrieved.
321        ///
322        /// Returns nil if no geometry source is found for the given semantic. May return more than one source, typically for multiple texture coordinate sources.
323        #[unsafe(method(geometrySourcesForSemantic:))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn geometrySourcesForSemantic(
326            &self,
327            semantic: &SCNGeometrySourceSemantic,
328        ) -> Retained<NSArray<SCNGeometrySource>>;
329
330        /// The array of geometry elements of the receiver.
331        #[unsafe(method(geometryElements))]
332        #[unsafe(method_family = none)]
333        pub unsafe fn geometryElements(&self) -> Retained<NSArray<SCNGeometryElement>>;
334
335        /// Returns the number of geometry elements owned by the geometry.
336        #[unsafe(method(geometryElementCount))]
337        #[unsafe(method_family = none)]
338        pub unsafe fn geometryElementCount(&self) -> NSInteger;
339
340        /// Returns the geometry element at a given index.
341        ///
342        /// Parameter `elementIndex`: The index of the geometry element.
343        #[unsafe(method(geometryElementAtIndex:))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn geometryElementAtIndex(
346            &self,
347            element_index: NSInteger,
348        ) -> Retained<SCNGeometryElement>;
349
350        /// An array of indices that describes, for each geometry source, which channel of the geometry elements to use.
351        #[unsafe(method(geometrySourceChannels))]
352        #[unsafe(method_family = none)]
353        pub unsafe fn geometrySourceChannels(&self) -> Option<Retained<NSArray<NSNumber>>>;
354
355        #[cfg(feature = "SCNLevelOfDetail")]
356        /// Determines the receiver's levels of detail. Defaults to nil.
357        #[unsafe(method(levelsOfDetail))]
358        #[unsafe(method_family = none)]
359        pub unsafe fn levelsOfDetail(&self) -> Option<Retained<NSArray<SCNLevelOfDetail>>>;
360
361        #[cfg(feature = "SCNLevelOfDetail")]
362        /// Setter for [`levelsOfDetail`][Self::levelsOfDetail].
363        ///
364        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
365        #[unsafe(method(setLevelsOfDetail:))]
366        #[unsafe(method_family = none)]
367        pub unsafe fn setLevelsOfDetail(
368            &self,
369            levels_of_detail: Option<&NSArray<SCNLevelOfDetail>>,
370        );
371
372        #[unsafe(method(tessellator))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn tessellator(&self) -> Option<Retained<SCNGeometryTessellator>>;
375
376        /// Setter for [`tessellator`][Self::tessellator].
377        #[unsafe(method(setTessellator:))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn setTessellator(&self, tessellator: Option<&SCNGeometryTessellator>);
380
381        /// Specifies the subdivision level of the receiver. Defaults to 0.
382        ///
383        /// A subdivision level of 0 means no subdivision. When the `tessellator` property of the receiver is not nil, the refinement is done on the GPU.
384        #[unsafe(method(subdivisionLevel))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn subdivisionLevel(&self) -> NSUInteger;
387
388        /// Setter for [`subdivisionLevel`][Self::subdivisionLevel].
389        #[unsafe(method(setSubdivisionLevel:))]
390        #[unsafe(method_family = none)]
391        pub unsafe fn setSubdivisionLevel(&self, subdivision_level: NSUInteger);
392
393        /// Specifies if the subdivision is adaptive or uniform. Defaults to YES.
394        ///
395        /// Adaptive subdivision requires that the `tessellator` property of the receiver is not nil.
396        #[unsafe(method(wantsAdaptiveSubdivision))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn wantsAdaptiveSubdivision(&self) -> bool;
399
400        /// Setter for [`wantsAdaptiveSubdivision`][Self::wantsAdaptiveSubdivision].
401        #[unsafe(method(setWantsAdaptiveSubdivision:))]
402        #[unsafe(method_family = none)]
403        pub unsafe fn setWantsAdaptiveSubdivision(&self, wants_adaptive_subdivision: bool);
404
405        /// Specifies the edges creases that control the subdivision. Defaults to nil.
406        ///
407        /// The primitive type of this geometry element must be SCNGeometryPrimitiveTypeLine. See subdivisionLevel above to control the level of subdivision. See edgeCreasesSource below to specify sharpness of the creases.
408        #[unsafe(method(edgeCreasesElement))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn edgeCreasesElement(&self) -> Option<Retained<SCNGeometryElement>>;
411
412        /// Setter for [`edgeCreasesElement`][Self::edgeCreasesElement].
413        #[unsafe(method(setEdgeCreasesElement:))]
414        #[unsafe(method_family = none)]
415        pub unsafe fn setEdgeCreasesElement(
416            &self,
417            edge_creases_element: Option<&SCNGeometryElement>,
418        );
419
420        /// Specifies the crease value of the edges specified by edgeCreasesElement. Defaults to nil.
421        ///
422        /// The semantic of this geometry source must be "SCNGeometrySourceSemanticEdgeCrease". The creases values are floating values between 0 and 10, where 0 means smooth and 10 means infinitely sharp. See subdivisionLevel above to control the level of subdivision. See edgeCreasesElement above to specify edges for edge creases.
423        #[unsafe(method(edgeCreasesSource))]
424        #[unsafe(method_family = none)]
425        pub unsafe fn edgeCreasesSource(&self) -> Option<Retained<SCNGeometrySource>>;
426
427        /// Setter for [`edgeCreasesSource`][Self::edgeCreasesSource].
428        #[unsafe(method(setEdgeCreasesSource:))]
429        #[unsafe(method_family = none)]
430        pub unsafe fn setEdgeCreasesSource(&self, edge_creases_source: Option<&SCNGeometrySource>);
431    );
432}
433
434/// Methods declared on superclass `NSObject`.
435impl SCNGeometry {
436    extern_methods!(
437        #[unsafe(method(init))]
438        #[unsafe(method_family = init)]
439        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
440
441        #[unsafe(method(new))]
442        #[unsafe(method_family = new)]
443        pub unsafe fn new() -> Retained<Self>;
444    );
445}
446
447extern_class!(
448    /// A geometry source contains geometry data for a specific semantic. The data format is described by properties.
449    ///
450    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrysource?language=objc)
451    #[unsafe(super(NSObject))]
452    #[derive(Debug, PartialEq, Eq, Hash)]
453    pub struct SCNGeometrySource;
454);
455
456extern_conformance!(
457    unsafe impl NSCoding for SCNGeometrySource {}
458);
459
460extern_conformance!(
461    unsafe impl NSObjectProtocol for SCNGeometrySource {}
462);
463
464extern_conformance!(
465    unsafe impl NSSecureCoding for SCNGeometrySource {}
466);
467
468impl SCNGeometrySource {
469    extern_methods!(
470        /// Creates and returns a geometry source from the given data and parameters.
471        ///
472        /// Parameter `data`: The geometry data.
473        ///
474        /// Parameter `semantic`: The semantic of the geometry source.
475        ///
476        /// Parameter `vectorCount`: The number of geometry source vectors.
477        ///
478        /// Parameter `floatComponents`: A flag that indicates if vector components are floating point values.
479        ///
480        /// Parameter `componentsPerVector`: The number of scalar components in a vector.
481        ///
482        /// Parameter `bytesPerComponent`: The number of bytes that represent a vector component.
483        ///
484        /// Parameter `offset`: The offset from the beginning of the data. In bytes.
485        ///
486        /// Parameter `stride`: The number of bytes from a vector to the next one in the data.
487        #[unsafe(method(geometrySourceWithData:semantic:vectorCount:floatComponents:componentsPerVector:bytesPerComponent:dataOffset:dataStride:))]
488        #[unsafe(method_family = none)]
489        pub unsafe fn geometrySourceWithData_semantic_vectorCount_floatComponents_componentsPerVector_bytesPerComponent_dataOffset_dataStride(
490            data: &NSData,
491            semantic: &SCNGeometrySourceSemantic,
492            vector_count: NSInteger,
493            float_components: bool,
494            components_per_vector: NSInteger,
495            bytes_per_component: NSInteger,
496            offset: NSInteger,
497            stride: NSInteger,
498        ) -> Retained<Self>;
499
500        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
501        /// Creates and returns a geometry source from vertices stored in a buffer of SCNVector3 values.
502        ///
503        /// Parameter `vertices`: The buffer of vertices.
504        ///
505        /// Parameter `count`: The number of vertices.
506        ///
507        /// Input vertices are copied to an optimized data format. The actual format is described by the properties of the resulting instance.
508        ///
509        /// # Safety
510        ///
511        /// `vertices` must be a valid pointer.
512        #[unsafe(method(geometrySourceWithVertices:count:))]
513        #[unsafe(method_family = none)]
514        pub unsafe fn geometrySourceWithVertices_count(
515            vertices: NonNull<SCNVector3>,
516            count: NSInteger,
517        ) -> Retained<Self>;
518
519        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
520        /// Creates and returns a geometry source from normals stored in a buffer of SCNVector3 values.
521        ///
522        /// Parameter `normals`: The buffer of normals.
523        ///
524        /// Parameter `count`: The number of normals.
525        ///
526        /// Input normals are copied to an optimized data format. The actual format is described by the properties of the resulting instance.
527        ///
528        /// # Safety
529        ///
530        /// `normals` must be a valid pointer.
531        #[unsafe(method(geometrySourceWithNormals:count:))]
532        #[unsafe(method_family = none)]
533        pub unsafe fn geometrySourceWithNormals_count(
534            normals: NonNull<SCNVector3>,
535            count: NSInteger,
536        ) -> Retained<Self>;
537
538        #[cfg(feature = "objc2-core-foundation")]
539        /// Creates and returns a geometry source from texture coordinates stored in a buffer of CGPoint values.
540        ///
541        /// Parameter `texcoord`: The buffer of texture coordinates.
542        ///
543        /// Parameter `count`: The number of texture coordinate points.
544        ///
545        /// Input texture coordinates are copied to an optimized data format. The actual format is described by the properties of the resulting instance.
546        ///
547        /// # Safety
548        ///
549        /// `texcoord` must be a valid pointer.
550        #[unsafe(method(geometrySourceWithTextureCoordinates:count:))]
551        #[unsafe(method_family = none)]
552        pub unsafe fn geometrySourceWithTextureCoordinates_count(
553            texcoord: NonNull<CGPoint>,
554            count: NSInteger,
555        ) -> Retained<Self>;
556
557        #[cfg(feature = "objc2-metal")]
558        #[cfg(not(target_os = "watchos"))]
559        /// Creates and returns a geometry source from the given data and parameters.
560        ///
561        /// Parameter `buffer`: A Metal buffer.
562        ///
563        /// Parameter `vertexFormat`: The vertex format.
564        ///
565        /// Parameter `semantic`: The semantic of the geometry source.
566        ///
567        /// Parameter `vertexCount`: The number of vertex.
568        ///
569        /// Parameter `offset`: The offset from the beginning of the data. In bytes.
570        ///
571        /// Parameter `stride`: The number of bytes from a vector to the next one in the data.
572        ///
573        /// Attempting to modify the Metal buffer outside the SCNSceneRenderer delegate callbacks is undefined.
574        /// The typical usage it to modify the MTLBuffer within the willRenderScene callback, using a compute kernel or a vertex function in the user own command buffer. So something like:
575        ///
576        /// - (void)renderer:(id
577        /// <SCNSceneRenderer
578        /// >)aRenderer willRenderScene:(SCNScene *)scene atTime:(NSTimeInterval)time
579        /// {
580        /// // ask for a new command buffer
581        /// id
582        /// <MTLCommandBuffer
583        /// > myCommandBuffer = [aRenderer.commandQueue commandBuffer];
584        ///
585        /// // get a compute command encoder
586        /// id
587        /// <MTLComputeCommandEncoder
588        /// > myComputeCommandEncoder = [myCommandBuffer computeCommandEncoder];
589        ///
590        /// // configure the compute command encoder's pipeline state, buffer inputs etc...
591        /// //...
592        ///
593        /// // dispatch the
594        /// [myComputeCommandEncoder dispatchThreadgroups:numberOfWorkingGroups threadsPerThreadgroup:numberOfThreads];
595        /// [myComputeCommandEncoder endEncoding];
596        ///
597        /// [myCommandBuffer commit];
598        /// }
599        ///
600        /// # Safety
601        ///
602        /// - `buffer` may need to be synchronized.
603        /// - `buffer` may be unretained, you must ensure it is kept alive while in use.
604        /// - `buffer` contents should be of the correct type.
605        #[unsafe(method(geometrySourceWithBuffer:vertexFormat:semantic:vertexCount:dataOffset:dataStride:))]
606        #[unsafe(method_family = none)]
607        pub unsafe fn geometrySourceWithBuffer_vertexFormat_semantic_vertexCount_dataOffset_dataStride(
608            buffer: &ProtocolObject<dyn MTLBuffer>,
609            vertex_format: MTLVertexFormat,
610            semantic: &SCNGeometrySourceSemantic,
611            vertex_count: NSInteger,
612            offset: NSInteger,
613            stride: NSInteger,
614        ) -> Retained<Self>;
615
616        /// The data for the geometry source
617        #[unsafe(method(data))]
618        #[unsafe(method_family = none)]
619        pub unsafe fn data(&self) -> Retained<NSData>;
620
621        /// The semantic of the geometry source
622        #[unsafe(method(semantic))]
623        #[unsafe(method_family = none)]
624        pub unsafe fn semantic(&self) -> Retained<SCNGeometrySourceSemantic>;
625
626        /// The number of vectors in the data.
627        #[unsafe(method(vectorCount))]
628        #[unsafe(method_family = none)]
629        pub unsafe fn vectorCount(&self) -> NSInteger;
630
631        /// A flag that indicates if vector components are floating point values.
632        #[unsafe(method(floatComponents))]
633        #[unsafe(method_family = none)]
634        pub unsafe fn floatComponents(&self) -> bool;
635
636        /// The number of scalar components in each vector.
637        #[unsafe(method(componentsPerVector))]
638        #[unsafe(method_family = none)]
639        pub unsafe fn componentsPerVector(&self) -> NSInteger;
640
641        /// The size of a vector component in bytes.
642        #[unsafe(method(bytesPerComponent))]
643        #[unsafe(method_family = none)]
644        pub unsafe fn bytesPerComponent(&self) -> NSInteger;
645
646        /// The offset from the beginning of the data. In bytes.
647        #[unsafe(method(dataOffset))]
648        #[unsafe(method_family = none)]
649        pub unsafe fn dataOffset(&self) -> NSInteger;
650
651        /// The number of bytes from a vector to the next one in the data.
652        #[unsafe(method(dataStride))]
653        #[unsafe(method_family = none)]
654        pub unsafe fn dataStride(&self) -> NSInteger;
655    );
656}
657
658/// Methods declared on superclass `NSObject`.
659impl SCNGeometrySource {
660    extern_methods!(
661        #[unsafe(method(init))]
662        #[unsafe(method_family = init)]
663        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
664
665        #[unsafe(method(new))]
666        #[unsafe(method_family = new)]
667        pub unsafe fn new() -> Retained<Self>;
668    );
669}
670
671extern_class!(
672    /// A geometry element describes how vertices from a geometry source are connected together.
673    ///
674    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometryelement?language=objc)
675    #[unsafe(super(NSObject))]
676    #[derive(Debug, PartialEq, Eq, Hash)]
677    pub struct SCNGeometryElement;
678);
679
680extern_conformance!(
681    unsafe impl NSCoding for SCNGeometryElement {}
682);
683
684extern_conformance!(
685    unsafe impl NSObjectProtocol for SCNGeometryElement {}
686);
687
688extern_conformance!(
689    unsafe impl NSSecureCoding for SCNGeometryElement {}
690);
691
692impl SCNGeometryElement {
693    extern_methods!(
694        /// Creates and returns a geometry element from the given data and data format info.
695        ///
696        /// Parameter `data`: The data that contains element indices. You can pass nil to use an implicit vertex ordering (0,1,2,…).
697        ///
698        /// Parameter `primitiveType`: The primitive type, as listed in the SCNGeometryPrimitiveType enumeration.
699        ///
700        /// Parameter `primitiveCount`: The number of primitives in the data.
701        ///
702        /// Parameter `bytesPerIndex`: The number of bytes that represent a single index value in the data.
703        #[unsafe(method(geometryElementWithData:primitiveType:primitiveCount:bytesPerIndex:))]
704        #[unsafe(method_family = none)]
705        pub unsafe fn geometryElementWithData_primitiveType_primitiveCount_bytesPerIndex(
706            data: Option<&NSData>,
707            primitive_type: SCNGeometryPrimitiveType,
708            primitive_count: NSInteger,
709            bytes_per_index: NSInteger,
710        ) -> Retained<Self>;
711
712        /// Parameter `data`: The data that contains element indices. You can pass nil to use an implicit vertex ordering (0,1,2,…).
713        ///
714        /// Parameter `primitiveType`: The primitive type, as listed in the SCNGeometryPrimitiveType enumeration.
715        ///
716        /// Parameter `primitiveCount`: The number of primitives in the data.
717        ///
718        /// Parameter `indicesChannelCount`: The number of channels for the vertex indices.
719        ///
720        /// Parameter `interleavedIndicesChannels`: Whether the channels are interleaved.
721        ///
722        /// Parameter `bytesPerIndex`: The number of bytes that represent a single index value in the data.
723        #[unsafe(method(geometryElementWithData:primitiveType:primitiveCount:indicesChannelCount:interleavedIndicesChannels:bytesPerIndex:))]
724        #[unsafe(method_family = none)]
725        pub unsafe fn geometryElementWithData_primitiveType_primitiveCount_indicesChannelCount_interleavedIndicesChannels_bytesPerIndex(
726            data: Option<&NSData>,
727            primitive_type: SCNGeometryPrimitiveType,
728            primitive_count: NSInteger,
729            indices_channel_count: NSInteger,
730            interleaved_indices_channels: bool,
731            bytes_per_index: NSInteger,
732        ) -> Retained<Self>;
733
734        #[cfg(feature = "objc2-metal")]
735        #[cfg(not(target_os = "watchos"))]
736        /// Creates and returns a geometry element from the given Metal buffer and parameters.
737        ///
738        /// Parameter `buffer`: The buffer that contains element indices.
739        ///
740        /// Parameter `primitiveType`: The primitive type, as listed in the SCNGeometryPrimitiveType enumeration.
741        ///
742        /// Parameter `primitiveCount`: The number of primitives in the data.
743        ///
744        /// Parameter `bytesPerIndex`: The number of bytes that represent a single index value in the data.
745        ///
746        /// # Safety
747        ///
748        /// - `buffer` may need to be synchronized.
749        /// - `buffer` may be unretained, you must ensure it is kept alive while in use.
750        /// - `buffer` contents should be of the correct type.
751        #[unsafe(method(geometryElementWithBuffer:primitiveType:primitiveCount:bytesPerIndex:))]
752        #[unsafe(method_family = none)]
753        pub unsafe fn geometryElementWithBuffer_primitiveType_primitiveCount_bytesPerIndex(
754            buffer: &ProtocolObject<dyn MTLBuffer>,
755            primitive_type: SCNGeometryPrimitiveType,
756            primitive_count: NSInteger,
757            bytes_per_index: NSInteger,
758        ) -> Retained<Self>;
759
760        #[cfg(feature = "objc2-metal")]
761        #[cfg(not(target_os = "watchos"))]
762        /// # Safety
763        ///
764        /// - `buffer` may need to be synchronized.
765        /// - `buffer` may be unretained, you must ensure it is kept alive while in use.
766        /// - `buffer` contents should be of the correct type.
767        #[unsafe(method(geometryElementWithBuffer:primitiveType:primitiveCount:indicesChannelCount:interleavedIndicesChannels:bytesPerIndex:))]
768        #[unsafe(method_family = none)]
769        pub unsafe fn geometryElementWithBuffer_primitiveType_primitiveCount_indicesChannelCount_interleavedIndicesChannels_bytesPerIndex(
770            buffer: &ProtocolObject<dyn MTLBuffer>,
771            primitive_type: SCNGeometryPrimitiveType,
772            primitive_count: NSInteger,
773            indices_channel_count: NSInteger,
774            interleaved_indices_channels: bool,
775            bytes_per_index: NSInteger,
776        ) -> Retained<Self>;
777
778        /// The data for the geometry element
779        #[unsafe(method(data))]
780        #[unsafe(method_family = none)]
781        pub unsafe fn data(&self) -> Retained<NSData>;
782
783        /// The type of the geometry element. Possible values are listed in the SCNGeometryPrimitiveType enumeration.
784        #[unsafe(method(primitiveType))]
785        #[unsafe(method_family = none)]
786        pub unsafe fn primitiveType(&self) -> SCNGeometryPrimitiveType;
787
788        /// The number of primitives in the data.
789        #[unsafe(method(primitiveCount))]
790        #[unsafe(method_family = none)]
791        pub unsafe fn primitiveCount(&self) -> NSInteger;
792
793        /// Determines whether the channels are interleaved.
794        #[unsafe(method(hasInterleavedIndicesChannels))]
795        #[unsafe(method_family = none)]
796        pub unsafe fn hasInterleavedIndicesChannels(&self) -> bool;
797
798        /// The number of channels in the geometry element.
799        #[unsafe(method(indicesChannelCount))]
800        #[unsafe(method_family = none)]
801        pub unsafe fn indicesChannelCount(&self) -> NSInteger;
802
803        /// The number of bytes that represent an index value
804        #[unsafe(method(bytesPerIndex))]
805        #[unsafe(method_family = none)]
806        pub unsafe fn bytesPerIndex(&self) -> NSInteger;
807
808        /// Specifies the subrange of primitives to render within NSMakeRange(0, primitiveCount). Defaults to NSMakeRange(NSNotFound, 0).
809        ///
810        /// When the location of the range is set to NSNotFound, the entire geometry element is rendered.
811        #[unsafe(method(primitiveRange))]
812        #[unsafe(method_family = none)]
813        pub unsafe fn primitiveRange(&self) -> NSRange;
814
815        /// Setter for [`primitiveRange`][Self::primitiveRange].
816        #[unsafe(method(setPrimitiveRange:))]
817        #[unsafe(method_family = none)]
818        pub unsafe fn setPrimitiveRange(&self, primitive_range: NSRange);
819
820        #[cfg(feature = "objc2-core-foundation")]
821        /// Specifies the size of the point in local space. Defaults to 1
822        #[unsafe(method(pointSize))]
823        #[unsafe(method_family = none)]
824        pub unsafe fn pointSize(&self) -> CGFloat;
825
826        #[cfg(feature = "objc2-core-foundation")]
827        /// Setter for [`pointSize`][Self::pointSize].
828        #[unsafe(method(setPointSize:))]
829        #[unsafe(method_family = none)]
830        pub unsafe fn setPointSize(&self, point_size: CGFloat);
831
832        #[cfg(feature = "objc2-core-foundation")]
833        /// Specifies the minimum size in screen-space (in pixel). Defaults to 1
834        #[unsafe(method(minimumPointScreenSpaceRadius))]
835        #[unsafe(method_family = none)]
836        pub unsafe fn minimumPointScreenSpaceRadius(&self) -> CGFloat;
837
838        #[cfg(feature = "objc2-core-foundation")]
839        /// Setter for [`minimumPointScreenSpaceRadius`][Self::minimumPointScreenSpaceRadius].
840        #[unsafe(method(setMinimumPointScreenSpaceRadius:))]
841        #[unsafe(method_family = none)]
842        pub unsafe fn setMinimumPointScreenSpaceRadius(
843            &self,
844            minimum_point_screen_space_radius: CGFloat,
845        );
846
847        #[cfg(feature = "objc2-core-foundation")]
848        /// Specifies the maximum size in screen-space (in pixel). Defaults to 1
849        #[unsafe(method(maximumPointScreenSpaceRadius))]
850        #[unsafe(method_family = none)]
851        pub unsafe fn maximumPointScreenSpaceRadius(&self) -> CGFloat;
852
853        #[cfg(feature = "objc2-core-foundation")]
854        /// Setter for [`maximumPointScreenSpaceRadius`][Self::maximumPointScreenSpaceRadius].
855        #[unsafe(method(setMaximumPointScreenSpaceRadius:))]
856        #[unsafe(method_family = none)]
857        pub unsafe fn setMaximumPointScreenSpaceRadius(
858            &self,
859            maximum_point_screen_space_radius: CGFloat,
860        );
861    );
862}
863
864/// Methods declared on superclass `NSObject`.
865impl SCNGeometryElement {
866    extern_methods!(
867        #[unsafe(method(init))]
868        #[unsafe(method_family = init)]
869        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
870
871        #[unsafe(method(new))]
872        #[unsafe(method_family = new)]
873        pub unsafe fn new() -> Retained<Self>;
874    );
875}
876
877/// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scntessellationsmoothingmode?language=objc)
878// NS_ENUM
879#[repr(transparent)]
880#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
881pub struct SCNTessellationSmoothingMode(pub NSInteger);
882impl SCNTessellationSmoothingMode {
883    #[doc(alias = "SCNTessellationSmoothingModeNone")]
884    pub const None: Self = Self(0);
885    #[doc(alias = "SCNTessellationSmoothingModePNTriangles")]
886    pub const PNTriangles: Self = Self(1);
887    #[doc(alias = "SCNTessellationSmoothingModePhong")]
888    pub const Phong: Self = Self(2);
889}
890
891unsafe impl Encode for SCNTessellationSmoothingMode {
892    const ENCODING: Encoding = NSInteger::ENCODING;
893}
894
895unsafe impl RefEncode for SCNTessellationSmoothingMode {
896    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
897}
898
899extern_class!(
900    /// A geometry tessellator describes how a more detailed surface is calculated from the geometry's initial surface.
901    ///
902    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scngeometrytessellator?language=objc)
903    #[unsafe(super(NSObject))]
904    #[derive(Debug, PartialEq, Eq, Hash)]
905    pub struct SCNGeometryTessellator;
906);
907
908extern_conformance!(
909    unsafe impl NSCoding for SCNGeometryTessellator {}
910);
911
912extern_conformance!(
913    unsafe impl NSCopying for SCNGeometryTessellator {}
914);
915
916unsafe impl CopyingHelper for SCNGeometryTessellator {
917    type Result = Self;
918}
919
920extern_conformance!(
921    unsafe impl NSObjectProtocol for SCNGeometryTessellator {}
922);
923
924extern_conformance!(
925    unsafe impl NSSecureCoding for SCNGeometryTessellator {}
926);
927
928impl SCNGeometryTessellator {
929    extern_methods!(
930        #[cfg(feature = "objc2-core-foundation")]
931        /// Specifies the scale factor applied to the per-patch tessellation factors. Defaults to 1.
932        #[unsafe(method(tessellationFactorScale))]
933        #[unsafe(method_family = none)]
934        pub unsafe fn tessellationFactorScale(&self) -> CGFloat;
935
936        #[cfg(feature = "objc2-core-foundation")]
937        /// Setter for [`tessellationFactorScale`][Self::tessellationFactorScale].
938        #[unsafe(method(setTessellationFactorScale:))]
939        #[unsafe(method_family = none)]
940        pub unsafe fn setTessellationFactorScale(&self, tessellation_factor_scale: CGFloat);
941
942        #[cfg(feature = "objc2-metal")]
943        #[cfg(not(target_os = "watchos"))]
944        /// Specifies the tessellation partition mode. Defaults to MTLTessellationPartitionModeInteger.
945        #[unsafe(method(tessellationPartitionMode))]
946        #[unsafe(method_family = none)]
947        pub unsafe fn tessellationPartitionMode(&self) -> MTLTessellationPartitionMode;
948
949        #[cfg(feature = "objc2-metal")]
950        #[cfg(not(target_os = "watchos"))]
951        /// Setter for [`tessellationPartitionMode`][Self::tessellationPartitionMode].
952        #[unsafe(method(setTessellationPartitionMode:))]
953        #[unsafe(method_family = none)]
954        pub unsafe fn setTessellationPartitionMode(
955            &self,
956            tessellation_partition_mode: MTLTessellationPartitionMode,
957        );
958
959        /// Specifies if the tessellation should be uniform or adaptive. Defaults to NO.
960        #[unsafe(method(isAdaptive))]
961        #[unsafe(method_family = none)]
962        pub unsafe fn isAdaptive(&self) -> bool;
963
964        /// Setter for [`isAdaptive`][Self::isAdaptive].
965        #[unsafe(method(setAdaptive:))]
966        #[unsafe(method_family = none)]
967        pub unsafe fn setAdaptive(&self, adaptive: bool);
968
969        /// Specifies if the level of tessellation should be adapted in screenSpace. Defaults to NO.
970        #[unsafe(method(isScreenSpace))]
971        #[unsafe(method_family = none)]
972        pub unsafe fn isScreenSpace(&self) -> bool;
973
974        /// Setter for [`isScreenSpace`][Self::isScreenSpace].
975        #[unsafe(method(setScreenSpace:))]
976        #[unsafe(method_family = none)]
977        pub unsafe fn setScreenSpace(&self, screen_space: bool);
978
979        #[cfg(feature = "objc2-core-foundation")]
980        /// Specifies the edge tessellation factor. Defaults to 1.
981        ///
982        /// This has no effect for adaptive subdivision
983        #[unsafe(method(edgeTessellationFactor))]
984        #[unsafe(method_family = none)]
985        pub unsafe fn edgeTessellationFactor(&self) -> CGFloat;
986
987        #[cfg(feature = "objc2-core-foundation")]
988        /// Setter for [`edgeTessellationFactor`][Self::edgeTessellationFactor].
989        #[unsafe(method(setEdgeTessellationFactor:))]
990        #[unsafe(method_family = none)]
991        pub unsafe fn setEdgeTessellationFactor(&self, edge_tessellation_factor: CGFloat);
992
993        #[cfg(feature = "objc2-core-foundation")]
994        /// Specifies the inside tessellation factor. Defaults to 1.
995        ///
996        /// This has no effect for adaptive subdivision
997        #[unsafe(method(insideTessellationFactor))]
998        #[unsafe(method_family = none)]
999        pub unsafe fn insideTessellationFactor(&self) -> CGFloat;
1000
1001        #[cfg(feature = "objc2-core-foundation")]
1002        /// Setter for [`insideTessellationFactor`][Self::insideTessellationFactor].
1003        #[unsafe(method(setInsideTessellationFactor:))]
1004        #[unsafe(method_family = none)]
1005        pub unsafe fn setInsideTessellationFactor(&self, inside_tessellation_factor: CGFloat);
1006
1007        #[cfg(feature = "objc2-core-foundation")]
1008        /// Specifies the maximum edge length. Defaults to 1.
1009        ///
1010        /// This has no effect for non-adaptive subdivision
1011        #[unsafe(method(maximumEdgeLength))]
1012        #[unsafe(method_family = none)]
1013        pub unsafe fn maximumEdgeLength(&self) -> CGFloat;
1014
1015        #[cfg(feature = "objc2-core-foundation")]
1016        /// Setter for [`maximumEdgeLength`][Self::maximumEdgeLength].
1017        #[unsafe(method(setMaximumEdgeLength:))]
1018        #[unsafe(method_family = none)]
1019        pub unsafe fn setMaximumEdgeLength(&self, maximum_edge_length: CGFloat);
1020
1021        /// Defaults to SCNTessellationSmoothingModeNone.
1022        #[unsafe(method(smoothingMode))]
1023        #[unsafe(method_family = none)]
1024        pub unsafe fn smoothingMode(&self) -> SCNTessellationSmoothingMode;
1025
1026        /// Setter for [`smoothingMode`][Self::smoothingMode].
1027        #[unsafe(method(setSmoothingMode:))]
1028        #[unsafe(method_family = none)]
1029        pub unsafe fn setSmoothingMode(&self, smoothing_mode: SCNTessellationSmoothingMode);
1030    );
1031}
1032
1033/// Methods declared on superclass `NSObject`.
1034impl SCNGeometryTessellator {
1035    extern_methods!(
1036        #[unsafe(method(init))]
1037        #[unsafe(method_family = init)]
1038        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1039
1040        #[unsafe(method(new))]
1041        #[unsafe(method_family = new)]
1042        pub unsafe fn new() -> Retained<Self>;
1043    );
1044}