| 629 | } |
| 630 | |
| 631 | void add_internal_corner_relations( const geode::BRep& model, |
| 632 | geode::BRepBuilder& builder, |
| 633 | absl::Span< const geode::uuid > corner_uuids, |
| 634 | absl::Span< const geode::uuid > line_uuids, |
| 635 | absl::Span< const geode::uuid > surface_uuids, |
| 636 | const geode::uuid& block_uuid ) |
| 637 | { |
| 638 | for( const auto& corner_id : corner_uuids ) |
| 639 | { |
| 640 | builder.add_corner_line_internal_relationship( |
| 641 | model.corner( corner_id ), model.line( line_uuids.back() ) ); |
| 642 | builder.add_corner_surface_internal_relationship( |
| 643 | model.corner( corner_id ), model.surface( surface_uuids.front() ) ); |
| 644 | builder.add_corner_block_internal_relationship( |
| 645 | model.corner( corner_id ), model.block( block_uuid ) ); |
| 646 | } |
| 647 | |
| 648 | for( const auto& corner_id : corner_uuids ) |
| 649 | { |
| 650 | for( const auto& embedding : |
| 651 | model.embedding_lines( model.corner( corner_id ) ) ) |
| 652 | { |
| 653 | geode::OpenGeodeModelException::test( |
| 654 | line_uuids.back() == embedding.id(), |
| 655 | "All Corners should be embedded in the same Line" ); |
| 656 | geode::OpenGeodeModelException::test( |
| 657 | model.nb_internal_corners( embedding ) == corner_uuids.size(), |
| 658 | "Line should embed all Corners" ); |
| 659 | } |
| 660 | for( const auto& embedding : |
| 661 | model.embedding_surfaces( model.corner( corner_id ) ) ) |
| 662 | { |
| 663 | geode::OpenGeodeModelException::test( |
| 664 | surface_uuids.front() == embedding.id(), |
| 665 | "All Corners embedded surfaces should be Surfaces" ); |
| 666 | geode::OpenGeodeModelException::test( |
| 667 | model.nb_internal_corners( embedding ) == corner_uuids.size(), |
| 668 | "Surface should embed all Corners" ); |
| 669 | } |
| 670 | for( const auto& embedding : |
| 671 | model.embedding_blocks( model.corner( corner_id ) ) ) |
| 672 | { |
| 673 | geode::OpenGeodeModelException::test( block_uuid == embedding.id(), |
| 674 | "All Corners embedded blocks should be Blocks" ); |
| 675 | geode::OpenGeodeModelException::test( |
| 676 | model.nb_internal_corners( embedding ) == corner_uuids.size(), |
| 677 | "Block should embed all Corners" ); |
| 678 | } |
| 679 | geode::OpenGeodeModelException::test( |
| 680 | model.nb_embeddings( corner_id ) == 3, |
| 681 | "All Corners should be embedded to 1 Block, 1 Surface and 1 Line" ); |
| 682 | geode::OpenGeodeModelException::test( |
| 683 | model.nb_embedding_lines( model.corner( corner_id ) ) == 1, |
| 684 | "All Corners should be embedded to 1 Line" ); |
| 685 | geode::OpenGeodeModelException::test( |
| 686 | model.nb_embedding_surfaces( model.corner( corner_id ) ) == 1, |
| 687 | "All Corners should be embedded to 1 Surface" ); |
| 688 | geode::OpenGeodeModelException::test( |
no test coverage detected