CGAL 5.1 - 2D Triangulation Data Structure
TriangulationDataStructure_2::Face Class Reference

#include <Concepts/TriangulationDataStructure_2.h>

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 handles to its three vertices and three handles 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 no longer used faces.

Has Models:
CGAL::Triangulation_ds_face_base_2<Tds>
See also
TriangulationDSFaceBase_2
TriangulationDataStructure_2
TriangulationDataStructure_2::Vertex

Vertex Access Functions

Vertex_handle vertex (int i) const
 returns the vertex i of the face. More...
 
int index (Vertex_handle v) const
 returns the index of vertex v in the face. More...
 
bool has_vertex (Vertex_handle v) const
 returns true if v is a vertex of the face. More...
 
bool has_vertex (Vertex_handle v, int &i) const
 returns true if v is a vertex of the face, and computes the index i of v in the face. More...
 

Neighbor Access Functions

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

Face_handle neighbor (int i) const
 returns the neighbor i of the face. More...
 
int index (Face_handle n) const
 returns the index of face n. More...
 
bool has_neighbor (Face_handle n) const
 returns true if n is a neighbor of the face. More...
 
bool has_neighbor (Face_handle n, int &i) const
 returns true if n is a neighbor of the face, and compute the index i of n. More...
 

Setting

void set_vertex (int i, Vertex_handle v)
 sets vertex i to be v. More...
 
void set_neighbor (int i, Face_handle n)
 sets neighbor i to be n. More...
 
void set_vertices ()
 sets the vertex handles to Vertex_handle(). More...
 
void set_vertices (Vertex_handle v0, Vertex_handle v1, Vertex_handle v2)
 sets the vertex handles. More...
 
void set_neighbors ()
 sets the neighbors handles to Face_handle(). More...
 
void set_neighbors (Face_handle n0, Face_handle n1, Face_handle n2)
 sets the neighbors handles. More...
 

Checking

bool is_valid () const
 returns true if the function is_valid() of the base class returns true and if, for each index \( i\), \( 0 \le i < 3\), the face 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. More...
 

Miscellaneous

int ccw (int i) const
 Returns \( i+1\) modulo 3, with \( 0\leq i \leq2\). More...
 
int cw (int i) const
 Returns \( i+2\) modulo 3, with \( 0\leq i \leq2\). More...
 
std::istream & operator>> (std::istream &is, TriangulationDataStructure_2::Face &f)
 Inputs any non combinatorial information possibly stored in the face. More...
 
std::ostream & operator<< (std::ostream &os, const TriangulationDataStructure_2::Face &f)
 Outputs any non combinatorial information possibly stored in the face. More...
 

Member Function Documentation

◆ ccw()

int TriangulationDataStructure_2::Face::ccw ( int  i) const

Returns \( i+1\) modulo 3, with \( 0\leq i \leq2\).

◆ cw()

int TriangulationDataStructure_2::Face::cw ( int  i) const

Returns \( i+2\) modulo 3, with \( 0\leq i \leq2\).

◆ has_neighbor() [1/2]

bool TriangulationDataStructure_2::Face::has_neighbor ( Face_handle  n) const

returns true if n is a neighbor of the face.

◆ has_neighbor() [2/2]

bool TriangulationDataStructure_2::Face::has_neighbor ( Face_handle  n,
int &  i 
) const

returns true if n is a neighbor of the face, and compute the index i of n.

◆ has_vertex() [1/2]

bool TriangulationDataStructure_2::Face::has_vertex ( Vertex_handle  v) const

returns true if v is a vertex of the face.

◆ has_vertex() [2/2]

bool TriangulationDataStructure_2::Face::has_vertex ( Vertex_handle  v,
int &  i 
) const

returns true if v is a vertex of the face, and computes the index i of v in the face.

◆ index() [1/2]

int TriangulationDataStructure_2::Face::index ( Face_handle  n) const

returns the index of face n.

Precondition
n is a neighbor of the face.

◆ index() [2/2]

int TriangulationDataStructure_2::Face::index ( Vertex_handle  v) const

returns the index of vertex v in the face.

Precondition
v is a vertex of the face.

◆ is_valid()

bool TriangulationDataStructure_2::Face::is_valid ( ) const

returns true if the function is_valid() of the base class returns true and if, for each index \( i\), \( 0 \le i < 3\), the face 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.

◆ neighbor()

Face_handle TriangulationDataStructure_2::Face::neighbor ( int  i) const

returns the neighbor i of the face.

Precondition
\( 0\leq i \leq2\).

◆ operator<<()

std::ostream& TriangulationDataStructure_2::Face::operator<< ( std::ostream &  os,
const TriangulationDataStructure_2::Face f 
)

Outputs any non combinatorial information possibly stored in the face.

◆ operator>>()

std::istream& TriangulationDataStructure_2::Face::operator>> ( std::istream &  is,
TriangulationDataStructure_2::Face f 
)

Inputs any non combinatorial information possibly stored in the face.

◆ set_neighbor()

void TriangulationDataStructure_2::Face::set_neighbor ( int  i,
Face_handle  n 
)

sets neighbor i to be n.

Precondition
\( 0\leq i \leq2\).

◆ set_neighbors() [1/2]

void TriangulationDataStructure_2::Face::set_neighbors ( )

sets the neighbors handles to Face_handle().

◆ set_neighbors() [2/2]

void TriangulationDataStructure_2::Face::set_neighbors ( Face_handle  n0,
Face_handle  n1,
Face_handle  n2 
)

sets the neighbors handles.

◆ set_vertex()

void TriangulationDataStructure_2::Face::set_vertex ( int  i,
Vertex_handle  v 
)

sets vertex i to be v.

Precondition
\( 0\leq i \leq2\).

◆ set_vertices() [1/2]

void TriangulationDataStructure_2::Face::set_vertices ( )

sets the vertex handles to Vertex_handle().

◆ set_vertices() [2/2]

void TriangulationDataStructure_2::Face::set_vertices ( Vertex_handle  v0,
Vertex_handle  v1,
Vertex_handle  v2 
)

sets the vertex handles.

◆ vertex()

Vertex_handle TriangulationDataStructure_2::Face::vertex ( int  i) const

returns the vertex i of the face.

Precondition
\( 0\leq i \leq2\).