init next pointer we rely on in the algorithm

This commit is contained in:
Sébastien Loriot 2018-07-17 09:56:47 +02:00
parent d1dbe2757d
commit 869f1c01b0
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
sm_halfedge_descriptor sm_h = halfedge(sm_e, sm), sm_h_opp = opposite(sm_h, sm); sm_halfedge_descriptor sm_h = halfedge(sm_e, sm), sm_h_opp = opposite(sm_h, sm);
tm_halfedge_descriptor tm_h = halfedge(tm_e, tm), tm_h_opp = opposite(tm_h, tm); tm_halfedge_descriptor tm_h = halfedge(tm_e, tm), tm_h_opp = opposite(tm_h, tm);
// set next pointers to null_halfedge() (in case previous garbage is present)
set_next( tm_h, boost::graph_traits<TargetMesh>::null_halfedge(), tm );
set_next( tm_h_opp, boost::graph_traits<TargetMesh>::null_halfedge(), tm );
put(hmap, sm_h, tm_h); put(hmap, sm_h, tm_h);
put(hmap, sm_h_opp, tm_h_opp); put(hmap, sm_h_opp, tm_h_opp);
*h2h++=std::make_pair(sm_h, tm_h); *h2h++=std::make_pair(sm_h, tm_h);