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 @@ -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 @@ -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 @@ -207,7 +207,7 @@

protected:
[[nodiscard]] bool polygons_intersect(
geode::index_t p1_id, geode::index_t p2_id ) const

Check warning on line 210 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:210:13 [bugprone-easily-swappable-parameters]

2 adjacent parameters of 'polygons_intersect' of similar type ('geode::index_t') are easily swapped by mistake
{
const auto p1_vertices = this->mesh1().polygon_vertices( p1_id );
const auto p2_vertices = this->mesh2().polygon_vertices( p2_id );
Expand Down Expand Up @@ -249,7 +249,7 @@

[[nodiscard]] absl::InlinedVector< std::array< geode::index_t, 2 >, 3 >
triangles_common_vertices(
const geode::PolygonVertices& t1_vertices,

Check warning on line 252 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:252:17 [bugprone-easily-swappable-parameters]

2 adjacent parameters of 'triangles_common_vertices' of similar type ('const geode::PolygonVertices &') are easily swapped by mistake
const geode::PolygonVertices& t2_vertices ) const
{
absl::InlinedVector< std::array< geode::index_t, 2 >, 3 >
Expand Down Expand Up @@ -425,7 +425,7 @@

template <>
[[nodiscard]] bool
ModelSurfacesIntersectionBase< geode::Section >::triangles_intersect(

Check warning on line 428 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:428:58 [readability-function-cognitive-complexity]

function 'triangles_intersect' has cognitive complexity of 28 (threshold 10)
const geode::PolygonVertices& t1_vertices,
const geode::PolygonVertices& t2_vertices,
absl::Span< const std::array< geode::index_t, 2 > >
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 Down
56 changes: 27 additions & 29 deletions src/geode/inspector/inspection/topology/brep_blocks_topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,33 +651,32 @@ namespace geode
for( const auto& surface_cmv :
brep_.component_mesh_vertices( unique_vertex_index ) )
{
if( surface_cmv.component_id.type()
if( surface_cmv.component_id.type
!= Surface3D::component_type_static() )
{
continue;
}
if( brep_.Relationships::is_boundary(
surface_cmv.component_id.id(), block_uuids[0] )
surface_cmv.component_id.id, block_uuids[0] )
&& brep_.Relationships::is_boundary(
surface_cmv.component_id.id(), block_uuids[1] ) )
surface_cmv.component_id.id, block_uuids[1] ) )
{
return std::nullopt;
}
for( const auto& line_cmv :
brep_.component_mesh_vertices( unique_vertex_index ) )
{
if( line_cmv.component_id.type()
if( line_cmv.component_id.type
!= Line3D::component_type_static() )
{
continue;
}
if( brep_.Relationships::is_boundary(
line_cmv.component_id.id(),
surface_cmv.component_id.id() )
line_cmv.component_id.id, surface_cmv.component_id.id )
&& ( brep_.Relationships::is_boundary(
surface_cmv.component_id.id(), block_uuids[0] )
surface_cmv.component_id.id, block_uuids[0] )
|| brep_.Relationships::is_boundary(
surface_cmv.component_id.id(), block_uuids[1] ) ) )
surface_cmv.component_id.id, block_uuids[1] ) ) )
{
return std::nullopt;
}
Expand Down Expand Up @@ -721,48 +720,47 @@ namespace geode
for( const auto& cmv :
brep_.component_mesh_vertices( unique_vertex_index ) )
{
if( cmv.component_id.type() != Surface3D::component_type_static()
|| !brep_.surface( cmv.component_id.id() ).is_active() )
if( cmv.component_id.type != Surface3D::component_type_static()
|| !brep_.surface( cmv.component_id.id ).is_active() )
{
continue;
}
if( brep_.nb_incidences( cmv.component_id.id() ) >= 1
if( brep_.nb_incidences( cmv.component_id.id ) >= 1
&& absl::c_contains(
not_boundary_surfaces, cmv.component_id.id() ) )
not_boundary_surfaces, cmv.component_id.id ) )
{
return absl::StrCat( "unique vertex with index ",
unique_vertex_index, " is part of Surface ",
brep_.surface( cmv.component_id.id() )
brep_.surface( cmv.component_id.id )
.name()
.value_or( cmv.component_id.id().string() ),
" (", cmv.component_id.id().string(),
.value_or( cmv.component_id.id.string() ),
" (", cmv.component_id.id.string(),
"), which should not be boundary of any Block." );
}
if( brep_.nb_embeddings( cmv.component_id.id() ) >= 1
&& brep_.nb_incidences( cmv.component_id.id() ) < 1
if( brep_.nb_embeddings( cmv.component_id.id ) >= 1
&& brep_.nb_incidences( cmv.component_id.id ) < 1
&& !absl::c_contains(
not_boundary_surfaces, cmv.component_id.id() )
&& absl::c_contains( dangling_surface, cmv.component_id.id() ) )
not_boundary_surfaces, cmv.component_id.id )
&& absl::c_contains( dangling_surface, cmv.component_id.id ) )
{
return absl::StrCat( "unique vertex ", unique_vertex_index,
" is part of Surface ",
brep_.surface( cmv.component_id.id() )
brep_.surface( cmv.component_id.id )
.name()
.value_or( cmv.component_id.id().string() ),
" (", cmv.component_id.id().string(),
.value_or( cmv.component_id.id.string() ),
" (", cmv.component_id.id.string(),
"), which should not be embedded in any Block." );
}
if( brep_.nb_incidences( cmv.component_id.id() ) < 1
&& brep_.nb_embeddings( cmv.component_id.id() ) < 1
&& !absl::c_contains(
dangling_surface, cmv.component_id.id() ) )
if( brep_.nb_incidences( cmv.component_id.id ) < 1
&& brep_.nb_embeddings( cmv.component_id.id ) < 1
&& !absl::c_contains( dangling_surface, cmv.component_id.id ) )
{
return absl::StrCat( "unique vertex ", unique_vertex_index,
" is part of Surface ",
brep_.surface( cmv.component_id.id() )
brep_.surface( cmv.component_id.id )
.name()
.value_or( cmv.component_id.id().string() ),
" (", cmv.component_id.id().string(),
.value_or( cmv.component_id.id.string() ),
" (", cmv.component_id.id.string(),
"), which is not internal to "
"a Block while it should be." );
}
Expand Down
Loading
Loading