- Ifc: no need to generate contour skiplist twice.

pull/19/head
Alexander Gessler 2013-01-25 04:19:12 +01:00
parent bbd10cd748
commit 9647c87c7c
1 changed files with 24 additions and 22 deletions

View File

@ -1660,31 +1660,33 @@ void CloseWindows(ContourVector& contours,
}
}
ContourRefVector adjacent_contours;
// prepare a skiplist for this contour. The skiplist is used to
// eliminate unwanted contour lines for adjacent windows and
// those bordering the outer frame.
(*it).PrepareSkiplist();
FindAdjacentContours(it, contours);
FindBorderContours(it);
// if the window is the result of a finite union or intersection of rectangles,
// there shouldn't be any crossing or diagonal lines in it. Such lines would
// be artifacts caused by numerical inaccuracies or other bugs in polyclipper
// and our own code. Since rectangular openings are by far the most frequent
// case, it is worth filtering for this corner case.
if((*it).is_rectangular) {
FindLikelyCrossingLines(it);
}
ai_assert((*it).skiplist.size() == (*it).contour.size());
SkipList::const_iterator skipbegin = (*it).skiplist.begin(), skipend = (*it).skiplist.end();
const Contour::const_iterator cbegin = (*it).contour.begin(), cend = (*it).contour.end();
if (has_other_side) {
ContourRefVector adjacent_contours;
// prepare a skiplist for this contour. The skiplist is used to
// eliminate unwanted contour lines for adjacent windows and
// those bordering the outer frame.
(*it).PrepareSkiplist();
FindAdjacentContours(it, contours);
FindBorderContours(it);
// if the window is the result of a finite union or intersection of rectangles,
// there shouldn't be any crossing or diagonal lines in it. Such lines would
// be artifacts caused by numerical inaccuracies or other bugs in polyclipper
// and our own code. Since rectangular openings are by far the most frequent
// case, it is worth filtering for this corner case.
if((*it).is_rectangular) {
FindLikelyCrossingLines(it);
}
ai_assert((*it).skiplist.size() == (*it).contour.size());
SkipList::const_iterator skipbegin = (*it).skiplist.begin(), skipend = (*it).skiplist.end();
curmesh.verts.reserve(curmesh.verts.size() + (*it).contour.size() * 4);
curmesh.vertcnt.reserve(curmesh.vertcnt.size() + (*it).contour.size());