objc2_ar_kit/generated/ARSkeletonDefinition.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointname?language=objc)
12// NS_TYPED_ENUM
13#[cfg(feature = "objc2-foundation")]
14pub type ARSkeletonJointName = NSString;
15
16extern "C" {
17 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnameroot?language=objc)
18 #[cfg(feature = "objc2-foundation")]
19 pub static ARSkeletonJointNameRoot: &'static ARSkeletonJointName;
20}
21
22extern "C" {
23 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnamehead?language=objc)
24 #[cfg(feature = "objc2-foundation")]
25 pub static ARSkeletonJointNameHead: &'static ARSkeletonJointName;
26}
27
28extern "C" {
29 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnamelefthand?language=objc)
30 #[cfg(feature = "objc2-foundation")]
31 pub static ARSkeletonJointNameLeftHand: &'static ARSkeletonJointName;
32}
33
34extern "C" {
35 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnamerighthand?language=objc)
36 #[cfg(feature = "objc2-foundation")]
37 pub static ARSkeletonJointNameRightHand: &'static ARSkeletonJointName;
38}
39
40extern "C" {
41 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnameleftfoot?language=objc)
42 #[cfg(feature = "objc2-foundation")]
43 pub static ARSkeletonJointNameLeftFoot: &'static ARSkeletonJointName;
44}
45
46extern "C" {
47 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnamerightfoot?language=objc)
48 #[cfg(feature = "objc2-foundation")]
49 pub static ARSkeletonJointNameRightFoot: &'static ARSkeletonJointName;
50}
51
52extern "C" {
53 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnameleftshoulder?language=objc)
54 #[cfg(feature = "objc2-foundation")]
55 pub static ARSkeletonJointNameLeftShoulder: &'static ARSkeletonJointName;
56}
57
58extern "C" {
59 /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletonjointnamerightshoulder?language=objc)
60 #[cfg(feature = "objc2-foundation")]
61 pub static ARSkeletonJointNameRightShoulder: &'static ARSkeletonJointName;
62}
63
64#[cfg(feature = "objc2")]
65extern_class!(
66 /// Definition of a skeleton.
67 ///
68 ///
69 /// A skeleton consists of a set of labeled joints that are defined in a certain hierarchy, i.e. joints are parented to other joints.
70 /// One may use the parentIndices property to identify the hierarchy for a given skeleton definition.
71 ///
72 /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeletondefinition?language=objc)
73 #[unsafe(super(NSObject))]
74 #[derive(Debug, PartialEq, Eq, Hash)]
75 #[cfg(feature = "objc2")]
76 pub struct ARSkeletonDefinition;
77);
78
79#[cfg(feature = "objc2")]
80unsafe impl Send for ARSkeletonDefinition {}
81
82#[cfg(feature = "objc2")]
83unsafe impl Sync for ARSkeletonDefinition {}
84
85#[cfg(feature = "objc2")]
86extern_conformance!(
87 unsafe impl NSObjectProtocol for ARSkeletonDefinition {}
88);
89
90#[cfg(feature = "objc2")]
91impl ARSkeletonDefinition {
92 extern_methods!(
93 /// Default skeleton definition for bodies defined in 3D.
94 ///
95 /// Note: The default height of this skeleton, measured from lowest to highest joint in standing position, is defined to be 1.71 meters.
96 ///
97 /// See: ARSkeleton3D
98 #[unsafe(method(defaultBody3DSkeletonDefinition))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn defaultBody3DSkeletonDefinition() -> Retained<ARSkeletonDefinition>;
101
102 /// Default skeleton definition for bodies defined in 2D.
103 ///
104 /// See: ARBody2D
105 #[unsafe(method(defaultBody2DSkeletonDefinition))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn defaultBody2DSkeletonDefinition() -> Retained<ARSkeletonDefinition>;
108
109 /// The number of joints.
110 ///
111 /// This property is not atomic.
112 ///
113 /// # Safety
114 ///
115 /// This might not be thread-safe.
116 #[unsafe(method(jointCount))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn jointCount(&self) -> NSUInteger;
119
120 #[cfg(feature = "objc2-foundation")]
121 /// The joint names.
122 ///
123 /// This property is not atomic.
124 ///
125 /// # Safety
126 ///
127 /// This might not be thread-safe.
128 #[unsafe(method(jointNames))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn jointNames(&self) -> Retained<NSArray<NSString>>;
131
132 #[cfg(feature = "objc2-foundation")]
133 /// The parent index for each joint.
134 ///
135 /// This property may be used to identify the hierarchical dependency between joints. If a line is drawn for every joint and its parent joint
136 /// the result is a visualization of the underlying skeleton. The joint with no parent is denoted as the root joint. The root joint's parent index has
137 /// a value of -1.
138 ///
139 /// This property is not atomic.
140 ///
141 /// # Safety
142 ///
143 /// This might not be thread-safe.
144 #[unsafe(method(parentIndices))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn parentIndices(&self) -> Retained<NSArray<NSNumber>>;
147
148 #[cfg(feature = "ARSkeleton")]
149 /// The 3D skeleton in neutral pose.
150 ///
151 /// The neutral skeleton pose assumes a standardized size of the skeleton in meters. The neutral pose is defined as the skeleton's T-pose.
152 ///
153 /// This property is not atomic.
154 ///
155 /// # Safety
156 ///
157 /// This might not be thread-safe.
158 #[unsafe(method(neutralBodySkeleton3D))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn neutralBodySkeleton3D(&self) -> Option<Retained<ARSkeleton3D>>;
161
162 #[cfg(feature = "objc2-foundation")]
163 /// Returns the index for a given joint identifier.
164 ///
165 ///
166 /// Parameter `jointName`: Name of a given joint.
167 ///
168 /// This function returns NSNotFound if an invalid joint name is passed.
169 ///
170 /// Returns: Joint index.
171 #[unsafe(method(indexForJointName:))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn indexForJointName(&self, joint_name: &ARSkeletonJointName) -> NSUInteger;
174
175 /// Unavailable
176 #[unsafe(method(init))]
177 #[unsafe(method_family = init)]
178 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
179
180 #[unsafe(method(new))]
181 #[unsafe(method_family = new)]
182 pub unsafe fn new() -> Retained<Self>;
183 );
184}