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.

Inherits From

Tds::Face_base

Types

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


begin of advanced section

Creation

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

Tds::Face f;
introduces a face f and initializes all vertices and neighbors with NULL.


Tds::Face f ( Vertex* v0, Vertex* v1, Vertex* v2);
introduces a face 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 face f, and initializes the vertices and the neighbors.

Setting

void f.set_vertex ( int i, Vertex* v)
sets vertex i to be v.
Precondition: 0 i 2.
void f.set_neighbor ( int i, Face* n)
sets neighbor i to be n.
Precondition: 0 i 2.
void f.set_vertices () sets the vertices pointers to NULL.
void f.set_vertices ( Vertex* v0, Vertex* v1, Vertex* v2)
sets the vertices pointers.
void f.set_neighbors () sets the neighbors pointers to NULL.
void f.set_neighbors ( Face* n0, Face* n1, Face* n2)
sets 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 v in f.

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 n.

Other Access Functions

int f.mirror_index ( int i)
index of f as a neighbor of f.neighbor(i)
Vertex* f.mirror_vertex ( int i)
vertex of f.neighbor(i)
opposite to f.


begin of advanced section

Checking

bool f.is_valid () returns true if the function is_valid() of the base class returns true and if, for each index i, 0 i < 3, face f is a neighbor of its neighboring face neighbor(i) and shares with this neighbor the vertices cw(i) and ccw(i) in correct reverse order.


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 Triangulation_default_data_structure_2<Tds_gt,Vb,Fb>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.