10 #ifndef vtk_m_worklet_internal_TriangulateTables_h
11 #define vtk_m_worklet_internal_TriangulateTables_h
27 using TriangulateArrayHandle =
80 class TriangulateTablesExecutionObject
86 TriangulateTablesExecutionObject(
const TriangulateArrayHandle& counts,
87 const TriangulateArrayHandle& offsets,
88 const TriangulateArrayHandle& indices,
91 : Counts(counts.PrepareForInput(device, token))
92 , Offsets(offsets.PrepareForInput(device, token))
93 , Indices(indices.PrepareForInput(device, token))
97 template <
typename CellShape>
102 return numPoints - 2;
106 return this->Counts.Get(shape.Id);
110 template <
typename CellShape>
117 triIndices[1] = triangleIndex + 1;
118 triIndices[2] = triangleIndex + 2;
123 triIndices[0] = this->Indices.Get(offset + 0);
124 triIndices[1] = this->Indices.Get(offset + 1);
125 triIndices[2] = this->Indices.Get(offset + 2);
142 return TriangulateTablesExecutionObject(
143 this->Counts, this->Offsets, this->Indices, device, token);
161 TriangulateArrayHandle Counts;
162 TriangulateArrayHandle Offsets;
163 TriangulateArrayHandle Indices;
253 class TetrahedralizeTablesExecutionObject
257 template <
typename Device>
258 VTKM_CONT TetrahedralizeTablesExecutionObject PrepareForExecution(Device)
const
264 TetrahedralizeTablesExecutionObject(
const TriangulateArrayHandle& counts,
265 const TriangulateArrayHandle& offsets,
266 const TriangulateArrayHandle& indices,
269 : Counts(counts.PrepareForInput(device, token))
270 , Offsets(offsets.PrepareForInput(device, token))
271 , Indices(indices.PrepareForInput(device, token))
275 template <
typename CellShape>
278 return this->Counts.Get(shape.Id);
281 template <
typename CellShape>
286 tetIndices[0] = this->Indices.Get(offset + 0);
287 tetIndices[1] = this->Indices.Get(offset + 1);
288 tetIndices[2] = this->Indices.Get(offset + 2);
289 tetIndices[3] = this->Indices.Get(offset + 3);
303 TetrahedralizeTables()
316 VTKM_CONT TetrahedralizeTablesExecutionObject
319 return TetrahedralizeTablesExecutionObject(
320 this->Counts, this->Offsets, this->Indices, device, token);
324 TriangulateArrayHandle Counts;
325 TriangulateArrayHandle Offsets;
326 TriangulateArrayHandle Indices;
333 #endif //vtk_m_worklet_internal_TriangulateTables_h