| 2282 | } |
| 2283 | |
| 2284 | std::string SvgSerializer::idElement(const IfcUtil::IfcBaseEntity* elem) { |
| 2285 | const std::string type = elem->declaration().is("IfcBuildingStorey") ? "storey" : "product"; |
| 2286 | const std::string name = |
| 2287 | (settings().get<ifcopenshell::geometry::settings::UseElementGuids>().get() |
| 2288 | ? static_cast<std::string>(elem->get("GlobalId")) |
| 2289 | : ((settings().get<ifcopenshell::geometry::settings::UseElementNames>().get() && !elem->get("Name").isNull())) |
| 2290 | ? static_cast<std::string>(elem->get("Name")) |
| 2291 | : (settings().get<ifcopenshell::geometry::settings::UseElementStepIds>().get()) |
| 2292 | ? ("id-" + boost::lexical_cast<std::string>(elem->id())) |
| 2293 | : IfcParse::IfcGlobalId(elem->get("GlobalId")).formatted()); |
| 2294 | return type + "-" + name; |
| 2295 | } |
| 2296 | |
| 2297 | std::string SvgSerializer::nameElement(const IfcUtil::IfcBaseEntity* elem) { |
| 2298 | if (elem == 0) { return ""; } |