10 #ifndef vtk_m_rendering_Quadralizer_h
11 #define vtk_m_rendering_Quadralizer_h
25 #define QUAD_PER_CSS 6
91 #if defined(VTKM_MSVC)
93 #pragma warning(disable : 4127) //conditional expression is constant
95 template <
typename CellNodeVecType,
typename OutIndicesPortal>
99 const CellNodeVecType& cellIndices,
100 OutIndicesPortal& outputIndices)
const
107 outputIndices.Set(offset, quad);
110 template <
typename CellNodeVecType,
typename OutIndicesPortal>
113 OutIndicesPortal& outputIndices)
const
118 cellIndex, { cellIndex, cellIndices[0], cellIndices[1], cellIndices[2], cellIndices[3] });
130 cell2quad(idx, quad, offset, cellIndices, outputIndices);
137 cell2quad(idx, quad, offset, cellIndices, outputIndices);
144 cell2quad(idx, quad, offset, cellIndices, outputIndices);
151 cell2quad(idx, quad, offset, cellIndices, outputIndices);
158 cell2quad(idx, quad, offset, cellIndices, outputIndices);
165 cell2quad(idx, quad, offset, cellIndices, outputIndices);
168 #if defined(VTKM_MSVC)
183 template <
typename VecType,
typename OutputPortal>
185 const VecType& cellIndices,
191 OutputPortal& outputIndices)
const
199 outputIndices.Set(offset++, quad);
202 template <
typename VecType,
typename OutputPortal>
205 const VecType& cellIndices,
207 OutputPortal& outputIndices)
const
211 cell2quad(offset, cellIndices, cellId, 3, 0, 2, 5, outputIndices);
212 cell2quad(offset, cellIndices, cellId, 1, 4, 5, 2, outputIndices);
213 cell2quad(offset, cellIndices, cellId, 0, 3, 4, 1, outputIndices);
215 template <
typename VecType,
typename OutputPortal>
217 vtkm::CellShapeTagQuad shapeType,
218 const VecType& cellIndices,
220 OutputPortal& outputIndices)
const
226 quad[1] =
static_cast<vtkm::Id>(cellIndices[0]);
227 quad[2] =
static_cast<vtkm::Id>(cellIndices[1]);
228 quad[3] =
static_cast<vtkm::Id>(cellIndices[2]);
229 quad[4] =
static_cast<vtkm::Id>(cellIndices[3]);
230 outputIndices.Set(offset, quad);
234 template <
typename VecType,
typename OutputPortal>
236 vtkm::CellShapeTagHexahedron
vtkmNotUsed(shapeType),
237 const VecType& cellIndices,
239 OutputPortal& outputIndices)
const
243 cell2quad(offset, cellIndices, cellId, 0, 1, 5, 4, outputIndices);
244 cell2quad(offset, cellIndices, cellId, 1, 2, 6, 5, outputIndices);
245 cell2quad(offset, cellIndices, cellId, 3, 7, 6, 2, outputIndices);
246 cell2quad(offset, cellIndices, cellId, 0, 4, 7, 3, outputIndices);
247 cell2quad(offset, cellIndices, cellId, 0, 3, 2, 1, outputIndices);
248 cell2quad(offset, cellIndices, cellId, 4, 5, 6, 7, outputIndices);
251 template <
typename VecType,
typename OutputPortal>
254 const VecType& cellIndices,
256 OutputPortal& outputIndices)
const
263 quad[1] = cellIndices[0];
264 quad[2] = cellIndices[1];
265 quad[3] = cellIndices[2];
266 quad[4] = cellIndices[3];
267 outputIndices.Set(pointOffset, quad);
272 cell2quad(offset, cellIndices, cellId, 0, 1, 5, 4, outputIndices);
273 cell2quad(offset, cellIndices, cellId, 1, 2, 6, 5, outputIndices);
274 cell2quad(offset, cellIndices, cellId, 3, 7, 6, 2, outputIndices);
275 cell2quad(offset, cellIndices, cellId, 0, 4, 7, 3, outputIndices);
276 cell2quad(offset, cellIndices, cellId, 0, 3, 2, 1, outputIndices);
277 cell2quad(offset, cellIndices, cellId, 4, 5, 6, 7, outputIndices);
283 cell2quad(offset, cellIndices, cellId, 3, 0, 2, 5, outputIndices);
284 cell2quad(offset, cellIndices, cellId, 1, 4, 5, 2, outputIndices);
285 cell2quad(offset, cellIndices, cellId, 0, 3, 4, 1, outputIndices);
291 cell2quad(offset, cellIndices, cellId, 3, 2, 1, 0, outputIndices);
327 outputIndices.Allocate(numCells);
334 auto cellSetUnstructured =
337 invoke(
CountQuads{}, cellSetUnstructured, quadsPerCell);
344 outputIndices.Allocate(total);
346 invoke(
Quadralize{}, cellSetUnstructured, cellOffsets, outputIndices);