Skip to content

Commit

Permalink
fix(build): Partio build errors on pointcloud functions for MSVC (Aca…
Browse files Browse the repository at this point in the history
…demySoftwareFoundation#1757)

Fixes AcademySoftwareFoundation#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 <[email protected]>
  • Loading branch information
AlexMWells authored Nov 28, 2023
1 parent da8f2be commit e154a22
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/liboslexec/pointcloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ustringhash,
Expand Down Expand Up @@ -55,7 +61,7 @@ namespace { // anon
static ustring u_position("position");

// some helper classes to make the sort easy
typedef std::pair<float, int> SortedPointRecord; // dist,index
typedef std::pair<float, Partio::ParticleIndex> SortedPointRecord; // dist,index
struct SortedPointCompare {
bool operator()(const SortedPointRecord& a, const SortedPointRecord& b)
{
Expand Down

0 comments on commit e154a22

Please sign in to comment.