Skip to content

Commit 88e774c

Browse files
committed
fix(Inspectors): Added missing internal namespaces and disable_edges if they were not enabled beforehand.
1 parent 5382822 commit 88e774c

14 files changed

+259
-219
lines changed

include/geode/inspector/criterion/internal/component_meshes_adjacency.hpp

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,28 @@ namespace geode
3636

3737
namespace geode
3838
{
39-
/*!
40-
* Class for inspecting the adjacency of edges in the Component Meshes of
41-
* a Model (BRep or Section).
42-
*/
43-
template < typename Model >
44-
class ComponentMeshesAdjacency
39+
namespace internal
4540
{
46-
OPENGEODE_DISABLE_COPY( ComponentMeshesAdjacency );
47-
48-
public:
49-
void add_surfaces_edges_with_wrong_adjacencies(
50-
InspectionIssuesMap< PolygonEdge >& issues_map ) const;
51-
52-
protected:
53-
explicit ComponentMeshesAdjacency( const Model& model );
54-
55-
[[nodiscard]] const Model& model() const;
56-
57-
private:
58-
const Model& model_;
59-
};
41+
/*!
42+
* Class for inspecting the adjacency of edges in the Component Meshes
43+
* of a Model (BRep or Section).
44+
*/
45+
template < typename Model >
46+
class ComponentMeshesAdjacency
47+
{
48+
OPENGEODE_DISABLE_COPY( ComponentMeshesAdjacency );
49+
50+
public:
51+
void add_surfaces_edges_with_wrong_adjacencies(
52+
InspectionIssuesMap< PolygonEdge >& issues_map ) const;
53+
54+
protected:
55+
explicit ComponentMeshesAdjacency( const Model& model );
56+
57+
[[nodiscard]] const Model& model() const;
58+
59+
private:
60+
const Model& model_;
61+
};
62+
} // namespace internal
6063
} // namespace geode

include/geode/inspector/criterion/internal/component_meshes_degeneration.hpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,31 @@ namespace geode
3636

3737
namespace geode
3838
{
39-
/*!
40-
* Class for inspecting the degeneration of elements in the Component Meshes
41-
* of a Model (BRep or Section).
42-
*/
43-
template < typename Model >
44-
class ComponentMeshesDegeneration
39+
namespace internal
4540
{
46-
OPENGEODE_DISABLE_COPY( ComponentMeshesDegeneration );
41+
/*!
42+
* Class for inspecting the degeneration of elements in the Component
43+
* Meshes of a Model (BRep or Section).
44+
*/
45+
template < typename Model >
46+
class ComponentMeshesDegeneration
47+
{
48+
OPENGEODE_DISABLE_COPY( ComponentMeshesDegeneration );
4749

48-
public:
49-
void add_degenerated_edges(
50-
InspectionIssuesMap< index_t >& issues_map ) const;
50+
public:
51+
void add_degenerated_edges(
52+
InspectionIssuesMap< index_t >& issues_map ) const;
5153

52-
void add_degenerated_polygons(
53-
InspectionIssuesMap< index_t >& issues_map ) const;
54+
void add_degenerated_polygons(
55+
InspectionIssuesMap< index_t >& issues_map ) const;
5456

55-
protected:
56-
explicit ComponentMeshesDegeneration( const Model& model );
57+
protected:
58+
explicit ComponentMeshesDegeneration( const Model& model );
5759

58-
[[nodiscard]] const Model& model() const;
60+
[[nodiscard]] const Model& model() const;
5961

60-
private:
61-
const Model& model_;
62-
};
62+
private:
63+
const Model& model_;
64+
};
65+
} // namespace internal
6366
} // namespace geode

include/geode/inspector/criterion/internal/component_meshes_manifold.hpp

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,32 @@
3232

