DefaultTypesVTK.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_cont_internal_DefaultTypesVTK_h
19 #define viskores_cont_internal_DefaultTypesVTK_h
20 
21 // This configures the default types to use when compiling Viskores for use as an
22 // accelerator in VTK.
23 
24 #include <viskores/TypeList.h>
25 
26 #include <viskores/cont/CellSetList.h>
27 #include <viskores/cont/StorageList.h>
28 
29 /* #undef VISKORES_ADD_XGC_DEFAULT_TYPES */
30 
31 #ifdef VISKORES_ADD_XGC_DEFAULT_TYPES
32 #include <viskores/cont/ArrayHandleCartesianProduct.h>
33 #include <viskores/cont/ArrayHandleUniformPointCoordinates.h>
34 #include <viskores/cont/ArrayHandleXGCCoordinates.h>
35 #include <viskores/cont/StorageList.h>
36 #endif
37 
38 namespace toviskores
39 {
40 
41 //------------------------------------------------------------------------------
42 // All scalar types in vtkType.h
43 using VTKScalarTypes = viskores::List< //
44  signed char, //
45  unsigned char, //
46  short, //
47  unsigned short, //
48  int, //
49  unsigned int, //
50  long long, //
51  unsigned long long, //
52  float, //
53  double, //
54  char, //
55  long, //
56  unsigned long //
57  >;
58 
60  viskores::List<viskores::Vec<viskores::Vec<viskores::Float32, 3>, 3>, viskores::Vec<viskores::Vec<viskores::Float64, 3>, 3> >;
61 
62 using FieldTypeInVTK = viskores::ListAppend<viskores::TypeListVecCommon, VTKScalarTypes>;
63 
64 using FieldTypeOutVTK =
65  viskores::ListAppend<viskores::TypeListVecCommon, SpecialGradientOutTypes, VTKScalarTypes>;
66 
67 //------------------------------------------------------------------------------
69  viskores::List<viskores::cont::CellSetStructured<3>, viskores::cont::CellSetStructured<2>, viskores::cont::CellSetStructured<1> >;
71 
72 // vtkCellArray may use either 32 or 64 bit arrays to hold connectivity/offset
73 // data, so we may be using ArrayHandleCast to convert to viskores::Ids.
74 #ifdef VISKORES_USE_64BIT_IDS
75 using Int32AOSHandle = viskores::cont::ArrayHandle<viskores::Int32>;
76 using Int32AsIdAOSHandle = viskores::cont::ArrayHandleCast<viskores::Id, Int32AOSHandle>;
77 using Int32AsIdAOSStorage = typename Int32AsIdAOSHandle::StorageTag;
78 
79 using CellSetExplicit32Bit = viskores::cont::CellSetExplicit<viskores::cont::StorageTagBasic,
80  Int32AsIdAOSStorage, Int32AsIdAOSStorage>;
81 using CellSetExplicit64Bit = viskores::cont::CellSetExplicit<viskores::cont::StorageTagBasic,
82  viskores::cont::StorageTagBasic, viskores::cont::StorageTagBasic>;
83 using CellSetSingleType32Bit = viskores::cont::CellSetSingleType<Int32AsIdAOSStorage>;
84 using CellSetSingleType64Bit = viskores::cont::CellSetSingleType<viskores::cont::StorageTagBasic>;
85 #else // VISKORES_USE_64BIT_IDS
86 using Int64AOSHandle = viskores::cont::ArrayHandle<viskores::Int64, viskores::cont::StorageTagBasic>;
87 using Int64AsIdAOSHandle = viskores::cont::ArrayHandleCast<viskores::Id, Int64AOSHandle>;
88 using Int64AsIdAOSStorage = typename Int64AsIdAOSHandle::StorageTag;
89 
90 using CellSetExplicit32Bit = viskores::cont::CellSetExplicit<viskores::cont::StorageTagBasic,
91  viskores::cont::StorageTagBasic, viskores::cont::StorageTagBasic>;
92 using CellSetExplicit64Bit = viskores::cont::CellSetExplicit<viskores::cont::StorageTagBasic,
94 using CellSetSingleType32Bit = viskores::cont::CellSetSingleType<viskores::cont::StorageTagBasic>;
95 using CellSetSingleType64Bit = viskores::cont::CellSetSingleType<Int64AsIdAOSStorage>;
96 #endif // VISKORES_USE_64BIT_IDS
97 
98 //------------------------------------------------------------------------------
99 using CellListUnstructuredInVTK = viskores::List< //
104  viskores::cont::CellSetExtrude //
105  >;
106 
107 using CellListUnstructuredOutVTK = viskores::List< //
108  viskores::cont::CellSetExplicit<>, //
109  viskores::cont::CellSetSingleType<>, //
113  CellSetSingleType64Bit //
114  >;
115 
116 //------------------------------------------------------------------------------
117 using CellListAllInVTK = viskores::ListAppend<CellListStructuredInVTK, CellListUnstructuredInVTK>;
118 using CellListAllOutVTK = viskores::ListAppend<CellListStructuredOutVTK, CellListUnstructuredOutVTK>;
119 
120 #ifdef VISKORES_ADD_XGC_DEFAULT_TYPES
121 using StorageListField = viskores::ListAppend<
122  viskores::List<viskores::cont::StorageTagXGCCoordinates>,
123  viskores::cont::StorageListCommon>;
124 #endif
125 
126 } // end namespace toviskores
127 
128 #define VISKORES_DEFAULT_TYPE_LIST ::toviskores::FieldTypeInVTK
129 #define VISKORES_DEFAULT_CELL_SET_LIST_STRUCTURED ::toviskores::CellListStructuredInVTK
130 #define VISKORES_DEFAULT_CELL_SET_LIST_UNSTRUCTURED ::toviskores::CellListUnstructuredInVTK
131 
132 #ifdef VISKORES_ADD_XGC_DEFAULT_TYPES
133 #define VISKORES_DEFAULT_STORAGE_LIST ::toviskores::StorageListField
134 #endif
135 
136 #endif //viskores_cont_internal_DefaultTypesVTK_h
viskores::List< viskores::Vec< viskores::Vec< viskores::Float32, 3 >, 3 >, viskores::Vec< viskores::Vec< viskores::Float64, 3 >, 3 > > SpecialGradientOutTypes
int
viskores::cont::CellSetSingleType< Int64AsIdAOSStorage > CellSetSingleType64Bit
viskores::List< viskores::cont::CellSetStructured< 3 >, viskores::cont::CellSetStructured< 2 >, viskores::cont::CellSetStructured< 1 > > CellListStructuredInVTK
viskores::cont::ArrayHandleCast< viskores::Id, Int64AOSHandle > Int64AsIdAOSHandle
CellListStructuredInVTK CellListStructuredOutVTK
viskores::List< signed char, unsigned char, short, unsigned short, int, unsigned int, long long, unsigned long long, float, double, char, long, unsigned long > VTKScalarTypes
viskores::List< CellSetExplicit32Bit, CellSetExplicit64Bit, CellSetSingleType32Bit, CellSetSingleType64Bit, viskores::cont::CellSetExtrude > CellListUnstructuredInVTK
viskores::ListAppend< viskores::TypeListVecCommon, VTKScalarTypes > FieldTypeInVTK
float
double
viskores::ListAppend< CellListStructuredOutVTK, CellListUnstructuredOutVTK > CellListAllOutVTK
viskores::cont::CellSetSingleType< viskores::cont::StorageTagBasic > CellSetSingleType32Bit
viskores::cont::CellSetExplicit< viskores::cont::StorageTagBasic, viskores::cont::StorageTagBasic, viskores::cont::StorageTagBasic > CellSetExplicit32Bit
viskores::ListAppend< viskores::TypeListVecCommon, SpecialGradientOutTypes, VTKScalarTypes > FieldTypeOutVTK
typename Int64AsIdAOSHandle::StorageTag Int64AsIdAOSStorage
viskores::ListAppend< CellListStructuredInVTK, CellListUnstructuredInVTK > CellListAllInVTK
viskores::cont::ArrayHandle< viskores::Int64, viskores::cont::StorageTagBasic > Int64AOSHandle
viskores::cont::CellSetExplicit< viskores::cont::StorageTagBasic, Int64AsIdAOSStorage, Int64AsIdAOSStorage > CellSetExplicit64Bit
viskores::List< viskores::cont::CellSetExplicit<>, viskores::cont::CellSetSingleType<>, CellSetExplicit32Bit, CellSetExplicit64Bit, CellSetSingleType32Bit, CellSetSingleType64Bit > CellListUnstructuredOutVTK