diff --git a/Packages/Triangulation_2/changes.txt b/Packages/Triangulation_2/changes.txt index c39b3243023..f14fd199c77 100644 --- a/Packages/Triangulation_2/changes.txt +++ b/Packages/Triangulation_2/changes.txt @@ -1,6 +1,10 @@ Package triangulation: provides triangulations Delaunay triangulations, constrained and regular triangulations with tests and examples. +Ver 7.53 +- fixed a long line in Trivial_iterator.h +- fixed is_valid() and mirror_vertex in Triangulation_ds_face_2.h + Ver 7.52 (12/11/02) - fixes is_valid() de Triangulation_ds_face_2.h to deal with data structure when two faces can share 3 vertices diff --git a/Packages/Triangulation_2/examples/Triangulation_2/terrain.C b/Packages/Triangulation_2/examples/Triangulation_2/terrain.C index d460c813533..f403bda80ef 100644 --- a/Packages/Triangulation_2/examples/Triangulation_2/terrain.C +++ b/Packages/Triangulation_2/examples/Triangulation_2/terrain.C @@ -20,6 +20,7 @@ int main() Delaunay dt; dt.insert(begin, end); + std::cout << dt.number_of_vertices() << std::endl; return 0; } diff --git a/Packages/Triangulation_2/include/CGAL/Triangulation_ds_face_2.h b/Packages/Triangulation_2/include/CGAL/Triangulation_ds_face_2.h index 849565e5bb0..f9899d3c936 100644 --- a/Packages/Triangulation_2/include/CGAL/Triangulation_ds_face_2.h +++ b/Packages/Triangulation_2/include/CGAL/Triangulation_ds_face_2.h @@ -127,7 +127,7 @@ typename Triangulation_ds_face_2::Vertex_handle Triangulation_ds_face_2:: mirror_vertex(int i) const { - CGAL_triangulation_precondition ( neighbor(i) != NULL); + CGAL_triangulation_precondition ( neighbor(i) != NULL && dimension() >= 1); //return neighbor(i)->vertex(neighbor(i)->index(this->handle())); return neighbor(i)->vertex(mirror_index(i)); } @@ -138,8 +138,8 @@ Triangulation_ds_face_2:: mirror_index(int i) const { // return the index of opposite vertex in neighbor(i); - CGAL_triangulation_precondition (neighbor(i) != NULL); - //return neighbor(i)->index(this->handle()); + CGAL_triangulation_precondition (neighbor(i) != NULL && dimension() >= 1); + if (dimension() == 1) return neighbor(i)->index(this->handle()); return ccw( neighbor(i)->index(vertex(ccw(i)))); } @@ -210,10 +210,12 @@ is_valid(bool verbose, int level) const bool result = Fb::is_valid(verbose, level); for(int i = 0; i <= dimension(); i++) { Face_handle n = neighbor(i); - // MK: this needs to be changed so that we get the correct index - // when we have two faces with two common edges - // int in = n->index(this->handle()); - int in = n->index(mirror_vertex(i)); + // the strange formulation in case dimension()==2 + // is used to handle the cases of TDS allowing + // two faces with two common edges + int in; + if (dimension() == 0) in = n->index(this->handle()); + else in = n->index(mirror_vertex(i)); result = result && ( this->handle() == n->neighbor(in) ); switch(dimension()) { case 0 :