VTK
FieldTypeToType.h
Go to the documentation of this file.
1//=============================================================================
2//
3// Copyright (c) Kitware, Inc.
4// All rights reserved.
5// See LICENSE.txt for details.
6//
7// This software is distributed WITHOUT ANY WARRANTY; without even
8// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9// PURPOSE. See the above copyright notice for more information.
10//
11// Copyright 2012 Sandia Corporation.
12// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
13// the U.S. Government retains certain rights in this software.
14//
15//=============================================================================
16
17#ifndef vtkToDax_FieldTypeToType_h
18#define vtkToDax_FieldTypeToType_h
19
20#include <stdint.h>
21
22class vtkIntArray;
23class vtkIdTypeArray;
24class vtkFloatArray;
26
27#include <dax/Types.h>
28
29namespace vtkToDax
30{
31
32namespace internal {
33
34template<int NUM_COMP>
35struct IdType
36{
37 static const int NUM_COMPONENTS = NUM_COMP;
38 typedef dax::Tuple<dax::Id,NUM_COMPONENTS> DaxValueType;
39 typedef dax::Id DaxComponentType;
40};
41
42template<>
43struct IdType<1>
44{
45 static const int NUM_COMPONENTS = 1;
46 typedef dax::Id DaxValueType;
47 typedef dax::Id DaxComponentType;
48};
49
50template<int NUM_COMP>
52{
53 static const int NUM_COMPONENTS = NUM_COMP;
54 typedef dax::Tuple<dax::Scalar,NUM_COMPONENTS> DaxValueType;
55 typedef dax::Scalar DaxComponentType;
56};
57
58template<>
59struct ScalarType<1>
60{
61 static const int NUM_COMPONENTS = 1;
62 typedef dax::Scalar DaxValueType;
63 typedef dax::Scalar DaxComponentType;
64};
65
66} // namespace internal
67
68template<typename VTKArrayType, int NUM_COMP> struct FieldTypeToType;
69
70template<int NUM_COMP>
71struct FieldTypeToType<vtkIntArray,NUM_COMP> : internal::IdType<NUM_COMP>
72{
73 typedef int VTKComponentType;
74};
75
76template<int NUM_COMP>
78{
80};
81
82
83template<int NUM_COMP>
85{
86 typedef float VTKComponentType;
87};
88
89template<int NUM_COMP>
91{
92 typedef double VTKComponentType;
93};
94
95template<int NUM_COMP>
97{
98 static const int NUM_COMPNENTS = NUM_COMP;
99 typedef dax::Tuple<uint8_t,NUM_COMPNENTS> DaxValueType;
100 typedef uint8_t DaxComponentType;
101 typedef uint8_t VTKComponentType;
102};
103
104template<>
106{
107 static const int NUM_COMPNENTS = 1;
108 typedef uint8_t DaxValueType;
109 typedef uint8_t DaxComponentType;
110 typedef uint8_t VTKComponentType;
111};
112}
113
114#endif // vtkToDax_FieldTypeToType_h
dynamic, self-adjusting array of double
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
dynamic, self-adjusting array of vtkIdType
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:46
dynamic, self-adjusting array of unsigned char
dax::Tuple< dax::Id, NUM_COMPONENTS > DaxValueType
static const int NUM_COMPONENTS
dax::Tuple< dax::Scalar, NUM_COMPONENTS > DaxValueType
int vtkIdType
Definition: vtkType.h:287