Skip to content

Introduces vtkm::cont::CellSetSingleType

vtkm::cont::CellSetSingleType is a subclass of vtkm::cont::ExplicitCellSet that allows for efficient storage of a CellSet of a single cell type.

vtkm::cont::CellSetSingleType efficient storage is attained by using ArrayHandleConstant for both the Shapes and NumIndices ArrayHandles, and than uses an ArrayHandleCounting for the OffsetsIndex ArrayHandle. The end result is that the only thing that the user needs to specify is a connectivity array, and under certain conditions even that could be an ArrayHandleCounting.

I have also updated vtkm::cont::CellSetListTag to make vtkm::cont::CellSetSingleType one of automatically converted types for DynamicCellSet's.

Here is an example of how you create a CellSetSingleType

vtkm::cont::CellSetSingleType< > cellSet(vtkm::CellShapeTagTriangle());

const int nPointIds = 6;
vtkm::Id pointIds[nPointIds] = { 0, 1, 3, 2, 3, 1 };
vtkm::cont::ArrayHandle<vtkm::Id> connectivity = vtkm::cont::make_ArrayHandle(pointIds, nPointIds);

Merge request reports