Go to the documentation of this file.
10 #ifndef vtk_m_rendering_raytracing_Cell_Intersector_h
11 #define vtk_m_rendering_raytracing_Cell_Intersector_h
45 for (
int i = 0; i < 6; ++i)
47 for (
int i = 0; i < numTriangles; ++i)
51 a[0] = xpoints[tables.
ZooTable(offset, 1)];
52 a[1] = ypoints[tables.
ZooTable(offset, 1)];
53 a[2] = zpoints[tables.
ZooTable(offset, 1)];
54 b[0] = xpoints[tables.
ZooTable(offset, 2)];
55 b[1] = ypoints[tables.
ZooTable(offset, 2)];
56 b[2] = zpoints[tables.
ZooTable(offset, 2)];
57 c[0] = xpoints[tables.
ZooTable(offset, 3)];
58 c[1] = ypoints[tables.
ZooTable(offset, 3)];
59 c[2] = zpoints[tables.
ZooTable(offset, 3)];
64 intersector.
IntersectTriSn(a, b, c, s, k, distance, uNotUsed, vNotUsed, origin);
68 if (distances[faceId] != -1.f)
69 distances[faceId] = vtkm::Min(distance, distances[faceId]);
71 distances[faceId] = distance;
91 for (
int i = 0; i < 6; ++i)
107 distances[i] = distance;
109 T uNotUsed, vNotUsed;
110 intersector.
IntersectTriSn(a, b, c, s, k, distance, uNotUsed, vNotUsed, origin);
112 if (distance != -1.f)
113 distances[i] = distance;
117 intersector.
IntersectTriSn(a, c, d, s, k, distance, uNotUsed, vNotUsed, origin);
121 if (distance != -1.f)
123 if (distances[i] != -1.f)
124 distances[i] = vtkm::Min(distance, distances[i]);
126 distances[i] = distance;
130 template <
typename T>
142 intersector.
FindDir(dir, s, k);
159 distances[i] = distance;
161 T uNotUsed, vNotUsed;
163 intersector.
IntersectTriSn(a, b, c, s, k, distance, uNotUsed, vNotUsed, origin);
165 if (distance != -1.f)
166 distances[i] = distance;
173 template <
typename T>
185 intersector.
FindDir(dir, s, k);
190 for (
int i = 0; i < 5; ++i)
206 distances[i] = distance;
208 T uNotUsed, vNotUsed;
210 intersector.
IntersectTriSn(a, b, c, s, k, distance, uNotUsed, vNotUsed, origin);
212 if (distance != -1.f)
213 distances[i] = distance;
221 intersector.
IntersectTriSn(a, c, d, s, k, distance, uNotUsed, vNotUsed, origin);
223 if (distance != -1.f)
225 if (distances[i] != -1.f)
226 distances[i] = vtkm::Min(distance, distances[i]);
228 distances[i] = distance;
237 template <
int CellType>
241 template <
typename T>
258 template <
typename T>
269 IntersectZoo(xpoints, ypoints, zpoints, dir, origin, distances, cellShape);
273 printf(
"CellIntersector Hex Error: unsupported cell type. Doing nothing\n");
285 template <
typename T>
296 IntersectZoo(xpoints, ypoints, zpoints, dir, origin, distances, cellShape);
300 printf(
"CellIntersector Hex Error: unsupported cell type. Doing nothing\n");
312 template <
typename T>
323 IntersectTet(xpoints, ypoints, zpoints, dir, origin, distances);
327 printf(
"CellIntersector Tet Error: unsupported cell type. Doing nothing\n");
339 template <
typename T>
350 IntersectWedge(xpoints, ypoints, zpoints, dir, origin, distances);
354 printf(
"CellIntersector Wedge Error: unsupported cell type. Doing nothing\n");
365 template <
typename T>
374 IntersectZoo(xpoints, ypoints, zpoints, dir, origin, distances, cellShape);
VTKM_EXEC vtkm::Int32 FaceLookUp(vtkm::Int32 x, vtkm::Int32 y) const
Definition: CellTables.h:48
@ CELL_SHAPE_WEDGE
Definition: CellShape.h:49
VTKM_EXEC_CONT void IntersectCell(T *xpoints, T *ypoints, T *zpoints, const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T *distances, const vtkm::UInt8 cellShape=12) const
Definition: CellIntersector.h:286
Groups connected points that have the same field value.
Definition: Atomic.h:19
Definition: CellIntersector.h:238
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_EXEC_CONT void IntersectHex(T xpoints[8], T ypoints[8], T zpoints[8], const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T distances[6])
Definition: CellIntersector.h:76
VTKM_EXEC_CONT void IntersectTet(T xpoints[8], T ypoints[8], T zpoints[8], const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T distances[6])
Definition: CellIntersector.h:131
VTKM_EXEC_CONT void IntersectCell(T *xpoints, T *ypoints, T *zpoints, const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T distances[6], const vtkm::UInt8 cellShape=12) const
Definition: CellIntersector.h:313
VTKM_EXEC vtkm::Int32 CellTypeLookUp(vtkm::Int32 x) const
Definition: CellTables.h:25
VTKM_EXEC void FindDir(const vtkm::Vec< Precision, 3 > &dir, vtkm::Vec< Precision, 3 > &s, vtkm::Vec< Int32, 3 > &k) const
Definition: TriangleIntersections.h:81
Definition: CellTables.h:22
@ CELL_SHAPE_TETRA
Definition: CellShape.h:46
VTKM_EXEC vtkm::Int32 ZooTable(vtkm::Int32 x, vtkm::Int32 y) const
Definition: CellTables.h:104
VTKM_EXEC_CONT void IntersectCell(T *xpoints, T *ypoints, T *zpoints, const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T *distances, const vtkm::UInt8 cellShape=12) const
Definition: CellIntersector.h:259
VTKM_EXEC void IntersectTriSn(const vtkm::Vec< Precision, 3 > &a, const vtkm::Vec< Precision, 3 > &b, const vtkm::Vec< Precision, 3 > &c, const vtkm::Vec< Precision, 3 > &s, const vtkm::Vec< Int32, 3 > &k, Precision &distance, Precision &u, Precision &v, const vtkm::Vec< Precision, 3 > &origin) const
Definition: TriangleIntersections.h:227
@ CELL_SHAPE_HEXAHEDRON
Definition: CellShape.h:48
uint8_t UInt8
Definition: Types.h:157
VTKM_EXEC_CONT void IntersectWedge(T xpoints[8], T ypoints[8], T zpoints[8], const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T distances[6])
Definition: CellIntersector.h:174
VTKM_EXEC_CONT void IntersectCell(T *xpoints, T *ypoints, T *zpoints, const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T distances[6], const vtkm::UInt8 cellShape=12) const
Definition: CellIntersector.h:340
VTKM_EXEC vtkm::Int32 ShapesFaceList(vtkm::Int32 x, vtkm::Int32 y) const
Definition: CellTables.h:68
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
Definition: TriangleIntersections.h:77
VTKM_EXEC_CONT void IntersectCell(T *vtkmNotUsed(xpoints), T *vtkmNotUsed(ypoints), T *vtkmNotUsed(zpoints), const vtkm::Vec< T, 3 > &vtkmNotUsed(dir), const vtkm::Vec< T, 3 > &vtkmNotUsed(origin), T *vtkmNotUsed(distances), const vtkm::UInt8 vtkmNotUsed(cellShape=12))
VTKM_EXEC_CONT void IntersectZoo(T xpoints[8], T ypoints[8], T zpoints[8], const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T distances[6], const vtkm::Int32 &shapeType)
Definition: CellIntersector.h:28
int32_t Int32
Definition: Types.h:160
VTKM_EXEC vtkm::Int32 ZooLookUp(vtkm::Int32 x, vtkm::Int32 y) const
Definition: CellTables.h:123
VTKM_EXEC_CONT void IntersectCell(T *xpoints, T *ypoints, T *zpoints, const vtkm::Vec< T, 3 > &dir, const vtkm::Vec< T, 3 > &origin, T distances[6], const vtkm::UInt8 cellShape=0) const
Definition: CellIntersector.h:366