objc2_ar_kit/generated/ARSCNView.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-scene-kit")]
8use objc2_scene_kit::*;
9
10use crate::*;
11
12#[cfg(feature = "objc2")]
13extern_protocol!(
14 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arscnviewdelegate?language=objc)
15 #[cfg(all(feature = "ARSession", feature = "objc2", feature = "objc2-scene-kit"))]
16 pub unsafe trait ARSCNViewDelegate:
17 SCNSceneRendererDelegate + ARSessionObserver
18 {
19 #[cfg(feature = "ARAnchor")]
20 /// Implement this to provide a custom node for the given anchor.
21 ///
22 ///
23 /// This node will automatically be added to the scene graph.
24 /// If this method is not implemented, a node will be automatically created.
25 /// If nil is returned the anchor will be ignored.
26 ///
27 /// Parameter `renderer`: The renderer that will render the scene.
28 ///
29 /// Parameter `anchor`: The added anchor.
30 ///
31 /// Returns: Node that will be mapped to the anchor or nil.
32 #[optional]
33 #[unsafe(method(renderer:nodeForAnchor:))]
34 #[unsafe(method_family = none)]
35 unsafe fn renderer_nodeForAnchor(
36 &self,
37 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
38 anchor: &ARAnchor,
39 ) -> Option<Retained<SCNNode>>;
40
41 #[cfg(feature = "ARAnchor")]
42 /// Called when a new node has been mapped to the given anchor.
43 ///
44 ///
45 /// Parameter `renderer`: The renderer that will render the scene.
46 ///
47 /// Parameter `node`: The node that maps to the anchor.
48 ///
49 /// Parameter `anchor`: The added anchor.
50 #[optional]
51 #[unsafe(method(renderer:didAddNode:forAnchor:))]
52 #[unsafe(method_family = none)]
53 unsafe fn renderer_didAddNode_forAnchor(
54 &self,
55 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
56 node: &SCNNode,
57 anchor: &ARAnchor,
58 );
59
60 #[cfg(feature = "ARAnchor")]
61 /// Called when a node will be updated with data from the given anchor.
62 ///
63 ///
64 /// Parameter `renderer`: The renderer that will render the scene.
65 ///
66 /// Parameter `node`: The node that will be updated.
67 ///
68 /// Parameter `anchor`: The anchor that was updated.
69 #[optional]
70 #[unsafe(method(renderer:willUpdateNode:forAnchor:))]
71 #[unsafe(method_family = none)]
72 unsafe fn renderer_willUpdateNode_forAnchor(
73 &self,
74 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
75 node: &SCNNode,
76 anchor: &ARAnchor,
77 );
78
79 #[cfg(feature = "ARAnchor")]
80 /// Called when a node has been updated with data from the given anchor.
81 ///
82 ///
83 /// Parameter `renderer`: The renderer that will render the scene.
84 ///
85 /// Parameter `node`: The node that was updated.
86 ///
87 /// Parameter `anchor`: The anchor that was updated.
88 #[optional]
89 #[unsafe(method(renderer:didUpdateNode:forAnchor:))]
90 #[unsafe(method_family = none)]
91 unsafe fn renderer_didUpdateNode_forAnchor(
92 &self,
93 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
94 node: &SCNNode,
95 anchor: &ARAnchor,
96 );
97
98 #[cfg(feature = "ARAnchor")]
99 /// Called when a mapped node has been removed from the scene graph for the given anchor.
100 ///
101 ///
102 /// Parameter `renderer`: The renderer that will render the scene.
103 ///
104 /// Parameter `node`: The node that was removed.
105 ///
106 /// Parameter `anchor`: The anchor that was removed.
107 #[optional]
108 #[unsafe(method(renderer:didRemoveNode:forAnchor:))]
109 #[unsafe(method_family = none)]
110 unsafe fn renderer_didRemoveNode_forAnchor(
111 &self,
112 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
113 node: &SCNNode,
114 anchor: &ARAnchor,
115 );
116 }
117);
118
119/// Extended debug options for an ARSCNView
120///
121/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscndebugoptions?language=objc)
122#[cfg(feature = "objc2-scene-kit")]
123pub type ARSCNDebugOptions = SCNDebugOptions;
124
125extern "C" {
126 /// Show the world origin in the scene.
127 ///
128 /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscndebugoptionshowworldorigin?language=objc)
129 #[cfg(feature = "objc2-scene-kit")]
130 pub static ARSCNDebugOptionShowWorldOrigin: SCNDebugOptions;
131}
132
133extern "C" {
134 /// Show detected 3D feature points in the world.
135 ///
136 /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscndebugoptionshowfeaturepoints?language=objc)
137 #[cfg(feature = "objc2-scene-kit")]
138 pub static ARSCNDebugOptionShowFeaturePoints: SCNDebugOptions;
139}