This commit is contained in:
David Rose 2001-11-16 02:24:44 +00:00
parent d7b0ea6c67
commit fb66a4add7

View File

@ -500,13 +500,17 @@ find_fans() {
Verts::iterator vi; Verts::iterator vi;
// Build up a list of far fan edges. // Build up several lists of far fan edges.
typedef pvector<FanMaker> FanMakers; typedef pvector<FanMaker> FanMakers;
FanMakers fans; typedef pvector<FanMakers> FanGroups;
FanGroups fan_groups;
for (vi = _verts.begin(); vi != _verts.end(); ++vi) { for (vi = _verts.begin(); vi != _verts.end(); ++vi) {
EdgePtrs &edges = (*vi).second; EdgePtrs &edges = (*vi).second;
fan_groups.push_back(FanMakers());
FanMakers &fans = fan_groups.back();
// 14 is the magic number of edges. 12 edges or fewer are likely // 14 is the magic number of edges. 12 edges or fewer are likely
// to be found on nearly every vertex in a quadsheet (six edges // to be found on nearly every vertex in a quadsheet (six edges
// times two, one each way). We don't want to waste time fanning // times two, one each way). We don't want to waste time fanning
@ -529,7 +533,6 @@ find_fans() {
} }
} }
} }
}
// Sort the fans list by edge pointers, and remove duplicates. // Sort the fans list by edge pointers, and remove duplicates.
sort(fans.begin(), fans.end()); sort(fans.begin(), fans.end());
@ -552,13 +555,21 @@ find_fans() {
} }
} }
} while (joined_any); } while (joined_any);
}
// Now try to make all the fans. We do this after we have gone
// completely through the list of vertices, above, since making fans
// may add more (false) triangles to the pool.
FanGroups::iterator gi;
for (gi = fan_groups.begin(); gi != fan_groups.end(); ++gi) {
FanMakers &fans = (*gi);
FanMakers::iterator fi;
for (fi = fans.begin(); fi != fans.end(); ++fi) { for (fi = fans.begin(); fi != fans.end(); ++fi) {
cerr << "Got fan, is_valid = " << (*fi).is_valid() << "\n";
if ((*fi).is_valid()) { if ((*fi).is_valid()) {
(*fi).build(); (*fi).build();
} }
} }
}
#endif #endif
} }