Fixed a test in the test suite

This commit is contained in:
Nico Kruithof 2013-03-21 20:47:52 +01:00
parent 6476837c76
commit f44799cdfb
2 changed files with 6 additions and 2 deletions

View File

@ -432,8 +432,8 @@ public:
Periodic_segment periodic_segment(const Face_handle &f, int i) const { Periodic_segment periodic_segment(const Face_handle &f, int i) const {
CGAL_triangulation_precondition( number_of_vertices() != 0 ); CGAL_triangulation_precondition( number_of_vertices() != 0 );
CGAL_triangulation_precondition( i >= 0 && i <= 2); CGAL_triangulation_precondition( i >= 0 && i <= 2);
return make_array(periodic_point(f, ccw(i) % 3), return make_array(periodic_point(f, ccw(i)),
periodic_point(f, cw(i) % 3)); periodic_point(f, cw(i)));
} }
/// Same as the previous method for edge e. /// Same as the previous method for edge e.

View File

@ -17,11 +17,15 @@ void greedy_flip_long_edges(Triangulation &t) {
} }
} }
bool is_1_cover = t.is_1_cover();
for (Edge_map::reverse_iterator it = edge_map.rbegin(); it != edge_map.rend(); ++it) { for (Edge_map::reverse_iterator it = edge_map.rbegin(); it != edge_map.rend(); ++it) {
double sqr_length_orig = it->first; double sqr_length_orig = it->first;
if (t.is_edge(it->second.first, it->second.second, f, i)) { if (t.is_edge(it->second.first, it->second.second, f, i)) {
if (t.flippable(f, i)) { if (t.flippable(f, i)) {
t.flip(f, i); t.flip(f, i);
// We flipped enough long edges, when we go to the 1-cover all faces are invalidated
if (is_1_cover != t.is_1_cover())
return;
double sqr_length_new = t.segment(f, t.ccw(i)).squared_length(); double sqr_length_new = t.segment(f, t.ccw(i)).squared_length();
if (sqr_length_orig < sqr_length_new) { if (sqr_length_orig < sqr_length_new) {
std::cout << sqr_length_orig << std::endl; std::cout << sqr_length_orig << std::endl;