use std::ptr::slice_from_raw_parts;
use crate::{define_obj_type, ns, objc, simd};
define_obj_type!(
#[doc(alias = "ARPointCloud")]
pub PointCloud(ns::Id)
);
unsafe impl Send for PointCloud {}
unsafe impl Sync for PointCloud {}
impl PointCloud {
#[objc::msg_send(count)]
pub fn len(&self) -> usize;
#[inline]
pub fn is_empty(&self) -> bool {
self.len() == 0
}
#[objc::msg_send(points)]
pub fn points_ptr(&self) -> *const simd::f32x3;
#[inline]
pub fn points(&self) -> &[simd::f32x3] {
unsafe { &*slice_from_raw_parts(self.points_ptr(), self.len()) }
}
#[objc::msg_send(identifiers)]
pub fn ids_ptr(&self) -> *const u64;
#[inline]
pub fn ids(&self) -> &[u64] {
unsafe { &*slice_from_raw_parts(self.ids_ptr(), self.len()) }
}
}