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