| 384 | } |
| 385 | |
| 386 | void test_delete_all( const geode::TetrahedralSolid3D& solid, |
| 387 | geode::TetrahedralSolidBuilder3D& builder ) |
| 388 | { |
| 389 | builder.delete_isolated_vertices(); |
| 390 | geode::OpenGeodeMeshException::test( |
| 391 | solid.nb_vertices() == 5, "TetrahedralSolid should have 5 vertices" ); |
| 392 | geode::OpenGeodeMeshException::test( solid.facets().nb_facets() == 7, |
| 393 | "TetrahedralSolid should have 4 facets" ); |
| 394 | geode::OpenGeodeMeshException::test( solid.nb_polyhedra() == 2, |
| 395 | "TetrahedralSolid should have 1 polyhedron" ); |
| 396 | |
| 397 | std::vector< bool > to_delete( solid.nb_polyhedra(), true ); |
| 398 | builder.delete_polyhedra( to_delete ); |
| 399 | geode::OpenGeodeMeshException::test( |
| 400 | solid.nb_vertices() == 5, "TetrahedralSolid should have 5 vertices" ); |
| 401 | geode::OpenGeodeMeshException::test( solid.facets().nb_facets() == 7, |
| 402 | "TetrahedralSolid should have 7 facet" ); |
| 403 | geode::OpenGeodeMeshException::test( solid.nb_polyhedra() == 0, |
| 404 | "TetrahedralSolid should have 0 polyhedron" ); |
| 405 | geode::OpenGeodeMeshException::test( |
| 406 | solid.polyhedra_around_vertex( 0 ).empty(), |
| 407 | "No more polyhedron around vertices" ); |
| 408 | |
| 409 | std::vector< bool > f_to_delete( solid.facets().nb_facets(), true ); |
| 410 | builder.facets_builder().delete_facets( f_to_delete ); |
| 411 | geode::OpenGeodeMeshException::test( solid.facets().nb_facets() == 0, |
| 412 | "TetrahedralSolid should have 0 facet" ); |
| 413 | |
| 414 | builder.delete_isolated_vertices(); |
| 415 | geode::OpenGeodeMeshException::test( |
| 416 | solid.nb_vertices() == 0, "TetrahedralSolid should have 0 vertex" ); |
| 417 | } |
| 418 | |
| 419 | void test() |
| 420 | { |
no test coverage detected