Concept

TriangulationDSFaceBase_2

Definition

The concept TriangulationDSFaceBase_2 describes the requirements for the base face of a Triangulation_data_structure_2<Vb,Fb>.

Note that if the Triangulation_data_structure_2 is plugged into a triangulation class, the face base class may have additional geometric requirements depending on the triangulation class.

At the base level, (see Sections 37.3 and 38.3), a face stores handles on its three vertices and on the three neighboring faces. The vertices and neighbors are indexed 0,1 and 2. Neighbor i lies opposite to vertex i.

Since the Triangulation_data_structure_2 is the class which defines the handle types, the face base class has to be somehow parameterized by the triangulation data structure. But since the Triangulation_data_structure_2 itself is parameterized by the face and vertex base classes, there is a cycle in the definition of these classes. In order to break the cycle, the base classes for faces and vertices which are plugged in to instantiate a Triangulation_data_structure_2 use a void as triangulation data structure parameter. Then, the Triangulation_data_structure_2 uses a rebind mechanism (similar to the one specified in std::allocator) in order to plug itself as parameter in the face and vertex base classes. This mechanism requires that the base class provides a templated nested class Rebind_TDS that itself provides the subtype Rebind_TDS<TDS2>::Other which is the rebound version of the base class. This rebound base class is the class that the Triangulation_data_structure_2 actually uses as a base class for the class Triangulation_data_structure_2::Face.

Types

The concept TriangulationDSFaceBase_2 has to provide the following types.

template <typename TDS2>
TriangulationDSFaceBase_2:: struct Rebind_TDS
This nested template class has to define a type Other which is the rebound face base, where the Triangulation_data_structure_2 is actually plugged in. This type Other will be the actual base of the class Triangulation_data_structure_2::Face.

typedef TriangulationDataStructure_2
Triangulation_data_structure;
typedef TriangulationDataStructure_2::Vertex_handle
Vertex_handle;
typedef TriangulationDataStructure_2::Face_handle
Face_handle;

Creation

TriangulationDSFaceBase_2 f;
default constructor.

TriangulationDSFaceBase_2 f ( Vertex_handle v0, Vertex_handle v1, Vertex_handle v2);
Initializes the vertices with v0, v1, v2 and the neighbors with Face_handle().

TriangulationDSFaceBase_2 f ( Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Face_handle n0, Face_handle n1, Face_handle n2);
initializes the vertices with v0,v1, v2 and the neighbors with n0, n1, n2.

Access Functions

int f.dimension () returns the dimension.

Vertex_handle f.vertex ( int i) const returns the vertex i of f .
Precondition: 0 i 2.
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) const
as above, and sets i to the index of v in f .
int f.index ( Vertex_handle v) const returns the index of v in f .
Face_handle f.neighbor ( int i) const returns the neighbor i of f .
Precondition: 0 i 2.
bool f.has_neighbor ( Face_handle n) returns true if n is a neighbor of f .
bool f.has_neigbor ( Face_handle n, int& i) const
as above, and sets i to the index of n in f .
int f.index ( const Face_handle n) const
returns the index of neighbor n in f .

Setting

void f.set_vertex ( int i, Vertex_handle v)
sets vertex i to v.
Precondition: 0 i 2.
void f.set_vertices () sets the vertices to Vertex_handle().
void f.set_vertices ( Vertex_handle v0, Vertex_handle v1, Vertex_handle v2)
sets the vertices.
void f.set_neighbor ( int i, Face_handle n)
sets neighbors i to n.
Precondition: 0 i 2.
void f.set_neighbors () sets the neighbors to Face_handle().
void f.set_neighbors ( Face_handle n0, Face_handle n1, Face_handle n2)
sets the neighbors.

Orientation

void f.reorient () Changes the orientation of f by exchanging vertex(0) with vertex(1) and neighbor(0) with neighbor(1).
void f.ccw_permute () preforms a counterclockwise permutation of the vertices and neighbors of f.
void f.cw_permute () preforms a clockwise permutation of the vertices and neighbors of f.

Checking

bool f.is_valid ( bool verbose = false) const
performs any required test on a face.
If verbose is set to true, messages are printed to give a precise indication of the kind of invalidity encountered.

Various

void * f.for_compact_container () const
void * & f.for_compact_container ()
These member functions are required by Triangulation_data_structure_2 because it uses Compact_container to store its faces. See the documentation of Compact_container for the exact requirements.

Has Models

CGAL::Triangulation_ds_face_base_2<Tds>
CGAL::Triangulation_face_base_2<Traits,Fb>
CGAL::Regular_triangulation_face_base_2<Traits,Fb>
CGAL::Constrained_triangulation_face_base_2<Traits,Fb>
CGAL::Triangulation_face_base_with_info_2<Info,Traits,Fb>

See Also

TriangulationDSVertexBase_2
TriangulationDataStructure_2::Face
TriangulationFaceBase_2
Triangulation_data_structure_2<Vb,Fb>