OGS 6.2.0-97-g4a610c866
VtkOGSEnum.cpp
Go to the documentation of this file.
1 
10 #include "VtkOGSEnum.h"
11 
12 #include "BaseLib/Error.h"
13 
14 #include <vtkCellType.h>
15 
17 {
18  switch (type)
19  {
20  case VTK_LINE:
22  case VTK_QUADRATIC_EDGE:
24  case VTK_TRIANGLE:
26  case VTK_QUADRATIC_TRIANGLE:
28  case VTK_QUAD:
30  case VTK_QUADRATIC_QUAD:
32  case VTK_BIQUADRATIC_QUAD:
34  case VTK_HEXAHEDRON:
36  case VTK_QUADRATIC_HEXAHEDRON:
38  case VTK_TRIQUADRATIC_HEXAHEDRON:
40  case VTK_TETRA:
42  case VTK_QUADRATIC_TETRA:
44  case VTK_WEDGE:
46  case VTK_QUADRATIC_WEDGE:
48  case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
50  case VTK_PYRAMID:
52  case VTK_QUADRATIC_PYRAMID:
54  default:
55  OGS_FATAL(
56  "Unknown cell type in conversion from VTK to OGS. Given cell "
57  "type value is %d.",
58  type);
59  }
60 }
61 
63 {
64  switch (ogs)
65  {
67  return VTK_VERTEX;
69  return VTK_LINE;
71  return VTK_QUADRATIC_EDGE;
73  return VTK_TRIANGLE;
75  return VTK_QUADRATIC_TRIANGLE;
77  return VTK_QUAD;
79  return VTK_QUADRATIC_QUAD;
81  return VTK_BIQUADRATIC_QUAD;
83  return VTK_HEXAHEDRON;
85  return VTK_QUADRATIC_HEXAHEDRON;
87  return VTK_TRIQUADRATIC_HEXAHEDRON;
89  return VTK_TETRA;
91  return VTK_QUADRATIC_TETRA;
93  return VTK_WEDGE;
95  return VTK_QUADRATIC_WEDGE;
97  return VTK_BIQUADRATIC_QUADRATIC_WEDGE;
99  return VTK_PYRAMID;
101  return VTK_QUADRATIC_PYRAMID;
103  return -1;
104  default:
105  OGS_FATAL(
106  "Unknown cell type in conversion from OGS to VTK. Given cell "
107  "type value is %d.",
108  ogs);
109  }
110 }
111 
112 
int OGSToVtkCellType(MeshLib::CellType ogs)
Definition: VtkOGSEnum.cpp:62
#define OGS_FATAL(fmt,...)
Definition: Error.h:63
MeshLib::CellType VtkCellTypeToOGS(int type)
Definition: VtkOGSEnum.cpp:16
CellType
Types of mesh elements supported by OpenGeoSys.
Definition: MeshEnums.h:42