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

Function test_replace_vertex

tests/mesh/test-polygonal-surface.cpp:576–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576void test_replace_vertex( const geode::PolygonalSurface3D& polygonal_surface,
577 geode::PolygonalSurfaceBuilder3D& builder )
578{
579 const auto att = polygonal_surface.edges()
580 .edge_attribute_manager()
581 .find_attribute< geode::index_t >( "counter" );
582 const auto new_id = builder.create_vertex();
583 const auto polygons_around = polygonal_surface.polygons_around_vertex( 1 );
584 builder.replace_vertex( 1, new_id );
585 for( const auto& pv : polygons_around )
586 {
587 geode::OpenGeodeMeshException::test(
588 polygonal_surface.polygon_vertex( pv ) == new_id,
589 "PolygonVertex after replace_vertex is wrong" );
590 }
591 geode::OpenGeodeMeshException::test(
592 polygonal_surface.is_vertex_isolated( 1 ),
593 "Isolated vertex after replace_vertex is wrong" );
594 builder.replace_vertex( new_id, 1 );
595 for( const auto& pv : polygons_around )
596 {
597 geode::OpenGeodeMeshException::test(
598 polygonal_surface.polygon_vertex( pv ) == 1,
599 "PolygonVertex after second replace_vertex is wrong" );
600 }
601 builder.delete_isolated_vertices();
602 builder.edges_builder().delete_isolated_edges();
603 geode::OpenGeodeMeshException::test(
604 polygonal_surface.nb_vertices() == new_id,
605 "Revert after replace_vertex is wrong" );
606}
607
608void test_delete_all( const geode::PolygonalSurface3D& polygonal_surface,
609 geode::PolygonalSurfaceBuilder3D& builder )

Callers 1

testFunction · 0.85

Calls 9

create_vertexMethod · 0.80
polygon_vertexMethod · 0.80
testFunction · 0.70
replace_vertexMethod · 0.45
is_vertex_isolatedMethod · 0.45
delete_isolated_edgesMethod · 0.45
edges_builderMethod · 0.45
nb_verticesMethod · 0.45

Tested by

no test coverage detected