VTK-m  2.0
VTKDataSetStructures.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_io_internal_VTKDataSetStructures_h
11 #define vtk_m_io_internal_VTKDataSetStructures_h
12 
13 #include <string>
14 
15 namespace vtkm
16 {
17 namespace io
18 {
19 namespace internal
20 {
21 
22 enum DataSetStructure
23 {
24  DATASET_UNKNOWN = 0,
25  DATASET_STRUCTURED_POINTS,
26  DATASET_STRUCTURED_GRID,
27  DATASET_UNSTRUCTURED_GRID,
28  DATASET_POLYDATA,
29  DATASET_RECTILINEAR_GRID,
30  DATASET_FIELD
31 };
32 
33 inline const char* DataSetStructureString(int id)
34 {
35  static const char* strings[] = { "",
36  "STRUCTURED_POINTS",
37  "STRUCTURED_GRID",
38  "UNSTRUCTURED_GRID",
39  "POLYDATA",
40  "RECTILINEAR_GRID",
41  "FIELD" };
42  return strings[id];
43 }
44 
45 inline DataSetStructure DataSetStructureId(const std::string& str)
46 {
47  DataSetStructure structure = DATASET_UNKNOWN;
48  for (int id = 1; id < 7; ++id)
49  {
50  if (str == DataSetStructureString(id))
51  {
52  structure = static_cast<DataSetStructure>(id);
53  }
54  }
55 
56  return structure;
57 }
58 }
59 }
60 } // namespace vtkm::io::internal
61 
62 #endif // vtk_m_io_internal_VTKDataSetStructures_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19