Commit 83659676 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'property_map_hfh_int_support' into 'master'

Property map hfh int support

See merge request !22
parents d13ed9c3 c254c0cd
Pipeline #6013 passed with stage
in 3 minutes and 53 seconds
......@@ -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<double>() { return "double"; }
template <> const std::string typeName<std::string>() { return "string"; }
template <> const std::string typeName<std::map<HalfEdgeHandle, int> >(){ return "map_he_int"; }
} // Namespace OpenVolumeMesh
......@@ -72,6 +72,7 @@ template <> const std::string typeName<bool>();
template <> const std::string typeName<float>();
template <> const std::string typeName<double>();
template <> const std::string typeName<std::string>();
template <> const std::string typeName<std::map<HalfEdgeHandle, int> >();
/// Property classes for the different entity types
template<class T>
......
......@@ -256,10 +256,19 @@ private:
}
PropIterT it = _begin;
for(; it != _end; ++it) {
if((*it)->name() == _name && dynamic_cast<FullPropT*>(*it) != NULL) {
for(; it != _end; ++it)
{
if((*it)->name() == _name )
{
#if OVM_FORCE_STATIC_CAST
return true;
#else
if(dynamic_cast<FullPropT*>(*it) != NULL)
{
return true;
}
#endif
}
}
return false;
}
......
......@@ -326,6 +326,8 @@ void FileManager::readProperty(std::istream& _iff, MeshT& _mesh) const {
name = line;
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);
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);
......@@ -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<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::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<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