SvgSerializer: Name storeys properly too

- Fix correct "storey-" prefix for stories
- Follow user settings on names/guids/notset
This commit is contained in:
Anders Granskogen Bjørnstad
2017-11-08 16:40:17 +01:00
committed by Thomas Krijnen
parent c419885329
commit a9606b3044
+5 -1
View File
@@ -348,7 +348,11 @@ std::string SvgSerializer::nameElement(const IfcSchema::IfcProduct* elem) {
if (elem == 0) { return ""; }
std::ostringstream oss;
const std::string type = elem->is(IfcSchema::Type::IfcBuildingStorey) ? "storey" : "product";
oss << "id=\"product-" << IfcParse::IfcGlobalId(elem->GlobalId()).formatted() << "\"";
const std::string name = (settings().get(SerializerSettings::USE_ELEMENT_GUIDS)
? elem->GlobalId() : (settings().get(SerializerSettings::USE_ELEMENT_NAMES)
? elem->Name() : IfcParse::IfcGlobalId(elem->GlobalId()).formatted()));
oss << "id=\"" << type << "-" << name << "\"";
return oss.str();
}