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 4949f99d145..d651fd5568f 100644 --- a/Packages/Triangulation_2/include/CGAL/Triangulation_ds_face_2.h +++ b/Packages/Triangulation_2/include/CGAL/Triangulation_ds_face_2.h @@ -350,32 +350,8 @@ public: } } - bool is_valid(bool verbose = false, int level = 0) const - { - bool result = true; - for(int i = 0; i < 3; i++) { - Face* n = neighbor(i); - - // The following seems natural, but it may fail if the faces - // this and n are neighbors on two edges (1-dim triangulation, - // with infinite faces - // int ni = n->index(this); - - // int ni = cw(n->index(vertex(cw(i)))); - // CGAL_triangulation_assertion( this == n->neighbor(ni) ); - // result = result && (vertex(cw(i)) == n->vertex(ccw(ni))); - // result = result && (vertex(ccw(i)) == n->vertex(cw(ni))); - - int in; - if (! n->has_vertex(vertex(cw(i)),in )) return false; - in = cw(in); - result = result && ( this == n->neighbor(in) ); - result = result && (vertex(ccw(i)) == n->vertex(cw(in))); - - } - return result; - } - + // bool is_valid(bool verbose = false, int level = 0) const + // inherited from Fb }; #endif CGAL_TRIANGULATION_DS_FACE_2_H diff --git a/Packages/Triangulation_2/include/CGAL/Triangulation_face_base_2.h b/Packages/Triangulation_2/include/CGAL/Triangulation_face_base_2.h index fd9750e904c..53ba6a69f1f 100644 --- a/Packages/Triangulation_2/include/CGAL/Triangulation_face_base_2.h +++ b/Packages/Triangulation_2/include/CGAL/Triangulation_face_base_2.h @@ -187,7 +187,32 @@ public: N[2] = n2; } + bool is_valid(bool verbose = false, int level = 0) const + { + bool result = true; + for(int i = 0; i < 3; i++) { + void* n = neighbor(i); + + // The following seems natural, but it may fail if the faces + // this and n are neighbors on two edges (1-dim triangulation, + // with infinite faces + // int ni = n->index(this); + // int ni = cw(n->index(vertex(cw(i)))); + // CGAL_triangulation_assertion( this == n->neighbor(ni) ); + // result = result && (vertex(cw(i)) == n->vertex(ccw(ni))); + // result = result && (vertex(ccw(i)) == n->vertex(cw(ni))); + + int in; + if (! n->has_vertex(vertex(cw(i)),in )) return false; + in = cw(in); + result = result && ( this == n->neighbor(in) ); + result = result && (vertex(ccw(i)) == n->vertex(cw(in))); + + } + return result; + } + private: void* V[3];