avoid reporting twice intersection edges

This commit is contained in:
Sébastien Loriot 2015-05-22 10:27:48 +02:00
parent 44ee151862
commit aaf0959c70
1 changed files with 15 additions and 9 deletions

View File

@ -793,9 +793,11 @@ public:
#endif
}
std::pair<int,int> edge_pair(*it_id,node_id_of_first);
border_halfedges.insert( std::make_pair(hedge,edge_pair) );
put(m_edge_mark_pmap,std::make_pair(hedge,poly),true);
put(m_edge_mark_pmap,std::make_pair(hedge->opposite(),poly),true);
if ( border_halfedges.insert( std::make_pair(hedge,edge_pair) ).second)
{
put(m_edge_mark_pmap,std::make_pair(hedge,poly),true);
put(m_edge_mark_pmap,std::make_pair(hedge->opposite(),poly),true);
}
update_edge_per_polyline(poly,edge_pair,hedge);
//save the fact that we already handle this edge
already_done.insert(std::make_pair(node_id_of_first,*it_id));
@ -1102,9 +1104,11 @@ public:
//is defined as one of them defines an adjacent face
//CGAL_assertion(it_poly_hedge!=edge_to_hedge.end());
if( it_poly_hedge!=edge_to_hedge.end() ){
border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),*it_cst) );
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second,P),true);
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second->opposite(),P),true); //setting the opposite is only needed for border edges (done in adjacent triangle otherwise)
if ( border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),*it_cst) ).second)
{
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second,P),true);
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second->opposite(),P),true); //setting the opposite is only needed for border edges (done in adjacent triangle otherwise)
}
update_edge_per_polyline(P,it_poly_hedge->first,it_poly_hedge->second);
}
else{
@ -1114,9 +1118,11 @@ public:
it_poly_hedge=edge_to_hedge.find(opposite_pair);
CGAL_assertion( it_poly_hedge!=edge_to_hedge.end() );
border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),opposite_pair) );
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second,P),true);
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second->opposite(),P),true); //setting the opposite is only needed for border edges (done in adjacent triangle otherwise)
if ( border_halfedges.insert( std::make_pair(Halfedge_const_handle(it_poly_hedge->second),opposite_pair) ).second )
{
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second,P),true);
put(m_edge_mark_pmap,std::make_pair(it_poly_hedge->second->opposite(),P),true); //setting the opposite is only needed for border edges (done in adjacent triangle otherwise)
}
update_edge_per_polyline(P,it_poly_hedge->first,it_poly_hedge->second);
}
}