objc2-ar-kit 0.3.2

Bindings to the ARKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-scene-kit")]
use objc2_scene_kit::*;

use crate::*;

#[cfg(feature = "objc2")]
extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arscnviewdelegate?language=objc)
    #[cfg(all(feature = "ARSession", feature = "objc2", feature = "objc2-scene-kit"))]
    pub unsafe trait ARSCNViewDelegate:
        SCNSceneRendererDelegate + ARSessionObserver
    {
        #[cfg(feature = "ARAnchor")]
        /// Implement this to provide a custom node for the given anchor.
        ///
        ///
        /// This node will automatically be added to the scene graph.
        /// If this method is not implemented, a node will be automatically created.
        /// If nil is returned the anchor will be ignored.
        ///
        /// Parameter `renderer`: The renderer that will render the scene.
        ///
        /// Parameter `anchor`: The added anchor.
        ///
        /// Returns: Node that will be mapped to the anchor or nil.
        #[optional]
        #[unsafe(method(renderer:nodeForAnchor:))]
        #[unsafe(method_family = none)]
        unsafe fn renderer_nodeForAnchor(
            &self,
            renderer: &ProtocolObject<dyn SCNSceneRenderer>,
            anchor: &ARAnchor,
        ) -> Option<Retained<SCNNode>>;

        #[cfg(feature = "ARAnchor")]
        /// Called when a new node has been mapped to the given anchor.
        ///
        ///
        /// Parameter `renderer`: The renderer that will render the scene.
        ///
        /// Parameter `node`: The node that maps to the anchor.
        ///
        /// Parameter `anchor`: The added anchor.
        #[optional]
        #[unsafe(method(renderer:didAddNode:forAnchor:))]
        #[unsafe(method_family = none)]
        unsafe fn renderer_didAddNode_forAnchor(
            &self,
            renderer: &ProtocolObject<dyn SCNSceneRenderer>,
            node: &SCNNode,
            anchor: &ARAnchor,
        );

        #[cfg(feature = "ARAnchor")]
        /// Called when a node will be updated with data from the given anchor.
        ///
        ///
        /// Parameter `renderer`: The renderer that will render the scene.
        ///
        /// Parameter `node`: The node that will be updated.
        ///
        /// Parameter `anchor`: The anchor that was updated.
        #[optional]
        #[unsafe(method(renderer:willUpdateNode:forAnchor:))]
        #[unsafe(method_family = none)]
        unsafe fn renderer_willUpdateNode_forAnchor(
            &self,
            renderer: &ProtocolObject<dyn SCNSceneRenderer>,
            node: &SCNNode,
            anchor: &ARAnchor,
        );

        #[cfg(feature = "ARAnchor")]
        /// Called when a node has been updated with data from the given anchor.
        ///
        ///
        /// Parameter `renderer`: The renderer that will render the scene.
        ///
        /// Parameter `node`: The node that was updated.
        ///
        /// Parameter `anchor`: The anchor that was updated.
        #[optional]
        #[unsafe(method(renderer:didUpdateNode:forAnchor:))]
        #[unsafe(method_family = none)]
        unsafe fn renderer_didUpdateNode_forAnchor(
            &self,
            renderer: &ProtocolObject<dyn SCNSceneRenderer>,
            node: &SCNNode,
            anchor: &ARAnchor,
        );

        #[cfg(feature = "ARAnchor")]
        /// Called when a mapped node has been removed from the scene graph for the given anchor.
        ///
        ///
        /// Parameter `renderer`: The renderer that will render the scene.
        ///
        /// Parameter `node`: The node that was removed.
        ///
        /// Parameter `anchor`: The anchor that was removed.
        #[optional]
        #[unsafe(method(renderer:didRemoveNode:forAnchor:))]
        #[unsafe(method_family = none)]
        unsafe fn renderer_didRemoveNode_forAnchor(
            &self,
            renderer: &ProtocolObject<dyn SCNSceneRenderer>,
            node: &SCNNode,
            anchor: &ARAnchor,
        );
    }
);

/// Extended debug options for an ARSCNView
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscndebugoptions?language=objc)
#[cfg(feature = "objc2-scene-kit")]
pub type ARSCNDebugOptions = SCNDebugOptions;

extern "C" {
    /// Show the world origin in the scene.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscndebugoptionshowworldorigin?language=objc)
    #[cfg(feature = "objc2-scene-kit")]
    pub static ARSCNDebugOptionShowWorldOrigin: SCNDebugOptions;
}

extern "C" {
    /// Show detected 3D feature points in the world.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscndebugoptionshowfeaturepoints?language=objc)
    #[cfg(feature = "objc2-scene-kit")]
    pub static ARSCNDebugOptionShowFeaturePoints: SCNDebugOptions;
}