Skip to content
Merged
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 @@ -27,6 +27,7 @@

#include <geode/basic/logger.hpp>
#include <geode/basic/pimpl_impl.hpp>
#include <geode/basic/range.hpp>

#include <geode/mesh/core/solid_mesh.hpp>

Expand Down Expand Up @@ -89,7 +90,8 @@ namespace geode
auto wrong_adjacencies =
inspector.polyhedron_facets_with_wrong_adjacency();
wrong_adjacencies.set_description( absl::StrCat( "Block ",
block.name(), " (", block.id().string(),
block.name().value_or( block.id().string() ), " (",
block.id().string(),
") polyhedron facets adjacencies issues" ) );
const auto& mesh = block.mesh();
for( const auto polyhedron_id : Range{ mesh.nb_polyhedra() } )
Expand Down
3 changes: 2 additions & 1 deletion src/geode/inspector/criterion/adjacency/solid_adjacency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ namespace geode
polyhedron_facets_with_wrong_adjacency() const
{
InspectionIssues< PolyhedronFacet > wrong_adjacency_facets{
absl::StrCat( "Solid ", mesh_.name(),
absl::StrCat( "Solid ",
mesh_.name().value_or( mesh_.id().string() ),
" polyhedron facets adjacencies issues" )
};
for( const auto polyhedron_id : Range{ mesh_.nb_polyhedra() } )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace geode
polygon_edges_with_wrong_adjacency() const
{
InspectionIssues< PolygonEdge > wrong_adjacency_edges{ absl::StrCat(
"Surface ", mesh_.name(),
"Surface ", mesh_.name().value_or( mesh_.id().string() ),
" polygon edges adjacencies issues" ) };
for( const auto polygon_id : Range{ mesh_.nb_polygons() } )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ namespace
if( !colocated_pts.empty() )
{
geode::InspectionIssues< std::vector< geode::index_t > >
line_issues{ absl::StrCat( "Line ", line.name(), " (",
line_issues{ absl::StrCat( "Line ",
line.name().value_or( line.id().string() ), " (",
line.id().string(), ") colocated vertices" ) };
const auto& line_mesh = line.mesh();
for( const auto& colocated_points_group : colocated_pts )
Expand All @@ -124,7 +125,8 @@ namespace
&point_group_string, " ", point_index );
}
line_issues.add_issue( colocated_points_group,
absl::StrCat( "Line ", line.name(), " (",
absl::StrCat( "Line ",
line.name().value_or( line.id().string() ), " (",
line.id().string(), ") has vertices ",
point_group_string, " colocated at position [",
line_mesh.point( colocated_points_group[0] )
Expand All @@ -147,8 +149,9 @@ namespace
if( !colocated_pts.empty() )
{
geode::InspectionIssues< std::vector< geode::index_t > >
surface_issues{ absl::StrCat( "Surface ", surface.name(),
" (", surface.id().string(), ") colocated vertices" ) };
surface_issues{ absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(), ") colocated vertices" ) };
const auto& surface_mesh = surface.mesh();
for( const auto& colocated_points_group : colocated_pts )
{
Expand All @@ -159,8 +162,9 @@ namespace
&point_group_string, " ", point_index );
}
surface_issues.add_issue( colocated_points_group,
absl::StrCat( "Surface ", surface.name(), " (",
surface.id().string(), ") has vertices ",
absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ),
" (", surface.id().string(), ") has vertices ",
Comment on lines +165 to +167
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of message may show twice the id. Is it something OK? No problem from my side but I must raise this point

point_group_string, " colocated at position [",
surface_mesh.point( colocated_points_group[0] )
.string(),
Expand Down Expand Up @@ -197,7 +201,8 @@ namespace
if( !colocated_pts.empty() )
{
geode::InspectionIssues< std::vector< geode::index_t > >
block_issues{ absl::StrCat( "Block ", block.name(), " (",
block_issues{ absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") colocated vertices" ) };
const auto& block_mesh = block.mesh();
for( const auto& colocated_points_group : colocated_pts )
Expand All @@ -209,7 +214,8 @@ namespace
&point_group_string, " ", point_index );
}
block_issues.add_issue( colocated_points_group,
absl::StrCat( "Block ", block.name(), " (",
absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") has vertices ",
point_group_string, " colocated at position [",
block_mesh.point( colocated_points_group[0] )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ namespace geode
}
const geode::SolidMeshDegeneration3D inspector{ mesh };
auto small_edges = inspector.small_edges( threshold );
small_edges.set_description(
absl::StrCat( "Block ", block.name(), " (",
block.id().string(), ") small edges polyhedra" ) );
small_edges.set_description( absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") small edges polyhedra" ) );
small_edges_map.add_issues_to_map(
block.id(), std::move( small_edges ) );
auto small_polyhedra =
inspector.small_height_polyhedra( threshold );
small_polyhedra.set_description(
absl::StrCat( "Block ", block.name(), " (",
block.id().string(), ") small height polyhedra" ) );
small_polyhedra.set_description( absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") small height polyhedra" ) );
small_polyhedra_map.add_issues_to_map(
block.id(), std::move( small_polyhedra ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ namespace geode
};
auto issues = inspector.polygon_edges_with_wrong_adjacency();
issues.set_description( absl::StrCat( "Surface ",
surface.name(), " (", surface.id().string(),
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(),
") polygon edges adjacency issues" ) );
const auto& mesh = surface.mesh();
for( const auto polygon_id : Range{ mesh.nb_polygons() } )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ namespace geode
line.mesh()
};
auto issues = inspector.small_edges( threshold );
issues.set_description( absl::StrCat( "Line ", line.name(),
" (", line.id().string(), ") small edges" ) );
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 ) );
} ) );
}
Expand Down Expand Up @@ -103,7 +104,8 @@ namespace geode
inspector{ surface.mesh() };
auto issues = inspector.small_edges( threshold );
issues.set_description( absl::StrCat( "Surface ",
surface.name(), " (", surface.id().string(),
surface.name().value_or( surface.id().string() ),
" (", surface.id().string(),
") small facet edges" ) );
return std::make_pair(
surface.id(), std::move( issues ) );
Expand Down Expand Up @@ -142,8 +144,8 @@ namespace geode
inspector{ surface.mesh() };
auto issues = inspector.small_height_polygons( threshold );
issues.set_description( absl::StrCat( "Surface ",
surface.name(), " (", surface.id().string(),
") small height polygons" ) );
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(), ") small height polygons" ) );
return std::make_pair( surface.id(), std::move( issues ) );
} ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ namespace geode
surface.mesh()
};
auto issues = inspector.non_manifold_vertices();
issues.set_description(
absl::StrCat( "Surface ", surface.name(), " (",
surface.id().string(), ") non manifold vertices" ) );
issues.set_description( absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(), ") non manifold vertices" ) );
surfaces_non_manifold_vertices.add_issues_to_map(
surface.id(), std::move( issues ) );
}
Expand All @@ -78,9 +78,9 @@ namespace geode
surface.mesh()
};
auto issues = inspector.non_manifold_edges();
issues.set_description(
absl::StrCat( "Surface ", surface.name(), " (",
surface.id().string(), ") non manifold edges" ) );
issues.set_description( absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(), ") non manifold edges" ) );
surfaces_non_manifold_edges.add_issues_to_map(
surface.id(), std::move( issues ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,12 @@ namespace geode
const auto& surface2 =
model_.surface( polygon_pair.second.component_id.id() );
intersection_issues.add_issue( polygon_pair,
absl::StrCat( "Surfaces ", surface1.name(), " (",
polygon_pair.first.component_id.id().string(), ") and ",
surface2.name(), " (",
polygon_pair.second.component_id.id().string(),
absl::StrCat( "Surfaces ",
surface1.name().value_or( surface1.id().string() ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of occurrences of such code
toto.name().value_or( toto.id().string()

Is there some room for a Identifier method returning always a string which is either the (copied) name or the (build) id as a string?

" (", polygon_pair.first.component_id.id().string(),
") and ",
surface2.name().value_or( surface2.id().string() ),
" (", polygon_pair.second.component_id.id().string(),
") intersect on polygons ",
polygon_pair.first.element_id, " and ",
polygon_pair.second.element_id ) );
Expand All @@ -542,7 +544,8 @@ namespace geode
const auto& surface =
model_.surface( polygon_pair.first.component_id.id() );
intersection_issues.add_issue( polygon_pair,
absl::StrCat( "Surface ", surface.name(), " (",
absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ), " (",
polygon_pair.first.component_id.id().string(),
") has a self intersection on polygons ",
polygon_pair.first.element_id, "and ",
Expand Down
33 changes: 18 additions & 15 deletions src/geode/inspector/criterion/manifold/brep_meshes_manifold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ namespace geode
{
const SolidMeshVertexManifold3D inspector{ block.mesh() };
auto non_manifold_vertices = inspector.non_manifold_vertices();
non_manifold_vertices.set_description(
absl::StrCat( "Block ", block.name(), " (",
block.id().string(), ") non manifold vertices" ) );
non_manifold_vertices.set_description( absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") non manifold vertices" ) );
components_non_manifold_vertices.add_issues_to_map(
block.id(), std::move( non_manifold_vertices ) );
}
Expand All @@ -128,9 +128,9 @@ namespace geode
{
const SolidMeshEdgeManifold3D inspector{ block.mesh() };
auto non_manifold_edges = inspector.non_manifold_edges();
non_manifold_edges.set_description(
absl::StrCat( "Block ", block.name(), " (",
block.id().string(), ") non manifold edges" ) );
non_manifold_edges.set_description( absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") non manifold edges" ) );
components_non_manifold_edges.add_issues_to_map(
block.id(), non_manifold_edges );
}
Expand All @@ -144,9 +144,9 @@ namespace geode
{
const SolidMeshFacetManifold3D inspector{ block.mesh() };
auto non_manifold_facets = inspector.non_manifold_facets();
non_manifold_facets.set_description(
absl::StrCat( "Block ", block.name(), " (",
block.id().string(), ") non manifold facets" ) );
non_manifold_facets.set_description( absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") non manifold facets" ) );
components_non_manifold_facets.add_issues_to_map(
block.id(), non_manifold_facets );
}
Expand Down Expand Up @@ -201,8 +201,11 @@ namespace geode
for( const auto surface_uuid : edge.second )
{
absl::StrAppend( &message,
model().surface( surface_uuid ).name(), " (",
surface_uuid.string(), "), " );
model()
.surface( surface_uuid )
.name()
.value_or( surface_uuid.string() ),
" (", surface_uuid.string(), "), " );
}
absl::StrAppend( &message, "but not on their border" );
issues.add_issue(
Expand Down Expand Up @@ -232,8 +235,8 @@ namespace geode
"Model edge between unique vertices ",
edge_unique_vertices[0], " and ", edge_unique_vertices[1],
" is not manifold: it belongs to internal Line ",
line.name(), " (", line.id().string(),
") with only one edge" );
line.name().value_or( line.id().string() ), " (",
line.id().string(), ") with only one edge" );
issues.add_issue(
BRepNonManifoldEdge{ edge_unique_vertices, { line.id() } },
message );
Expand Down Expand Up @@ -264,8 +267,8 @@ namespace geode
}
absl::StrAppend( &message,
" is not manifold: it belongs to internal Surface ",
surface.name(), " (", surface.id().string(),
") with only one facet" );
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(), ") with only one facet" );
issues.add_issue(
BRepNonManifoldFacet{ facet_vertices, { surface.id() } },
message );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ namespace geode
block.mesh()
};
auto negative_elements = inspector.negative_polyhedra();
negative_elements.set_description(
absl::StrCat( "Block ", block.name(), " (",
block.id().string(), ") negative polyhedra" ) );
negative_elements.set_description( absl::StrCat( "Block ",
block.name().value_or( block.id().string() ), " (",
block.id().string(), ") negative polyhedra" ) );
result.negative_polyhedra.add_issues_to_map(
block.id(), std::move( negative_elements ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ namespace geode
surface.mesh()
};
auto negative_elements = inspector.negative_polygons();
negative_elements.set_description(
absl::StrCat( "Surface ", surface.name(), " (",
surface.id().string(), ") negative polygons" ) );
negative_elements.set_description( absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ), " (",
surface.id().string(), ") negative polygons" ) );
result.negative_polygons.add_issues_to_map(
surface.id(), std::move( negative_elements ) );
}
Expand Down
Loading