| 34 | #include <geode/tests/common.hpp> |
| 35 | |
| 36 | void test_copy_mapping() |
| 37 | { |
| 38 | geode::ModelCopyMapping copy_mapping; |
| 39 | |
| 40 | std::vector< geode::uuid > uuids_in( 3 ); |
| 41 | std::vector< geode::uuid > uuids_out( 3 ); |
| 42 | |
| 43 | geode::BijectiveMapping< geode::uuid > corner_mapping; |
| 44 | for( const auto i : geode::LRange{ 3 } ) |
| 45 | { |
| 46 | corner_mapping.map( uuids_in[i], uuids_out[i] ); |
| 47 | } |
| 48 | copy_mapping.emplace( |
| 49 | geode::Corner3D::component_type_static(), std::move( corner_mapping ) ); |
| 50 | geode::OpenGeodeModelException::test( |
| 51 | !copy_mapping.has_mapping_type( |
| 52 | geode::Surface3D::component_type_static() ), |
| 53 | "Copy mappings should not exist for Surfaces" ); |
| 54 | geode::OpenGeodeModelException::test( |
| 55 | copy_mapping.has_mapping_type( |
| 56 | geode::Corner3D::component_type_static() ), |
| 57 | "Copy mappings should exist for Corners" ); |
| 58 | const auto& corner_copy_mappings = |
| 59 | copy_mapping.at( geode::Corner3D::component_type_static() ); |
| 60 | geode::OpenGeodeModelException::test( corner_copy_mappings.size() == 3, |
| 61 | "Wrong size for CopyMapping Corners" ); |
| 62 | for( const auto i : geode::LRange{ 3 } ) |
| 63 | { |
| 64 | geode::OpenGeodeModelException::test( |
| 65 | corner_copy_mappings.in2out( uuids_in[i] ) == uuids_out[i], |
| 66 | "Wrong mapping for CopyMapping Corners" ); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | void test_generic_mapping() |
| 71 | { |