objc2-model-io 0.3.2

Bindings to the ModelIO framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// MDLTransformComponent
    /// a container for a time sampled local transformation
    ///
    ///
    /// Accessors to get the local transform and the global transform
    /// for a particular MDLObject are provided.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltransformcomponent?language=objc)
    #[cfg(feature = "MDLTypes")]
    pub unsafe trait MDLTransformComponent: MDLComponent {
        /// if YES, this transform is intended to be in global space, not parent space
        #[unsafe(method(resetsTransform))]
        #[unsafe(method_family = none)]
        unsafe fn resetsTransform(&self) -> bool;

        /// Setter for [`resetsTransform`][Self::resetsTransform].
        #[unsafe(method(setResetsTransform:))]
        #[unsafe(method_family = none)]
        unsafe fn setResetsTransform(&self, resets_transform: bool);

        /// If no animation data is present, minimumTime and maximumTime will be zero
        #[unsafe(method(minimumTime))]
        #[unsafe(method_family = none)]
        unsafe fn minimumTime(&self) -> NSTimeInterval;

        #[unsafe(method(maximumTime))]
        #[unsafe(method_family = none)]
        unsafe fn maximumTime(&self) -> NSTimeInterval;

        /// An array of sample times for which a key has been stored
        /// If no animation data is present, the array will contain a single value of zero
        #[unsafe(method(keyTimes))]
        #[unsafe(method_family = none)]
        unsafe fn keyTimes(&self) -> Retained<NSArray<NSNumber>>;
    }
);

extern_class!(
    /// Concrete implementation of
    /// <MDLTransformComponent
    /// >.
    /// For more complex transform components create a class that conforms to
    /// <MDLTransformComponent
    /// >.
    ///
    ///
    /// Setting any of scale, translation, or rotation individually will
    /// set the matrix property, and clear any timing information.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltransform?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MDLTransform;
);

#[cfg(feature = "MDLTypes")]
extern_conformance!(
    unsafe impl MDLComponent for MDLTransform {}
);

#[cfg(feature = "MDLTypes")]
extern_conformance!(
    unsafe impl MDLTransformComponent for MDLTransform {}
);

extern_conformance!(
    unsafe impl NSCopying for MDLTransform {}
);

unsafe impl CopyingHelper for MDLTransform {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for MDLTransform {}
);

impl MDLTransform {
    extern_methods!(
        /// Initialize an MDLTransform's matrices with identity
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(initWithIdentity))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentity(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "MDLTypes")]
        #[unsafe(method(initWithTransformComponent:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTransformComponent(
            this: Allocated<Self>,
            component: &ProtocolObject<dyn MDLTransformComponent>,
        ) -> Retained<Self>;

        #[cfg(feature = "MDLTypes")]
        #[unsafe(method(initWithTransformComponent:resetsTransform:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTransformComponent_resetsTransform(
            this: Allocated<Self>,
            component: &ProtocolObject<dyn MDLTransformComponent>,
            resets_transform: bool,
        ) -> Retained<Self>;

        /// Set all transform components to identity
        #[unsafe(method(setIdentity))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIdentity(&self);
    );
}

/// Methods declared on superclass `NSObject`.
impl MDLTransform {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}