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

Function test_delete_all

tests/mesh/test-triangulated-surface.cpp:271–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271void test_delete_all( const geode::TriangulatedSurface3D& triangulated_surface,
272 geode::TriangulatedSurfaceBuilder3D& builder )
273{
274 builder.delete_isolated_vertices();
275 geode::OpenGeodeMeshException::test(
276 triangulated_surface.nb_vertices() == 3,
277 "[Test]TriangulatedSurface should have 3 vertices" );
278 geode::OpenGeodeMeshException::test(
279 triangulated_surface.edges().nb_edges() == 3,
280 "[Test]TriangulatedSurface should have 3 edges" );
281 geode::OpenGeodeMeshException::test(
282 triangulated_surface.nb_polygons() == 1,
283 "[Test]TriangulatedSurface should have 1 polygon" );
284
285 std::vector< bool > to_delete( triangulated_surface.nb_polygons(), true );
286 builder.delete_polygons( to_delete );
287 geode::OpenGeodeMeshException::test(
288 triangulated_surface.nb_vertices() == 3,
289 "[Test]TriangulatedSurface should have 3 vertices" );
290 builder.edges_builder().delete_isolated_edges();
291 geode::OpenGeodeMeshException::test(
292 triangulated_surface.edges().nb_edges() == 0,
293 "[Test]TriangulatedSurface should have 0 edge" );
294 geode::OpenGeodeMeshException::test(
295 triangulated_surface.nb_polygons() == 0,
296 "[Test]TriangulatedSurface should have 0 polygon" );
297 geode::OpenGeodeMeshException::test(
298 triangulated_surface.polygons_around_vertex( 0 ).empty(),
299 "No more polygon around vertices" );
300
301 builder.delete_isolated_vertices();
302 geode::OpenGeodeMeshException::test(
303 triangulated_surface.nb_vertices() == 0,
304 "[Test]TriangulatedSurface should have 0 vertex" );
305}
306
307void test()
308{

Callers

nothing calls this directly

Calls 9

nb_polygonsMethod · 0.80
delete_polygonsMethod · 0.80
emptyMethod · 0.80
testFunction · 0.70
nb_verticesMethod · 0.45
nb_edgesMethod · 0.45
delete_isolated_edgesMethod · 0.45
edges_builderMethod · 0.45

Tested by

no test coverage detected