6 #ifndef vtkmlib_PortalTraits_h
7 #define vtkmlib_PortalTraits_h
9 #include "vtkmConfigCore.h"
11 #include <viskores/Types.h>
12 #include <viskores/internal/Assume.h>
14 #include <type_traits>
18 VTK_ABI_NAMESPACE_BEGIN
20 struct vtkPortalOfVecOfVecValues;
21 struct vtkPortalOfVecOfValues;
22 struct vtkPortalOfScalarValues;
37 template <
typename T,
int N>
42 using Type = viskores::Vec<T, N>;
47 VISKORES_ASSUME((i >= 0 && i < N));
53 VISKORES_ASSUME((i >= 0 && i < N));
58 template <
typename T,
int N>
63 using Type = viskores::Vec<T, N>;
68 VISKORES_ASSUME((i >= 0 && i < N));
74 VISKORES_ASSUME((i >= 0 && i < N));
79 template <
typename T,
int N,
int M>
82 using TagType = vtkPortalOfVecOfVecValues;
84 using Type = viskores::Vec<viskores::Vec<T, N>, M>;
87 static constexpr viskores::IdComponent NUM_COMPONENTS_OUTER = M;
88 static constexpr viskores::IdComponent NUM_COMPONENTS_INNER = N;
92 VISKORES_ASSUME((i >= 0 && i < NUM_COMPONENTS));
94 const viskores::IdComponent j = i % N;
100 VISKORES_ASSUME((i >= 0 && i < NUM_COMPONENTS));
102 const viskores::IdComponent j = i % N;
107 template <
typename T,
int N,
int M>
112 using Type = viskores::Vec<viskores::Vec<T, N>, M>;
115 static constexpr viskores::IdComponent NUM_COMPONENTS_OUTER = M;
116 static constexpr viskores::IdComponent NUM_COMPONENTS_INNER = N;
120 VISKORES_ASSUME((i >= 0 && i < NUM_COMPONENTS));
122 const viskores::IdComponent j = i % N;
128 VISKORES_ASSUME((i >= 0 && i < NUM_COMPONENTS));
130 const viskores::IdComponent j = i % N;
135 VTK_ABI_NAMESPACE_END
138 #endif // vtkmlib_PortalsTraits_h
typename std::remove_const< T >::type ComponentType
static ComponentType GetComponent(const Type &t, viskores::IdComponent i)
typename std::remove_const< T >::type ComponentType
static void SetComponent(Type &t, viskores::IdComponent i, const ComponentType &v)
vtkPortalOfVecOfVecValues TagType
static void SetComponent(Type &t, viskores::IdComponent i, const ComponentType &v)
viskores::Vec< viskores::Vec< T, N >, M > Type
static ComponentType GetComponent(const Type &t, viskores::IdComponent)
vtkPortalOfVecOfValues TagType
static void SetComponent(Type &t, viskores::IdComponent i, const ComponentType &v)
vtkPortalOfVecOfVecValues TagType
vtkPortalOfVecOfValues TagType
static ComponentType GetComponent(const Type &t, viskores::IdComponent i)
vtkPortalOfScalarValues TagType
typename std::remove_const< T >::type ComponentType
viskores::Vec< T, N > Type
viskores::Vec< viskores::Vec< T, N >, M > Type
typename std::remove_const< T >::type ComponentType
static void SetComponent(Type &t, viskores::IdComponent, const ComponentType &v)
static constexpr viskores::IdComponent NUM_COMPONENTS
viskores::Vec< T, N > Type
static ComponentType GetComponent(const Type &t, viskores::IdComponent i)
static void SetComponent(Type &t, viskores::IdComponent i, const ComponentType &v)
typename std::remove_const< T >::type ComponentType
static ComponentType GetComponent(const Type &t, viskores::IdComponent i)