Go to the documentation of this file.
10 #ifndef vtk_m_CellShape_h
11 #define vtk_m_CellShape_h
16 #include <lcl/Polygon.h>
17 #include <lcl/Shapes.h>
68 struct CellShapeTagCheck : std::false_type
73 template <
typename VtkmCellShapeTag>
74 struct CellShapeTagVtkmToVtkc;
82 #define VTKM_IS_CELL_SHAPE_TAG(tag) \
83 VTKM_STATIC_ASSERT_MSG(::vtkm::internal::CellShapeTagCheck<tag>::value, \
84 "Provided type is not a valid VTK-m cell shape tag.")
88 template <vtkm::IdComponent Id>
101 #define VTKM_DEFINE_CELL_TAG(name, idname) \
102 struct CellShapeTag##name \
104 static constexpr vtkm::UInt8 Id = vtkm::idname; \
109 struct CellShapeTagCheck<vtkm::CellShapeTag##name> : std::true_type \
113 struct CellShapeTagVtkmToVtkc<vtkm::CellShapeTag##name> \
115 using Type = lcl::name; \
118 static inline VTKM_EXEC_CONT const char* GetCellShapeName(vtkm::CellShapeTag##name) \
123 struct CellShapeIdToTag<vtkm::idname> \
125 using valid = std::true_type; \
126 using Tag = vtkm::CellShapeTag##name; \
145 #undef VTKM_DEFINE_CELL_TAG
166 template <
typename VtkmCellShapeTag>
167 VTKM_EXEC_CONT inline typename CellShapeTagVtkmToVtkc<VtkmCellShapeTag>::Type make_LclCellShapeTag(
168 const VtkmCellShapeTag&,
171 using VtkcCellShapeTag =
typename CellShapeTagVtkmToVtkc<VtkmCellShapeTag>::Type;
172 static_cast<void>(numPoints);
173 return VtkcCellShapeTag{};
177 inline lcl::Polygon make_LclCellShapeTag(
const vtkm::CellShapeTagPolygon&,
180 return lcl::Polygon(numPoints);
187 return lcl::Cell(
static_cast<std::int8_t
>(tag.
Id), numPoints);
192 #define vtkmGenericCellShapeMacroCase(cellShapeId, call) \
193 case vtkm::cellShapeId: \
195 using CellShapeTag = vtkm::CellShapeIdToTag<vtkm::cellShapeId>::Tag; \
230 #define vtkmGenericCellShapeMacro(call) \
231 vtkmGenericCellShapeMacroCase(CELL_SHAPE_EMPTY, call); \
232 vtkmGenericCellShapeMacroCase(CELL_SHAPE_VERTEX, call); \
233 vtkmGenericCellShapeMacroCase(CELL_SHAPE_LINE, call); \
234 vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLY_LINE, call); \
235 vtkmGenericCellShapeMacroCase(CELL_SHAPE_TRIANGLE, call); \
236 vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLYGON, call); \
237 vtkmGenericCellShapeMacroCase(CELL_SHAPE_QUAD, call); \
238 vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
239 vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
240 vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
241 vtkmGenericCellShapeMacroCase(CELL_SHAPE_PYRAMID, call)
245 #endif //vtk_m_CellShape_h
@ NUMBER_OF_CELL_SHAPES
Definition: CellShape.h:52
VTKM_DEFINE_CELL_TAG(Empty, CELL_SHAPE_EMPTY)
@ CELL_SHAPE_WEDGE
Definition: CellShape.h:49
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
VTKM_EXEC_CONT CellShapeTagGeneric(vtkm::UInt8 shape)
Definition: CellShape.h:155
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
A traits-like class to get an CellShapeId known at compile time to a tag.
Definition: CellShape.h:89
@ CELL_SHAPE_EMPTY
Definition: CellShape.h:36
std::false_type valid
Definition: CellShape.h:95
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
CellShapeIdEnum
CellShapeId identifies the type of each cell.
Definition: CellShape.h:33
Ray< CoordType, Dim, true > Line
Lines are two-sided rays:
Definition: Geometry.h:330
@ CELL_SHAPE_POLY_LINE
Definition: CellShape.h:40
@ CELL_SHAPE_TETRA
Definition: CellShape.h:46
@ CELL_SHAPE_HEXAHEDRON
Definition: CellShape.h:48
uint8_t UInt8
Definition: Types.h:157
@ CELL_SHAPE_TRIANGLE
Definition: CellShape.h:41
@ CELL_SHAPE_LINE
Definition: CellShape.h:39
vtkm::UInt8 Id
Definition: CellShape.h:160
A special cell shape tag that holds a cell shape that is not known at compile time.
Definition: CellShape.h:152
@ CELL_SHAPE_PYRAMID
Definition: CellShape.h:50
@ CELL_SHAPE_POLYGON
Definition: CellShape.h:43
@ CELL_SHAPE_VERTEX
Definition: CellShape.h:37
@ CELL_SHAPE_QUAD
Definition: CellShape.h:45
Definition: CellShape.h:21