Go to the documentation of this file.
10 #ifndef vtk_m_cont_ArrayHandleOffsetsToNumComponents_h
11 #define vtk_m_cont_ArrayHandleOffsetsToNumComponents_h
22 template <
typename OffsetsPortal>
28 ArrayPortalOffsetsToNumComponents() =
default;
30 ArrayPortalOffsetsToNumComponents(
const OffsetsPortal& portal)
41 return static_cast<vtkm::IdComponent>(this->Portal.Get(index + 1) - this->Portal.Get(index));
53 template <
typename OffsetsStorageTag>
61 template <
typename OffsetsStorageTag>
65 using OffsetsStorage = vtkm::cont::internal::Storage<vtkm::Id, OffsetsStorageTag>;
71 using ReadPortalType =
72 vtkm::internal::ArrayPortalOffsetsToNumComponents<typename OffsetsStorage::ReadPortalType>;
74 VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers()
76 return OffsetsStorage::CreateBuffers();
80 const std::vector<vtkm::cont::internal::Buffer>& buffers)
82 vtkm::Id numOffsets = OffsetsStorage::GetNumberOfValues(buffers);
86 "ArrayHandleOffsetsToNumComponents requires an offsets array with at least one value.");
88 return numOffsets - 1;
91 VTKM_CONT static ReadPortalType CreateReadPortal(
92 const std::vector<vtkm::cont::internal::Buffer>& buffers,
96 VTKM_ASSERT(OffsetsStorage::GetNumberOfValues(buffers) > 0);
97 return ReadPortalType(OffsetsStorage::CreateReadPortal(buffers, device, token));
128 template <
class OffsetsArray>
132 vtkm::cont::StorageTagOffsetsToNumComponents<typename OffsetsArray::StorageTag>>
136 "Offsets array must have a value type of vtkm::Id.");
147 : Superclass(array.GetBuffers())
152 template <
typename OffsetsStorageTag>
165 #endif //vtk_m_cont_ArrayHandleOffsetsToNumComponents_h
VTKM_CONT vtkm::cont::ArrayHandleOffsetsToNumComponents< vtkm::cont::ArrayHandle< vtkm::Id, OffsetsStorageTag > > make_ArrayHandleOffsetsToNumComponents(const vtkm::cont::ArrayHandle< vtkm::Id, OffsetsStorageTag > &array)
Definition: ArrayHandleOffsetsToNumComponents.h:155
Manages an array-worth of data.
Definition: ArrayHandle.h:283
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass)
Macro to make default methods in ArrayHandle subclasses.
Definition: ArrayHandle.h:226
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto Get(const vtkm::Tuple< Ts... > &tuple) -> decltype(tuple.template Get< Index >())
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:83
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
Definition: ArrayHandleOffsetsToNumComponents.h:54
#define VTKM_STORAGE_NO_RESIZE
Definition: Storage.h:185
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
#define VTKM_STORAGE_NO_WRITE_PORTAL
Definition: Storage.h:198
VTKM_CONT ArrayHandleOffsetsToNumComponents(const OffsetsArray &array)
Definition: ArrayHandleOffsetsToNumComponents.h:146
#define VTKM_IS_ARRAY_HANDLE(T)
Definition: ArrayHandle.h:132
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
#define VTKM_CONT
Definition: ExportMacros.h:57
Definition: DeviceAdapterTag.h:52
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
An ArrayHandle that converts an array of offsets to an array of Vec sizes.
Definition: ArrayHandleOffsetsToNumComponents.h:129
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92