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