3333
namespace geode
3434
{
35-
/*!
36-
* Class for inspecting the manifold property in the Component Meshes of
37-
* a Model (BRep or Section).
38-
*/
39-
template < typename Model >
40-
class ComponentMeshesManifold
35+
namespace internal
4136
{
42-
OPENGEODE_DISABLE_COPY( ComponentMeshesManifold );
43-
44-
public:
45-
void add_surfaces_meshes_non_manifold_vertices(
46-
InspectionIssuesMap< index_t >& issues_map ) const;
47-
48-
void add_surfaces_meshes_non_manifold_edges(
49-
InspectionIssuesMap< std::array< index_t, 2 > >& issues_map ) const;
50-
51-
protected:
52-
explicit ComponentMeshesManifold( const Model& model );
53-
54-
[[nodiscard]] const Model& model() const;
55-
56-
private:
57-
const Model& model_;
58-
};
37+
/*!
38+
* Class for inspecting the manifold property in the Component Meshes of
39+
* a Model (BRep or Section).
40+
*/
41+
template < typename Model >
42+
class ComponentMeshesManifold
43+
{
44+
OPENGEODE_DISABLE_COPY( ComponentMeshesManifold );
45+
46+
public:
47+
void add_surfaces_meshes_non_manifold_vertices(
48+
InspectionIssuesMap< index_t >& issues_map ) const;
49+
50+
void add_surfaces_meshes_non_manifold_edges(
51+
InspectionIssuesMap< std::array< index_t, 2 > >& issues_map )
52+
const;
53+
54+
protected:
55+
explicit ComponentMeshesManifold( const Model& model );
56+
57+
[[nodiscard]] const Model& model() const;
58+
59+
private:
60+
const Model& model_;
61+
};
62+
} // namespace internal
5963
} // namespace geode

include/geode/inspector/criterion/internal/degeneration_impl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ namespace geode
5353

5454
private:
5555
const Mesh& mesh_;
56+
bool enabled_edges_;
5657
};
5758
} // namespace internal
5859
} // namespace geode

src/geode/inspector/criterion/adjacency/brep_meshes_adjacency.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ namespace geode
7171
}
7272

7373
class BRepComponentMeshesAdjacency::Impl
74-
: public ComponentMeshesAdjacency< BRep >
74+
: public internal::ComponentMeshesAdjacency< BRep >
7575
{
7676
public:
77-
Impl( const BRep& brep ) : ComponentMeshesAdjacency< BRep >( brep ) {}
77+
Impl( const BRep& brep )
78+
: internal::ComponentMeshesAdjacency< BRep >( brep )
79+
{
80+
}
7881

7982
void add_blocks_facets_with_wrong_adjacencies(
8083
InspectionIssuesMap< PolyhedronFacet >&

src/geode/inspector/criterion/adjacency/section_meshes_adjacency.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
namespace geode
3434
{
3535
class SectionComponentMeshesAdjacency::Impl
36-
: public ComponentMeshesAdjacency< Section >
36+
: public internal::ComponentMeshesAdjacency< Section >
3737
{
3838
public:
3939
Impl( const Section& section )
40-
: ComponentMeshesAdjacency< Section >( section )
40+
: internal::ComponentMeshesAdjacency< Section >( section )
4141
{
4242
}
4343
};

src/geode/inspector/criterion/degeneration/brep_meshes_degeneration.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ namespace geode
6868
}
6969

7070
class BRepComponentMeshesDegeneration::Impl
71-
: public ComponentMeshesDegeneration< BRep >
71+
: public internal::ComponentMeshesDegeneration< BRep >
7272
{
7373
public:
74-
Impl( const BRep& brep ) : ComponentMeshesDegeneration< BRep >( brep )
74+
Impl( const BRep& brep )
75+
: internal::ComponentMeshesDegeneration< BRep >( brep )
7576
{
7677
}
7778

src/geode/inspector/criterion/degeneration/section_meshes_degeneration.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ namespace geode
6262
}
6363

6464
class SectionComponentMeshesDegeneration::Impl
65-
: public ComponentMeshesDegeneration< Section >
65+
: public internal::ComponentMeshesDegeneration< Section >
6666
{
6767
public:
6868
Impl( const Section& section )
69-
: ComponentMeshesDegeneration< Section >( section )
69+
: internal::ComponentMeshesDegeneration< Section >( section )
7070
{
7171
}
7272
};

src/geode/inspector/criterion/internal/component_meshes_adjacency.cpp

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -54,71 +54,76 @@ namespace
5454

5555
namespace geode
5656
{
57-
template < typename Model >
58-
ComponentMeshesAdjacency< Model >::ComponentMeshesAdjacency(
59-
const Model& model )
60-
: model_( model )
57+
namespace internal
6158
{
62-
}
59+
template < typename Model >
60+
ComponentMeshesAdjacency< Model >::ComponentMeshesAdjacency(
61+
const Model& model )
62+
: model_( model )
63+
{
64+
}
6365

64-
template < typename Model >
65-
void ComponentMeshesAdjacency< Model >::
66-
add_surfaces_edges_with_wrong_adjacencies(
67-
InspectionIssuesMap< PolygonEdge >& components_wrong_adjacencies )
68-
const
69-
{
70-
for( const auto& surface : model_.surfaces() )
66+
template < typename Model >
67+
void ComponentMeshesAdjacency< Model >::
68+
add_surfaces_edges_with_wrong_adjacencies(
69+
InspectionIssuesMap< PolygonEdge >&
70+
components_wrong_adjacencies ) const
7171
{
72-
const SurfaceMeshAdjacency< Model::dim > inspector{
73-
surface.mesh()
74-
};
75-
auto issues = inspector.polygon_edges_with_wrong_adjacency();
76-
issues.set_description( absl::StrCat( "Surface ",
77-
surface.id().string(), " polygon edges adjacency issues." ) );
78-
const auto& mesh = surface.mesh();
79-
for( const auto polygon_id : Range{ mesh.nb_polygons() } )
72+
for( const auto& surface : model_.surfaces() )
8073
{
81-
for( const auto edge_id :
82-
LRange{ mesh.nb_polygon_edges( polygon_id ) } )
74+
const SurfaceMeshAdjacency< Model::dim > inspector{
75+
surface.mesh()
76+
};
77+
auto issues = inspector.polygon_edges_with_wrong_adjacency();
78+
issues.set_description(
79+
absl::StrCat( "Surface ", surface.id().string(),
80+
" polygon edges adjacency issues." ) );
81+
const auto& mesh = surface.mesh();
82+
for( const auto polygon_id : Range{ mesh.nb_polygons() } )
8383
{
84-
const PolygonEdge polygon_edge{ polygon_id, edge_id };
85-
try
84+
for( const auto edge_id :
85+
LRange{ mesh.nb_polygon_edges( polygon_id ) } )
8686
{
87-
if( mesh.is_edge_on_border( polygon_edge )
88-
&& !polygon_edge_is_on_a_line(
89-
model_, surface, polygon_edge ) )
87+
const PolygonEdge polygon_edge{ polygon_id, edge_id };
88+
try
89+
{
90+
if( mesh.is_edge_on_border( polygon_edge )
91+
&& !polygon_edge_is_on_a_line(
92+
model_, surface, polygon_edge ) )
93+
{
94+
issues.add_issue( polygon_edge,
95+
absl::StrCat( "Local edge ", edge_id,
96+
" of polygon ", polygon_id,
97+
" has no adjacencies but is not part "
98+
"of a "
99+
"model Line." ) );
100+
}
101+
}
102+
catch( const OpenGeodeException& e )
90103
{
104+
Logger::warn( e.what() );
91105
issues.add_issue( polygon_edge,
92106
absl::StrCat( "Local edge ", edge_id,
93107
" of polygon ", polygon_id,
94108
" has no adjacencies but is not part of a "
95109
"model Line." ) );
96110
}
97111
}
98-
catch( const OpenGeodeException& e )
99-
{
100-
Logger::warn( e.what() );
101-
issues.add_issue( polygon_edge,
102-
absl::StrCat( "Local edge ", edge_id,
103-
" of polygon ", polygon_id,
104-
" has no adjacencies but is not part of a "
105-
"model Line." ) );
106-
}
107112
}
113+
components_wrong_adjacencies.add_issues_to_map(
114+
surface.id(), std::move( issues ) );
108115
}
109-
components_wrong_adjacencies.add_issues_to_map(
110-
surface.id(), std::move( issues ) );
111116
}
112-
}
113117

114-
template < typename Model >
115-
const Model& ComponentMeshesAdjacency< Model >::model() const
116-
{
117-
return model_;
118-
}
118+
template < typename Model >
119+
const Model& ComponentMeshesAdjacency< Model >::model() const
120+
{
121+
return model_;
122+
}
119123

120-
template class opengeode_inspector_inspector_api
121-
ComponentMeshesAdjacency< Section >;
122-
template class opengeode_inspector_inspector_api
123-
ComponentMeshesAdjacency< BRep >;
124+
template class opengeode_inspector_inspector_api
125+
ComponentMeshesAdjacency< Section >;
126+
template class opengeode_inspector_inspector_api
127+
ComponentMeshesAdjacency< BRep >;
128+
} // namespace internal
124129
} // namespace geode

0 commit comments

Comments
 (0)