17#ifndef vtkmlib_DataArrayConverters_h
18#define vtkmlib_DataArrayConverters_h
20#include "vtkAcceleratorsVTKmCoreModule.h"
21#include "vtkmConfigCore.h"
26#include <vtkm/cont/ArrayHandleSOA.h>
27#include <vtkm/cont/Field.h>
28#include <vtkm/cont/UnknownArrayHandle.h>
39class CoordinateSystem;
46template <
typename DataArrayType, vtkm::IdComponent NumComponents>
49template <
typename T, vtkm::IdComponent NumComponents>
53 typename std::conditional<NumComponents == 1, T, vtkm::Vec<T, NumComponents>>::type;
54 using StorageType = vtkm::cont::internal::Storage<ValueType, vtkm::cont::StorageTagBasic>;
55 using ArrayHandleType = vtkm::cont::ArrayHandle<ValueType, vtkm::cont::StorageTagBasic>;
64template <
typename T, vtkm::IdComponent NumComponents>
68 using StorageType = vtkm::cont::internal::Storage<ValueType, vtkm::cont::StorageTagSOA>;
69 using ArrayHandleType = vtkm::cont::ArrayHandle<ValueType, vtkm::cont::StorageTagSOA>;
74 vtkm::cont::ArrayHandleSOA<ValueType> handle;
75 for (vtkm::IdComponent i = 0; i < NumComponents; ++i)
79 numValues, vtkm::CopyFlag::Off));
89 using StorageType = vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic>;
94 return vtkm::cont::make_ArrayHandle(
113VTKACCELERATORSVTKMCORE_EXPORT
116VTKACCELERATORSVTKMCORE_EXPORT
119VTKACCELERATORSVTKMCORE_EXPORT
126 using T = std::underlying_type<tovtkm::FieldsFlag>::type;
132 using T = std::underlying_type<tovtkm::FieldsFlag>::type;
tovtkm::FieldsFlag operator&(const tovtkm::FieldsFlag &a, const tovtkm::FieldsFlag &b)
tovtkm::FieldsFlag operator|(const tovtkm::FieldsFlag &a, const tovtkm::FieldsFlag &b)
Array-Of-Structs implementation of vtkGenericDataArray.
ValueType * GetPointer(vtkIdType valueIdx)
Get the address of a particular data index.
vtkIdType GetNumberOfTuples() const
Get the number of complete tuples (a component group) in the array.
abstract superclass for arrays of numeric data
represent and manipulate 3D points
Struct-Of-Arrays implementation of vtkGenericDataArray.
ValueType * GetComponentArrayPointer(int comp)
Return a pointer to a contiguous block of memory containing all values for a particular components (i...
VTKACCELERATORSVTKMCORE_EXPORT vtkDataArray * Convert(const vtkm::cont::Field &input)
typename std::conditional< NumComponents==1, T, vtkm::Vec< T, NumComponents > >::type ValueType
vtkm::cont::ArrayHandle< ValueType, vtkm::cont::StorageTagBasic > ArrayHandleType
vtkm::cont::internal::Storage< ValueType, vtkm::cont::StorageTagBasic > StorageType
static ArrayHandleType Wrap(vtkAOSDataArrayTemplate< T > *input)
static ArrayHandleType Wrap(vtkSOADataArrayTemplate< T > *input)
vtkm::cont::ArrayHandle< T, vtkm::cont::StorageTagBasic > ArrayHandleType
vtkm::cont::internal::Storage< T, vtkm::cont::StorageTagBasic > StorageType
vtkm::Vec< T, NumComponents > ValueType
vtkm::cont::internal::Storage< ValueType, vtkm::cont::StorageTagSOA > StorageType
static ArrayHandleType Wrap(vtkSOADataArrayTemplate< T > *input)
vtkm::cont::ArrayHandle< ValueType, vtkm::cont::StorageTagSOA > ArrayHandleType