Go to the documentation of this file.
13 #ifndef vtk_m_worklet_contour_flyingedges_pass4_common_h
14 #define vtk_m_worklet_contour_flyingedges_pass4_common_h
23 namespace flying_edges
28 return vtkm::Id3{ 1, dims[0], (dims[0] * dims[1]) };
39 return cellId + (y_point_axis_inc - 1);
44 return (edgeUses[0] != 0 || edgeUses[4] != 0 || edgeUses[8] != 0);
47 template <
typename WholeConnField,
typename WholeCellIdField>
53 const WholeConnField& conn,
54 const WholeCellIdField& cellIds)
61 cellIds.Set(triId + i, inputCellId);
67 conn.Set(index, edgeIds[edges[edgeIndex]]);
68 conn.Set(index + 1, edgeIds[edges[edgeIndex + 2]]);
69 conn.Set(index + 2, edgeIds[edges[edgeIndex + 1]]);
79 template <
typename AxisToSum,
typename FieldInPo
intId3>
83 const FieldInPointId3& axis_sums,
87 edgeIds[0] = writeOffset + axis_sums[0][AxisToSum::xindex];
88 edgeIds[1] = writeOffset + axis_sums[1][AxisToSum::xindex];
89 edgeIds[2] = writeOffset + axis_sums[3][AxisToSum::xindex];
90 edgeIds[3] = writeOffset + axis_sums[2][AxisToSum::xindex];
91 edgeIds[4] = writeOffset + axis_sums[0][AxisToSum::yindex];
92 edgeIds[5] = edgeIds[4] + edgeUses[4];
93 edgeIds[6] = writeOffset + axis_sums[3][AxisToSum::yindex];
94 edgeIds[7] = edgeIds[6] + edgeUses[6];
95 edgeIds[8] = writeOffset + axis_sums[0][AxisToSum::zindex];
96 edgeIds[9] = edgeIds[8] + edgeUses[8];
97 edgeIds[10] = writeOffset + axis_sums[1][AxisToSum::zindex];
98 edgeIds[11] = edgeIds[10] + edgeUses[10];
105 edgeIds[0] += edgeUses[0];
106 edgeIds[1] += edgeUses[1];
107 edgeIds[2] += edgeUses[2];
108 edgeIds[3] += edgeUses[3];
109 edgeIds[4] += edgeUses[4];
110 edgeIds[5] = edgeIds[4] + edgeUses[5];
111 edgeIds[6] += edgeUses[6];
112 edgeIds[7] = edgeIds[6] + edgeUses[7];
113 edgeIds[8] += edgeUses[8];
114 edgeIds[9] = edgeIds[8] + edgeUses[9];
115 edgeIds[10] += edgeUses[10];
116 edgeIds[11] = edgeIds[10] + edgeUses[11];
130 template <
typename AxisToSum,
131 typename ThreadIndices,
132 typename WholeSumField,
133 typename FieldInPointId,
134 typename WholeEdgeField>
137 const ThreadIndices& threadIndices,
139 const FieldInPointId& axis_mins,
140 const FieldInPointId& axis_maxs,
141 const WholeEdgeField& edges)
168 if (
ijk[AxisToSum::xindex] < 1)
172 if (
ijk[AxisToSum::xindex] >= (pdims[AxisToSum::xindex] - 2))
176 if (
ijk[AxisToSum::yindex] < 1)
180 if (
ijk[AxisToSum::yindex] >= (pdims[AxisToSum::yindex] - 2))
184 if (
ijk[AxisToSum::zindex] < 1)
188 if (
ijk[AxisToSum::zindex] >= (pdims[AxisToSum::zindex] - 2))
194 template <
typename AxisToSum>
201 ijk[AxisToSum::xindex]++;
205 if (
ijk[AxisToSum::xindex] >= (pdims[AxisToSum::xindex] - 2))
vtkm::Id cellId
Definition: FlyingEdgesPass4Common.h:125
VTKM_EXEC vtkm::Id3 compute_ijk(SumXAxis, const vtkm::Id3 &executionSpaceIJK)
Definition: FlyingEdgesHelpers.h:96
VTKM_EXEC void generate_tris(vtkm::Id inputCellId, vtkm::UInt8 edgeCase, vtkm::UInt8 numTris, vtkm::Id *edgeIds, vtkm::Id &triId, const WholeConnField &conn, const WholeCellIdField &cellIds)
Definition: FlyingEdgesPass4Common.h:48
VTKM_EXEC bool case_includes_axes(vtkm::UInt8 const *const edgeUses)
Definition: FlyingEdgesPass4Common.h:42
#define VTKM_EXEC
Definition: ExportMacros.h:51
VTKM_EXEC vtkm::UInt8 const * GetEdgeUses(vtkm::UInt8 edgecase)
Definition: FlyingEdgesTables.h:42
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Vec< vtkm::UInt8, 3 > boundaryStatus
Definition: FlyingEdgesPass4Common.h:127
VTKM_EXEC vtkm::Id4 compute_neighbor_starts(SumXAxis, const vtkm::Id3 &ijk, const vtkm::Id3 &pdims)
Definition: FlyingEdgesHelpers.h:140
@ MaxBoundary
Definition: FlyingEdgesHelpers.h:47
vtkm::Id left
Definition: FlyingEdgesPass4Common.h:122
VTKM_EXEC vtkm::Id compute_start(SumXAxis, const vtkm::Id3 &ijk, const vtkm::Id3 &dims)
Definition: FlyingEdgesHelpers.h:131
VTKM_EXEC vtkm::Id3 compute_incs3d(const vtkm::Id3 &dims)
Definition: FlyingEdgesPass4Common.h:26
vtkm::Id axis_inc
Definition: FlyingEdgesPass4Common.h:126
bool hasWork
Definition: FlyingEdgesPass4Common.h:128
VTKM_EXEC bool computeTrimBounds(vtkm::Id rightMax, const WholeEdgeField &edges, const FieldInPointId &axis_mins, const FieldInPointId &axis_maxs, const vtkm::Id4 &startPos, vtkm::Id inc, vtkm::Id &left, vtkm::Id &right)
Definition: FlyingEdgesHelpers.h:200
@ Interior
Definition: FlyingEdgesHelpers.h:45
Definition: FlyingEdgesPass4Common.h:120
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::Id3 ijk
Definition: FlyingEdgesPass4Common.h:123
Definition: FlyingEdgesHelpers.h:51
constexpr VTKM_EXEC vtkm::Id increment_cellId(SumXAxis, vtkm::Id cellId, vtkm::Id)
Definition: FlyingEdgesPass4Common.h:31
VTKM_EXEC void increment(AxisToSum, const vtkm::Id3 &pdims)
Definition: FlyingEdgesPass4Common.h:195
VTKM_EXEC bool fully_interior(const vtkm::Vec< vtkm::UInt8, 3 > &boundaryStatus)
Definition: FlyingEdgesPass4Common.h:219
VTKM_EXEC Pass4TrimState(AxisToSum, const vtkm::Id3 &pdims, const ThreadIndices &threadIndices, const WholeSumField &vtkmNotUsed(axis_sums), const FieldInPointId &axis_mins, const FieldInPointId &axis_maxs, const WholeEdgeField &edges)
Definition: FlyingEdgesPass4Common.h:135
VTKM_EXEC vtkm::Id compute_inc(SumXAxis, const vtkm::Id3 &)
Definition: FlyingEdgesHelpers.h:174
uint8_t UInt8
Definition: Types.h:157
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
VTKM_EXEC void advance_voxelIds(vtkm::UInt8 const *const edgeUses, vtkm::Id *edgeIds)
Definition: FlyingEdgesPass4Common.h:103
VTKM_EXEC vtkm::UInt8 const * GetTriEdgeCases(vtkm::UInt8 edgecase)
Definition: FlyingEdgesTables.h:116
Definition: FlyingEdgesHelpers.h:57
VTKM_EXEC void init_voxelIds(AxisToSum, vtkm::Id writeOffset, vtkm::UInt8 edgeCase, const FieldInPointId3 &axis_sums, vtkm::Id *edgeIds)
Definition: FlyingEdgesPass4Common.h:80
vtkm::Id right
Definition: FlyingEdgesPass4Common.h:122
vtkm::Id4 startPos
Definition: FlyingEdgesPass4Common.h:124
@ MinBoundary
Definition: FlyingEdgesHelpers.h:46