28#ifndef vtkmDataArray_h
29#define vtkmDataArray_h
31#include "vtkAcceleratorsVTKmCoreModule.h"
33#include "vtkmConfigCore.h"
35#include <viskores/VecTraits.h>
36#include <viskores/cont/ArrayHandle.h>
37#include <viskores/cont/UnknownArrayHandle.h>
43VTK_ABI_NAMESPACE_BEGIN
54VTK_ABI_NAMESPACE_BEGIN
58 static_assert(std::is_arithmetic<T>::value,
"T must be an integral or floating-point type");
65 using typename Superclass::ValueType;
98 using Superclass::ComputeScalarRange;
100 double* ranges,
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
101 using Superclass::ComputeVectorRange;
103 double range[2],
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
104 using Superclass::ComputeFiniteScalarRange;
106 double* ranges,
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
107 using Superclass::ComputeFiniteVectorRange;
109 double range[2],
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
120 mutable std::unique_ptr<fromvtkm::ArrayHandleHelperBase<T>> Helper;
127template <
typename T,
typename S>
129 const viskores::cont::ArrayHandle<T, S>& ah)
132 ret->SetVtkmArrayHandle(ah);
137#ifndef vtkmDataArray_cxx
156#include "vtkmlib/vtkmDataArray.hxx"
Abstract superclass for all arrays.
Base interface for all typed vtkDataArray subclasses.
Wraps a Viskores ArrayHandle inside a sub-class of vtkGenericDataArray.
bool ComputeVectorRange(double range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Returns true if the range was computed.
void * GetVoidPointer(vtkIdType valueIdx) override
ValueType GetValue(vtkIdType valueIdx) const
Support methods for vtkGenericDataArray.
void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues) override
bool ComputeFiniteVectorRange(double range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Returns true if the range was computed.
void SetValue(vtkIdType valueIdx, ValueType value)
void SetTypedTuple(vtkIdType tupleIdx, const ValueType *tuple)
~vtkmDataArray() override
void SetTypedComponent(vtkIdType tupleIdx, int compIdx, ValueType value)
bool ComputeFiniteScalarRange(double *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Computes the range for each component of an array, the length of ranges must be two times the number ...
static vtkmDataArray * New()
bool AllocateTuples(vtkIdType numberOfTuples)
concept methods for vtkGenericDataArray
void GetTypedTuple(vtkIdType tupleIdx, ValueType *tuple) const
ValueType GetTypedComponent(vtkIdType tupleIdx, int compIdx) const
viskores::cont::UnknownArrayHandle GetVtkmUnknownArrayHandle() const
Get the underlying ArrayHandle.
bool ComputeScalarRange(double *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Computes the range for each component of an array, the length of ranges must be two times the number ...
bool ReallocateTuples(vtkIdType numberOfTuples)
void SetVtkmArrayHandle(const viskores::cont::UnknownArrayHandle &ah)
Set the Viskores ArrayHandle to be wrapped.
vtkmDataArray< typename viskores::VecTraits< T >::BaseComponentType > * make_vtkmDataArray(const viskores::cont::ArrayHandle< T, S > &ah)