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>
86 struct CellShapeTagCheck : std::false_type
91 template <
typename VtkmCellShapeTag>
92 struct CellShapeTagVtkmToVtkc;
100 #define VTKM_IS_CELL_SHAPE_TAG(tag) \
101 VTKM_STATIC_ASSERT_MSG(::vtkm::internal::CellShapeTagCheck<tag>::value, \
102 "Provided type is not a valid VTK-m cell shape tag.")
106 template <vtkm::IdComponent Id>
119 #define VTKM_DEFINE_CELL_TAG(name, idname) \
120 struct CellShapeTag##name \
122 static constexpr vtkm::UInt8 Id = vtkm::idname; \
127 struct CellShapeTagCheck<vtkm::CellShapeTag##name> : std::true_type \
131 struct CellShapeTagVtkmToVtkc<vtkm::CellShapeTag##name> \
133 using Type = lcl::name; \
136 static inline VTKM_EXEC_CONT const char* GetCellShapeName(vtkm::CellShapeTag##name) \
141 struct CellShapeIdToTag<vtkm::idname> \
143 using valid = std::true_type; \
144 using Tag = vtkm::CellShapeTag##name; \
163 #undef VTKM_DEFINE_CELL_TAG
186 template <
typename VtkmCellShapeTag>
187 VTKM_EXEC_CONT inline typename CellShapeTagVtkmToVtkc<VtkmCellShapeTag>::Type make_LclCellShapeTag(
188 const VtkmCellShapeTag&,
191 using VtkcCellShapeTag =
typename CellShapeTagVtkmToVtkc<VtkmCellShapeTag>::Type;
192 static_cast<void>(numPoints);
193 return VtkcCellShapeTag{};
200 return lcl::Polygon(numPoints);
207 return lcl::Cell(
static_cast<std::int8_t
>(tag.
Id), numPoints);
212 #define vtkmGenericCellShapeMacroCase(cellShapeId, call) \
213 case vtkm::cellShapeId: \
215 using CellShapeTag = vtkm::CellShapeIdToTag<vtkm::cellShapeId>::Tag; \
250 #define vtkmGenericCellShapeMacro(call) \
251 vtkmGenericCellShapeMacroCase(CELL_SHAPE_EMPTY, call); \
252 vtkmGenericCellShapeMacroCase(CELL_SHAPE_VERTEX, call); \
253 vtkmGenericCellShapeMacroCase(CELL_SHAPE_LINE, call); \
254 vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLY_LINE, call); \
255 vtkmGenericCellShapeMacroCase(CELL_SHAPE_TRIANGLE, call); \
256 vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLYGON, call); \
257 vtkmGenericCellShapeMacroCase(CELL_SHAPE_QUAD, call); \
258 vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
259 vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
260 vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
261 vtkmGenericCellShapeMacroCase(CELL_SHAPE_PYRAMID, call)
265 #endif //vtk_m_CellShape_h
Represent an infinite or semi-infinite line segment with a point and a direction.
Definition: Geometry.h:21
@ NUMBER_OF_CELL_SHAPES
Definition: CellShape.h:70
@ CELL_SHAPE_WEDGE
A wedge.
Definition: CellShape.h:66
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
A traits-like class to get an CellShapeId known at compile time to a tag.
Definition: CellShape.h:107
@ CELL_SHAPE_EMPTY
Placeholder for empty or invalid cells.
Definition: CellShape.h:37
std::false_type valid
Definition: CellShape.h:113
Definition: CellShape.h:154
CellShapeIdEnum
CellShapeId identifies the type of each cell.
Definition: CellShape.h:33
#define VTKM_DEFINE_CELL_TAG(name, idname)
Definition: CellShape.h:119
@ CELL_SHAPE_POLY_LINE
A sequence of line segments.
Definition: CellShape.h:46
CellShapeTagGeneric(vtkm::UInt8 shape)
Definition: CellShape.h:173
@ CELL_SHAPE_TETRA
A tetrahedron.
Definition: CellShape.h:59
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
@ CELL_SHAPE_HEXAHEDRON
A hexahedron.
Definition: CellShape.h:62
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:169
@ CELL_SHAPE_TRIANGLE
A triangle.
Definition: CellShape.h:48
@ CELL_SHAPE_LINE
A line cell connecting two points.
Definition: CellShape.h:42
vtkm::UInt8 Id
An identifier that corresponds to one of the CELL_SHAPE_* identifiers.
Definition: CellShape.h:180
A special cell shape tag that holds a cell shape that is not known at compile time.
Definition: CellShape.h:170
@ CELL_SHAPE_PYRAMID
A pyramid with a quadrilateral base and four triangular faces.0.
Definition: CellShape.h:68
@ CELL_SHAPE_POLYGON
A general polygon shape.
Definition: CellShape.h:53
@ CELL_SHAPE_VERTEX
Vertex cells of a single point.
Definition: CellShape.h:39
@ CELL_SHAPE_QUAD
A four-sided polygon.
Definition: CellShape.h:56
Definition: CellShape.h:21