VTK-m  2.2
Public Types | Public Member Functions | Private Types | 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 Thisclass = typename vtkm::cont::detail::GetTypeInParentheses< void(ArrayHandleSwizzle< ArrayHandleType, OutSize >) >::type
 
using Superclass = typename vtkm::cont::detail::GetTypeInParentheses< void(typename Traits::Superclass) >::type
 
using ValueType = typename Superclass::ValueType
 
using StorageTag = typename Superclass::StorageTag
 
using StorageType = typename Superclass::StorageType
 
using ReadPortalType = typename Superclass::ReadPortalType
 
using WritePortalType = typename Superclass::WritePortalType
 
using MapType = typename Traits::MapType
 
- Public Types inherited from vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >
using Thisclass = typename vtkm::cont::detail::GetTypeInParentheses< void(ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >) >::type
 
using Superclass = typename vtkm::cont::detail::GetTypeInParentheses< void(vtkm::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType > >) >::type
 
using ValueType = typename Superclass::ValueType
 
using StorageTag = typename Superclass::StorageTag
 
using StorageType = typename Superclass::StorageType
 
using ReadPortalType = typename Superclass::ReadPortalType
 
using WritePortalType = typename Superclass::WritePortalType
 

Public Member Functions

 ArrayHandleSwizzle ()
 
VTKM_CONT ArrayHandleSwizzle (const Thisclass &src)
 
VTKM_CONT ArrayHandleSwizzle (Thisclass &&src) noexcept
 
VTKM_CONT ArrayHandleSwizzle (const vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &src)
 
VTKM_CONT ArrayHandleSwizzle (vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&src) noexcept
 
VTKM_CONT ArrayHandleSwizzle (const std::vector< vtkm::cont::internal::Buffer > &buffers)
 
VTKM_CONT ArrayHandleSwizzle (std::vector< vtkm::cont::internal::Buffer > &&buffers) noexcept
 
VTKM_CONT Thisclassoperator= (const Thisclass &src)
 
VTKM_CONT Thisclassoperator= (Thisclass &&src) noexcept
 
 ArrayHandleSwizzle (const ArrayHandleType &array, const MapType &map)
 Construct an ArrayHandleSwizzle with a source array and a swizzle map. More...
 
- Public Member Functions inherited from vtkm::cont::ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >
 ArrayHandleTransform ()
 
VTKM_CONT ArrayHandleTransform (const Thisclass &src)
 
VTKM_CONT ArrayHandleTransform (Thisclass &&src) noexcept
 
VTKM_CONT ArrayHandleTransform (const vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &src)
 
VTKM_CONT ArrayHandleTransform (vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&src) noexcept
 
VTKM_CONT ArrayHandleTransform (const std::vector< vtkm::cont::internal::Buffer > &buffers)
 
VTKM_CONT ArrayHandleTransform (std::vector< vtkm::cont::internal::Buffer > &&buffers) noexcept
 
VTKM_CONT Thisclassoperator= (const Thisclass &src)
 
VTKM_CONT Thisclassoperator= (Thisclass &&src) noexcept
 
 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 >
 

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

◆ ReadPortalType

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ReadPortalType = typename Superclass::ReadPortalType

◆ StorageTag

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::StorageTag = typename Superclass::StorageTag

◆ StorageType

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::StorageType = typename Superclass::StorageType

◆ Superclass

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::Superclass = typename vtkm::cont::detail::GetTypeInParentheses<void (typename Traits::Superclass) >::type

◆ Thisclass

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::Thisclass = typename vtkm::cont::detail::GetTypeInParentheses<void (ArrayHandleSwizzle<ArrayHandleType, OutSize>) >::type

◆ Traits

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

◆ ValueType

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ValueType = typename Superclass::ValueType

◆ WritePortalType

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
using vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::WritePortalType = typename Superclass::WritePortalType

Constructor & Destructor Documentation

◆ ArrayHandleSwizzle() [1/8]

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

◆ ArrayHandleSwizzle() [2/8]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ArrayHandleSwizzle ( const Thisclass src)
inline

◆ ArrayHandleSwizzle() [3/8]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ArrayHandleSwizzle ( Thisclass &&  src)
inlinenoexcept

◆ ArrayHandleSwizzle() [4/8]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ArrayHandleSwizzle ( const vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &  src)
inline

◆ ArrayHandleSwizzle() [5/8]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ArrayHandleSwizzle ( vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&  src)
inlinenoexcept

◆ ArrayHandleSwizzle() [6/8]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ArrayHandleSwizzle ( const std::vector< vtkm::cont::internal::Buffer > &  buffers)
inlineexplicit

◆ ArrayHandleSwizzle() [7/8]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::ArrayHandleSwizzle ( std::vector< vtkm::cont::internal::Buffer > &&  buffers)
inlineexplicitnoexcept

◆ ArrayHandleSwizzle() [8/8]

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

Construct an ArrayHandleSwizzle with a source array and a swizzle map.

The swizzle map is a vtkm::Vec containing vtkm::IdComponent components and sized to the number of components in the array. Each value in the map specifies from which component of the input the corresponding component of the output should come from.

Member Function Documentation

◆ operator=() [1/2]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT Thisclass& vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::operator= ( const Thisclass src)
inline

◆ operator=() [2/2]

template<typename ArrayHandleType , vtkm::IdComponent OutSize>
VTKM_CONT Thisclass& vtkm::cont::ArrayHandleSwizzle< ArrayHandleType, OutSize >::operator= ( Thisclass &&  src)
inlinenoexcept

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