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::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;

use crate::*;

/// Option set of hit-test result types.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arhittestresulttype?language=objc)
// NS_OPTIONS
#[cfg(feature = "objc2")]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ARHitTestResultType(pub NSUInteger);
#[cfg(feature = "objc2")]
bitflags::bitflags! {
    impl ARHitTestResultType: NSUInteger {
/// Result type from intersecting the nearest feature point.
        #[doc(alias = "ARHitTestResultTypeFeaturePoint")]
        const FeaturePoint = 1<<0;
/// Result type from intersecting a horizontal plane estimate, determined for the current frame.
        #[doc(alias = "ARHitTestResultTypeEstimatedHorizontalPlane")]
        const EstimatedHorizontalPlane = 1<<1;
/// Result type from intersecting a vertical plane estimate, determined for the current frame.
        #[doc(alias = "ARHitTestResultTypeEstimatedVerticalPlane")]
        const EstimatedVerticalPlane = 1<<2;
/// Result type from intersecting with an existing plane anchor.
        #[doc(alias = "ARHitTestResultTypeExistingPlane")]
        const ExistingPlane = 1<<3;
/// Result type from intersecting with an existing plane anchor, taking into account the plane’s extent.
        #[doc(alias = "ARHitTestResultTypeExistingPlaneUsingExtent")]
        const ExistingPlaneUsingExtent = 1<<4;
/// Result type from intersecting with an existing plane anchor, taking into account the plane’s geometry.
        #[doc(alias = "ARHitTestResultTypeExistingPlaneUsingGeometry")]
        const ExistingPlaneUsingGeometry = 1<<5;
    }
}

#[cfg(feature = "objc2")]
unsafe impl Encode for ARHitTestResultType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for ARHitTestResultType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

#[cfg(feature = "objc2")]
extern_class!(
    /// A result of an intersection found during a hit-test.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arhittestresult?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2")]
    #[deprecated = "Use raycasting"]
    pub struct ARHitTestResult;
);

#[cfg(feature = "objc2")]
extern_conformance!(
    unsafe impl NSObjectProtocol for ARHitTestResult {}
);

#[cfg(feature = "objc2")]
impl ARHitTestResult {
    extern_methods!(
        /// The type of the hit-test result.
        #[deprecated = "Use raycasting"]
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub unsafe fn r#type(&self) -> ARHitTestResultType;

        #[cfg(feature = "objc2-core-foundation")]
        /// The distance from the camera to the intersection in meters.
        #[deprecated = "Use raycasting"]
        #[unsafe(method(distance))]
        #[unsafe(method_family = none)]
        pub unsafe fn distance(&self) -> CGFloat;

        #[cfg(feature = "ARAnchor")]
        /// The anchor that the hit-test intersected.
        ///
        ///
        /// An anchor will only be provided for existing plane result types.
        #[deprecated = "Use raycasting"]
        #[unsafe(method(anchor))]
        #[unsafe(method_family = none)]
        pub unsafe fn anchor(&self) -> Option<Retained<ARAnchor>>;

        /// Unavailable
        #[deprecated = "Use raycasting"]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[deprecated = "Use raycasting"]
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}