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")]
67unsafe impl MDLComponent for MDLTransform {}
68
69#[cfg(feature = "MDLTypes")]
70unsafe impl MDLTransformComponent for MDLTransform {}
71
72unsafe impl NSCopying for MDLTransform {}
73
74unsafe impl CopyingHelper for MDLTransform {
75    type Result = Self;
76}
77
78unsafe impl NSObjectProtocol for MDLTransform {}
79
80impl MDLTransform {
81    extern_methods!(
82        /// Initialize an MDLTransform's matrices with identity
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[deprecated]
88        #[unsafe(method(initWithIdentity))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn initWithIdentity(this: Allocated<Self>) -> Retained<Self>;
91
92        #[cfg(feature = "MDLTypes")]
93        #[unsafe(method(initWithTransformComponent:))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn initWithTransformComponent(
96            this: Allocated<Self>,
97            component: &ProtocolObject<dyn MDLTransformComponent>,
98        ) -> Retained<Self>;
99
100        #[cfg(feature = "MDLTypes")]
101        #[unsafe(method(initWithTransformComponent:resetsTransform:))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn initWithTransformComponent_resetsTransform(
104            this: Allocated<Self>,
105            component: &ProtocolObject<dyn MDLTransformComponent>,
106            resets_transform: bool,
107        ) -> Retained<Self>;
108
109        /// Set all transform components to identity
110        #[unsafe(method(setIdentity))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setIdentity(&self);
113    );
114}
115
116/// Methods declared on superclass `NSObject`.
117impl MDLTransform {
118    extern_methods!(
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}