18 #ifndef viskores_worklet_internal_TriangulateTables_h
19 #define viskores_worklet_internal_TriangulateTables_h
35 using TriangulateArrayHandle =
88 class TriangulateTablesExecutionObject
94 TriangulateTablesExecutionObject(
const TriangulateArrayHandle& counts,
95 const TriangulateArrayHandle& offsets,
96 const TriangulateArrayHandle& indices,
99 : Counts(counts.PrepareForInput(device, token))
100 , Offsets(offsets.PrepareForInput(device, token))
101 , Indices(indices.PrepareForInput(device, token))
105 template <
typename CellShape>
111 return numPoints - 2;
115 return this->Counts.Get(shape.Id);
119 template <
typename CellShape>
127 triIndices[1] = triangleIndex + 1;
128 triIndices[2] = triangleIndex + 2;
133 triIndices[0] = this->Indices.Get(offset + 0);
134 triIndices[1] = this->Indices.Get(offset + 1);
135 triIndices[2] = this->Indices.Get(offset + 2);
152 return TriangulateTablesExecutionObject(
153 this->Counts, this->Offsets, this->Indices, device, token);
171 TriangulateArrayHandle Counts;
172 TriangulateArrayHandle Offsets;
173 TriangulateArrayHandle Indices;
263 class TetrahedralizeTablesExecutionObject
267 template <
typename Device>
268 VISKORES_CONT TetrahedralizeTablesExecutionObject PrepareForExecution(Device)
const
274 TetrahedralizeTablesExecutionObject(
const TriangulateArrayHandle& counts,
275 const TriangulateArrayHandle& offsets,
276 const TriangulateArrayHandle& indices,
279 : Counts(counts.PrepareForInput(device, token))
280 , Offsets(offsets.PrepareForInput(device, token))
281 , Indices(indices.PrepareForInput(device, token))
285 template <
typename CellShape>
288 return this->Counts.Get(shape.Id);
291 template <
typename CellShape>
297 tetIndices[0] = this->Indices.Get(offset + 0);
298 tetIndices[1] = this->Indices.Get(offset + 1);
299 tetIndices[2] = this->Indices.Get(offset + 2);
300 tetIndices[3] = this->Indices.Get(offset + 3);
314 TetrahedralizeTables()
330 return TetrahedralizeTablesExecutionObject(
331 this->Counts, this->Offsets, this->Indices, device, token);
335 TriangulateArrayHandle Counts;
336 TriangulateArrayHandle Offsets;
337 TriangulateArrayHandle Indices;
344 #endif //viskores_worklet_internal_TriangulateTables_h