VTK-m  2.0
Public Types | Public Member Functions | Private Types | Private Member Functions | List of all members
vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize > Class Template Reference

Swizzle the components of the values in an ArrayHandle. More...

#include <ArrayHandleSwizzle.h>

Inheritance diagram for vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >:
vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >

Public Types

using MapType = typename Traits::MapType
 

Public Member Functions

 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...
 

Private Types

using Traits = detail::ArrayHandleSwizzleTraits< ArrayHandleType, OutSize >
 

Private Member Functions

 VTKM_IS_ARRAY_HANDLE (ArrayHandleType)
 

Detailed Description

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.

Member Typedef Documentation

◆ MapType

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::MapType = typename Traits::MapType

◆ Traits

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::Traits = detail::ArrayHandleSwizzleTraits<ArrayHandleType, OutSize>
private

Constructor & Destructor Documentation

◆ ArrayHandleSwizzle()

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ArrayHandleSwizzle ( const ArrayHandleType &  array,
const MapType map 
)
inline

Member Function Documentation

◆ VTKM_ARRAY_HANDLE_SUBCLASS()

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::VTKM_ARRAY_HANDLE_SUBCLASS ( ArrayHandleSwizzle< ArrayHandleType, OutSize >  ,
(ArrayHandleSwizzle< ArrayHandleType, OutSize >)  ,
(typename Traits::Superclass  
)

◆ VTKM_IS_ARRAY_HANDLE()

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::VTKM_IS_ARRAY_HANDLE ( ArrayHandleType  )
private

The documentation for this class was generated from the following file: