Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ namespace geode
const EdgedCurveDegeneration< Model::dim > inspector{
line.mesh()
};
auto issues = inspector.small_edges( threshold );
std::pair< uuid, InspectionIssues< index_t > > result;
auto& [line_id, issues] = result;
line_id = line.id();
issues = inspector.small_edges( threshold );
issues.set_description( absl::StrCat( "Line ",
line.name().value_or( line.id().string() ), " (",
line.id().string(), ") small edges" ) );
return std::make_pair( line.id(), std::move( issues ) );
return result;
} ) );
}
for( auto& task :
Expand All @@ -102,13 +105,15 @@ namespace geode
}
const geode::SurfaceMeshDegeneration< Model::dim >
inspector{ surface.mesh() };
auto issues = inspector.small_edges( threshold );
std::pair< uuid, InspectionIssues< index_t > > result;
auto& [surface_id, issues] = result;
surface_id = surface.id();
issues = inspector.small_edges( threshold );
issues.set_description( absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ),
" (", surface.id().string(),
") small facet edges" ) );
return std::make_pair(
surface.id(), std::move( issues ) );
return result;
} ) );
}
for( auto& task :
Expand Down Expand Up @@ -142,11 +147,14 @@ namespace geode
tasks.emplace_back( async::spawn( [&threshold, &surface] {
const geode::SurfaceMeshDegeneration< Model::dim >
inspector{ surface.mesh() };
auto issues = inspector.small_height_polygons( threshold );
std::pair< uuid, InspectionIssues< index_t > > result;
auto& [surface_id, issues] = result;
surface_id = surface.id();
issues = inspector.small_height_polygons( threshold );
issues.set_description( absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(), ") small height polygons" ) );
return std::make_pair( surface.id(), std::move( issues ) );
return result;
} ) );
}
for( auto& task :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ namespace
};
if( !polygons_around_edges
.try_emplace( polygon_edge_vertex_cycle,
std::make_pair( 1, false ) )
std::pair< geode::local_index_t, bool >{
1, false } )
.second )
{
polygons_around_edges[polygon_edge_vertex_cycle].first += 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ namespace
if( nb_block_cmvs
== predicted_nb_block_cmvs + nb_lines_on_several_boundaries )
{
return std::make_pair( nb_block_cmvs, std::nullopt );
return { nb_block_cmvs, std::nullopt };
}
}
return std::make_pair( predicted_nb_block_cmvs,
return { predicted_nb_block_cmvs,
nb_block_cmvs == predicted_nb_block_cmvs
? std::nullopt
: std::make_optional( absl::StrCat( "unique vertex ",
Expand All @@ -227,7 +227,7 @@ namespace
nb_line_on_boundary_cmvs,
" cmvs counted for lines on the boundary, with ",
nb_block_cmvs, " Block CMVs (expected ",
predicted_nb_block_cmvs, " with valid topology)." ) ) );
predicted_nb_block_cmvs, " with valid topology)." ) ) };
}
} // namespace

Expand Down
15 changes: 10 additions & 5 deletions tests/inspection/test-surface-intersections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,20 @@ void check_intersections2D()
"2D Surface should have 3 intersecting elements pair." );
bool right_intersections{ true };
const auto &triangles_inter = inspection.issues();
if( absl::c_find( triangles_inter, std::make_pair( 2u, 0u ) )
if( absl::c_find( triangles_inter,
std::pair< geode::index_t, geode::index_t >{ 2u, 0u } )
== triangles_inter.end() )
{
right_intersections = false;
}
if( absl::c_find( triangles_inter, std::make_pair( 2u, 1u ) )
if( absl::c_find( triangles_inter,
std::pair< geode::index_t, geode::index_t >{ 2u, 1u } )
== triangles_inter.end() )
{
right_intersections = false;
}
if( absl::c_find( triangles_inter, std::make_pair( 0u, 1u ) )
if( absl::c_find( triangles_inter,
std::pair< geode::index_t, geode::index_t >{ 0u, 1u } )
== triangles_inter.end() )
{
right_intersections = false;
Expand Down Expand Up @@ -112,12 +115,14 @@ void check_intersections3D()
inspection.nb_issues(), "." );
bool right_intersections{ true };
const auto &triangles_inter = inspection.issues();
if( absl::c_find( triangles_inter, std::make_pair( 0u, 4u ) )
if( absl::c_find( triangles_inter,
std::pair< geode::index_t, geode::index_t >{ 0u, 4u } )
== triangles_inter.end() )
{
right_intersections = false;
}
if( absl::c_find( triangles_inter, std::make_pair( 2u, 4u ) )
if( absl::c_find( triangles_inter,
std::pair< geode::index_t, geode::index_t >{ 2u, 4u } )
== triangles_inter.end() )
{
right_intersections = false;
Expand Down
Loading