VTK  9.0.1
vtkmFilterPolicy.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 vtkmFilterPolicy_h
18 #define vtkmFilterPolicy_h
19 #ifndef __VTK_WRAP__
20 #ifndef VTK_WRAPPING_CXX
21 
22 #include "vtkmConfig.h" //required for general vtkm setup
23 
24 #include <vtkm/List.h>
25 #include <vtkm/cont/ArrayHandleCast.h>
26 #include <vtkm/cont/ArrayHandlePermutation.h>
27 #include <vtkm/cont/CellSetExplicit.h>
28 #include <vtkm/cont/CellSetPermutation.h>
29 #include <vtkm/cont/CellSetSingleType.h>
30 #include <vtkm/cont/CellSetStructured.h>
31 #include <vtkm/filter/PolicyDefault.h>
32 
33 namespace tovtkm
34 {
35 
36 //------------------------------------------------------------------------------
37 // All scalar types in vtkType.h
38 using VTKScalarTypes = vtkm::List< //
39  char, //
40  signed char, //
41  unsigned char, //
42  short, //
43  unsigned short, //
44  int, //
45  unsigned int, //
46  long, //
47  unsigned long, //
48  long long, //
49  unsigned long long, //
50  float, //
51  double //
52  >;
53 
55  vtkm::List<vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>, vtkm::Vec<vtkm::Vec<vtkm::Float64, 3>, 3> >;
56 
57 using FieldTypeInVTK = vtkm::ListAppend<vtkm::TypeListVecCommon, VTKScalarTypes>;
58 
59 using FieldTypeOutVTK =
60  vtkm::ListAppend<vtkm::TypeListVecCommon, SpecialGradientOutTypes, VTKScalarTypes>;
61 
62 //------------------------------------------------------------------------------
64  vtkm::List<vtkm::cont::CellSetStructured<3>, vtkm::cont::CellSetStructured<2> >;
66  vtkm::List<vtkm::cont::CellSetPermutation<vtkm::cont::CellSetStructured<3> >,
67  vtkm::cont::CellSetPermutation<vtkm::cont::CellSetStructured<2> > >;
68 
69 // vtkCellArray may use either 32 or 64 bit arrays to hold connectivity/offset
70 // data, so we may be using ArrayHandleCast to convert to vtkm::Ids.
71 #ifdef VTKM_USE_64BIT_IDS
72 using Int32AOSHandle = vtkm::cont::ArrayHandle<vtkTypeInt32>;
73 using Int32AsIdAOSHandle = vtkm::cont::ArrayHandleCast<vtkm::Id, Int32AOSHandle>;
74 using Int32AsIdAOSStorage = typename Int32AsIdAOSHandle::StorageTag;
75 
76 using CellSetExplicit32Bit = vtkm::cont::CellSetExplicit<vtkm::cont::StorageTagBasic,
77  Int32AsIdAOSStorage, Int32AsIdAOSStorage>;
78 using CellSetExplicit64Bit = vtkm::cont::CellSetExplicit<vtkm::cont::StorageTagBasic,
79  vtkm::cont::StorageTagBasic, vtkm::cont::StorageTagBasic>;
80 using CellSetSingleType32Bit = vtkm::cont::CellSetSingleType<Int32AsIdAOSStorage>;
81 using CellSetSingleType64Bit = vtkm::cont::CellSetSingleType<vtkm::cont::StorageTagBasic>;
82 #else // VTKM_USE_64BIT_IDS
83 using Int64AOSHandle = vtkm::cont::ArrayHandle<vtkTypeInt64, vtkm::cont::StorageTagBasic>;
84 using Int64AsIdAOSHandle = vtkm::cont::ArrayHandleCast<vtkm::Id, Int64AOSHandle>;
85 using Int64AsIdAOSStorage = typename Int64AsIdAOSHandle::StorageTag;
86 
87 using CellSetExplicit32Bit = vtkm::cont::CellSetExplicit<vtkm::cont::StorageTagBasic,
88  vtkm::cont::StorageTagBasic, vtkm::cont::StorageTagBasic>;
89 using CellSetExplicit64Bit = vtkm::cont::CellSetExplicit<vtkm::cont::StorageTagBasic,
91 using CellSetSingleType32Bit = vtkm::cont::CellSetSingleType<vtkm::cont::StorageTagBasic>;
92 using CellSetSingleType64Bit = vtkm::cont::CellSetSingleType<Int64AsIdAOSStorage>;
93 #endif // VTKM_USE_64BIT_IDS
94 
95 //------------------------------------------------------------------------------
96 using CellListUnstructuredInVTK = vtkm::List< //
101  >;
102 
103 using CellListUnstructuredOutVTK = vtkm::List< //
104  vtkm::cont::CellSetExplicit<>, //
105  vtkm::cont::CellSetSingleType<>, //
110  vtkm::cont::CellSetPermutation<CellSetExplicit32Bit>, //
111  vtkm::cont::CellSetPermutation<CellSetExplicit64Bit>, //
112  vtkm::cont::CellSetPermutation<CellSetSingleType32Bit>, //
113  vtkm::cont::CellSetPermutation<CellSetSingleType64Bit>, //
114  vtkm::cont::CellSetPermutation<vtkm::cont::CellSetExplicit<> >, //
115  vtkm::cont::CellSetPermutation<vtkm::cont::CellSetSingleType<> > //
116  >;
117 
118 //------------------------------------------------------------------------------
119 using CellListAllInVTK = vtkm::ListAppend<CellListStructuredInVTK, CellListUnstructuredInVTK>;
120 using CellListAllOutVTK = vtkm::ListAppend<CellListStructuredOutVTK, CellListUnstructuredOutVTK>;
121 
122 } // end namespace tovtkm
123 
124 //------------------------------------------------------------------------------
125 class vtkmInputFilterPolicy : public vtkm::filter::PolicyBase<vtkmInputFilterPolicy>
126 {
127 public:
129 
133 };
134 
135 //------------------------------------------------------------------------------
136 class vtkmOutputFilterPolicy : public vtkm::filter::PolicyBase<vtkmOutputFilterPolicy>
137 {
138 public:
140 
144 };
145 
146 #endif
147 #endif
148 #endif
149 // VTK-HeaderTest-Exclude: vtkmFilterPolicy.h
vtkm::List< char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double > VTKScalarTypes
tovtkm::CellListStructuredInVTK StructuredCellSetList
vtkm::cont::ArrayHandle< vtkTypeInt64, vtkm::cont::StorageTagBasic > Int64AOSHandle
vtkm::cont::CellSetExplicit< vtkm::cont::StorageTagBasic, vtkm::cont::StorageTagBasic, vtkm::cont::StorageTagBasic > CellSetExplicit32Bit
vtkm::List< vtkm::Vec< vtkm::Vec< vtkm::Float32, 3 >, 3 >, vtkm::Vec< vtkm::Vec< vtkm::Float64, 3 >, 3 > > SpecialGradientOutTypes
tovtkm::CellListAllOutVTK AllCellSetList
vtkm::List< vtkm::cont::CellSetPermutation< vtkm::cont::CellSetStructured< 3 > >, vtkm::cont::CellSetPermutation< vtkm::cont::CellSetStructured< 2 > > > CellListStructuredOutVTK
vtkm::List< vtkm::cont::CellSetStructured< 3 >, vtkm::cont::CellSetStructured< 2 > > CellListStructuredInVTK
vtkm::ListAppend< CellListStructuredOutVTK, CellListUnstructuredOutVTK > CellListAllOutVTK
vtkm::cont::ArrayHandleCast< vtkm::Id, Int64AOSHandle > Int64AsIdAOSHandle
vtkm::cont::CellSetSingleType< vtkm::cont::StorageTagBasic > CellSetSingleType32Bit
vtkm::List< vtkm::cont::CellSetExplicit<>, vtkm::cont::CellSetSingleType<>, CellSetExplicit32Bit, CellSetExplicit64Bit, CellSetSingleType32Bit, CellSetSingleType64Bit, vtkm::cont::CellSetPermutation< CellSetExplicit32Bit >, vtkm::cont::CellSetPermutation< CellSetExplicit64Bit >, vtkm::cont::CellSetPermutation< CellSetSingleType32Bit >, vtkm::cont::CellSetPermutation< CellSetSingleType64Bit >, vtkm::cont::CellSetPermutation< vtkm::cont::CellSetExplicit<> >, vtkm::cont::CellSetPermutation< vtkm::cont::CellSetSingleType<> > > CellListUnstructuredOutVTK
tovtkm::CellListAllInVTK AllCellSetList
tovtkm::CellListStructuredOutVTK StructuredCellSetList
tovtkm::CellListUnstructuredInVTK UnstructuredCellSetList
vtkm::ListAppend< vtkm::TypeListVecCommon, VTKScalarTypes > FieldTypeInVTK
vtkm::List< CellSetExplicit32Bit, CellSetExplicit64Bit, CellSetSingleType32Bit, CellSetSingleType64Bit > CellListUnstructuredInVTK
vtkm::cont::CellSetExplicit< vtkm::cont::StorageTagBasic, Int64AsIdAOSStorage, Int64AsIdAOSStorage > CellSetExplicit64Bit
tovtkm::FieldTypeInVTK FieldTypeList
vtkm::ListAppend< vtkm::TypeListVecCommon, SpecialGradientOutTypes, VTKScalarTypes > FieldTypeOutVTK
vtkm::ListAppend< CellListStructuredInVTK, CellListUnstructuredInVTK > CellListAllInVTK
vtkm::cont::CellSetSingleType< Int64AsIdAOSStorage > CellSetSingleType64Bit
tovtkm::CellListUnstructuredOutVTK UnstructuredCellSetList
tovtkm::FieldTypeOutVTK FieldTypeList
typename Int64AsIdAOSHandle::StorageTag Int64AsIdAOSStorage