11 #ifndef smtk_mesh_core_CellTraits_h
12 #define smtk_mesh_core_CellTraits_h
14 #include "smtk/mesh/core/CellTypes.h"
21 template<
int dimension>
29 const static int Type = 1;
33 const static int Type = 2;
51 template<
class CellTag>
57 const static int NUM_VERTICES = 8;
58 const static int TOPOLOGICAL_DIMENSIONS = 3;
65 bool fixedPointSize()
const {
return true; }
68 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
74 const static int NUM_VERTICES = 2;
75 const static int TOPOLOGICAL_DIMENSIONS = 1;
82 bool fixedPointSize()
const {
return true; }
85 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
91 const static int NUM_VERTICES = -1;
92 const static int TOPOLOGICAL_DIMENSIONS = 2;
99 bool fixedPointSize()
const {
return false; }
102 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
108 const static int NUM_VERTICES = 5;
109 const static int TOPOLOGICAL_DIMENSIONS = 3;
116 bool fixedPointSize()
const {
return true; }
119 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
125 const static int NUM_VERTICES = 4;
126 const static int TOPOLOGICAL_DIMENSIONS = 2;
133 bool fixedPointSize()
const {
return true; }
136 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
142 const static int NUM_VERTICES = 4;
143 const static int TOPOLOGICAL_DIMENSIONS = 3;
150 bool fixedPointSize()
const {
return true; }
153 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
159 const static int NUM_VERTICES = 3;
160 const static int TOPOLOGICAL_DIMENSIONS = 2;
167 bool fixedPointSize()
const {
return true; }
170 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
176 const static int NUM_VERTICES = 1;
177 const static int TOPOLOGICAL_DIMENSIONS = 0;
184 bool fixedPointSize()
const {
return true; }
187 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
193 const static int NUM_VERTICES = 6;
194 const static int TOPOLOGICAL_DIMENSIONS = 3;
201 bool fixedPointSize()
const {
return true; }
204 int dimension()
const {
return TOPOLOGICAL_DIMENSIONS; }
207 template<
int CellEnum>
273 #define smtkMeshCellEnumToTypeMacroCase(cellEnum, call) \
276 static const int CellEnumValue = cellEnum; \
277 typedef smtk::mesh::CellEnumToType<CellEnumValue>::Traits CellTraits; \
282 #define smtkMeshCellEnumToTypeMacro(call) \
283 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Vertex, call); \
284 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Line, call); \
285 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Triangle, call); \
286 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Quad, call); \
287 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Polygon, call); \
288 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Tetrahedron, call); \
289 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Pyramid, call); \
290 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Wedge, call); \
291 smtkMeshCellEnumToTypeMacroCase(smtk::mesh::Hexahedron, call);
295 #endif //__smtk_mesh_CellTraits_h