Navigation: Up, Table of Contents, Bibliography, Index, Title Page

The face class Tds::Face of a triangulation data structure stores three pointers to its three vertices and three pointers to its three neighbors The vertices are indexed 0,1, and 2 in counterclockwise order. The neighbor indexed i lies opposite to vertex i.

Types

The class Tds::Face defines the same types as the triangulation data structure class Tds except the iterators and circulators.

Creation


begin of advanced section

For user defined triangulation algorithms, faces need to be explicitly constructed and linked to their neighbors.

Tds::Face f;
Introduces a variable f and initializes all vertices and neighbors with NULL.

Tds::Face f ( Vertex* v0, Vertex* v1, Vertex* v2);
Introduces a variable f, and initializes the vertices. The neighbors are initialized with NULL.

Tds::Face f ( Vertex* v0,
Vertex* v1,
Vertex* v2,
Face* n0,
Face* n1,
Face* n2);
Introduces a variable f, and initializes the vertices and the neighbors.


end of advanced section

Setting


begin of advanced section

void f.set_vertex ( int i, Vertex* v)
Set vertex i to be v.
Precondition: 0<=i <=2.
void f.set_neighbor ( int i, Face* n)
Set neighbor i to be n.
Precondition: 0<=i <=2.
void f.set_vertices () set the vertices pointers to NULL.
void f.set_vertices ( Vertex* v0, Vertex* v1, Vertex* v2)
set the vertices pointers.
void f.set_neighbors () set the neighbors pointers to NULL.
void f.set_neighbors ( Face* n0, Face* n1, Face* n2)
set the neighbors pointers.


end of advanced section

Vertex Access Functions

Vertex* f.vertex ( int i) Returns the vertex i of f.
Precondition: 0<=i <=2.
int f.index ( Vertex* v)
Returns the index of vertex v in f.
Precondition: v is a vertex of f
bool f.has_vertex ( Vertex* v)
Returns true if v is a vertex of f.
bool f.has_vertex ( Vertex* v, int& i)
Returns true if v is a vertex of f, and computes the index i of the vertex.

Neighbor Access Functions

The neighbor with index i is the neighbor which is opposite to the vertex with index i.

Face* f.neighbor ( int i)
Returns the neighbor i of f.
Precondition: 0<=i <=2.
int f.index ( Face* n) Returns the index of face n.
Precondition: n is a neighbor of f.
bool f.has_neighbor ( Face* n)
Returns true if n is a neighbor of f.
bool f.has_neighbor ( Face* n, int& i)
Returns true if n is a neighbor of f, and compute the index i of the neighbor.


begin of advanced section

Checking

bool f.is_valid () Returns true if the base class is_valid() function returns true and if the triangle shares two vertices with its neighbors, and these neighbors have a correct reciprocal neighboring link.


end of advanced section

Miscellaneous

int f.ccw ( int i) Returns i+1 modulo 3.
Precondition: 0<=i <=2.
int f.cw ( int i) Returns i+2 modulo 3.
Precondition: 0<=i <=2.


Next: Class declaration of CGAL_Triangulation_default_data_structure_2<Tds_gt,Vb,Fb>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January, 1999.