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