Skip to content

Commit

Permalink
BUG: SliceTriangleGeometry - fix crash when RegionIds are not used. (B…
Browse files Browse the repository at this point in the history
…lueQuartzSoftware#1065)

Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Sep 4, 2024
1 parent ae3860d commit 5653e9a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,20 @@ Result<> SliceTriangleGeometry::operator()()
std::vector<int32> sliceIds;
std::vector<int32> regionIds;

AbstractDataStore<int32>* triRegionIdPtr = nullptr;
// Get an object reference to the pointer
const auto& triRegionId = m_DataStructure.getDataAs<Int32Array>(m_InputValues->RegionIdArrayPath)->getDataStoreRef();

if(m_InputValues->HaveRegionIds)
{
triRegionIdPtr = m_DataStructure.getDataAs<Int32Array>(m_InputValues->RegionIdArrayPath)->getDataStore();
}
int32 edgeCounter = 0;
for(usize i = 0; i < numTris; i++)
{
int32 regionId = 0;
// get regionId of this triangle (if they are available)
if(m_InputValues->HaveRegionIds)
{
regionId = triRegionId[i];
regionId = triRegionIdPtr->operator[](i);
}
// determine which slices would hit the triangle
auto minTriDim = std::numeric_limits<float32>::max();
Expand Down

0 comments on commit 5653e9a

Please sign in to comment.