| 522 | } |
| 523 | |
| 524 | H5::Group HdfSerializer::createRepresentationGroup(const H5::Group& element_group, const std::string& gid) { |
| 525 | // the part before the hyphen is the representation id |
| 526 | auto gid2 = gid; |
| 527 | auto hyphen = gid2.find("-"); |
| 528 | if (hyphen != std::string::npos) { |
| 529 | gid2 = gid2.substr(0, hyphen); |
| 530 | } |
| 531 | |
| 532 | H5::Group representation_group; |
| 533 | try { |
| 534 | representation_group = element_group.openGroup(gid2); |
| 535 | } catch (H5::Exception&) { |
| 536 | representation_group = element_group.createGroup(gid2); |
| 537 | |
| 538 | H5::DataSpace attrdspace(H5S_SCALAR); |
| 539 | { |
| 540 | H5::Attribute att = representation_group.createAttribute("geom_id", str_type, attrdspace); |
| 541 | std::string value = gid; |
| 542 | att.write(str_type, value); |
| 543 | } |
| 544 | } |
| 545 | return representation_group; |
| 546 | } |
| 547 | |
| 548 | void HdfSerializer::write_style(surface_style_serialization& data, const ifcopenshell::geometry::taxonomy::style::ptr& sptr) { |
| 549 | auto& s = *sptr; |