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

Method addFaces

source/MRMesh/MRFillContourByGraphCut.cpp:92–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void GraphCut::addFaces( FaceBitSet source, FaceBitSet sink )
93{
94 MR_TIMER;
95 assert( !filled_[Left].intersects( filled_[Right] ) );
96
97 // ignore faces marked simultaneously as source and sink
98 const auto bothLabels = source & sink;
99 source -= bothLabels;
100 sink -= bothLabels;
101
102 // do not change already filled faces
103 const auto alreadyFilled = filled_[Left] | filled_[Right];
104 source -= alreadyFilled;
105 sink -= alreadyFilled;
106
107 for ( auto f : source )
108 active_[Left].push_back( f );
109
110 for ( auto f : sink )
111 active_[Right].push_back( f );
112
113 filled_[Left] |= source;
114 filled_[Right] |= sink;
115
116 assert( !filled_[Left].intersects( filled_[Right] ) );
117}
118
119FaceBitSet GraphCut::fillLeft( const ProgressCallback& progress )
120{

Callers 1

segmentByGraphCutFunction · 0.80

Calls 2

push_backMethod · 0.80
intersectsMethod · 0.45

Tested by

no test coverage detected