Accelerators/Vtkm/vtkmlib/CellSetConverters.cxx
// convert a cell array of mixed types to a vtkm CellSetExplicit
convert a cell array of mixed types to a vtkm CellSetExplicit
convert a cell array of mixed types to a vtkm CellSetExplicit
vtkm::cont::DynamicCellSet Convert(vtkUnsignedCharArray* types,
                                   vtkCellArray* cells,
                                   vtkIdTypeArray* locations,
                                   vtkIdType numberOfPoints)
{
  typedef vtkAOSDataArrayTemplate<vtkm::Id> DATIdType;
  typedef vtkAOSDataArrayTemplate<vtkm::UInt8> DATUInt8Type;
  typedef tovtkm::vtkCellArrayContainerTag CellArrayTag;
  vtkm::cont::internal::Storage<vtkIdType, CellArrayTag> cstorage(cells);
  vtkm::cont::ArrayHandle<vtkIdType, CellArrayTag> chandle(cstorage);
  auto ts_ptr = static_cast<DATUInt8Type*>(types);
  vtkm::cont::ArrayHandle<vtkm::UInt8> thandle = vtkm::cont::make_ArrayHandle(ts_ptr->GetPointer(0), ts_ptr->GetNumberOfTuples());
  auto ls_ptr = static_cast<DATIdType*>(locations);
  vtkm::cont::ArrayHandle<vtkIdType> lhandle = vtkm::cont::make_ArrayHandle(ls_ptr->GetPointer(0), ls_ptr->GetNumberOfTuples());
  vtkm::cont::vtkmCellSetExplicitAOS cellset;
  cellset.Fill(numberOfPoints, thandle, chandle, lhandle);
  return vtkm::cont::DynamicCellSet(cellset);
}
vtkm :: cont :: DynamicCellSet Convert ( vtkUnsignedCharArray * types , vtkCellArray * cells , vtkIdTypeArray * locations , vtkIdType numberOfPoints ) { typedef vtkAOSDataArrayTemplate < vtkm :: Id > DATIdType ; typedef vtkAOSDataArrayTemplate < vtkm :: UInt8 > DATUInt8Type ; typedef tovtkm :: vtkCellArrayContainerTag CellArrayTag ; vtkm :: cont :: internal :: Storage < vtkIdType , CellArrayTag > cstorage ( cells ) ; vtkm :: cont :: ArrayHandle < vtkIdType , CellArrayTag > chandle ( cstorage ) ; auto ts_ptr = static_cast < DATUInt8Type * > ( types ) ; vtkm :: cont :: ArrayHandle < vtkm :: UInt8 > thandle = vtkm :: cont :: make_ArrayHandle ( ts_ptr -> GetPointer ( 0 ) , ts_ptr -> GetNumberOfTuples ( ) ) ; auto ls_ptr = static_cast < DATIdType * > ( locations ) ; vtkm :: cont :: ArrayHandle < vtkIdType > lhandle = vtkm :: cont :: make_ArrayHandle ( ls_ptr -> GetPointer ( 0 ) , ls_ptr -> GetNumberOfTuples ( ) ) ; vtkm :: cont :: vtkmCellSetExplicitAOS cellset ; cellset . Fill ( numberOfPoints , thandle , chandle , lhandle ) ; return vtkm :: cont :: DynamicCellSet ( cellset ) ; }
convert a cell array of mixed types to a vtkm CellSetExplicit
convert a cell array of mixed types to a vtkm CellSetExplicit
// create the storage containers for everything