Go to the documentation of this file.
10 #ifndef vtk_m_rendering_raytracing_CellSampler_h
11 #define vtk_m_rendering_raytracing_CellSampler_h
17 #ifndef CELL_SHAPE_ZOO
18 #define CELL_SHAPE_ZOO 255
21 #ifndef CELL_SHAPE_STRUCTURED
22 #define CELL_SHAPE_STRUCTURED 254
34 template <
typename CellTag>
65 template <
typename P,
typename S,
typename CellShapeTagType>
70 const CellShapeTagType& shapeTag)
73 bool validSample =
true;
76 for (
vtkm::Int32 i = 0; i < GetNumberOfPoints(shapeTag); ++i)
78 pointsVec.
Append(points[i]);
79 scalarVec.
Append(scalars[i]);
82 vtkm::exec::WorldCoordinatesToParametricCoordinates(pointsVec, sampleLocation, shapeTag, pcoords);
84 pmin = vtkm::Min(vtkm::Min(pcoords[0], pcoords[1]), pcoords[2]);
85 pmax = vtkm::Max(vtkm::Max(pcoords[0], pcoords[1]), pcoords[2]);
86 if (pmin < 0.f || pmax > 1.f)
94 template <
typename S,
typename P,
typename CellShapeTagType>
102 bool validSample =
true;
104 vtkm::exec::WorldCoordinatesToParametricCoordinates(
105 points, sampleLocation, vtkm::CellShapeTagHexahedron(), pcoords);
107 pmin = vtkm::Min(vtkm::Min(pcoords[0], pcoords[1]), pcoords[2]);
108 pmax = vtkm::Max(vtkm::Max(pcoords[0], pcoords[1]), pcoords[2]);
109 if (pmin < 0.f || pmax > 1.f)
121 template <
int CellType>
125 template <
typename P,
typename S>
135 "Cell Sampler: Default template. This should not happen.\n");
147 template <
typename P,
typename S>
157 valid = detail::Sample(
158 points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagHexahedron());
164 detail::Sample(points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagTetra());
170 detail::Sample(points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagWedge());
175 detail::Sample(points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagPyramid());
188 template <
typename P,
typename S>
196 return detail::Sample(
197 points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagHexahedron());
209 template <
typename P,
typename S>
218 return detail::Sample(
219 rPoints, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagHexahedron());
230 template <
typename P,
typename S>
238 return detail::Sample(
239 points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagPyramid());
251 template <
typename P,
typename S>
259 return detail::Sample(points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagTetra());
270 template <
typename P,
typename S>
278 return detail::Sample(points, scalars, sampleLocation, lerpedScalar, vtkm::CellShapeTagWedge());
@ CELL_SHAPE_WEDGE
Definition: CellShape.h:49
An implicit vector for point coordinates in axis aligned cells.
Definition: VecAxisAlignedPointCoordinates.h:78
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_EXEC_CONT bool SampleCell(const vtkm::Vec< vtkm::Vec< P, 3 >, 8 > &vtkmNotUsed(points), const vtkm::Vec< S, 8 > &vtkmNotUsed(scalars), const vtkm::Vec< P, 3 > &vtkmNotUsed(sampleLocation), S &vtkmNotUsed(lerpedScalar), const vtkm::Int32 &vtkmNotUsed(cellShape=CellType)) const
Definition: CellSampler.h:126
VTKM_EXEC_CONT bool SampleCell(const vtkm::Vec< vtkm::Vec< P, 3 >, 8 > &points, const vtkm::Vec< S, 8 > &scalars, const vtkm::Vec< P, 3 > &sampleLocation, S &lerpedScalar, const vtkm::Int32 &vtkmNotUsed(cellShape=CELL_SHAPE_TETRA)) const
Definition: CellSampler.h:252
VTKM_EXEC_CONT void Append(ComponentType value)
Definition: VecVariable.h:80
A short variable-length array with maximum length.
Definition: VecVariable.h:30
@ CELL_SHAPE_TETRA
Definition: CellShape.h:46
VTKM_EXEC vtkm::ErrorCode CellInterpolate(const FieldVecType &pointFieldValues, const vtkm::Vec< ParametricCoordType, 3 > &pcoords, CellShapeTag tag, typename FieldVecType::ComponentType &result)
Definition: CellInterpolate.h:56
@ CELL_SHAPE_HEXAHEDRON
Definition: CellShape.h:48
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
VTKM_EXEC_CONT bool SampleCell(const vtkm::Vec< vtkm::Vec< P, 3 >, 8 > &points, const vtkm::Vec< S, 8 > &scalars, const vtkm::Vec< P, 3 > &sampleLocation, S &lerpedScalar, const vtkm::Int32 &vtkmNotUsed(cellShape=CELL_SHAPE_PYRAMID)) const
Definition: CellSampler.h:231
VTKM_EXEC_CONT bool SampleCell(const vtkm::Vec< vtkm::Vec< P, 3 >, 8 > &points, const vtkm::Vec< S, 8 > &scalars, const vtkm::Vec< P, 3 > &sampleLocation, S &lerpedScalar, const vtkm::Int32 &vtkmNotUsed(cellShape=CELL_SHAPE_HEXAHEDRON)) const
Definition: CellSampler.h:210
A short fixed-length array.
Definition: Types.h:767
Definition: CellSampler.h:122
VTKM_EXEC_CONT bool SampleCell(const vtkm::Vec< vtkm::Vec< P, 3 >, 8 > &points, const vtkm::Vec< S, 8 > &scalars, const vtkm::Vec< P, 3 > &sampleLocation, S &lerpedScalar, const vtkm::Int32 &vtkmNotUsed(cellShape=CELL_SHAPE_HEXAHEDRON)) const
Definition: CellSampler.h:189
int32_t Int32
Definition: Types.h:160
@ CELL_SHAPE_PYRAMID
Definition: CellShape.h:50
VTKM_EXEC_CONT bool SampleCell(const vtkm::Vec< vtkm::Vec< P, 3 >, 8 > &points, const vtkm::Vec< S, 8 > &scalars, const vtkm::Vec< P, 3 > &sampleLocation, S &lerpedScalar, const vtkm::Int32 &vtkmNotUsed(cellShape=CELL_SHAPE_WEDGE)) const
Definition: CellSampler.h:271
#define CELL_SHAPE_STRUCTURED
Definition: CellSampler.h:22
VTKM_EXEC_CONT bool SampleCell(const vtkm::Vec< vtkm::Vec< P, 3 >, 8 > &points, const vtkm::Vec< S, 8 > &scalars, const vtkm::Vec< P, 3 > &sampleLocation, S &lerpedScalar, const vtkm::Int32 &cellShape) const
Definition: CellSampler.h:148
#define CELL_SHAPE_ZOO
Definition: CellSampler.h:18