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

The Face Class of a triangulation

Definition

A face of a triangulation gives access to its three vertices indexed 0,1, and 2 in counterclockwise order and to its three adjacent faces, also called neighbors. The neighbors are indexed in such a way that neighbor i lies opposite to vertex i.

Inherits From

Tds::Face

Types

The class Face defines the same types as the class Triangulation_2<Gt,Tds> except the iterators and circulators which are not needed.

Creation


begin of advanced section

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

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

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

Face f ( Vertex_handle v0,
Vertex_handle v1,
Vertex_handle v2,
{Face_handle} n0,
{Face_handle} n1,
{Face_handle} 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_handle v)
Set vertex i to be v.
Precondition: 0<=i <=2.
void f.set_neighbor ( int i, {Face_handle} n)
Set neighbor i to be n.
Precondition: 0<=i <=2.
void f.set_vertices () Set vertices to NULL
void f.set_neighbors () Set neighbors to NULL
void
f.set_vertices ( Vertex_handle v0,
Vertex_handle v1,
Vertex_handle v2)
void
f.set_neighbors ( {Face_handle} n0,
{Face_handle} n1,
{Face_handle} n2)


end of advanced section

Vertex Access Functions

Vertex_handle f.vertex ( int i) Returns the vertex i of f.
Precondition: 0<=i <=2.
int f.index ( Vertex_handle v)
Returns the index of vertex v in f.
Precondition: v is a vertex of f
bool f.has_vertex ( Vertex_handle v)
Returns true if v is a vertex of f.
bool f.has_vertex ( Vertex_handle 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_handle} f.neighbor ( int i)
Returns the neighbor i of f.
Precondition: 0<=i <=2.
int f.index ( {Face_handle} n)
Returns the index of face n.
Precondition: n is a neighbor of f.
bool f.has_neighbor ( {Face_handle} n)
Returns true if n is a neighbor of f.
bool f.has_neighbor ( {Face_handle} n, int& i)
Returns true if n is a neighbor of f, and compute the index i of the neighbor.

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.
{Face_handle} f.handle () Returns a handle to the face.
bool f.is_valid () Check the validity of an individual face: i.e. the pointers to the incident vertices and neighboring faces and call the is_valid() function of the base class to perform any geometric test provided by the user therein.


Next: Class declaration of Geom_traits
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January, 1999.