is_valid has been moved from Triangulation_ds_face_2.h

to Triangulation_face_base_2.h
This commit is contained in:
Mariette Yvinec 1998-07-02 11:55:59 +00:00
parent 2c7a8f68bb
commit caa5008ccc
2 changed files with 27 additions and 26 deletions

View File

@ -350,32 +350,8 @@ public:
} }
} }
bool is_valid(bool verbose = false, int level = 0) const // bool is_valid(bool verbose = false, int level = 0) const
{ // inherited from Fb
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;
}
}; };
#endif CGAL_TRIANGULATION_DS_FACE_2_H #endif CGAL_TRIANGULATION_DS_FACE_2_H

View File

@ -187,7 +187,32 @@ public:
N[2] = n2; 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: private:
void* V[3]; void* V[3];