| 96 | |
| 97 | template < typename Mesh > |
| 98 | void test_basic_accessor( const Mesh& mesh, geode::index_t nb_element_vertices ) |
| 99 | { |
| 100 | using Accessor = geode::GenericMeshAccessor< Mesh >; |
| 101 | const Accessor accessor{ mesh }; |
| 102 | geode::OpenGeodeMeshException::test( |
| 103 | accessor.nb_elements() == 2, "Wrong number of elements" ); |
| 104 | geode::OpenGeodeMeshException::test( |
| 105 | accessor.nb_element_vertices( 0 ) == nb_element_vertices, |
| 106 | "Wrong number of element vertices" ); |
| 107 | geode::OpenGeodeMeshException::test( |
| 108 | accessor.nb_element_facets( 0 ) == nb_element_vertices, |
| 109 | "Wrong number of element facets" ); |
| 110 | geode::OpenGeodeMeshException::test( |
| 111 | accessor.element_vertex( { 0, 0 } ) == 0, |
| 112 | "Wrong element vertex { 0, 0 }" ); |
| 113 | geode::OpenGeodeMeshException::test( |
| 114 | accessor.element_vertex( { 0, 1 } ) == 1, |
| 115 | "Wrong element vertex { 0, 1 }" ); |
| 116 | geode::OpenGeodeMeshException::test( |
| 117 | accessor.element_vertices( 0 ).size() == nb_element_vertices, |
| 118 | "Wrong size of element vertices container" ); |
| 119 | const auto attribute = |
| 120 | accessor.element_attribute_manager() |
| 121 | .template find_attribute< geode::index_t >( "test_attribute" ); |
| 122 | geode::OpenGeodeMeshException::test( |
| 123 | attribute->value( 0 ) == 2 && attribute->value( 1 ) == 5, |
| 124 | "Wrong values of the element attributes." ); |
| 125 | geode::OpenGeodeMeshException::test( |
| 126 | accessor.id() == mesh.id(), "Wrong uuid value." ); |
| 127 | geode::OpenGeodeMeshException::test( |
| 128 | accessor.point( 0 ).value( 0 ) == 0 |
| 129 | && accessor.point( 0 ).value( 1 ) == 0, |
| 130 | "Wrong point coordinate value." ); |
| 131 | } |
| 132 | |
| 133 | template < typename Mesh > |
| 134 | void test_adjacent_accessor( const Mesh& mesh ) |
no test coverage detected