TriangulationDataStructure_2::Face

Definition

The concept TriangulationDataStructure_2::Face describes the types used to store the faces face class of a TriangulationDataStructure_2. A TriangulationDataStructure_2::Face 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.

In degenerate cases, when the triangulation data structure stores a simplicial complex of dimension 0 and 1, the type TriangulationDataStructure_2::Face is used to store the faces of maximal dimension of the complex : i.e. a vertex in dimension 0, an edge in dimension 1. Only vertices and neighbors with index 0 are set in the first case, only vertices and neighbors with index 0 or 1 are set in the second case.

Types

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

Creation

The methods create_face and delete_face() have to be used to define new faces and to delete non longer used faces.

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 v in f.

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

Other Access Functions

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


begin of advanced section  advanced  begin of advanced section

Setting

void f.set_vertex ( int i, Vertex_handle v)
sets vertex i to be v.
Precondition: 0 i 2.
void f.set_neighbor ( int i, Face_handle 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_handle v0,
Vertex_handle v1,
Vertex_handle v2)
sets the vertices pointers.
void f.set_neighbors () sets the neighbors pointers to NULL.
void
f.set_neighbors ( Face_handle n0,
Face_handle n1,
Face_handle n2)
sets the neighbors pointers.

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

See Also

TriangulationDataStructure_2,
TriangulationDataStructure_2::Vertex,
TriangulationFaceBase_2.