diff --git a/Applications/FileIO/GocadIO/GocadEnums.cpp b/Applications/FileIO/GocadIO/GocadEnums.cpp new file mode 100644 index 0000000000000000000000000000000000000000..efb9baa1c98fa1e1659d85f873453a3fd1812025 --- /dev/null +++ b/Applications/FileIO/GocadIO/GocadEnums.cpp @@ -0,0 +1,69 @@ +/** + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#include "GocadEnums.h" + +namespace FileIO +{ +namespace Gocad +{ + +std::string DataType2Str(DataType const t) +{ + if (t == DataType::UNDEFINED) + { + return "[Undefinied Type]"; + } + if (t == DataType::VSET) + { + return "GOCAD VSet"; + } + if (t == DataType::PLINE) + { + return "GOCAD PLine"; + } + if (t == DataType::TSURF) + { + return "GOCAD TSurf"; + } + if (t == DataType::MODEL3D) + { + return "GOCAD Model3d"; + } + return "[all types]"; +} + +std::string DataType2ShortStr(DataType const t) +{ + if (t == DataType::UNDEFINED) + { + return "[undefinied]"; + } + if (t == DataType::VSET) + { + return "vertices"; + } + if (t == DataType::PLINE) + { + return "line"; + } + if (t == DataType::TSURF) + { + return "surface"; + } + if (t == DataType::MODEL3D) + { + return "model"; + } + return "[all data]"; +} + +} // namespace Gocad + +} // namespace FileIO diff --git a/Applications/FileIO/GocadIO/GocadEnums.h b/Applications/FileIO/GocadIO/GocadEnums.h new file mode 100644 index 0000000000000000000000000000000000000000..f40484893577251bcc9c91526e5f5219be11bcf5 --- /dev/null +++ b/Applications/FileIO/GocadIO/GocadEnums.h @@ -0,0 +1,37 @@ +/** + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include <string> + +namespace FileIO +{ +namespace Gocad +{ + +enum class DataType +{ + UNDEFINED, + VSET, + PLINE, + TSURF, + MODEL3D, + ALL +}; + +/// Given a Gocad DataType this returns the appropriate string. +std::string DataType2Str(DataType const t); + +/// Given a Gocad DataType this returns the appropriate short form. +std::string DataType2ShortStr(DataType const t); + +} // namespace GocadIO + +} // namespace FileIO