MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / fillLeft

Method fillLeft

source/MRMesh/MRFillContourByGraphCut.cpp:119–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119FaceBitSet GraphCut::fillLeft( const ProgressCallback& progress )
120{
121 MR_TIMER;
122
123 size_t numCycles = 0;
124 while ( !active_[Left].empty() )
125 {
126 auto lf = active_[Left].front();
127 active_[Left].pop_front();
128 processActive_( lf, Left );
129
130 if ( !active_[Right].empty() )
131 {
132 auto rf = active_[Right].front();
133 active_[Right].pop_front();
134 processActive_( rf, Right );
135 }
136
137 ++numCycles;
138 if ( !reportProgress( progress,
139 [numCycles]() { return std::erf( numCycles * 1e-7f ); }, // report 84% for numCycles == 10'000'000
140 numCycles, 65536 ) )
141 break;
142 }
143
144 // this will return all connected components without single Left seed on them
145 // if ( active_[Right].empty() )
146 // return topology_.getValidFaces() - filled_[Right];
147
148 return filled_[Left];
149}
150
151void GraphCut::processActive_( FaceId f, int side )
152{

Callers 2

segmentByGraphCutFunction · 0.80

Calls 2

reportProgressFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected