Update path v2 big fix (nyf)

This commit is contained in:
Guillaume Damiand 2018-09-27 16:34:02 +02:00
parent 7d96da2dd1
commit a8c24d706c
1 changed files with 23 additions and 7 deletions

View File

@ -399,8 +399,8 @@ namespace CGAL {
} }
else else
{ {
// update_length_two_paths_before_edge_removals_v1(toremove); update_length_two_paths_before_edge_removals_v1(toremove);
update_length_two_paths_before_edge_removals_v2(toremove, copy_to_origin); // update_length_two_paths_before_edge_removals_v2(toremove, copy_to_origin);
// We remove all the edges to remove. // We remove all the edges to remove.
for (typename Map::Dart_range::iterator it=m_map.darts().begin(), for (typename Map::Dart_range::iterator it=m_map.darts().begin(),
@ -519,7 +519,7 @@ namespace CGAL {
{ {
// std::cout<<"************************************************"<<std::endl; // std::cout<<"************************************************"<<std::endl;
// We update the pair of darts // We update the pair of darts
/* for (typename TPaths::iterator itp=paths.begin(), itpend=paths.end(); for (typename TPaths::iterator itp=paths.begin(), itpend=paths.end();
itp!=itpend; ++itp) itp!=itpend; ++itp)
{ {
std::pair<Dart_const_handle, Dart_const_handle>& p=itp->second; std::pair<Dart_const_handle, Dart_const_handle>& p=itp->second;
@ -529,6 +529,7 @@ namespace CGAL {
if (!m_map.is_marked(p.first, toremove)) if (!m_map.is_marked(p.first, toremove))
{ // Here p.first belongs to the "border" of the face { // Here p.first belongs to the "border" of the face
Dart_handle initdart=m_map.darts().iterator_to(const_cast<typename Map::Dart &>(*(p.first))); Dart_handle initdart=m_map.darts().iterator_to(const_cast<typename Map::Dart &>(*(p.first)));
Dart_handle initdart2=m_map.template beta<2>(initdart);
// 1) We update the dart associated with p.second // 1) We update the dart associated with p.second
p.second=m_map.template beta<1>(initdart); p.second=m_map.template beta<1>(initdart);
@ -545,10 +546,25 @@ namespace CGAL {
else { paths[d2].second=p.second; } else { paths[d2].second=p.second; }
initdart=m_map.template beta<2, 1>(initdart); initdart=m_map.template beta<2, 1>(initdart);
} }
}
}*/
for (auto it=m_original_map.darts().begin(); it!=m_original_map.darts().end(); ++it) // 3) We do the same loop but starting from initdart2
initdart2=m_map.template beta<1>(initdart2);
Dart_handle enddart2=initdart2;
while (m_map.is_marked(enddart2, toremove))
{ enddart2=m_map.template beta<2, 1>(enddart2); }
while (m_map.is_marked(initdart2, toremove))
{
Dart_const_handle d1=copy_to_origin.find(initdart2)->second;
Dart_const_handle d2=m_original_map.template beta<2>(d1);
if (d1<d2) { paths[d1].first=enddart2; }
else { paths[d2].second=enddart2; }
initdart2=m_map.template beta<2, 1>(initdart2);
}
}
}
/* for (auto it=m_original_map.darts().begin(); it!=m_original_map.darts().end(); ++it)
{ {
if (!m_original_map.is_marked(it, m_mark_T) && if (!m_original_map.is_marked(it, m_mark_T) &&
!m_original_map.is_marked(it, m_mark_L)) !m_original_map.is_marked(it, m_mark_L))
@ -574,7 +590,7 @@ namespace CGAL {
initdart=m_map.template beta<2, 1>(initdart); initdart=m_map.template beta<2, 1>(initdart);
} }
} }
} } */
} }
/// @return true iff the edge containing adart is associated with a path. /// @return true iff the edge containing adart is associated with a path.
/// (used for debug purpose because we are suppose to be able to /// (used for debug purpose because we are suppose to be able to