VTK
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 
20 #include "vtkmConfig.h" //required for general vtkm setup
21 #include "vtkmTags.h"
22 
23 #include <vtkm/cont/ArrayHandlePermutation.h>
24 #include <vtkm/cont/CellSetExplicit.h>
25 #include <vtkm/cont/CellSetPermutation.h>
26 #include <vtkm/cont/CellSetSingleType.h>
27 #include <vtkm/cont/CellSetStructured.h>
28 #include <vtkm/filter/PolicyDefault.h>
29 
30 // Forward declaration of types.
31 namespace vtkm
32 {
33 namespace cont
34 {
35 class vtkmCellSetExplicitAOS;
36 class vtkmCellSetSingleType;
37 }
38 }
39 
40 namespace tovtkm
41 {
42 
43 //------------------------------------------------------------------------------
45  : vtkm::ListTagBase<
46  vtkm::Vec< vtkm::Vec<vtkm::Float32,3>, 3>,
47  vtkm::Vec< vtkm::Vec<vtkm::Float64,3>, 3>
48  >
49 {
50 };
51 
53  : vtkm::ListTagJoin<
54  vtkm::TypeListTagVecCommon,
55  vtkm::TypeListTagScalarAll>
56 {
57 };
58 
60  : vtkm::ListTagJoin<
61  vtkm::ListTagJoin<
62  vtkm::TypeListTagVecCommon,
63  SpecialGradientOutTypes
64  >,
65  vtkm::TypeListTagScalarAll
66  >
67 {
68 };
69 
70 //------------------------------------------------------------------------------
71 struct ArrayListInVTK : vtkm::ListTagBase<
72 #if defined(VTKM_FILTER_INCLUDE_AOS)
73  tovtkm::vtkAOSArrayContainerTag
74 #endif
75 #if defined(VTKM_FILTER_INCLUDE_SOA)
76  ,tovtkm::vtkSOAArrayContainerTag
77 #endif
78  >
79 {
80 };
81 
82 // Currently vtk-m doesn't offer an easy way to auto generate all these
83 // permutation
84 // tag types that are needed to handle the output of the Threshold algorithm
86  : vtkm::ListTagBase<
87  vtkm::cont::internal::StorageTagPermutation<
88  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::UInt8, 2>>,
89  vtkm::cont::internal::StorageTagPermutation<
90  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Int32, 2>>,
91  vtkm::cont::internal::StorageTagPermutation<
92  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Int64, 2>>,
93  vtkm::cont::internal::StorageTagPermutation<
94  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Float32, 2>>,
95  vtkm::cont::internal::StorageTagPermutation<
96  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Float64, 2>>,
97  vtkm::cont::internal::StorageTagPermutation<
98  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::UInt8, 3>>,
99  vtkm::cont::internal::StorageTagPermutation<
100  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Int32, 3>>,
101  vtkm::cont::internal::StorageTagPermutation<
102  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Int64, 3>>,
103  vtkm::cont::internal::StorageTagPermutation<
104  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Float32, 3>>,
105  vtkm::cont::internal::StorageTagPermutation<
106  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Float64, 3>>,
107  vtkm::cont::internal::StorageTagPermutation<
108  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::UInt8, 4>>,
109  vtkm::cont::internal::StorageTagPermutation<
110  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Int32, 4>>,
111  vtkm::cont::internal::StorageTagPermutation<
112  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Int64, 4>>,
113  vtkm::cont::internal::StorageTagPermutation<
114  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Float32, 4>>,
115  vtkm::cont::internal::StorageTagPermutation<
116  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Vec<vtkm::Float64, 4>>>
117 {
118 };
119 
121  : vtkm::ListTagBase<vtkm::cont::internal::StorageTagPermutation<
122  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Int8>,
123  vtkm::cont::internal::StorageTagPermutation<
124  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::UInt8>,
125  vtkm::cont::internal::StorageTagPermutation<
126  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Int16>,
127  vtkm::cont::internal::StorageTagPermutation<
128  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::UInt16>,
129  vtkm::cont::internal::StorageTagPermutation<
130  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Int32>,
131  vtkm::cont::internal::StorageTagPermutation<
132  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::UInt32>,
133  vtkm::cont::internal::StorageTagPermutation<
134  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Int64>,
135  vtkm::cont::internal::StorageTagPermutation<
136  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::UInt64>,
137  vtkm::cont::internal::StorageTagPermutation<
138  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Float32>,
139  vtkm::cont::internal::StorageTagPermutation<
140  vtkm::cont::ArrayHandle<vtkm::Id>, vtkm::Float64>>
141 {
142 };
143 
145  : vtkm::ListTagJoin<tovtkm::TypeListTagPermutationVecCommon,
146  tovtkm::TypeListTagPermutationScalarAll>
147 {
148 };
149 
150 struct TypeListTagVTMOut : vtkm::ListTagBase<vtkm::cont::StorageTagBasic
151 #if defined(VTKM_FILTER_INCLUDE_AOS)
152  ,tovtkm::vtkAOSArrayContainerTag
153 #endif
154 #if defined(VTKM_FILTER_INCLUDE_SOA)
155  ,tovtkm::vtkSOAArrayContainerTag
156 #endif
157  >
158 {
159 };
160 
162  : vtkm::ListTagJoin<TypeListTagVTMOut, TypeListTagPermutationVTK>
163 {
164 };
165 
166 //------------------------------------------------------------------------------
168  : vtkm::ListTagBase<
169  vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag,
170  tovtkm::vtkAOSArrayContainerTag
171 #if defined(VTKM_FILTER_INCLUDE_SOA)
172  ,
173  tovtkm::vtkSOAArrayContainerTag
174 #endif
175  >
176 {
177 };
179  : vtkm::ListTagBase<
180  vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag,
181  vtkm::cont::StorageTagBasic,
182  tovtkm::vtkAOSArrayContainerTag>
183 {
184 };
185 
186 //------------------------------------------------------------------------------
188  : vtkm::ListTagBase<vtkm::cont::CellSetStructured<3>, vtkm::cont::CellSetStructured<2>>
189 {
190 };
192  : vtkm::ListTagBase<
193  vtkm::cont::CellSetPermutation<vtkm::cont::CellSetStructured<3>>,
194  vtkm::cont::CellSetPermutation<vtkm::cont::CellSetStructured<2>> >
195 {
196 };
197 
198 //------------------------------------------------------------------------------
200  : vtkm::ListTagBase<vtkm::cont::vtkmCellSetExplicitAOS,
201  vtkm::cont::vtkmCellSetSingleType>
202 {
203 };
205  : vtkm::ListTagBase<
206  vtkm::cont::CellSetExplicit<>, vtkm::cont::CellSetSingleType<>,
207  vtkm::cont::vtkmCellSetExplicitAOS, vtkm::cont::vtkmCellSetSingleType,
208  vtkm::cont::CellSetPermutation<vtkm::cont::vtkmCellSetExplicitAOS>,
209  vtkm::cont::CellSetPermutation<vtkm::cont::vtkmCellSetSingleType>>
210 {
211 };
212 
213 //------------------------------------------------------------------------------
215  : vtkm::ListTagJoin<CellListStructuredInVTK, CellListUnstructuredInVTK>
216 {
217 };
219  : vtkm::ListTagJoin<CellListStructuredOutVTK, CellListUnstructuredOutVTK>
220 {
221 };
222 }
223 
224 //------------------------------------------------------------------------------
226  : public vtkm::filter::PolicyBase<vtkmInputFilterPolicy>
227 {
228 public:
231 
235 
236  typedef vtkm::TypeListTagFieldVec3 CoordinateTypeList;
238 
239  typedef vtkm::filter::PolicyDefault::DeviceAdapterList DeviceAdapterList;
240 };
241 
242 //------------------------------------------------------------------------------
244  : public vtkm::filter::PolicyBase<vtkmOutputFilterPolicy>
245 {
246 public:
249 
253 
254  typedef vtkm::TypeListTagFieldVec3 CoordinateTypeList;
256 
257  typedef vtkm::filter::PolicyDefault::DeviceAdapterList DeviceAdapterList;
258 };
259 
260 #endif
261 // VTK-HeaderTest-Exclude: vtkmFilterPolicy.h
vtkm::filter::PolicyDefault::DeviceAdapterList DeviceAdapterList
tovtkm::CellListAllOutVTK AllCellSetList
tovtkm::ArrayListInVTK FieldStorageList
vtkm::filter::PolicyDefault::DeviceAdapterList DeviceAdapterList
tovtkm::PointListOutVTK CoordinateStorageList
tovtkm::FieldTypeInVTK FieldTypeList
tovtkm::CellListAllInVTK AllCellSetList
vtkm::TypeListTagFieldVec3 CoordinateTypeList
tovtkm::PointListInVTK CoordinateStorageList
tovtkm::CellListUnstructuredOutVTK UnstructuredCellSetList
vtkm::TypeListTagFieldVec3 CoordinateTypeList
tovtkm::ArrayListOutVTK FieldStorageList
tovtkm::FieldTypeOutVTK FieldTypeList
tovtkm::CellListUnstructuredInVTK UnstructuredCellSetList
tovtkm::CellListStructuredOutVTK StructuredCellSetList
tovtkm::CellListStructuredInVTK StructuredCellSetList