MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_delete_all

Function test_delete_all

tests/mesh/test-tetrahedral-solid.cpp:386–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386void 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
419void test()
420{

Callers 1

testFunction · 0.70

Calls 9

nb_polyhedraMethod · 0.80
delete_polyhedraMethod · 0.80
emptyMethod · 0.80
facets_builderMethod · 0.80
testFunction · 0.70
nb_verticesMethod · 0.45
nb_facetsMethod · 0.45
delete_facetsMethod · 0.45

Tested by

no test coverage detected