6#ifndef vtkmlib_DataArrayConverters_h
7#define vtkmlib_DataArrayConverters_h
9#include "vtkAcceleratorsVTKmCoreModule.h"
10#include "vtkmConfigCore.h"
15#include <vtkm/cont/ArrayHandleSOA.h>
16#include <vtkm/cont/Field.h>
17#include <vtkm/cont/UnknownArrayHandle.h>
25class CoordinateSystem;
29VTK_ABI_NAMESPACE_BEGIN
36VTK_ABI_NAMESPACE_BEGIN
43 static const char* name =
"NoNameVTKField";
47template <
typename DataArrayType, vtkm::IdComponent NumComponents>
50template <
typename T, vtkm::IdComponent NumComponents>
54 typename std::conditional<NumComponents == 1, T, vtkm::Vec<T, NumComponents>>::type;
55 using StorageType = vtkm::cont::internal::Storage<ValueType, vtkm::cont::StorageTagBasic>;
56 using ArrayHandleType = vtkm::cont::ArrayHandle<ValueType, vtkm::cont::StorageTagBasic>;
65template <
typename T, vtkm::IdComponent NumComponents>
69 using StorageType = vtkm::cont::internal::Storage<ValueType, vtkm::cont::StorageTagSOA>;
70 using ArrayHandleType = vtkm::cont::ArrayHandle<ValueType, vtkm::cont::StorageTagSOA>;
75 vtkm::cont::ArrayHandleSOA<ValueType> handle;
76 for (vtkm::IdComponent i = 0; i < NumComponents; ++i)
80 numValues, vtkm::CopyFlag::Off));
83 return std::move(handle);
90 using StorageType = vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic>;
95 return vtkm::cont::make_ArrayHandle(
114VTK_ABI_NAMESPACE_BEGIN
116VTKACCELERATORSVTKMCORE_EXPORT
119VTKACCELERATORSVTKMCORE_EXPORT
122VTKACCELERATORSVTKMCORE_EXPORT
128VTK_ABI_NAMESPACE_BEGIN
131 using T = std::underlying_type<tovtkm::FieldsFlag>::type;
137 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)
static const char * NoNameVTKFieldName()
Temporary name for arrays converted from VTK that do not have a name.
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