379 cline_strip_list::iterator pos,pos2;
385 if(!_ASSERT_RET_(m_vStripLists.size() ==
get_number_of_planes(),
"clist_contour::compact_strips ::0"))
return false;
396 if(!_ASSERT_RET_(newList.empty(),
"clist_contour::compact_strips ::1"))
return false;
397 for (pos=m_vStripLists[i].
begin(); pos!=m_vStripLists[i].end();pos++)
400 for (pos2=newList.begin(); pos2!=newList.end();pos2++)
412 newList.insert(newList.begin(),pStrip);
417 m_vStripLists[i].clear();
420 for (pos2=newList.begin(); pos2 != newList.end(); pos2++)
423 cline_strip::iterator pos1 = pStrip2->begin(),pos3;
424 while (pos1!=pStrip2->end())
428 if (pos3==pStrip2->end())
break;
429 if ( (*pos1) == (*pos3))
440 pStrip2->erase(pos3);
447 if (pStrip2->size()!=1)
448 m_vStripLists[i].insert(m_vStripLists[i].
begin(),pStrip2 );
458 if (m_vStripLists[i].empty())
465 Nstrip = m_vStripLists[i].size();
466 std::vector<bool> closed(Nstrip);
470 for(pos2 = m_vStripLists[i].
begin(), j=0, count=0; pos2 != m_vStripLists[i].end(); pos2++, j++)
475 if (pStrip->front() != pStrip->back())
477 index = pStrip->front();
479 index = pStrip->back();
483 if ((x*x+y*y < weldDist) ||
492 pStrip->push_back(pStrip->front());
510 pos = m_vStripLists[i].begin();
511 for(j=0;j<Nstrip;j++)
513 if (closed[j] ==
false )
516 newList.insert(newList.begin(),pStrip);
517 pos = m_vStripLists[i].erase(pos);
524 while(newList.size()>1)
526 pStripBase = newList.front();
533 pos = newList.begin();
534 for(pos++; pos!=newList.end();)
537 changed =
ForceMerge(pStripBase,pStrip,planeHeight);
542 pos = newList.erase(pos);
549 index = pStripBase->front();
551 index = pStripBase->back();
555 if ((x*x+y*y < weldDist) ||
557 get_xi(pStripBase->back()),
558 get_yi(pStripBase->front()),
559 get_yi(pStripBase->back()),
564 if ((x!=0) || (y!=0)) {
565 pStripBase->push_back(pStripBase->front());
568 m_vStripLists[i].insert(m_vStripLists[i].
begin(),pStripBase);
575 _TRACE_(_TT(
"# open strip ends on boundary, continue.\n"));
576 m_vStripLists[i].insert(m_vStripLists[i].
begin(),pStripBase);
581 _PROBLEM_(_TT(
"unpaird open strip at 1!\n"));
589 if (newList.size() ==1)
591 pStripBase = newList.front();
592 index = pStripBase->front();
594 index = pStripBase->back();
598 if (x*x+y*y < 3*weldDist)
600 m_vStripLists[i].insert(m_vStripLists[i].
begin(),pStripBase);
605 _TRACE_(_TT(
"# open strip ends on boundary, continue.\n"));
606 m_vStripLists[i].insert(m_vStripLists[i].
begin(),pStripBase);
611 _PROBLEM_(_TT(
"unpaird open strip at 2!\n"));
623 pos = m_vStripLists[i].begin();
624 for(j=0;j<Nstrip;j++)
626 if (closed[j] ==
false )
633 index = pStripBase->front();
635 index = pStripBase->back();
639 if (x*x+y*y < 2*weldDist)
642 pStripBase->push_back(pStripBase->front());
646 _TRACE_(_TT(
"# open strip ends on boundary, continue.\n"));
647 pStripBase->push_back(pStripBase->front());
651 _TRACE_(_TT(
"unpaird open strip at 3!"));