mirror of https://github.com/CGAL/cgal
remove edges of length 0 instead of ignoring them
This commit is contained in:
parent
6ece04338b
commit
1fec6c7ca1
|
|
@ -111,6 +111,8 @@ void EdgeCollapse<M,SP,VIM,EIM,EBM,CF,PF,V>::Collect()
|
||||||
CGAL_SURF_SIMPL_TEST_assertion_code ( size_type lInserted = 0 ) ;
|
CGAL_SURF_SIMPL_TEST_assertion_code ( size_type lInserted = 0 ) ;
|
||||||
CGAL_SURF_SIMPL_TEST_assertion_code ( size_type lNotInserted = 0 ) ;
|
CGAL_SURF_SIMPL_TEST_assertion_code ( size_type lNotInserted = 0 ) ;
|
||||||
|
|
||||||
|
std::vector<Profile> zero_length_edges;
|
||||||
|
|
||||||
undirected_edge_iterator eb, ee ;
|
undirected_edge_iterator eb, ee ;
|
||||||
for ( boost::tie(eb,ee) = undirected_edges(mSurface); eb!=ee; ++eb )
|
for ( boost::tie(eb,ee) = undirected_edges(mSurface); eb!=ee; ++eb )
|
||||||
{
|
{
|
||||||
|
|
@ -134,6 +136,7 @@ void EdgeCollapse<M,SP,VIM,EIM,EBM,CF,PF,V>::Collect()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
zero_length_edges.push_back(lProfile);
|
||||||
CGAL_SURF_SIMPL_TEST_assertion_code ( ++ lNotInserted ) ;
|
CGAL_SURF_SIMPL_TEST_assertion_code ( ++ lNotInserted ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,6 +148,12 @@ void EdgeCollapse<M,SP,VIM,EIM,EBM,CF,PF,V>::Collect()
|
||||||
|
|
||||||
CGAL_SURF_SIMPL_TEST_assertion ( lInserted + lNotInserted == mInitialEdgeCount ) ;
|
CGAL_SURF_SIMPL_TEST_assertion ( lInserted + lNotInserted == mInitialEdgeCount ) ;
|
||||||
|
|
||||||
|
for (typename std::vector<Profile>::iterator it=zero_length_edges.begin(),it_end=zero_length_edges.end();it!=it_end;++it)
|
||||||
|
{
|
||||||
|
Placement_type lPlacement = get_placement(*it);
|
||||||
|
Collapse(*it,lPlacement);
|
||||||
|
}
|
||||||
|
|
||||||
CGAL_ECMS_TRACE(0,"Initial edge count: " << mInitialEdgeCount ) ;
|
CGAL_ECMS_TRACE(0,"Initial edge count: " << mInitialEdgeCount ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue