2525
2626#include < geode/basic/pimpl_impl.h>
2727
28+ #include < geode/mesh/core/edged_curve.h>
29+ #include < geode/mesh/core/solid_mesh.h>
30+ #include < geode/mesh/core/surface_mesh.h>
31+
2832#include < geode/model/mixin/core/block.h>
2933#include < geode/model/mixin/core/corner.h>
3034#include < geode/model/mixin/core/line.h>
3842
3943namespace
4044{
41- bool brep_has_unique_vertex_associated_to_component_id (
45+ bool brep_line_is_meshed (
46+ const geode::BRep& brep, const geode::uuid& line_id )
47+ {
48+ return brep.line ( line_id ).mesh ().nb_vertices () != 0 ;
49+ }
50+
51+ bool brep_surface_is_meshed (
52+ const geode::BRep& brep, const geode::uuid& surface_id )
53+ {
54+ return brep.surface ( surface_id ).mesh ().nb_vertices () != 0 ;
55+ }
56+
57+ bool brep_block_is_meshed (
58+ const geode::BRep& brep, const geode::uuid& block_id )
59+ {
60+ return brep.block ( block_id ).mesh ().nb_vertices () != 0 ;
61+ }
62+
63+ bool brep_has_unique_vertex_associated_to_component (
4264 const geode::BRep& brep, const geode::uuid& component_id )
4365 {
4466 for ( const auto unique_vertex_id :
@@ -77,7 +99,7 @@ namespace geode
7799 {
78100 return false ;
79101 }
80- if ( !brep_components_are_linked_to_a_unique_vertex () )
102+ if ( !brep_meshed_components_are_linked_to_a_unique_vertex () )
81103 {
82104 return false ;
83105 }
@@ -97,27 +119,38 @@ namespace geode
97119 return true ;
98120 }
99121
100- bool brep_components_are_linked_to_a_unique_vertex () const
122+ bool brep_meshed_components_are_linked_to_a_unique_vertex () const
101123 {
102124 for ( const auto & corner : brep_.corners () )
103125 {
104- if ( !brep_has_unique_vertex_associated_to_component_id (
126+ if ( !brep_has_unique_vertex_associated_to_component (
105127 brep_, corner.id () ) )
106128 {
107129 return false ;
108130 }
109131 }
132+ for ( const auto & line : brep_.lines () )
133+ {
134+ if ( brep_line_is_meshed ( brep_, line.id () )
135+ && !brep_has_unique_vertex_associated_to_component (
136+ brep_, line.id () ) )
137+ {
138+ return false ;
139+ }
140+ }
110141 for ( const auto & surface : brep_.surfaces () )
111142 {
112- if ( !brep_has_unique_vertex_associated_to_component_id (
143+ if ( brep_surface_is_meshed ( brep_, surface.id () )
144+ && !brep_has_unique_vertex_associated_to_component (
113145 brep_, surface.id () ) )
114146 {
115147 return false ;
116148 }
117149 }
118150 for ( const auto & block : brep_.blocks () )
119151 {
120- if ( !brep_has_unique_vertex_associated_to_component_id (
152+ if ( brep_block_is_meshed ( brep_, block.id () )
153+ && !brep_has_unique_vertex_associated_to_component (
121154 brep_, block.id () ) )
122155 {
123156 return false ;
@@ -131,7 +164,7 @@ namespace geode
131164 index_t counter{ 0 };
132165 for ( const auto & corner : brep_.corners () )
133166 {
134- if ( !brep_has_unique_vertex_associated_to_component_id (
167+ if ( !brep_has_unique_vertex_associated_to_component (
135168 brep_, corner.id () ) )
136169 {
137170 counter++;
@@ -140,12 +173,13 @@ namespace geode
140173 return counter;
141174 }
142175
143- index_t nb_lines_not_linked_to_a_unique_vertex () const
176+ index_t nb_lines_meshed_but_not_linked_to_a_unique_vertex () const
144177 {
145178 index_t counter{ 0 };
146179 for ( const auto & line : brep_.lines () )
147180 {
148- if ( !brep_has_unique_vertex_associated_to_component_id (
181+ if ( brep_line_is_meshed ( brep_, line.id () )
182+ && !brep_has_unique_vertex_associated_to_component (
149183 brep_, line.id () ) )
150184 {
151185 counter++;
@@ -154,12 +188,13 @@ namespace geode
154188 return counter;
155189 }
156190
157- index_t nb_surfaces_not_linked_to_a_unique_vertex () const
191+ index_t nb_surfaces_meshed_but_not_linked_to_a_unique_vertex () const
158192 {
159193 index_t counter{ 0 };
160194 for ( const auto & surface : brep_.surfaces () )
161195 {
162- if ( !brep_has_unique_vertex_associated_to_component_id (
196+ if ( brep_surface_is_meshed ( brep_, surface.id () )
197+ && !brep_has_unique_vertex_associated_to_component (
163198 brep_, surface.id () ) )
164199 {
165200 counter++;
@@ -168,12 +203,13 @@ namespace geode
168203 return counter;
169204 }
170205
171- index_t nb_blocks_not_linked_to_a_unique_vertex () const
206+ index_t nb_blocks_meshed_but_not_linked_to_a_unique_vertex () const
172207 {
173208 index_t counter{ 0 };
174209 for ( const auto & block : brep_.blocks () )
175210 {
176- if ( !brep_has_unique_vertex_associated_to_component_id (
211+ if ( brep_block_is_meshed ( brep_, block.id () )
212+ && !brep_has_unique_vertex_associated_to_component (
177213 brep_, block.id () ) )
178214 {
179215 counter++;
@@ -416,10 +452,10 @@ namespace geode
416452 return impl_->brep_topology_is_valid ();
417453 }
418454
419- bool BRepTopologyInspector::brep_components_are_linked_to_a_unique_vertex ()
420- const
455+ bool BRepTopologyInspector::
456+ brep_meshed_components_are_linked_to_a_unique_vertex () const
421457 {
422- return impl_->brep_components_are_linked_to_a_unique_vertex ();
458+ return impl_->brep_meshed_components_are_linked_to_a_unique_vertex ();
423459 }
424460
425461 index_t
@@ -428,22 +464,22 @@ namespace geode
428464 return impl_->nb_corners_not_linked_to_a_unique_vertex ();
429465 }
430466
431- index_t
432- BRepTopologyInspector::nb_lines_not_linked_to_a_unique_vertex () const
467+ index_t BRepTopologyInspector::
468+ nb_lines_meshed_but_not_linked_to_a_unique_vertex () const
433469 {
434- return impl_->nb_lines_not_linked_to_a_unique_vertex ();
470+ return impl_->nb_lines_meshed_but_not_linked_to_a_unique_vertex ();
435471 }
436472
437- index_t
438- BRepTopologyInspector::nb_surfaces_not_linked_to_a_unique_vertex () const
473+ index_t BRepTopologyInspector::
474+ nb_surfaces_meshed_but_not_linked_to_a_unique_vertex () const
439475 {
440- return impl_->nb_surfaces_not_linked_to_a_unique_vertex ();
476+ return impl_->nb_surfaces_meshed_but_not_linked_to_a_unique_vertex ();
441477 }
442478
443- index_t
444- BRepTopologyInspector::nb_blocks_not_linked_to_a_unique_vertex () const
479+ index_t BRepTopologyInspector::
480+ nb_blocks_meshed_but_not_linked_to_a_unique_vertex () const
445481 {
446- return impl_->nb_blocks_not_linked_to_a_unique_vertex ();
482+ return impl_->nb_blocks_meshed_but_not_linked_to_a_unique_vertex ();
447483 }
448484
449485 std::vector< index_t >
0 commit comments