From e154a220b69441f37742da325fb1fa9673d54388 Mon Sep 17 00:00:00 2001 From: Alex Wells Date: Mon, 27 Nov 2023 18:57:40 -0800 Subject: [PATCH] fix(build): Partio build errors on pointcloud functions for MSVC (#1757) Fixes #1755: Build error on MSVC with Partio Explicitly mark unsupported/unused PointCould copy/move constructors and assignment operators as deleted. Change SortedPointRecord index type from int to uint32_t and add static_cast during construction to avoid a warning. Change SortedPointRecord index type from uint32_t to Partio::ParticleIndex to handle 64bit indices (where we can) clang-format changes Signed-off-by: Alex M. Wells --- src/liboslexec/pointcloud.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/liboslexec/pointcloud.h b/src/liboslexec/pointcloud.h index 57ab75ab3..474e92c69 100644 --- a/src/liboslexec/pointcloud.h +++ b/src/liboslexec/pointcloud.h @@ -20,6 +20,12 @@ class OSLEXECPUBLIC PointCloud { PointCloud(ustringhash filename, Partio::ParticlesDataMutable* partio_cloud, bool write); ~PointCloud(); + + PointCloud(const PointCloud&) = delete; + PointCloud(const PointCloud&&) = delete; + PointCloud& operator=(const PointCloud&) = delete; + PointCloud& operator=(const PointCloud&&) = delete; + static PointCloud* get(ustringhash filename, bool write = false); typedef std::unordered_map SortedPointRecord; // dist,index +typedef std::pair SortedPointRecord; // dist,index struct SortedPointCompare { bool operator()(const SortedPointRecord& a, const SortedPointRecord& b) {