Skip to content
Draft

V18 #193

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 @@ -37,11 +37,11 @@
class Section;
struct uuid;
struct ComponentMeshVertex;
class ComponentID;
struct ComponentID;
class VertexSet;
} // namespace geode

namespace geode

Check warning on line 44 in include/geode/inspector/inspection/topology/internal/topology_helpers.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/inspector/inspection/topology/internal/topology_helpers.hpp:44:1 [modernize-concat-nested-namespaces]

nested namespaces can be concatenated
{
namespace internal
{
Expand All @@ -59,9 +59,9 @@
for( const auto& cmv :
model.component_mesh_vertices( unique_vertex_index ) )
{
if( cmv.component_id.type() == type )
if( cmv.component_id.type == type )
{
component_uuids.push_back( cmv.component_id.id() );
component_uuids.push_back( cmv.component_id.id );
}
}
sort_unique( component_uuids );
Expand Down Expand Up @@ -96,7 +96,7 @@
InspectionIssues< index_t > result;
for( const auto vertex_id : Range{ component_mesh.nb_vertices() } )
{
ComponentMeshVertex component_mesh_vertex{ component_id,

Check failure on line 99 in include/geode/inspector/inspection/topology/internal/topology_helpers.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/inspector/inspection/topology/internal/topology_helpers.hpp:99:37 [clang-diagnostic-error]

variable has incomplete type 'ComponentMeshVertex'
vertex_id };
if( model.unique_vertex( component_mesh_vertex ) == NO_ID )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,21 @@
const geode::ComponentMeshVertex& cmv,
const geode::Point< Model::dim >& point )
{
if( cmv.component_id.type()
if( cmv.component_id.type

Check failure on line 55 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:55:30 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
== geode::Line< Model::dim >::component_type_static() )
{
return point.inexact_equal( model.line( cmv.component_id.id() )
.mesh()
.point( cmv.vertex ) );
return point.inexact_equal(
model.line( cmv.component_id.id ).mesh().point( cmv.vertex ) );

Check failure on line 59 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:59:46 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
}
else if( cmv.component_id.type()
else if( cmv.component_id.type

Check failure on line 61 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:61:35 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?

Check warning on line 61 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:61:9 [llvm-else-after-return]

do not use 'else' after 'return'
== geode::Surface< Model::dim >::component_type_static() )
{
return point.inexact_equal( model.surface( cmv.component_id.id() )
return point.inexact_equal( model.surface( cmv.component_id.id )

Check failure on line 64 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:64:73 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
.mesh()
.point( cmv.vertex ) );
}
return point.inexact_equal(
model.corner( cmv.component_id.id() ).mesh().point( cmv.vertex ) );
model.corner( cmv.component_id.id ).mesh().point( cmv.vertex ) );

Check failure on line 69 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:69:44 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
}

bool model_cmv_is_colocated_on_point( const geode::Section& model,
Expand All @@ -82,11 +81,10 @@
const geode::ComponentMeshVertex& cmv,
const geode::Point3D& point )
{
if( cmv.component_id.type() == geode::Block3D::component_type_static() )
if( cmv.component_id.type == geode::Block3D::component_type_static() )

Check failure on line 84 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:84:30 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
{
return point.inexact_equal( model.block( cmv.component_id.id() )
.mesh()
.point( cmv.vertex ) );
return point.inexact_equal(
model.block( cmv.component_id.id ).mesh().point( cmv.vertex ) );

Check failure on line 87 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:87:47 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
}
return model_cmv_is_colocated_on_point_base< geode::BRep >(
model, cmv, point );
Expand All @@ -99,7 +97,7 @@
{
for( const auto& cmv : cmvs )
{
if( !model.component( cmv.component_id.id() ).is_active() )
if( !model.component( cmv.component_id.id ).is_active() )

Check failure on line 100 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:100:52 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
{
continue;
}
Expand All @@ -115,21 +113,19 @@
geode::Point< Model::dim > model_cmv_point(
const Model& model, const geode::ComponentMeshVertex& cmv )
{
if( cmv.component_id.type()
if( cmv.component_id.type

Check failure on line 116 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:116:30 [clang-diagnostic-error]

reference to non-static member function must be called; did you mean to call it with no arguments?
== geode::Line< Model::dim >::component_type_static() )
{
return model.line( cmv.component_id.id() )
.mesh()
.point( cmv.vertex );
return model.line( cmv.component_id.id ).mesh().point( cmv.vertex );
}
if( cmv.component_id.type()
if( cmv.component_id.type
== geode::Surface< Model::dim >::component_type_static() )
{
return model.surface( cmv.component_id.id() )
return model.surface( cmv.component_id.id )
.mesh()
.point( cmv.vertex );
}
return model.corner( cmv.component_id.id() ).mesh().point( cmv.vertex );
return model.corner( cmv.component_id.id ).mesh().point( cmv.vertex );
}

std::optional< geode::Point2D > model_unique_vertex_point(
Expand All @@ -138,7 +134,7 @@
{
for( const auto& cmv : cmvs )
{
if( !model.component( cmv.component_id.id() ).is_active() )
if( !model.component( cmv.component_id.id ).is_active() )
{
continue;
}
Expand All @@ -153,14 +149,14 @@
{
for( const auto& cmv : cmvs )
{
if( !model.component( cmv.component_id.id() ).is_active() )
if( !model.component( cmv.component_id.id ).is_active() )
{
continue;
}
if( cmv.component_id.type()
if( cmv.component_id.type
== geode::Block3D::component_type_static() )
{
return model.block( cmv.component_id.id() )
return model.block( cmv.component_id.id )
.mesh()
.point( cmv.vertex );
}
Expand Down Expand Up @@ -193,7 +189,7 @@
class UniqueVerticesColocation< Model >::Impl
{
public:
Impl( const Model& model )

Check warning on line 192 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:192:9 [google-explicit-constructor]

single-argument constructors must be marked explicit to avoid unintentional implicit conversions
: model_( model ),
active_uv_pointset_{ PointSet< Model::dim >::create() }
{
Expand All @@ -219,7 +215,7 @@
}
}

bool model_has_unique_vertices_linked_to_different_points() const

Check warning on line 218 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:218:9 [modernize-use-nodiscard]

function 'model_has_unique_vertices_linked_to_different_points' should be marked [[nodiscard]]
{
for( const auto unique_vertex_id :
Range{ model_.nb_unique_vertices() } )
Expand All @@ -240,7 +236,7 @@
return false;
}

bool model_has_colocated_unique_vertices() const

Check warning on line 239 in src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/colocation/unique_vertices_colocation.cpp:239:9 [modernize-use-nodiscard]

function 'model_has_colocated_unique_vertices' should be marked [[nodiscard]]
{
const PointSetColocation< Model::dim > pointset_inspector{
*active_uv_pointset_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}
} // namespace

namespace geode

Check warning on line 66 in src/geode/inspector/inspection/criterion/internal/component_meshes_adjacency.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/internal/component_meshes_adjacency.cpp:66:1 [modernize-concat-nested-namespaces]

nested namespaces can be concatenated
{
namespace internal
{
Expand All @@ -76,7 +76,7 @@

template < typename Model >
void ComponentMeshesAdjacency< Model >::
add_surfaces_edges_with_wrong_adjacencies(

Check warning on line 79 in src/geode/inspector/inspection/criterion/internal/component_meshes_adjacency.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/internal/component_meshes_adjacency.cpp:79:13 [readability-function-cognitive-complexity]

function 'add_surfaces_edges_with_wrong_adjacencies' has cognitive complexity of 15 (threshold 10)
InspectionIssuesMap< PolygonEdge >&
components_wrong_adjacencies ) const
{
Expand Down Expand Up @@ -112,7 +112,7 @@
}
catch( const OpenGeodeException& e )
{
Logger::warn( e.what() );
Logger::warning( e.what() );
issues.add_issue( polygon_edge,
absl::StrCat( "edge ", edge_id, " of polygon ",
polygon_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <geode/inspector/inspection/criterion/degeneration/edgedcurve_degeneration.hpp>
#include <geode/inspector/inspection/criterion/degeneration/surface_degeneration.hpp>

namespace geode

Check warning on line 40 in src/geode/inspector/inspection/criterion/internal/component_meshes_degeneration.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/internal/component_meshes_degeneration.cpp:40:1 [modernize-concat-nested-namespaces]

nested namespaces can be concatenated
{
namespace internal
{
Expand Down Expand Up @@ -71,11 +71,14 @@
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 @@
}
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 @@
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 @@ -82,7 +82,7 @@
{
public:
BRepLineSurfacesIntersection( const geode::BRep& model,
const geode::uuid& surface_id,

Check warning on line 85 in src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:85:13 [bugprone-easily-swappable-parameters]

2 adjacent parameters of 'BRepLineSurfacesIntersection' of similar type ('const geode::uuid &') are easily swapped by mistake
const geode::uuid& line_id )
: surface_( model.surface( surface_id ) ),
line_( model.line( line_id ) ),
Expand Down Expand Up @@ -164,7 +164,7 @@
class ModelIntersectionBase
{
public:
ModelIntersectionBase( const Model& model ) : model_( model ) {}

Check warning on line 167 in src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/inspector/inspection/criterion/intersections/model_intersections.cpp:167:9 [google-explicit-constructor]

single-argument constructors must be marked explicit to avoid unintentional implicit conversions

[[nodiscard]] std::vector< std::pair< geode::index_t, geode::index_t > >
intersecting_elements()
Expand Down Expand Up @@ -672,16 +672,16 @@
for( const auto& polygon_pair : intersections )
{
const auto& surface1 =
model_.surface( polygon_pair.first.component_id.id() );
model_.surface( polygon_pair.first.component_id.id );
const auto& surface2 =
model_.surface( polygon_pair.second.component_id.id() );
model_.surface( polygon_pair.second.component_id.id );
intersection_issues.add_issue( polygon_pair,
absl::StrCat( "Surfaces ",
surface1.name().value_or( surface1.id().string() ),
" (", polygon_pair.first.component_id.id().string(),
" (", polygon_pair.first.component_id.id.string(),
") and ",
surface2.name().value_or( surface2.id().string() ),
" (", polygon_pair.second.component_id.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 @@ -696,15 +696,15 @@
for( const auto& edge_pair : intersections )
{
const auto& line1 =
model_.line( edge_pair.first.component_id.id() );
model_.line( edge_pair.first.component_id.id );
const auto& line2 =
model_.line( edge_pair.second.component_id.id() );
model_.line( edge_pair.second.component_id.id );
intersection_issues.add_issue( edge_pair,
absl::StrCat( "Lines ",
line1.name().value_or( line1.id().string() ), " (",
edge_pair.first.component_id.id().string(), ") and ",
edge_pair.first.component_id.id.string(), ") and ",
line2.name().value_or( line2.id().string() ), " (",
edge_pair.second.component_id.id().string(),
edge_pair.second.component_id.id.string(),
") intersect on edges ", edge_pair.first.element_id,
" and ", edge_pair.second.element_id ) );
}
Expand All @@ -719,11 +719,11 @@
for( const auto& polygon_pair : intersections )
{
const auto& surface =
model_.surface( polygon_pair.first.component_id.id() );
model_.surface( polygon_pair.first.component_id.id );
intersection_issues.add_issue( polygon_pair,
absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ), " (",
polygon_pair.first.component_id.id().string(),
polygon_pair.first.component_id.id.string(),
") has a self intersection on polygons ",
polygon_pair.first.element_id, "and ",
polygon_pair.second.element_id ) );
Expand All @@ -741,16 +741,16 @@
for( const auto& element_pair : intersections )
{
const auto& surface =
model_.surface( element_pair.first.component_id.id() );
model_.surface( element_pair.first.component_id.id );
const auto& line =
model_.line( element_pair.second.component_id.id() );
model_.line( element_pair.second.component_id.id );
intersection_issues.add_issue( element_pair,
absl::StrCat( "Surface ",
surface.name().value_or( surface.id().string() ),
" (", element_pair.first.component_id.id().string(),
" (", element_pair.first.component_id.id.string(),
") and Line ",
line.name().value_or( line.id().string() ), " (",
element_pair.second.component_id.id().string(),
element_pair.second.component_id.id.string(),
") intersect on polygon ",
element_pair.first.element_id, " and edge ",
element_pair.second.element_id ) );
Expand All @@ -772,7 +772,7 @@
{
if( surface.mesh().nb_polygons() == 0 )
{
geode::Logger::warn(
geode::Logger::warning(
"One of the surface meshes has an empty mesh, cannot "
"compute the AABBTree used for detecting the mesh "
"intersections, no intersections will be "
Expand Down Expand Up @@ -854,7 +854,7 @@
{
if( line.mesh().nb_edges() == 0 )
{
geode::Logger::warn(
geode::Logger::warning(
"One of the line meshes has an empty mesh, "
"skipping line-surface intersection detection." );
return component_intersections;
Expand Down Expand Up @@ -934,7 +934,7 @@
{
if( surface.mesh().nb_polygons() == 0 )
{
geode::Logger::warn(
geode::Logger::warning(
"One of the surface meshes has an empty mesh, "
"skipping line-surface intersection detection." );
return component_intersections;
Expand All @@ -944,7 +944,7 @@
{
if( line.mesh().nb_edges() == 0 )
{
geode::Logger::warn(
geode::Logger::warning(
"One of the line meshes has an empty mesh, "
"skipping line-surface intersection detection." );
return component_intersections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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 @@ -82,7 +82,7 @@ namespace geode
mesh_.polyhedron_vertex( { polyhedron_id, 2 } ) ),
mesh_.point(
mesh_.polyhedron_vertex( { polyhedron_id, 3 } ) ) };
return tetrahedron_volume_sign( tetrahedron ) == Sign::negative;
return tetrahedron_volume_sign( tetrahedron ) == SIGN::negative;
}
return mesh_.polyhedron_volume( polyhedron_id ) < 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace geode
for( const auto polygon_id : Range{ mesh_.nb_polygons() } )
{
if( polygon_area_sign( mesh_.polygon( polygon_id ) )
== Sign::negative )
== SIGN::negative )
{
return true;
}
Expand All @@ -68,7 +68,7 @@ namespace geode
for( const auto polygon_id : Range{ mesh_.nb_polygons() } )
{
if( polygon_area_sign( mesh_.polygon( polygon_id ) )
== Sign::negative )
== SIGN::negative )
{
wrong_polygons.add_issue( polygon_id,
absl::StrCat( "negative polygon ", polygon_id ) );
Expand Down
Loading
Loading