VTK-m  2.0
MarchingCellTables.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_MarchingCellTables_h
11 #define vtk_m_MarchingCellTables_h
12 
13 #include <vtkm/CellShape.h>
14 #include <vtkm/Types.h>
15 
16 #include <vtkm/cont/ArrayHandle.h>
18 
19 namespace vtkm
20 {
21 namespace worklet
22 {
23 namespace marching_cells
24 {
25 
26 // clang-format off
28  0, // CELL_SHAPE_EMPTY = 0,
29  0, // CELL_SHAPE_VERTEX = 1,
30  0, // CELL_SHAPE_POLY_VERTEX = 2,
31  0, // CELL_SHAPE_LINE = 3,
32  0, // CELL_SHAPE_POLY_LINE = 4,
33  3, // CELL_SHAPE_TRIANGLE = 5,
34  0, // CELL_SHAPE_TRIANGLE_STRIP = 6,
35  0, // CELL_SHAPE_POLYGON = 7,
36  0, // CELL_SHAPE_PIXEL = 8,
37  4, // CELL_SHAPE_QUAD = 9,
38  4, // CELL_SHAPE_TETRA = 10,
39  0, // CELL_SHAPE_VOXEL = 11,
40  8, // CELL_SHAPE_HEXAHEDRON = 12,
41  6, // CELL_SHAPE_WEDGE = 13,
42  5 // CELL_SHAPE_PYRAMID = 14,
43 };
44 
46  0, // CELL_SHAPE_EMPTY = 0,
47  0, // CELL_SHAPE_VERTEX = 1,
48  0, // CELL_SHAPE_POLY_VERTEX = 2,
49  0, // CELL_SHAPE_LINE = 3,
50  0, // CELL_SHAPE_POLY_LINE = 4,
51  0, // CELL_SHAPE_TRIANGLE = 5,
52  0, // CELL_SHAPE_TRIANGLE_STRIP = 6,
53  0, // CELL_SHAPE_POLYGON = 7,
54  0, // CELL_SHAPE_PIXEL = 8,
55  0, // CELL_SHAPE_QUAD = 9,
56  0, // CELL_SHAPE_TETRA = 10,
57  0, // CELL_SHAPE_VOXEL = 11,
58  16, // CELL_SHAPE_HEXAHEDRON = 12,
59  16+256, // CELL_SHAPE_WEDGE = 13,
60  16+256+64 // CELL_SHAPE_PYRAMID = 14,
61 };
62 
64  // CELL_SHAPE_TETRA, case 0 - 15
65  0, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 0,
66  // CELL_SHAPE_HEXAHEDRON, case 0 - 255
67  0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 2,
68  1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 3,
69  1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 3,
70  2, 3, 3, 2, 3, 4, 4, 3, 3, 4, 4, 3, 4, 5, 5, 2,
71  1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 3,
72  2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 4,
73  2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 4, 5, 4, 5, 3, 2,
74  3, 4, 4, 3, 4, 5, 3, 2, 4, 5, 5, 4, 5, 2, 4, 1,
75  1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 3,
76  2, 3, 3, 4, 3, 4, 4, 5, 3, 2, 4, 3, 4, 3, 5, 2,
77  2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 4,
78  3, 4, 4, 3, 4, 5, 5, 4, 4, 3, 5, 2, 5, 4, 2, 1,
79  2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 2, 3, 3, 2,
80  3, 4, 4, 5, 4, 5, 5, 2, 4, 3, 5, 4, 3, 2, 4, 1,
81  3, 4, 4, 5, 4, 5, 3, 4, 4, 5, 5, 2, 3, 4, 2, 1,
82  2, 3, 3, 2, 3, 4, 2, 1, 3, 2, 4, 1, 2, 1, 1, 0,
83  // CELL_SHAPE_WEDGE, case 0 - 63
84  0, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 3, 2, 3, 3, 2,
85  1, 2, 2, 3, 2, 3, 3, 2, 2, 3, 3, 2, 3, 4, 4, 1,
86  1, 2, 2, 3, 2, 3, 3, 2, 2, 3, 3, 4, 3, 2, 4, 1,
87  2, 3, 3, 4, 3, 4, 2, 1, 1, 2, 2, 1, 2, 1, 1, 0,
88  // CELL_SHAPE_PYRAMID, case 0 - 31
89  0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 2,
90  2, 3, 3, 2, 3, 4, 2, 1, 3, 2, 4, 1, 2, 1, 1, 0
91 };
92 
94  // CELL_SHAPE_TETRA, 6 edge * 2 vertices/edge = 12 entries
95  0, 1, // edge 0 : vertex 0 -> vertex 1
96  1, 2, // edge 1 : vertex 1 -> vertex 2
97  0, 2, // edge 2 : vertex 0 -> vertex 2
98  0, 3, // edge 3 : vertex 0 -> vertex 3
99  1, 3, // edge 4 : vertex 1 -> vertex 3
100  2, 3, // edge 5 : vertex 2 -> vertex 3
101  // CELL_SHAPE_HEXAHEDRON, 12 edges * 2 vertices/edge = 24 entries
102  0, 1, // bottom layer
103  1, 2,
104  3, 2,
105  0, 3,
106  4, 5, // top layer
107  5, 6,
108  7, 6,
109  4, 7,
110  0, 4, // side
111  1, 5,
112  2, 6,
113  3, 7,
114  // CELL_SHAPE_WEDGE, 9 edges * 2 vertices/edge = 18 entries
115  0, 1,
116  1, 2,
117  2, 0,
118  3, 4,
119  4, 5,
120  5, 3,
121  0, 3,
122  1, 4,
123  2, 5,
124  // CELL_SHAPE_PYRAMID, 8 edges * 2 vertices/ede = 16 entries
125  0, 1,
126  1, 2,
127  2, 3,
128  3, 0,
129  0, 4,
130  1, 4,
131  2, 4,
132  3, 4
133 };
134 
136  0, // CELL_SHAPE_EMPTY = 0,
137  0, // CELL_SHAPE_VERTEX = 1,
138  0, // CELL_SHAPE_POLY_VERTEX = 2,
139  0, // CELL_SHAPE_LINE = 3,
140  0, // CELL_SHAPE_POLY_LINE = 4,
141  0, // CELL_SHAPE_TRIANGLE = 5,
142  0, // CELL_SHAPE_TRIANGLE_STRIP = 6,
143  0, // CELL_SHAPE_POLYGON = 7,
144  0, // CELL_SHAPE_PIXEL = 8,
145  0, // CELL_SHAPE_QUAD = 9,
146  0, // CELL_SHAPE_TETRA = 10,
147  0, // CELL_SHAPE_VOXEL = 11,
148  12, // CELL_SHAPE_HEXAHEDRON = 12,
149  12+24, // CELL_SHAPE_WEDGE = 13,
150  12+24+18 // CELL_SHAPE_PYRAMID = 14,
151 };
152 
154 #define X -1
155  // CELL_SHAPE_TETRA, 16 cases, 7 edges/cases, 112 entries total
156  // FIXME, this is different winding rule than VTK
157  X, X, X, X, X, X, X,
158  0, 3, 2, X, X, X, X,
159  0, 1, 4, X, X, X, X,
160  1, 4, 2, 2, 4, 3, X,
161  1, 2, 5, X, X, X, X,
162  0, 3, 5, 0, 5, 1, X,
163  0, 2, 5, 0, 5, 4, X,
164  5, 4, 3, X, X, X, X,
165  3, 4, 5, X, X, X, X,
166  4, 5, 0, 5, 2, 0, X,
167  1, 5, 0, 5, 3, 0, X,
168  5, 2, 1, X, X, X, X,
169  3, 4, 2, 2, 4, 1, X,
170  4, 1, 0, X, X, X, X,
171  2, 3, 0, X, X, X, X,
172  X, X, X, X, X, X, X,
173 
174  // CELL_SHAPE_HEXAHEDRON, 256 cases, 16 edges/cases, 4096 entries total
175  X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
176  0, 8, 3, X, X, X, X, X, X, X, X, X, X, X, X, X,
177  0, 1, 9, X, X, X, X, X, X, X, X, X, X, X, X, X,
178  1, 8, 3, 9, 8, 1, X, X, X, X, X, X, X, X, X, X,
179  1, 2, 10, X, X, X, X, X, X, X, X, X, X, X, X, X,
180  0, 8, 3, 1, 2, 10, X, X, X, X, X, X, X, X, X, X,
181  9, 2, 10, 0, 2, 9, X, X, X, X, X, X, X, X, X, X,
182  2, 8, 3, 2, 10, 8, 10, 9, 8, X, X, X, X, X, X, X,
183  3, 11, 2, X, X, X, X, X, X, X, X, X, X, X, X, X,
184  0, 11, 2, 8, 11, 0, X, X, X, X, X, X, X, X, X, X,
185  1, 9, 0, 2, 3, 11, X, X, X, X, X, X, X, X, X, X,
186  1, 11, 2, 1, 9, 11, 9, 8, 11, X, X, X, X, X, X, X,
187  3, 10, 1, 11, 10, 3, X, X, X, X, X, X, X, X, X, X,
188  0, 10, 1, 0, 8, 10, 8, 11, 10, X, X, X, X, X, X, X,
189  3, 9, 0, 3, 11, 9, 11, 10, 9, X, X, X, X, X, X, X,
190  9, 8, 10, 10, 8, 11, X, X, X, X, X, X, X, X, X, X,
191  4, 7, 8, X, X, X, X, X, X, X, X, X, X, X, X, X,
192  4, 3, 0, 7, 3, 4, X, X, X, X, X, X, X, X, X, X,
193  0, 1, 9, 8, 4, 7, X, X, X, X, X, X, X, X, X, X,
194  4, 1, 9, 4, 7, 1, 7, 3, 1, X, X, X, X, X, X, X,
195  1, 2, 10, 8, 4, 7, X, X, X, X, X, X, X, X, X, X,
196  3, 4, 7, 3, 0, 4, 1, 2, 10, X, X, X, X, X, X, X,
197  9, 2, 10, 9, 0, 2, 8, 4, 7, X, X, X, X, X, X, X,
198  2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, X, X, X, X,
199  8, 4, 7, 3, 11, 2, X, X, X, X, X, X, X, X, X, X, 11, 4, 7, 11, 2, 4, 2, 0,
200  4, X, X, X, X, X, X, X, 9, 0, 1, 8, 4, 7, 2, 3, 11, X, X, X, X, X, X, X,
201  4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, X, X, X, X, 3, 10, 1, 3, 11, 10, 7, 8,
202  4, X, X, X, X, X, X, X, 1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, X, X, X, X,
203  4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, X, X, X, X, 4, 7, 11, 4, 11, 9, 9, 11,
204  10, X, X, X, X, X, X, X, 9, 5, 4, X, X, X, X, X, X, X, X, X, X, X, X, X,
205  9, 5, 4, 0, 8, 3, X, X, X, X, X, X, X, X, X, X, 0, 5, 4, 1, 5, 0, X, X,
206  X, X, X, X, X, X, X, X, 8, 5, 4, 8, 3, 5, 3, 1, 5, X, X, X, X, X, X, X,
207  1, 2, 10, 9, 5, 4, X, X, X, X, X, X, X, X, X, X, 3, 0, 8, 1, 2, 10, 4, 9,
208  5, X, X, X, X, X, X, X, 5, 2, 10, 5, 4, 2, 4, 0, 2, X, X, X, X, X, X, X,
209  2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, X, X, X, X, 9, 5, 4, 2, 3, 11, X, X,
210  X, X, X, X, X, X, X, X, 0, 11, 2, 0, 8, 11, 4, 9, 5, X, X, X, X, X, X, X,
211  0, 5, 4, 0, 1, 5, 2, 3, 11, X, X, X, X, X, X, X, 2, 1, 5, 2, 5, 8, 2, 8,
212  11, 4, 8, 5, X, X, X, X, 10, 3, 11, 10, 1, 3, 9, 5, 4, X, X, X, X, X, X, X,
213  4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, X, X, X, X, 5, 4, 0, 5, 0, 11, 5, 11,
214  10, 11, 0, 3, X, X, X, X, 5, 4, 8, 5, 8, 10, 10, 8, 11, X, X, X, X, X, X, X,
215  9, 7, 8, 5, 7, 9, X, X, X, X, X, X, X, X, X, X, 9, 3, 0, 9, 5, 3, 5, 7,
216  3, X, X, X, X, X, X, X, 0, 7, 8, 0, 1, 7, 1, 5, 7, X, X, X, X, X, X, X,
217  1, 5, 3, 3, 5, 7, X, X, X, X, X, X, X, X, X, X, 9, 7, 8, 9, 5, 7, 10, 1,
218  2, X, X, X, X, X, X, X, 10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, X, X, X, X,
219  8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, X, X, X, X, 2, 10, 5, 2, 5, 3, 3, 5,
220  7, X, X, X, X, X, X, X, 7, 9, 5, 7, 8, 9, 3, 11, 2, X, X, X, X, X, X, X,
221  9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, X, X, X, X, 2, 3, 11, 0, 1, 8, 1, 7,
222  8, 1, 5, 7, X, X, X, X, 11, 2, 1, 11, 1, 7, 7, 1, 5, X, X, X, X, X, X, X,
223  9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, X, X, X, X, 5, 7, 0, 5, 0, 9, 7, 11,
224  0, 1, 0, 10, 11, 10, 0, X, 11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, X,
225  11, 10, 5, 7, 11, 5, X, X, X, X, X, X, X, X, X, X, 10, 6, 5, X, X, X, X, X,
226  X, X, X, X, X, X, X, X, 0, 8, 3, 5, 10, 6, X, X, X, X, X, X, X, X, X, X,
227  9, 0, 1, 5, 10, 6, X, X, X, X, X, X, X, X, X, X, 1, 8, 3, 1, 9, 8, 5, 10,
228  6, X, X, X, X, X, X, X, 1, 6, 5, 2, 6, 1, X, X, X, X, X, X, X, X, X, X,
229  1, 6, 5, 1, 2, 6, 3, 0, 8, X, X, X, X, X, X, X, 9, 6, 5, 9, 0, 6, 0, 2,
230  6, X, X, X, X, X, X, X, 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, X, X, X, X,
231  2, 3, 11, 10, 6, 5, X, X, X, X, X, X, X, X, X, X, 11, 0, 8, 11, 2, 0, 10, 6,
232  5, X, X, X, X, X, X, X, 0, 1, 9, 2, 3, 11, 5, 10, 6, X, X, X, X, X, X, X,
233  5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, X, X, X, X, 6, 3, 11, 6, 5, 3, 5, 1,
234  3, X, X, X, X, X, X, X, 0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, X, X, X, X,
235  3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, X, X, X, X, 6, 5, 9, 6, 9, 11, 11, 9,
236  8, X, X, X, X, X, X, X, 5, 10, 6, 4, 7, 8, X, X, X, X, X, X, X, X, X, X,
237  4, 3, 0, 4, 7, 3, 6, 5, 10, X, X, X, X, X, X, X, 1, 9, 0, 5, 10, 6, 8, 4,
238  7, X, X, X, X, X, X, X, 10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, X, X, X, X,
239  6, 1, 2, 6, 5, 1, 4, 7, 8, X, X, X, X, X, X, X, 1, 2, 5, 5, 2, 6, 3, 0,
240  4, 3, 4, 7, X, X, X, X, 8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, X, X, X, X,
241  7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, X, 3, 11, 2, 7, 8, 4, 10, 6,
242  5, X, X, X, X, X, X, X, 5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, X, X, X, X,
243  0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, X, X, X, X, 9, 2, 1, 9, 11, 2, 9, 4,
244  11, 7, 11, 4, 5, 10, 6, X, 8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, X, X, X, X,
245  5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, X, 0, 5, 9, 0, 6, 5, 0, 3,
246  6, 11, 6, 3, 8, 4, 7, X, 6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, X, X, X, X,
247  10, 4, 9, 6, 4, 10, X, X, X, X, X, X, X, X, X, X, 4, 10, 6, 4, 9, 10, 0, 8,
248  3, X, X, X, X, X, X, X, 10, 0, 1, 10, 6, 0, 6, 4, 0, X, X, X, X, X, X, X,
249  8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, X, X, X, X, 1, 4, 9, 1, 2, 4, 2, 6,
250  4, X, X, X, X, X, X, X, 3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, X, X, X, X,
251  0, 2, 4, 4, 2, 6, X, X, X, X, X, X, X, X, X, X, 8, 3, 2, 8, 2, 4, 4, 2,
252  6, X, X, X, X, X, X, X, 10, 4, 9, 10, 6, 4, 11, 2, 3, X, X, X, X, X, X, X,
253  0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, X, X, X, X, 3, 11, 2, 0, 1, 6, 0, 6,
254  4, 6, 1, 10, X, X, X, X, 6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, X,
255  9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, X, X, X, X, 8, 11, 1, 8, 1, 0, 11, 6,
256  1, 9, 1, 4, 6, 4, 1, X, 3, 11, 6, 3, 6, 0, 0, 6, 4, X, X, X, X, X, X, X,
257  6, 4, 8, 11, 6, 8, X, X, X, X, X, X, X, X, X, X, 7, 10, 6, 7, 8, 10, 8, 9,
258  10, X, X, X, X, X, X, X, 0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, X, X, X, X,
259  10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, X, X, X, X, 10, 6, 7, 10, 7, 1, 1, 7,
260  3, X, X, X, X, X, X, X, 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, X, X, X, X,
261  2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, X, 7, 8, 0, 7, 0, 6, 6, 0,
262  2, X, X, X, X, X, X, X, 7, 3, 2, 6, 7, 2, X, X, X, X, X, X, X, X, X, X,
263  2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, X, X, X, X, 2, 0, 7, 2, 7, 11, 0, 9,
264  7, 6, 7, 10, 9, 10, 7, X, 1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, X,
265  11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, X, X, X, X, 8, 9, 6, 8, 6, 7, 9, 1,
266  6, 11, 6, 3, 1, 3, 6, X, 0, 9, 1, 11, 6, 7, X, X, X, X, X, X, X, X, X, X,
267  7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, X, X, X, X, 7, 11, 6, X, X, X, X, X,
268  X, X, X, X, X, X, X, X, 7, 6, 11, X, X, X, X, X, X, X, X, X, X, X, X, X,
269  3, 0, 8, 11, 7, 6, X, X, X, X, X, X, X, X, X, X, 0, 1, 9, 11, 7, 6, X, X,
270  X, X, X, X, X, X, X, X, 8, 1, 9, 8, 3, 1, 11, 7, 6, X, X, X, X, X, X, X,
271  10, 1, 2, 6, 11, 7, X, X, X, X, X, X, X, X, X, X, 1, 2, 10, 3, 0, 8, 6, 11,
272  7, X, X, X, X, X, X, X, 2, 9, 0, 2, 10, 9, 6, 11, 7, X, X, X, X, X, X, X,
273  6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, X, X, X, X, 7, 2, 3, 6, 2, 7, X, X,
274  X, X, X, X, X, X, X, X, 7, 0, 8, 7, 6, 0, 6, 2, 0, X, X, X, X, X, X, X,
275  2, 7, 6, 2, 3, 7, 0, 1, 9, X, X, X, X, X, X, X, 1, 6, 2, 1, 8, 6, 1, 9,
276  8, 8, 7, 6, X, X, X, X, 10, 7, 6, 10, 1, 7, 1, 3, 7, X, X, X, X, X, X, X,
277  10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, X, X, X, X, 0, 3, 7, 0, 7, 10, 0, 10,
278  9, 6, 10, 7, X, X, X, X, 7, 6, 10, 7, 10, 8, 8, 10, 9, X, X, X, X, X, X, X,
279  6, 8, 4, 11, 8, 6, X, X, X, X, X, X, X, X, X, X, 3, 6, 11, 3, 0, 6, 0, 4,
280  6, X, X, X, X, X, X, X, 8, 6, 11, 8, 4, 6, 9, 0, 1, X, X, X, X, X, X, X,
281  9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, X, X, X, X, 6, 8, 4, 6, 11, 8, 2, 10,
282  1, X, X, X, X, X, X, X, 1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, X, X, X, X,
283  4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, X, X, X, X, 10, 9, 3, 10, 3, 2, 9, 4,
284  3, 11, 3, 6, 4, 6, 3, X, 8, 2, 3, 8, 4, 2, 4, 6, 2, X, X, X, X, X, X, X,
285  0, 4, 2, 4, 6, 2, X, X, X, X, X, X, X, X, X, X, 1, 9, 0, 2, 3, 4, 2, 4,
286  6, 4, 3, 8, X, X, X, X, 1, 9, 4, 1, 4, 2, 2, 4, 6, X, X, X, X, X, X, X,
287  8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, X, X, X, X, 10, 1, 0, 10, 0, 6, 6, 0,
288  4, X, X, X, X, X, X, X, 4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, X,
289  10, 9, 4, 6, 10, 4, X, X, X, X, X, X, X, X, X, X, 4, 9, 5, 7, 6, 11, X, X,
290  X, X, X, X, X, X, X, X, 0, 8, 3, 4, 9, 5, 11, 7, 6, X, X, X, X, X, X, X,
291  5, 0, 1, 5, 4, 0, 7, 6, 11, X, X, X, X, X, X, X, 11, 7, 6, 8, 3, 4, 3, 5,
292  4, 3, 1, 5, X, X, X, X, 9, 5, 4, 10, 1, 2, 7, 6, 11, X, X, X, X, X, X, X,
293  6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, X, X, X, X, 7, 6, 11, 5, 4, 10, 4, 2,
294  10, 4, 0, 2, X, X, X, X, 3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, X,
295  7, 2, 3, 7, 6, 2, 5, 4, 9, X, X, X, X, X, X, X, 9, 5, 4, 0, 8, 6, 0, 6,
296  2, 6, 8, 7, X, X, X, X, 3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, X, X, X, X,
297  6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, X, 9, 5, 4, 10, 1, 6, 1, 7,
298  6, 1, 3, 7, X, X, X, X, 1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, X,
299  4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, X, 7, 6, 10, 7, 10, 8, 5, 4,
300  10, 4, 8, 10, X, X, X, X, 6, 9, 5, 6, 11, 9, 11, 8, 9, X, X, X, X, X, X, X,
301  3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, X, X, X, X, 0, 11, 8, 0, 5, 11, 0, 1,
302  5, 5, 6, 11, X, X, X, X, 6, 11, 3, 6, 3, 5, 5, 3, 1, X, X, X, X, X, X, X,
303  1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, X, X, X, X, 0, 11, 3, 0, 6, 11, 0, 9,
304  6, 5, 6, 9, 1, 2, 10, X, 11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, X,
305  6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, X, X, X, X, 5, 8, 9, 5, 2, 8, 5, 6,
306  2, 3, 8, 2, X, X, X, X, 9, 5, 6, 9, 6, 0, 0, 6, 2, X, X, X, X, X, X, X,
307  1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, X, 1, 5, 6, 2, 1, 6, X, X,
308  X, X, X, X, X, X, X, X, 1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, X,
309  10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, X, X, X, X, 0, 3, 8, 5, 6, 10, X, X,
310  X, X, X, X, X, X, X, X, 10, 5, 6, X, X, X, X, X, X, X, X, X, X, X, X, X,
311  11, 5, 10, 7, 5, 11, X, X, X, X, X, X, X, X, X, X, 11, 5, 10, 11, 7, 5, 8, 3,
312  0, X, X, X, X, X, X, X, 5, 11, 7, 5, 10, 11, 1, 9, 0, X, X, X, X, X, X, X,
313  10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, X, X, X, X, 11, 1, 2, 11, 7, 1, 7, 5,
314  1, X, X, X, X, X, X, X, 0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, X, X, X, X,
315  9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, X, X, X, X, 7, 5, 2, 7, 2, 11, 5, 9,
316  2, 3, 2, 8, 9, 8, 2, X, 2, 5, 10, 2, 3, 5, 3, 7, 5, X, X, X, X, X, X, X,
317  8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, X, X, X, X, 9, 0, 1, 5, 10, 3, 5, 3,
318  7, 3, 10, 2, X, X, X, X, 9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, X,
319  1, 3, 5, 3, 7, 5, X, X, X, X, X, X, X, X, X, X, 0, 8, 7, 0, 7, 1, 1, 7,
320  5, X, X, X, X, X, X, X, 9, 0, 3, 9, 3, 5, 5, 3, 7, X, X, X, X, X, X, X,
321  9, 8, 7, 5, 9, 7, X, X, X, X, X, X, X, X, X, X, 5, 8, 4, 5, 10, 8, 10, 11,
322  8, X, X, X, X, X, X, X, 5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, X, X, X, X,
323  0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, X, X, X, X, 10, 11, 4, 10, 4, 5, 11, 3,
324  4, 9, 4, 1, 3, 1, 4, X, 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, X, X, X, X,
325  0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, X, 0, 2, 5, 0, 5, 9, 2, 11,
326  5, 4, 5, 8, 11, 8, 5, X, 9, 4, 5, 2, 11, 3, X, X, X, X, X, X, X, X, X, X,
327  2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, X, X, X, X, 5, 10, 2, 5, 2, 4, 4, 2,
328  0, X, X, X, X, X, X, X, 3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, X,
329  5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, X, X, X, X, 8, 4, 5, 8, 5, 3, 3, 5,
330  1, X, X, X, X, X, X, X, 0, 4, 5, 1, 0, 5, X, X, X, X, X, X, X, X, X, X,
331  8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, X, X, X, X, 9, 4, 5, X, X, X, X, X,
332  X, X, X, X, X, X, X, X, 4, 11, 7, 4, 9, 11, 9, 10, 11, X, X, X, X, X, X, X,
333  0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, X, X, X, X, 1, 10, 11, 1, 11, 4, 1, 4,
334  0, 7, 4, 11, X, X, X, X, 3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, X,
335  4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, X, X, X, X, 9, 7, 4, 9, 11, 7, 9, 1,
336  11, 2, 11, 1, 0, 8, 3, X, 11, 7, 4, 11, 4, 2, 2, 4, 0, X, X, X, X, X, X, X,
337  11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, X, X, X, X, 2, 9, 10, 2, 7, 9, 2, 3,
338  7, 7, 4, 9, X, X, X, X, 9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, X,
339  3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, X, 1, 10, 2, 8, 7, 4, X, X,
340  X, X, X, X, X, X, X, X, 4, 9, 1, 4, 1, 7, 7, 1, 3, X, X, X, X, X, X, X,
341  4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, X, X, X, X, 4, 0, 3, 7, 4, 3, X, X,
342  X, X, X, X, X, X, X, X, 4, 8, 7, X, X, X, X, X, X, X, X, X, X, X, X, X,
343  9, 10, 8, 10, 11, 8, X, X, X, X, X, X, X, X, X, X, 3, 0, 9, 3, 9, 11, 11, 9,
344  10, X, X, X, X, X, X, X, 0, 1, 10, 0, 10, 8, 8, 10, 11, X, X, X, X, X, X, X,
345  3, 1, 10, 11, 3, 10, X, X, X, X, X, X, X, X, X, X, 1, 2, 11, 1, 11, 9, 9, 11,
346  8, X, X, X, X, X, X, X, 3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, X, X, X, X,
347  0, 2, 11, 8, 0, 11, X, X, X, X, X, X, X, X, X, X, 3, 2, 11, X, X, X, X, X,
348  X, X, X, X, X, X, X, X, 2, 3, 8, 2, 8, 10, 10, 8, 9, X, X, X, X, X, X, X,
349  9, 10, 2, 0, 9, 2, X, X, X, X, X, X, X, X, X, X, 2, 3, 8, 2, 8, 10, 0, 1,
350  8, 1, 10, 8, X, X, X, X, 1, 10, 2, X, X, X, X, X, X, X, X, X, X, X, X, X,
351  1, 3, 8, 9, 1, 8, X, X, X, X, X, X, X, X, X, X, 0, 9, 1, X, X, X, X, X,
352  X, X, X, X, X, X, X, X, 0, 3, 8, X, X, X, X, X, X, X, X, X, X, X, X, X,
353  X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X,
354 
355  // CELL_SHAPE_WEDGE = 13, 64 cases, 13 edges/case, 832 total entries
356  X, X, X, X, X, X, X, X, X, X, X, X, X, //0
357  0, 6, 2, X, X, X, X, X, X, X, X, X, X, //1
358  0, 1, 7, X, X, X, X, X, X, X, X, X, X, //2
359  6, 1, 7, 6, 2, 1, X, X, X, X, X, X, X, //3
360  1, 2, 8, X, X, X, X, X, X, X, X, X, X, //4
361  6, 1, 0, 6, 8, 1, X, X, X, X, X, X, X, //5
362  0, 2, 8, 7, 0, 8, X, X, X, X, X, X, X, //6
363  7, 6, 8, X, X, X, X, X, X, X, X, X, X, //7
364  3, 5, 6, X, X, X, X, X, X, X, X, X, X, //8
365  3, 5, 0, 5, 2, 0, X, X, X, X, X, X, X, //9
366  0, 1, 7, 6, 3, 5, X, X, X, X, X, X, X, //10
367  1, 7, 3, 1, 3, 5, 1, 5, 2, X, X, X, X, //11
368  2, 8, 1, 6, 3, 5, X, X, X, X, X, X, X, //12
369  0, 3, 1, 1, 3, 5, 1, 5, 8, X, X, X, X, //13
370  6, 3, 5, 0, 8, 7, 0, 2, 8, X, X, X, X, //14
371  7, 3, 5, 7, 5, 8, X, X, X, X, X, X, X, //15
372  7, 4, 3, X, X, X, X, X, X, X, X, X, X, //16
373  7, 4, 3, 0, 6, 2, X, X, X, X, X, X, X, //17
374  0, 1, 3, 1, 4, 3, X, X, X, X, X, X, X, //18
375  1, 4, 3, 1, 3, 6, 1, 6, 2, X, X, X, X, //19
376  7, 4, 3, 2, 8, 1, X, X, X, X, X, X, X, //20
377  7, 4, 3, 6, 1, 0, 6, 8, 1, X, X, X, X, //21
378  0, 4, 3, 0, 8, 4, 0, 2, 8, X, X, X, X, //22
379  6, 8, 3, 3, 8, 4, X, X, X, X, X, X, X, //23
380  6, 7, 4, 6, 4, 5, X, X, X, X, X, X, X, //24
381  0, 7, 5, 7, 4, 5, 2, 0, 5, X, X, X, X, //25
382  1, 6, 0, 1, 5, 6, 1, 4, 5, X, X, X, X, //26
383  2, 1, 5, 5, 1, 4, X, X, X, X, X, X, X, //27
384  2, 8, 1, 6, 7, 5, 7, 4, 5, X, X, X, X, //28
385  0, 7, 5, 7, 4, 5, 0, 5, 1, 1, 5, 8, X, //29
386  0, 2, 8, 0, 8, 4, 0, 4, 5, 0, 5, 6, X, //30
387  8, 4, 5, X, X, X, X, X, X, X, X, X, X, //31
388  4, 8, 5, X, X, X, X, X, X, X, X, X, X, //32
389  4, 8, 5, 0, 6, 2, X, X, X, X, X, X, X, //33
390  4, 8, 5, 0, 1, 7, X, X, X, X, X, X, X, //34
391  4, 8, 5, 6, 1, 7, 6, 2, 1, X, X, X, X, //35
392  1, 5, 4, 2, 5, 1, X, X, X, X, X, X, X, //36
393  1, 5, 4, 1, 6, 5, 1, 0, 6, X, X, X, X, //37
394  5, 4, 7, 5, 7, 0, 5, 0, 2, X, X, X, X, //38
395  6, 4, 7, 6, 5, 4, X, X, X, X, X, X, X, //39
396  6, 3, 8, 3, 4, 8, X, X, X, X, X, X, X, //40
397  0, 3, 4, 0, 4, 8, 0, 8, 2, X, X, X, X, //41
398  7, 0, 1, 6, 3, 4, 6, 4, 8, X, X, X, X, //42
399  1, 7, 3, 1, 3, 2, 2, 3, 8, 8, 3, 4, X, //43
400  2, 6, 1, 6, 3, 1, 3, 4, 1, X, X, X, X, //44
401  0, 3, 1, 1, 3, 4, X, X, X, X, X, X, X, //45
402  7, 0, 4, 4, 0, 2, 4, 2, 3, 3, 2, 6, X, //46
403  7, 3, 4, X, X, X, X, X, X, X, X, X, X, //47
404  7, 8, 5, 7, 5, 3, X, X, X, X, X, X, X, //48
405  0, 6, 2, 7, 8, 5, 7, 5, 3, X, X, X, X, //49
406  0, 1, 3, 1, 5, 3, 1, 8, 5, X, X, X, X, //50
407  2, 1, 6, 6, 1, 3, 5, 1, 8, 3, 1, 5, X, //51
408  1, 3, 7, 1, 5, 3, 1, 2, 5, X, X, X, X, //52
409  1, 0, 6, 1, 6, 5, 1, 5, 7, 7, 5, 3, X, //53
410  0, 2, 5, 0, 5, 3, X, X, X, X, X, X, X, //54
411  3, 6, 5, X, X, X, X, X, X, X, X, X, X, //55
412  7, 8, 6, X, X, X, X, X, X, X, X, X, X, //56
413  0, 7, 8, 0, 8, 2, X, X, X, X, X, X, X, //57
414  0, 1, 6, 1, 8, 6, X, X, X, X, X, X, X, //58
415  2, 1, 8, X, X, X, X, X, X, X, X, X, X, //59
416  6, 7, 1, 6, 1, 2, X, X, X, X, X, X, X, //60
417  0, 7, 1, X, X, X, X, X, X, X, X, X, X, //61
418  0, 2, 6, X, X, X, X, X, X, X, X, X, X, //62
419  X, X, X, X, X, X, X, X, X, X, X, X, X, //63
420 
421  // CELL_SHAPE_PYRAMID = 14, 32 cases, 13 edges/case, 416 total entries
422  X, X, X, X, X, X, X, X, X, X, X, X, X, //0
423  3, 4, 0, X, X, X, X, X, X, X, X, X, X, //1
424  5, 1, 0, X, X, X, X, X, X, X, X, X, X, //2
425  5, 1, 4, 1, 3, 4, X, X, X, X, X, X, X, //3
426  6, 2, 1, X, X, X, X, X, X, X, X, X, X, //4
427  3, 4, 0, 6, 2, 1, X, X, X, X, X, X, X, //5
428  5, 2, 0, 6, 2, 5, X, X, X, X, X, X, X, //6
429  2, 3, 4, 2, 4, 6, 4, 5, 6, X, X, X, X, //7
430  2, 7, 3, X, X, X, X, X, X, X, X, X, X, //8
431  2, 7, 4, 4, 0, 2, X, X, X, X, X, X, X, //9
432  5, 1, 0, 2, 7, 3, X, X, X, X, X, X, X, //10
433  5, 7, 4, 1, 7, 5, 2, 7, 1, X, X, X, X, //11
434  6, 3, 1, 7, 3, 6, X, X, X, X, X, X, X, //12
435  4, 6, 7, 0, 6, 4, 1, 6, 0, X, X, X, X, //13
436  7, 5, 6, 3, 5, 7, 0, 5, 3, X, X, X, X, //14
437  7, 4, 5, 7, 5, 6, X, X, X, X, X, X, X, //15
438  7, 5, 4, 7, 6, 5, X, X, X, X, X, X, X, //16
439  5, 0, 3, 6, 5, 3, 7, 6, 3, X, X, X, X, //17
440  1, 0, 4, 7, 1, 4, 6, 1, 7, X, X, X, X, //18
441  6, 1, 3, 7, 6, 3, X, X, X, X, X, X, X, //19
442  7, 5, 4, 7, 1, 5, 7, 2, 1, X, X, X, X, //20
443  3, 7, 0, 7, 5, 0, 7, 2, 5, 2, 1, 5, X, //21
444  4, 2, 0, 7, 2, 4, X, X, X, X, X, X, X, //22
445  7, 2, 3, X, X, X, X, X, X, X, X, X, X, //23
446  2, 4, 3, 5, 4, 2, 6, 5, 2, X, X, X, X, //24
447  2, 5, 0, 2, 6, 5, X, X, X, X, X, X, X, //25
448  6, 1, 0, 4, 6, 0, 3, 6, 4, 3, 2, 6, X, //26
449  2, 6, 1, X, X, X, X, X, X, X, X, X, X, //27
450  1, 4, 3, 1, 5, 4, X, X, X, X, X, X, X, //28
451  1, 5, 0, X, X, X, X, X, X, X, X, X, X, //29
452  4, 3, 0, X, X, X, X, X, X, X, X, X, X, //30
453  X, X, X, X, X, X, X, X, X, X, X, X, X //31
454 
455 #undef X
456 };
457 
459  0, // CELL_SHAPE_EMPTY = 0,
460  0, // CELL_SHAPE_VERTEX = 1,
461  0, // CELL_SHAPE_POLY_VERTEX = 2,
462  0, // CELL_SHAPE_LINE = 3,
463  0, // CELL_SHAPE_POLY_LINE = 4,
464  0, // CELL_SHAPE_TRIANGLE = 5,
465  0, // CELL_SHAPE_TRIANGLE_STRIP = 6,
466  0, // CELL_SHAPE_POLYGON = 7,
467  0, // CELL_SHAPE_PIXEL = 8,
468  0, // CELL_SHAPE_QUAD = 9,
469  0, // CELL_SHAPE_TETRA = 10,
470  0, // CELL_SHAPE_VOXEL = 11,
471  112, // CELL_SHAPE_HEXAHEDRON = 12,
472  112+4096, // CELL_SHAPE_WEDGE = 13,
473  112+4096+832, // CELL_SHAPE_PYRAMID = 14,
474 };
475 
476 // clang-format on
478 {
479 public:
480  template <typename DeviceAdapter>
482  {
483  public:
484  VTKM_EXEC
486  {
487  return this->NumVerticesPerCellPortal.Get(shape);
488  }
489 
490  VTKM_EXEC
492  {
493  vtkm::IdComponent offset = this->NumTrianglesTableOffsetPortal.Get(shape);
494  return this->NumTrianglesTablePortal.Get(offset + caseNumber);
495  }
496 
497  private:
502 
503  friend class CellClassifyTable;
504  };
505 
509  vtkm::CopyFlag::Off))
512  vtkm::CopyFlag::Off))
515  sizeof(NumTrianglesTable) / sizeof(NumTrianglesTable[0]),
516  vtkm::CopyFlag::Off))
517  {
518  }
519 
520  template <typename DeviceAdapter>
522  {
523  ExecObject<DeviceAdapter> execObject;
524  execObject.NumVerticesPerCellPortal =
525  this->NumVerticesPerCellArray.PrepareForInput(DeviceAdapter(), token);
526  execObject.NumTrianglesTableOffsetPortal =
527  this->NumTrianglesTableOffsetArray.PrepareForInput(DeviceAdapter(), token);
528  execObject.NumTrianglesTablePortal =
529  this->NumTrianglesTableArray.PrepareForInput(DeviceAdapter(), token);
530  return execObject;
531  }
532 
533 private:
537 };
538 
540 {
541 public:
542  template <typename DeviceAdapter>
544  {
545  public:
546  VTKM_EXEC
548  vtkm::Id shape,
549  vtkm::IdComponent caseNumber,
550  vtkm::IdComponent triangleNumber,
551  vtkm::IdComponent vertexNumber) const
552  {
553  VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent NumEntriesPerCase[] = {
554  0, // CELL_SHAPE_EMPTY = 0,
555  0, // CELL_SHAPE_VERTEX = 1,
556  0, // CELL_SHAPE_POLY_VERTEX = 2,
557  0, // CELL_SHAPE_LINE = 3,
558  0, // CELL_SHAPE_POLY_LINE = 4,
559  0, // CELL_SHAPE_TRIANGLE = 5,
560  0, // CELL_SHAPE_TRIANGLE_STRIP = 6,
561  0, // CELL_SHAPE_POLYGON = 7,
562  0, // CELL_SHAPE_PIXEL = 8,
563  0, // CELL_SHAPE_QUAD = 9,
564  7, // CELL_SHAPE_TETRA = 10,
565  0, // CELL_SHAPE_VOXEL = 11,
566  16, // CELL_SHAPE_HEXAHEDRON = 12,
567  13, // CELL_SHAPE_WEDGE = 13,
568  13, // CELL_SHAPE_PYRAMID = 14,
569  };
570 
571  vtkm::IdComponent triOffset = TriangleTableOffsetPortal.Get(shape) +
572  NumEntriesPerCase[shape] * caseNumber + triangleNumber * 3;
573  vtkm::IdComponent edgeIndex = TriangleTablePortal.Get(triOffset + vertexNumber);
574  vtkm::IdComponent edgeOffset = EdgeTableOffsetPortal.Get(shape);
575 
576  return { EdgeTablePortal.Get(edgeOffset + edgeIndex * 2 + 0),
577  EdgeTablePortal.Get(edgeOffset + edgeIndex * 2 + 1) };
578  }
579 
580  private:
586  };
587 
588  template <typename DeviceAdapter>
590  {
591  ExecObject<DeviceAdapter> execObject;
592  execObject.EdgeTablePortal = this->EdgeTableArray.PrepareForInput(DeviceAdapter(), token);
593  execObject.EdgeTableOffsetPortal =
594  this->EdgeTableOffsetArray.PrepareForInput(DeviceAdapter(), token);
595  execObject.TriangleTablePortal =
596  this->TriangleTableArray.PrepareForInput(DeviceAdapter(), token);
597  execObject.TriangleTableOffsetPortal =
598  this->TriangleTableOffsetArray.PrepareForInput(DeviceAdapter(), token);
599  return execObject;
600  }
601 
604  sizeof(EdgeTable) / sizeof(EdgeTable[0]),
605  vtkm::CopyFlag::Off))
608  sizeof(EdgeTableOffset) / sizeof(EdgeTableOffset[0]),
609  vtkm::CopyFlag::Off))
612  sizeof(TriangleTable) / sizeof(TriangleTable[0]),
613  vtkm::CopyFlag::Off))
616  sizeof(TriangleTableOffset) / sizeof(TriangleTableOffset[0]),
617  vtkm::CopyFlag::Off))
618  {
619  }
620 
621 private:
626 };
627 }
628 }
629 }
630 #endif // vtk_m_MarchingCellTables_h
vtkm::cont::make_ArrayHandle
VTKM_CONT vtkm::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, vtkm::Id numberOfValues, vtkm::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:217
vtkm::cont::ArrayHandle< vtkm::IdComponent >
ArrayHandle.h
vtkm::NUMBER_OF_CELL_SHAPES
@ NUMBER_OF_CELL_SHAPES
Definition: CellShape.h:52
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::worklet::marching_cells::EdgeTableOffset
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent EdgeTableOffset[]
Definition: MarchingCellTables.h:135
Types.h
vtkm::worklet::marching_cells::TriangleGenerationTable
Definition: MarchingCellTables.h:539
vtkm::cont::ArrayHandle::PrepareForInput
VTKM_CONT ReadPortalType PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this array to be used as an input to an operation in the execution environment.
Definition: ArrayHandle.h:574
vtkm::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
VTKM_STATIC_CONSTEXPR_ARRAY
#define VTKM_STATIC_CONSTEXPR_ARRAY
Definition: ExportMacros.h:107
vtkm::worklet::marching_cells::TriangleGenerationTable::ExecObject::EdgeTablePortal
vtkm::cont::ArrayHandle< vtkm::IdComponent >::ReadPortalType EdgeTablePortal
Definition: MarchingCellTables.h:581
vtkm::worklet::marching_cells::TriangleTableOffset
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent TriangleTableOffset[]
Definition: MarchingCellTables.h:458
vtkm::worklet::marching_cells::CellClassifyTable::NumTrianglesTableOffsetArray
vtkm::cont::ArrayHandle< vtkm::IdComponent > NumTrianglesTableOffsetArray
Definition: MarchingCellTables.h:535
vtkm::worklet::marching_cells::CellClassifyTable::ExecObject::GetNumTriangles
VTKM_EXEC vtkm::IdComponent GetNumTriangles(vtkm::Id shape, vtkm::IdComponent caseNumber) const
Definition: MarchingCellTables.h:491
vtkm::worklet::marching_cells::TriangleGenerationTable::TriangleTableArray
vtkm::cont::ArrayHandle< vtkm::IdComponent > TriangleTableArray
Definition: MarchingCellTables.h:624
vtkm::worklet::marching_cells::CellClassifyTable::NumTrianglesTableArray
vtkm::cont::ArrayHandle< vtkm::IdComponent > NumTrianglesTableArray
Definition: MarchingCellTables.h:536
vtkm::worklet::marching_cells::TriangleGenerationTable::ExecObject::TriangleTableOffsetPortal
vtkm::cont::ArrayHandle< vtkm::IdComponent >::ReadPortalType TriangleTableOffsetPortal
Definition: MarchingCellTables.h:584
CellShape.h
vtkm::cont::ArrayHandle::ReadPortalType
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
X
#define X
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::worklet::marching_cells::TriangleGenerationTable::ExecObject
Definition: MarchingCellTables.h:543
vtkm::worklet::marching_cells::CellClassifyTable::CellClassifyTable
CellClassifyTable()
Definition: MarchingCellTables.h:506
vtkm::worklet::marching_cells::CellClassifyTable::ExecObject::NumVerticesPerCellPortal
vtkm::cont::ArrayHandle< vtkm::IdComponent >::ReadPortalType NumVerticesPerCellPortal
Definition: MarchingCellTables.h:498
vtkm::worklet::marching_cells::CellClassifyTable
Definition: MarchingCellTables.h:477
vtkm::worklet::marching_cells::TriangleGenerationTable::TriangleGenerationTable
TriangleGenerationTable()
Definition: MarchingCellTables.h:602
vtkm::worklet::marching_cells::TriangleGenerationTable::ExecObject::EdgeTableOffsetPortal
vtkm::cont::ArrayHandle< vtkm::IdComponent >::ReadPortalType EdgeTableOffsetPortal
Definition: MarchingCellTables.h:582
vtkm::worklet::marching_cells::CellClassifyTable::PrepareForExecution
ExecObject< DeviceAdapter > PrepareForExecution(DeviceAdapter, vtkm::cont::Token &token)
Definition: MarchingCellTables.h:521
vtkm::worklet::marching_cells::NumVerticesPerCellTable
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent NumVerticesPerCellTable[]
Definition: MarchingCellTables.h:27
vtkm::worklet::marching_cells::CellClassifyTable::ExecObject::NumTrianglesTableOffsetPortal
vtkm::cont::ArrayHandle< vtkm::IdComponent >::ReadPortalType NumTrianglesTableOffsetPortal
Definition: MarchingCellTables.h:501
vtkm::worklet::marching_cells::TriangleTable
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent TriangleTable[]
Definition: MarchingCellTables.h:153
vtkm::worklet::marching_cells::TriangleGenerationTable::EdgeTableArray
vtkm::cont::ArrayHandle< vtkm::IdComponent > EdgeTableArray
Definition: MarchingCellTables.h:622
vtkm::worklet::marching_cells::TriangleGenerationTable::ExecObject::TriangleTablePortal
vtkm::cont::ArrayHandle< vtkm::IdComponent >::ReadPortalType TriangleTablePortal
Definition: MarchingCellTables.h:583
vtkm::worklet::marching_cells::CellClassifyTable::NumVerticesPerCellArray
vtkm::cont::ArrayHandle< vtkm::IdComponent > NumVerticesPerCellArray
Definition: MarchingCellTables.h:534
vtkm::cont::ExecutionObjectBase
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
vtkm::worklet::marching_cells::NumTrianglesTable
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent NumTrianglesTable[]
Definition: MarchingCellTables.h:63
vtkm::worklet::marching_cells::CellClassifyTable::ExecObject::NumTrianglesTablePortal
vtkm::cont::ArrayHandle< vtkm::IdComponent >::ReadPortalType NumTrianglesTablePortal
Definition: MarchingCellTables.h:499
vtkm::worklet::marching_cells::EdgeTable
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent EdgeTable[]
Definition: MarchingCellTables.h:93
vtkm::CopyFlag
CopyFlag
Definition: Flags.h:16
vtkm::worklet::marching_cells::CellClassifyTable::ExecObject::GetNumVerticesPerCell
VTKM_EXEC vtkm::IdComponent GetNumVerticesPerCell(vtkm::Id shape) const
Definition: MarchingCellTables.h:485
vtkm::worklet::marching_cells::TriangleGenerationTable::TriangleTableOffsetArray
vtkm::cont::ArrayHandle< vtkm::IdComponent > TriangleTableOffsetArray
Definition: MarchingCellTables.h:625
vtkm::worklet::marching_cells::TriangleGenerationTable::EdgeTableOffsetArray
vtkm::cont::ArrayHandle< vtkm::IdComponent > EdgeTableOffsetArray
Definition: MarchingCellTables.h:623
vtkm::worklet::marching_cells::NumTrianglesTableOffset
VTKM_STATIC_CONSTEXPR_ARRAY vtkm::IdComponent NumTrianglesTableOffset[]
Definition: MarchingCellTables.h:45
ExecutionObjectBase.h
vtkm::Pair
A vtkm::Pair is essentially the same as an STL pair object except that the methods (constructors and ...
Definition: Pair.h:29
vtkm::worklet::marching_cells::TriangleGenerationTable::PrepareForExecution
ExecObject< DeviceAdapter > PrepareForExecution(DeviceAdapter, vtkm::cont::Token &token)
Definition: MarchingCellTables.h:589
vtkm::worklet::marching_cells::TriangleGenerationTable::ExecObject::GetEdgeVertices
VTKM_EXEC vtkm::Pair< vtkm::IdComponent, vtkm::IdComponent > GetEdgeVertices(vtkm::Id shape, vtkm::IdComponent caseNumber, vtkm::IdComponent triangleNumber, vtkm::IdComponent vertexNumber) const
Definition: MarchingCellTables.h:547
vtkm::worklet::marching_cells::CellClassifyTable::ExecObject
Definition: MarchingCellTables.h:481