29#ifndef vtkmDataArray_h
30#define vtkmDataArray_h
32#include "vtkAcceleratorsVTKmCoreModule.h"
34#include "vtkmConfigCore.h"
36#include <vtkm/VecTraits.h>
37#include <vtkm/cont/ArrayHandle.h>
38#include <vtkm/cont/UnknownArrayHandle.h>
44VTK_ABI_NAMESPACE_BEGIN
55VTK_ABI_NAMESPACE_BEGIN
59 static_assert(std::is_arithmetic<T>::value,
"T must be an integral or floating-point type");
66 using typename Superclass::ValueType;
99 using Superclass::ComputeScalarRange;
101 double* ranges,
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
102 using Superclass::ComputeVectorRange;
104 double range[2],
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
105 using Superclass::ComputeFiniteScalarRange;
107 double* ranges,
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
108 using Superclass::ComputeFiniteVectorRange;
110 double range[2],
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
121 mutable std::unique_ptr<fromvtkm::ArrayHandleHelperBase<T>> Helper;
128template <
typename T,
typename S>
130 const vtkm::cont::ArrayHandle<T, S>& ah)
133 ret->SetVtkmArrayHandle(ah);
138#ifndef vtkmDataArray_cxx
157#include "vtkmlib/vtkmDataArray.hxx"
Abstract superclass for all arrays.
Base interface for all typed vtkDataArray subclasses.
Wraps a VTK-m 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)
vtkm::cont::UnknownArrayHandle GetVtkmUnknownArrayHandle() const
Get the underlying ArrayHandle.
void SetVtkmArrayHandle(const vtkm::cont::UnknownArrayHandle &ah)
Set the VTK-m ArrayHandle to be wrapped.
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
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)
vtkmDataArray< typename vtkm::VecTraits< T >::BaseComponentType > * make_vtkmDataArray(const vtkm::cont::ArrayHandle< T, S > &ah)