|
| VTKM_ARRAY_HANDLE_SUBCLASS (ArrayHandleSwizzle,(ArrayHandleSwizzle< ArrayHandleType, OutSize >),(typename Traits::Superclass)) |
|
VTKM_CONT | ArrayHandleSwizzle (const ArrayHandleType &array, const MapType &map) |
|
Public Member Functions inherited from vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType > |
| VTKM_ARRAY_HANDLE_SUBCLASS (ArrayHandleTransform,(ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >),(vtkm::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >>)) |
|
| ArrayHandleTransform (const ArrayHandleType &handle, const FunctorType &functor=FunctorType(), const InverseFunctorType &inverseFunctor=InverseFunctorType()) |
|
| ~ArrayHandleTransform () |
| Implemented so that it is defined exclusively in the control environment. More...
|
|
ArrayHandleType | GetTransformedArray () const |
| Returns the ArrayHandle that is being transformed. More...
|
|
FunctorType | GetFunctor () const |
| Returns the functor transforming the ArrayHandle . More...
|
|
InverseFunctorType | GetInverseFunctor () const |
| Returns the inverse functor transforming the ArrayHandle More...
|
|
template<typename ArrayHandleType, vtkm::IdComponent OutSize>
class vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >
Swizzle the components of the values in an ArrayHandle
.
Given an ArrayHandle
with Vec
values, ArrayHandleSwizzle
allows you to reorder the components of all the Vec
values. This reordering is done in place, so the array does not have to be duplicated.
The resulting array does not have to contain all of the components of the input. For example, you could use ArrayHandleSwizzle
to drop one of the components of each vector. However, if you do that, then the swizzled array is read-only. If there is a 1:1 map from input components to output components, writing to the array will be enabled.
The swizzle map given to ArrayHandleSwizzle
must comprise valid component indices (between 0 and number of components - 1). Also, the component indices should not be repeated, particularly if you expect to write to the array. These conditions are not checked.