Skip to content

Commit 7977cc2

Browse files
committed
cutMesh: more timers
1 parent bdfe28a commit 7977cc2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

source/MRMesh/MRContoursCut.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,7 @@ edges should be already cut */
18711871
void fixOrphans( Mesh& mesh, const std::vector<EdgePath>& paths, const FullRemovedFacesInfo& removedFaces, FaceMap* new2OldMap, NewEdgesMap* new2OldEdgeMap )
18721872
{
18731873

1874+
MR_TIMER;
18741875
auto fixOrphan = [&]( EdgeId e, FaceId oldF )
18751876
{
18761877
if ( mesh.topology.left( e ).valid() ||
@@ -2119,6 +2120,7 @@ void cutEdgesIntoPieces( Mesh& mesh,
21192120

21202121
void prepareFacesMap( const MeshTopology& topology, FaceMap& new2OldMap )
21212122
{
2123+
MR_TIMER;
21222124
new2OldMap.resize( topology.lastValidFace() + 1 );
21232125
for ( auto f : topology.getValidFaces() )
21242126
new2OldMap[f] = f;
@@ -2129,6 +2131,7 @@ void prepareFacesMap( const MeshTopology& topology, FaceMap& new2OldMap )
21292131
FaceBitSet getBadFacesAfterCut( const MeshTopology& topology, const PreCutResult& preRes,
21302132
const FullRemovedFacesInfo& oldFaces )
21312133
{
2134+
MR_TIMER;
21322135
FaceBitSet badFacesBS( topology.getValidFaces().size() );
21332136
EdgeBitSet visited( topology.edgeSize() );
21342137
for ( int pathId = 0; pathId < preRes.paths.size(); ++pathId )
@@ -2160,7 +2163,7 @@ FaceBitSet getBadFacesAfterCut( const MeshTopology& topology, const PreCutResult
21602163
CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMeshParameters& params )
21612164
{
21622165
MR_TIMER;
2163-
MR_WRITER( mesh );
2166+
mesh.invalidateCaches();
21642167
CutMeshResult res;
21652168
if ( params.new2OldMap )
21662169
prepareFacesMap( mesh.topology, *params.new2OldMap );
@@ -2169,6 +2172,7 @@ CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMes
21692172

21702173
if ( params.new2oldEdgesMap )
21712174
{
2175+
Timer t( "new2oldEdgesMap" );
21722176
for ( int i = 0; i < preRes.paths.size(); ++i )
21732177
{
21742178
for ( int j = 0; j < preRes.paths[i].size(); ++j )
@@ -2186,6 +2190,7 @@ CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMes
21862190
return res;
21872191

21882192
// find one edge for every hole to fill
2193+
Timer t( "find edge per hole" );
21892194
HashSet<EdgeId> allHoleEdges;
21902195
struct HoleDesc
21912196
{
@@ -2221,8 +2226,9 @@ CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMes
22212226
addHoleDesc( path[edgeId].sym(), oldf );
22222227
}
22232228
}
2229+
22242230
// prepare in parallel the plan to fill every contour
2225-
Timer t( "get TriangulateContourPlans" );
2231+
t.restart( "get TriangulateContourPlans" );
22262232
tbb::parallel_for( tbb::blocked_range<size_t>( 0, holeRepresentativeEdges.size() ),
22272233
[&]( const tbb::blocked_range<size_t>& range )
22282234
{

0 commit comments

Comments
 (0)