From b7ef2467896567d11e3318d422eb70ea7f5e6279 Mon Sep 17 00:00:00 2001 From: Jefferson Amstutz Date: Wed, 13 Mar 2024 13:41:05 -0500 Subject: [PATCH] fix assumption that ANARIMapperVolume only consumed point data --- vtkm/interop/anari/ANARIMapperVolume.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vtkm/interop/anari/ANARIMapperVolume.cxx b/vtkm/interop/anari/ANARIMapperVolume.cxx index 904ced3df..840f6e187 100644 --- a/vtkm/interop/anari/ANARIMapperVolume.cxx +++ b/vtkm/interop/anari/ANARIMapperVolume.cxx @@ -132,6 +132,8 @@ void ANARIMapperVolume::ConstructArrays(bool regenerate) const auto& cells = actor.GetCellSet(); const auto& fieldArray = actor.GetField().GetData(); + const bool isPointBased = + actor.GetField().GetAssociation() == vtkm::cont::Field::Association::Points; const bool isStructured = cells.CanConvert>(); const bool isScalar = fieldArray.GetNumberOfComponentsFlat() == 1; @@ -140,7 +142,8 @@ void ANARIMapperVolume::ConstructArrays(bool regenerate) if (isStructured && isScalar) { auto structuredCells = cells.AsCellSet>(); - auto pdims = structuredCells.GetPointDimensions(); + auto pdims = + isPointBased ? structuredCells.GetPointDimensions() : structuredCells.GetCellDimensions(); VolumeArrays arrays;