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