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>
18VTK_ABI_NAMESPACE_BEGIN
20struct vtkPortalOfVecOfVecValues;
21struct vtkPortalOfVecOfValues;
22struct vtkPortalOfScalarValues;
37template <
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));
58template <
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));
79template <
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;
94 const viskores::IdComponent j = i % N;
102 const viskores::IdComponent j = i % N;
107template <
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;
122 const viskores::IdComponent j = i % N;
130 const viskores::IdComponent j = i % N;
typename std::remove_const< T >::type ComponentType
viskores::Vec< T, N > Type
static void SetComponent(Type &t, viskores::IdComponent i, const ComponentType &v)
vtkPortalOfVecOfValues TagType
static ComponentType GetComponent(const Type &t, viskores::IdComponent i)
viskores::Vec< viskores::Vec< T, N >, M > Type
typename std::remove_const< T >::type ComponentType
vtkPortalOfVecOfVecValues TagType
static void SetComponent(Type &t, viskores::IdComponent i, const ComponentType &v)
static ComponentType GetComponent(const Type &t, viskores::IdComponent i)
static ComponentType GetComponent(const Type &t, viskores::IdComponent i)
viskores::Vec< T, N > Type
vtkPortalOfVecOfValues TagType
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)
viskores::Vec< viskores::Vec< T, N >, M > Type
typename std::remove_const< T >::type ComponentType
vtkPortalOfVecOfVecValues TagType
static void SetComponent(Type &t, viskores::IdComponent i, const ComponentType &v)
static ComponentType GetComponent(const Type &t, viskores::IdComponent)
static void SetComponent(Type &t, viskores::IdComponent, const ComponentType &v)
typename std::remove_const< T >::type ComponentType
static constexpr viskores::IdComponent NUM_COMPONENTS
vtkPortalOfScalarValues TagType