| 525 | |
| 526 | namespace { |
| 527 | boost::optional<std::string> get_curve_style_name(IfcUtil::IfcBaseEntity* item) { |
| 528 | auto refs = item->get_inverse("StyledByItem"); |
| 529 | for (auto& ref : *refs) { |
| 530 | if (ref->declaration().is("IfcStyledItem")) { |
| 531 | aggregate_of_instance::ptr styles = ((IfcUtil::IfcBaseEntity*)ref)->get("Styles"); |
| 532 | for (auto& s_ : *styles) { |
| 533 | auto s = (IfcUtil::IfcBaseEntity*) s_; |
| 534 | std::vector<IfcUtil::IfcBaseEntity*> pss; |
| 535 | if (s->declaration().is("IfcPresentationStyleAssignment")) { |
| 536 | aggregate_of_instance::ptr pstyles = s->get("Styles"); |
| 537 | for (auto& ssss : *pstyles) { |
| 538 | pss.push_back((IfcUtil::IfcBaseEntity*) ssss); |
| 539 | } |
| 540 | } else { |
| 541 | pss.push_back(s); |
| 542 | } |
| 543 | for (auto& ps : pss) { |
| 544 | if (ps->declaration().is("IfcCurveStyle")) { |
| 545 | auto arg = ps->get("Name"); |
| 546 | if (!arg.isNull()) { |
| 547 | return (std::string) arg; |
| 548 | } |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | } |
| 553 | } |
| 554 | return boost::none; |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | void SvgSerializer::write(const IfcGeom::BRepElement* brep_obj) { |