Commit a425eafc authored by David Bommes's avatar David Bommes

added property support for map<HFH,int>

parent d13ed9c3
...@@ -55,5 +55,6 @@ template <> const std::string typeName<bool>() { return "bool"; } ...@@ -55,5 +55,6 @@ template <> const std::string typeName<bool>() { return "bool"; }
template <> const std::string typeName<float>() { return "float"; } template <> const std::string typeName<float>() { return "float"; }
template <> const std::string typeName<double>() { return "double"; } template <> const std::string typeName<double>() { return "double"; }
template <> const std::string typeName<std::string>() { return "string"; } template <> const std::string typeName<std::string>() { return "string"; }
template <> const std::string typeName<std::map<HalfEdgeHandle, int> >(){ return "map_he_int"; }
} // Namespace OpenVolumeMesh } // Namespace OpenVolumeMesh
...@@ -72,6 +72,7 @@ template <> const std::string typeName<bool>(); ...@@ -72,6 +72,7 @@ template <> const std::string typeName<bool>();
template <> const std::string typeName<float>(); template <> const std::string typeName<float>();
template <> const std::string typeName<double>(); template <> const std::string typeName<double>();
template <> const std::string typeName<std::string>(); template <> const std::string typeName<std::string>();
template <> const std::string typeName<std::map<HalfEdgeHandle, int> >();
/// Property classes for the different entity types /// Property classes for the different entity types
template<class T> template<class T>
......
...@@ -326,6 +326,8 @@ void FileManager::readProperty(std::istream& _iff, MeshT& _mesh) const { ...@@ -326,6 +326,8 @@ void FileManager::readProperty(std::istream& _iff, MeshT& _mesh) const {
name = line; name = line;
extractQuotedText(name); extractQuotedText(name);
std::cerr << "OVM read property " << name << " of type " << prop_t << std::endl;
if(prop_t == typeName<int>()) generateGenericProperty<int, MeshT>(entity_t, name, _iff, _mesh); if(prop_t == typeName<int>()) generateGenericProperty<int, MeshT>(entity_t, name, _iff, _mesh);
else if(prop_t == typeName<unsigned int>()) generateGenericProperty<unsigned int, MeshT>(entity_t, name, _iff, _mesh); else if(prop_t == typeName<unsigned int>()) generateGenericProperty<unsigned int, MeshT>(entity_t, name, _iff, _mesh);
else if(prop_t == typeName<short>()) generateGenericProperty<short, MeshT>(entity_t, name, _iff, _mesh); else if(prop_t == typeName<short>()) generateGenericProperty<short, MeshT>(entity_t, name, _iff, _mesh);
...@@ -337,6 +339,7 @@ void FileManager::readProperty(std::istream& _iff, MeshT& _mesh) const { ...@@ -337,6 +339,7 @@ void FileManager::readProperty(std::istream& _iff, MeshT& _mesh) const {
else if(prop_t == typeName<float>()) generateGenericProperty<float, MeshT>(entity_t, name, _iff, _mesh); else if(prop_t == typeName<float>()) generateGenericProperty<float, MeshT>(entity_t, name, _iff, _mesh);
else if(prop_t == typeName<double>()) generateGenericProperty<double, MeshT>(entity_t, name, _iff, _mesh); else if(prop_t == typeName<double>()) generateGenericProperty<double, MeshT>(entity_t, name, _iff, _mesh);
else if(prop_t == typeName<std::string>()) generateGenericProperty<std::string, MeshT>(entity_t, name, _iff, _mesh); else if(prop_t == typeName<std::string>()) generateGenericProperty<std::string, MeshT>(entity_t, name, _iff, _mesh);
else if(prop_t == typeName<std::map<HalfEdgeHandle, int> >()) generateGenericProperty<std::map<HalfEdgeHandle, int>, MeshT>(entity_t, name, _iff, _mesh);
else if(prop_t == typeName<Vec2f>()) generateGenericProperty<Vec2f, MeshT>(entity_t, name, _iff, _mesh); else if(prop_t == typeName<Vec2f>()) generateGenericProperty<Vec2f, MeshT>(entity_t, name, _iff, _mesh);
else if(prop_t == typeName<Vec2d>()) generateGenericProperty<Vec2d, MeshT>(entity_t, name, _iff, _mesh); else if(prop_t == typeName<Vec2d>()) generateGenericProperty<Vec2d, MeshT>(entity_t, name, _iff, _mesh);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment