fix assumption that ANARIMapperVolume only consumed point data

This commit is contained in:
Jefferson Amstutz 2024-03-13 13:41:05 -05:00
parent 35f5abcc17
commit b7ef246789

@ -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<vtkm::cont::CellSetStructured<3>>();
const bool isScalar = fieldArray.GetNumberOfComponentsFlat() == 1;
@ -140,7 +142,8 @@ void ANARIMapperVolume::ConstructArrays(bool regenerate)
if (isStructured && isScalar)
{
auto structuredCells = cells.AsCellSet<vtkm::cont::CellSetStructured<3>>();
auto pdims = structuredCells.GetPointDimensions();
auto pdims =
isPointBased ? structuredCells.GetPointDimensions() : structuredCells.GetCellDimensions();
VolumeArrays arrays;