Skip to content

Commit 76c6bc3

Browse files
committed
fix(ModelColocation): Upgraded the verbose mode for the ModelComponentsMeshColocation
1 parent 93ecb48 commit 76c6bc3

File tree

3 files changed

+47
-11
lines changed

3 files changed

+47
-11
lines changed

src/bin/geode-inspector-brep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void inspect_brep( const geode::BRep& brep )
245245
{
246246
tasks.emplace_back( async::spawn( [&brep_inspector] {
247247
const auto nb =
248-
brep_inspector.components_with_colocated_points().size();
248+
brep_inspector.components_nb_colocated_points().size();
249249
geode::Logger::info(
250250
nb, " components with colocated points in their mesh." );
251251
} ) );

src/geode/inspector/criterion/colocation/component_meshes_colocation.cpp

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <geode/basic/logger.h>
2727
#include <geode/basic/pimpl_impl.h>
28+
#include <geode/basic/uuid.h>
2829

2930
#include <geode/mesh/core/edged_curve.h>
3031
#include <geode/mesh/core/solid_mesh.h>
@@ -50,21 +51,31 @@ namespace
5051
for( const auto& line : model.lines() )
5152
{
5253
const geode::EdgedCurveColocation< dimension > inspector{
53-
line.mesh(), verbose
54+
line.mesh(), false
5455
};
5556
if( inspector.mesh_has_colocated_points() )
5657
{
5758
components_with_colocation.push_back( line.id() );
59+
if( verbose )
60+
{
61+
geode::Logger::info( "Line with uuid ", line.id().string(),
62+
" has colocated points." );
63+
}
5864
}
5965
}
6066
for( const auto& surface : model.surfaces() )
6167
{
6268
const geode::SurfaceMeshColocation< dimension > inspector{
63-
surface.mesh(), verbose
69+
surface.mesh(), false
6470
};
6571
if( inspector.mesh_has_colocated_points() )
6672
{
6773
components_with_colocation.push_back( surface.id() );
74+
if( verbose )
75+
{
76+
geode::Logger::info( "Surface with uuid ",
77+
surface.id().string(), " has colocated points." );
78+
}
6879
}
6980
}
7081
return components_with_colocation;
@@ -85,11 +96,15 @@ namespace
8596
model, verbose );
8697
for( const auto& block : model.blocks() )
8798
{
88-
const geode::SolidMeshColocation3D inspector{ block.mesh(),
89-
verbose };
99+
const geode::SolidMeshColocation3D inspector{ block.mesh(), false };
90100
if( inspector.mesh_has_colocated_points() )
91101
{
92102
components_with_colocation.push_back( block.id() );
103+
if( verbose )
104+
{
105+
geode::Logger::info( "Block with uuid ",
106+
block.id().string(), " has colocated points." );
107+
}
93108
}
94109
}
95110
return components_with_colocation;
@@ -105,25 +120,36 @@ namespace
105120
for( const auto& line : model.lines() )
106121
{
107122
const geode::EdgedCurveColocation< dimension > inspector{
108-
line.mesh(), verbose
123+
line.mesh(), false
109124
};
110125
const auto nb_colocated = inspector.nb_colocated_points();
111126
if( nb_colocated > 0 )
112127
{
113128
components_nb_colocated_points.emplace(
114129
line.id(), nb_colocated );
130+
if( verbose )
131+
{
132+
geode::Logger::info( "Line with uuid ", line.id().string(),
133+
" has ", nb_colocated, " colocated points." );
134+
}
115135
}
116136
}
117137
for( const auto& surface : model.surfaces() )
118138
{
119139
const geode::SurfaceMeshColocation< dimension > inspector{
120-
surface.mesh(), verbose
140+
surface.mesh(), false
121141
};
122142
const auto nb_colocated = inspector.nb_colocated_points();
123143
if( nb_colocated > 0 )
124144
{
125145
components_nb_colocated_points.emplace(
126146
surface.id(), nb_colocated );
147+
if( verbose )
148+
{
149+
geode::Logger::info( "Surface with uuid ",
150+
surface.id().string(), " has ", nb_colocated,
151+
" colocated points." );
152+
}
127153
}
128154
}
129155
return components_nb_colocated_points;
@@ -146,13 +172,18 @@ namespace
146172
model, verbose );
147173
for( const auto& block : model.blocks() )
148174
{
149-
const geode::SolidMeshColocation3D inspector{ block.mesh(),
150-
verbose };
175+
const geode::SolidMeshColocation3D inspector{ block.mesh(), false };
151176
const auto nb_colocated = inspector.nb_colocated_points();
152177
if( nb_colocated > 0 )
153178
{
154179
components_nb_colocated_points.emplace(
155180
block.id(), nb_colocated );
181+
if( verbose )
182+
{
183+
geode::Logger::info( "Block with uuid ",
184+
block.id().string(), " has ", nb_colocated,
185+
" colocated points." );
186+
}
156187
}
157188
}
158189
return components_nb_colocated_points;

src/geode/inspector/criterion/private/colocation_impl.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,14 @@ namespace geode
7474
template < index_t dimension, typename Mesh >
7575
index_t ColocationImpl< dimension, Mesh >::nb_colocated_points() const
7676
{
77-
return mesh_points_colocated_info< dimension, Mesh >(
77+
auto nb_colocated = mesh_points_colocated_info< dimension, Mesh >(
7878
mesh_, global_epsilon )
79-
.nb_colocated_points();
79+
.nb_colocated_points();
80+
if( nb_colocated > 0 && verbose_ )
81+
{
82+
Logger::info( "Mesh has ", nb_colocated, " colocated points" );
83+
}
84+
return nb_colocated;
8085
}
8186

8287
template < index_t dimension, typename Mesh >

0 commit comments

Comments
 (0)