/// <summary> /// Copies the point values of another point cloud into this one. /// </summary> /// <param name="other">PointCloud to merge with this one.</param> /// <since>5.0</since> public void Merge(PointCloud other) { IntPtr const_ptr_other = other.ConstPointer(); IntPtr ptr_this = NonConstPointer(); UnsafeNativeMethods.ON_PointCloud_MergeCloud(ptr_this, const_ptr_other); }
/// <summary> /// Constructs a new tree with an element for each point cloud point. /// </summary> /// <param name="cloud">A point cloud.</param> /// <returns>A new tree, or null on error.</returns> /// <since>5.0</since> public static RTree CreatePointCloudTree(PointCloud cloud) { if (cloud == null) { throw new ArgumentNullException(nameof(cloud)); } IntPtr const_ptr_cloud = cloud.ConstPointer(); IntPtr ptr_rtree = UnsafeNativeMethods.ON_RTree_CreatePointCloudTree(const_ptr_cloud); if (IntPtr.Zero == ptr_rtree) { return(null); } RTree rc = new RTree(ptr_rtree); uint size = UnsafeNativeMethods.ON_RTree_SizeOf(ptr_rtree); rc.m_memory_pressure = size; GC.AddMemoryPressure(rc.m_memory_pressure); rc.m_count = cloud.Count; GC.KeepAlive(cloud); return(rc); }