OGS
GocadEnums.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "GocadEnums.h"
5
6namespace FileIO
7{
8namespace Gocad
9{
10std::string dataType2String(DataType const t)
11{
12 if (t == DataType::UNDEFINED)
13 {
14 return "[Undefined Type]";
15 }
16 if (t == DataType::VSET)
17 {
18 return "GOCAD VSet";
19 }
20 if (t == DataType::PLINE)
21 {
22 return "GOCAD PLine";
23 }
24 if (t == DataType::TSURF)
25 {
26 return "GOCAD TSurf";
27 }
28 if (t == DataType::MODEL3D)
29 {
30 return "GOCAD Model3d";
31 }
32 return "[all types]";
33}
34
35std::string dataType2ShortString(DataType const t)
36{
37 if (t == DataType::UNDEFINED)
38 {
39 return "[undefined]";
40 }
41 if (t == DataType::VSET)
42 {
43 return "vertices";
44 }
45 if (t == DataType::PLINE)
46 {
47 return "line";
48 }
49 if (t == DataType::TSURF)
50 {
51 return "surface";
52 }
53 if (t == DataType::MODEL3D)
54 {
55 return "model";
56 }
57 return "[all data]";
58}
59
60} // namespace Gocad
61
62} // namespace FileIO
std::string dataType2String(DataType const t)
Given a Gocad DataType this returns the appropriate string.
std::string dataType2ShortString(DataType const t)
Given a Gocad DataType this returns the appropriate short form.