objc2_model_io/generated/
MDLTransform.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// MDLTransformComponent
12    /// a container for a time sampled local transformation
13    ///
14    ///
15    /// Accessors to get the local transform and the global transform
16    /// for a particular MDLObject are provided.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltransformcomponent?language=objc)
19    #[cfg(feature = "MDLTypes")]
20    pub unsafe trait MDLTransformComponent: MDLComponent {
21        /// if YES, this transform is intended to be in global space, not parent space
22        #[unsafe(method(resetsTransform))]
23        #[unsafe(method_family = none)]
24        unsafe fn resetsTransform(&self) -> bool;
25
26        /// Setter for [`resetsTransform`][Self::resetsTransform].
27        #[unsafe(method(setResetsTransform:))]
28        #[unsafe(method_family = none)]
29        unsafe fn setResetsTransform(&self, resets_transform: bool);
30
31        /// If no animation data is present, minimumTime and maximumTime will be zero
32        #[unsafe(method(minimumTime))]
33        #[unsafe(method_family = none)]
34        unsafe fn minimumTime(&self) -> NSTimeInterval;
35
36        #[unsafe(method(maximumTime))]
37        #[unsafe(method_family = none)]
38        unsafe fn maximumTime(&self) -> NSTimeInterval;
39
40        /// An array of sample times for which a key has been stored
41        /// If no animation data is present, the array will contain a single value of zero
42        #[unsafe(method(keyTimes))]
43        #[unsafe(method_family = none)]
44        unsafe fn keyTimes(&self) -> Retained<NSArray<NSNumber>>;
45    }
46);
47
48extern_class!(
49    /// Concrete implementation of
50    /// <MDLTransformComponent
51    /// >.
52    /// For more complex transform components create a class that conforms to
53    /// <MDLTransformComponent
54    /// >.
55    ///
56    ///
57    /// Setting any of scale, translation, or rotation individually will
58    /// set the matrix property, and clear any timing information.
59    ///
60    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltransform?language=objc)
61    #[unsafe(super(NSObject))]
62    #[derive(Debug, PartialEq, Eq, Hash)]
63    pub struct MDLTransform;
64);
65
66#[cfg(feature = "MDLTypes")]
67extern_conformance!(
68    unsafe impl MDLComponent for MDLTransform {}
69);
70
71#[cfg(feature = "MDLTypes")]
72extern_conformance!(
73    unsafe impl MDLTransformComponent for MDLTransform {}
74);
75
76extern_conformance!(
77    unsafe impl NSCopying for MDLTransform {}
78);
79
80unsafe impl CopyingHelper for MDLTransform {
81    type Result = Self;
82}
83
84extern_conformance!(
85    unsafe impl NSObjectProtocol for MDLTransform {}
86);
87
88impl MDLTransform {
89    extern_methods!(
90        /// Initialize an MDLTransform's matrices with identity
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95        #[deprecated]
96        #[unsafe(method(initWithIdentity))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn initWithIdentity(this: Allocated<Self>) -> Retained<Self>;
99
100        #[cfg(feature = "MDLTypes")]
101        #[unsafe(method(initWithTransformComponent:))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn initWithTransformComponent(
104            this: Allocated<Self>,
105            component: &ProtocolObject<dyn MDLTransformComponent>,
106        ) -> Retained<Self>;
107
108        #[cfg(feature = "MDLTypes")]
109        #[unsafe(method(initWithTransformComponent:resetsTransform:))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn initWithTransformComponent_resetsTransform(
112            this: Allocated<Self>,
113            component: &ProtocolObject<dyn MDLTransformComponent>,
114            resets_transform: bool,
115        ) -> Retained<Self>;
116
117        /// Set all transform components to identity
118        #[unsafe(method(setIdentity))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setIdentity(&self);
121    );
122}
123
124/// Methods declared on superclass `NSObject`.
125impl MDLTransform {
126    extern_methods!(
127        #[unsafe(method(new))]
128        #[unsafe(method_family = new)]
129        pub unsafe fn new() -> Retained<Self>;
130    );
131}