diff --git a/src/OpenMesh/Core/IO/OMFormat.hh b/src/OpenMesh/Core/IO/OMFormat.hh index 234e0844..514a932b 100644 --- a/src/OpenMesh/Core/IO/OMFormat.hh +++ b/src/OpenMesh/Core/IO/OMFormat.hh @@ -54,7 +54,6 @@ #include #include #include -#include // -------------------- #include #if defined(OM_CC_GCC) && (OM_GCC_VERSION < 30000) @@ -279,30 +278,6 @@ namespace OMFormat { }; // Chunk // ------------------------------------------------------------ Helper - //----------------------get string for type recognition - - template std::string get_type_string(){ return "unknown";} - - template <> inline std::string get_type_string(){ return "facehandle";} - template <> inline std::string get_type_string(){ return "edgehandle";} - template <> inline std::string get_type_string(){ return "halfedgehandle";} - template <> inline std::string get_type_string(){ return "vertexhandle";} - - template <> inline std::string get_type_string(){ return "bool";} - template <> inline std::string get_type_string(){ return "char";} - template <> inline std::string get_type_string(){ return "double";} - template <> inline std::string get_type_string(){ return "float";} - template <> inline std::string get_type_string(){ return "int";} - template <> inline std::string get_type_string(){ return "uchar";} - template <> inline std::string get_type_string(){ return "uint";} - template <> inline std::string get_type_string(){ return "ushort";} - - template std::string get_type_string(std::vector) - { return "std::vector of " + get_type_string(T());} - - template std::string get_type_string(OpenMesh::VectorT) - { return "OM vector of dimension " + std::to_string(Dim) + " of type " + get_type_string(T()); } - // -------------------- get size information /// Return size of header in bytes. diff --git a/src/OpenMesh/Core/Utils/typename.hh b/src/OpenMesh/Core/Utils/typename.hh index f67ae18b..44b4f1e9 100644 --- a/src/OpenMesh/Core/Utils/typename.hh +++ b/src/OpenMesh/Core/Utils/typename.hh @@ -7,6 +7,8 @@ #include #include +#include +#include namespace OpenMesh { @@ -23,4 +25,28 @@ std::string get_type_name() #endif } +//----------------------get string for type recognition-- can be used in file format + +inline std::string get_string_for_type(OpenMesh::FaceHandle){ return "facehandle";} +inline std::string get_string_for_type(OpenMesh::EdgeHandle){ return "edgehandle";} + +inline std::string get_string_for_type(OpenMesh::HalfedgeHandle){ return "halfedgehandle";} +inline std::string get_string_for_type(OpenMesh::VertexHandle){ return "vertexhandle";} + +inline std::string get_string_for_type(bool){ return "bool";} +inline std::string get_string_for_type(char){ return "char";} +inline std::string get_string_for_type(double){ return "double";} +inline std::string get_string_for_type(float){ return "float";} +inline std::string get_string_for_type(int){ return "int";} +inline std::string get_string_for_type(unsigned char){ return "uchar";} +inline std::string get_string_for_type(unsigned int){ return "uint";} +inline std::string get_string_for_type(unsigned short){ return "ushort";} + +template std::string get_string_for_type(T){return "unknown";} +template std::string get_string_for_type(std::vector){ return "std::vector<" + get_string_for_type(T()) + ">";} + + +//template std::string get_string_for_type(OpenMesh::VectorT) +// { return "VectorT<"+ get_string_for_type(T(),"+std::to_string(Dim)+">";} + }