move function from OMFormat.hh to typename.hh
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
|
||||
#include <string>
|
||||
#include <typeinfo>
|
||||
#include <vector>
|
||||
#include <OpenMesh/Core/Mesh/Handles.hh>
|
||||
|
||||
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 <typename T> std::string get_string_for_type(T){return "unknown";}
|
||||
template <typename T> std::string get_string_for_type(std::vector<T>){ return "std::vector<" + get_string_for_type(T()) + ">";}
|
||||
|
||||
|
||||
//template <typename T, int Dim> std::string get_string_for_type(OpenMesh::VectorT<T, Dim>)
|
||||
// { return "VectorT<"+ get_string_for_type(T(),"+std::to_string(Dim)+">";}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user