18 #ifndef viskores_rendering_Cylinderizer_h
19 #define viskores_rendering_Cylinderizer_h
27 #include <viskores/rendering/raytracing/MeshConnectivityBuilder.h>
34 #define TRI_PER_CSS 12
105 #if defined(VISKORES_MSVC)
106 #pragma warning(push)
107 #pragma warning(disable : 4127) //conditional expression is constant
109 template <
typename CellNodeVecType,
typename OutIndicesPortal>
113 const CellNodeVecType& cellIndices,
114 OutIndicesPortal& outputIndices)
const
119 outputIndices.Set(offset, segment);
123 outputIndices.Set(offset + 1, segment);
127 outputIndices.Set(offset + 2, segment);
129 template <
typename CellNodeVecType,
typename OutIndicesPortal>
132 OutIndicesPortal& outputIndices)
const
142 segment[0] = cellIndex;
147 cell2seg(idx, segment, offset, cellIndices, outputIndices);
152 cell2seg(idx, segment, offset, cellIndices, outputIndices);
157 cell2seg(idx, segment, offset, cellIndices, outputIndices);
162 cell2seg(idx, segment, offset, cellIndices, outputIndices);
167 cell2seg(idx, segment, offset, cellIndices, outputIndices);
172 cell2seg(idx, segment, offset, cellIndices, outputIndices);
177 cell2seg(idx, segment, offset, cellIndices, outputIndices);
182 cell2seg(idx, segment, offset, cellIndices, outputIndices);
187 cell2seg(idx, segment, offset, cellIndices, outputIndices);
192 cell2seg(idx, segment, offset, cellIndices, outputIndices);
197 cell2seg(idx, segment, offset, cellIndices, outputIndices);
202 cell2seg(idx, segment, offset, cellIndices, outputIndices);
205 #if defined(VISKORES_MSVC)
220 template <
typename VecType,
typename OutputPortal>
222 const VecType& cellIndices,
227 OutputPortal& outputIndices)
const
233 outputIndices.Set(offset++, segment);
237 outputIndices.Set(offset++, segment);
241 outputIndices.Set(offset++, segment);
245 template <
typename VecType,
typename OutputPortal>
248 const VecType& cellIndices,
250 OutputPortal& outputIndices)
const
256 segment[1] = cellIndices[0];
257 segment[2] = cellIndices[1];
258 outputIndices.Set(offset, segment);
260 segment[1] = cellIndices[1];
261 segment[2] = cellIndices[2];
262 outputIndices.Set(offset + 1, segment);
264 segment[1] = cellIndices[2];
265 segment[2] = cellIndices[3];
266 outputIndices.Set(offset + 2, segment);
268 segment[1] = cellIndices[3];
269 segment[2] = cellIndices[0];
270 outputIndices.Set(offset + 3, segment);
274 template <
typename VecType,
typename OutputPortal>
277 const VecType& cellIndices,
279 OutputPortal& outputIndices)
const
283 tri2seg(offset, cellIndices, cellId, 0, 1, 5, outputIndices);
284 tri2seg(offset, cellIndices, cellId, 0, 5, 4, outputIndices);
285 tri2seg(offset, cellIndices, cellId, 1, 2, 6, outputIndices);
286 tri2seg(offset, cellIndices, cellId, 1, 6, 5, outputIndices);
287 tri2seg(offset, cellIndices, cellId, 3, 7, 6, outputIndices);
288 tri2seg(offset, cellIndices, cellId, 3, 6, 2, outputIndices);
289 tri2seg(offset, cellIndices, cellId, 0, 4, 7, outputIndices);
290 tri2seg(offset, cellIndices, cellId, 0, 7, 3, outputIndices);
291 tri2seg(offset, cellIndices, cellId, 0, 3, 2, outputIndices);
292 tri2seg(offset, cellIndices, cellId, 0, 2, 1, outputIndices);
293 tri2seg(offset, cellIndices, cellId, 4, 5, 6, outputIndices);
294 tri2seg(offset, cellIndices, cellId, 4, 6, 7, outputIndices);
296 template <
typename VecType,
typename OutputPortal>
299 const VecType& cellIndices,
301 OutputPortal& outputIndices)
const
305 tri2seg(offset, cellIndices, cellId, 0, 1, 2, outputIndices);
306 tri2seg(offset, cellIndices, cellId, 3, 5, 4, outputIndices);
307 tri2seg(offset, cellIndices, cellId, 3, 0, 2, outputIndices);
308 tri2seg(offset, cellIndices, cellId, 3, 2, 5, outputIndices);
309 tri2seg(offset, cellIndices, cellId, 1, 4, 5, outputIndices);
310 tri2seg(offset, cellIndices, cellId, 1, 5, 2, outputIndices);
311 tri2seg(offset, cellIndices, cellId, 0, 3, 4, outputIndices);
312 tri2seg(offset, cellIndices, cellId, 0, 4, 1, outputIndices);
314 template <
typename VecType,
typename OutputPortal>
317 const VecType& cellIndices,
319 OutputPortal& outputIndices)
const
327 segment[1] = cellIndices[0];
328 segment[2] = cellIndices[1];
329 outputIndices.Set(pointOffset, segment);
335 segment[1] = cellIndices[0];
336 segment[2] = cellIndices[1];
337 outputIndices.Set(pointOffset, segment);
339 segment[1] = cellIndices[1];
340 segment[2] = cellIndices[2];
341 outputIndices.Set(pointOffset + 1, segment);
343 segment[1] = cellIndices[2];
344 segment[2] = cellIndices[0];
345 outputIndices.Set(pointOffset + 2, segment);
351 segment[1] = cellIndices[0];
352 segment[2] = cellIndices[1];
353 outputIndices.Set(pointOffset, segment);
355 segment[1] = cellIndices[1];
356 segment[2] = cellIndices[2];
357 outputIndices.Set(pointOffset + 1, segment);
359 segment[1] = cellIndices[2];
360 segment[2] = cellIndices[3];
361 outputIndices.Set(pointOffset + 2, segment);
363 segment[1] = cellIndices[3];
364 segment[2] = cellIndices[0];
365 outputIndices.Set(pointOffset + 3, segment);
370 tri2seg(offset, cellIndices, cellId, 0, 3, 1, outputIndices);
371 tri2seg(offset, cellIndices, cellId, 1, 2, 3, outputIndices);
372 tri2seg(offset, cellIndices, cellId, 0, 2, 3, outputIndices);
373 tri2seg(offset, cellIndices, cellId, 0, 2, 1, outputIndices);
378 tri2seg(offset, cellIndices, cellId, 0, 1, 5, outputIndices);
379 tri2seg(offset, cellIndices, cellId, 0, 5, 4, outputIndices);
380 tri2seg(offset, cellIndices, cellId, 1, 2, 6, outputIndices);
381 tri2seg(offset, cellIndices, cellId, 1, 6, 5, outputIndices);
382 tri2seg(offset, cellIndices, cellId, 3, 7, 6, outputIndices);
383 tri2seg(offset, cellIndices, cellId, 3, 6, 2, outputIndices);
384 tri2seg(offset, cellIndices, cellId, 0, 4, 7, outputIndices);
385 tri2seg(offset, cellIndices, cellId, 0, 7, 3, outputIndices);
386 tri2seg(offset, cellIndices, cellId, 0, 3, 2, outputIndices);
387 tri2seg(offset, cellIndices, cellId, 0, 2, 1, outputIndices);
388 tri2seg(offset, cellIndices, cellId, 4, 5, 6, outputIndices);
389 tri2seg(offset, cellIndices, cellId, 4, 6, 7, outputIndices);
394 tri2seg(offset, cellIndices, cellId, 0, 1, 2, outputIndices);
395 tri2seg(offset, cellIndices, cellId, 3, 5, 4, outputIndices);
396 tri2seg(offset, cellIndices, cellId, 3, 0, 2, outputIndices);
397 tri2seg(offset, cellIndices, cellId, 3, 2, 5, outputIndices);
398 tri2seg(offset, cellIndices, cellId, 1, 4, 5, outputIndices);
399 tri2seg(offset, cellIndices, cellId, 1, 5, 2, outputIndices);
400 tri2seg(offset, cellIndices, cellId, 0, 3, 4, outputIndices);
401 tri2seg(offset, cellIndices, cellId, 0, 4, 1, outputIndices);
407 tri2seg(offset, cellIndices, cellId, 0, 4, 1, outputIndices);
408 tri2seg(offset, cellIndices, cellId, 1, 2, 4, outputIndices);
409 tri2seg(offset, cellIndices, cellId, 2, 3, 4, outputIndices);
410 tri2seg(offset, cellIndices, cellId, 0, 4, 3, outputIndices);
411 tri2seg(offset, cellIndices, cellId, 3, 2, 1, outputIndices);
412 tri2seg(offset, cellIndices, cellId, 3, 1, 0, outputIndices);
437 segInvoker.Invoke(cellSetStructured3D, cellIdxs, outputIndices);
443 auto cellSetUnstructured =
448 countInvoker.Invoke(cellSetUnstructured, segmentsPerCell);
458 cylInvoker.Invoke(cellSetUnstructured, cellOffsets, outputIndices);