CGAL 5.1 - 3D Triangulation Data Structure
TriangulationDataStructure_3::Cell Class Reference

#include <Concepts/TriangulationDataStructure_3.h>

Definition

The concept TriangulationDataStructure_3::Cell stores four Vertex_handles to its four vertices and four Cell_handles to its four neighbors. The vertices are indexed 0, 1, 2, and 3 in consistent order. The neighbor indexed \( i\) lies opposite to vertex i.

In degenerate dimensions, cells are used to store faces of maximal dimension: in dimension 2, each cell represents only one facet of index 3, and 3 edges \( (0,1)\), \( (1,2)\) and \( (2,0)\); in dimension 1, each cell represents one edge \( (0,1)\). (See also Section Representation.)

Creation

In order to obtain new cells or destruct unused cells, the user must call the create_cell() and delete_cell() methods of the triangulation data structure.

See also
TriangulationDataStructure_3::Vertex
TriangulationDataStructure_3::Cell_data

Types

typedef TriangulationDataStructure_3 Triangulation_data_structure
 
typedef TriangulationDataStructure_3::Vertex_handle Vertex_handle
 
typedef TriangulationDataStructure_3::Cell_handle Cell_handle
 
typedef TriangulationDataStructure_3::Cell_data TDS_data
 

Access Functions

Vertex_handle vertex (int i) const
 Returns the vertex i of c. More...
 
int index (Vertex_handle v) const
 Returns the index of vertex v in c. More...
 
bool has_vertex (Vertex_handle v) const
 Returns true if v is a vertex of c. More...
 
bool has_vertex (Vertex_handle v, int &i) const
 Returns true if v is a vertex of c, and computes its index i in c. More...
 
Cell_handle neighbor (int i) const
 Returns the neighbor i of c. More...
 
int index (Cell_handle n) const
 Returns the index corresponding to neighboring cell n. More...
 
bool has_neighbor (Cell_handle n) const
 Returns true if n is a neighbor of c. More...
 
bool has_neighbor (Cell_handle n, int &i) const
 Returns true if n is a neighbor of c, and computes its index i in c. More...
 

Setting

void set_vertex (int i, Vertex_handle v)
 Sets vertex i to v. More...
 
void set_vertices (Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3)
 Sets the vertex pointers. More...
 
void set_neighbor (int i, Cell_handle n)
 Sets neighbor i to n. More...
 
void set_neighbors (Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3)
 Sets the neighbors pointers. More...
 

Internal

Advanced

These functions are used internally by the triangulation data structure.

The user is not encouraged to use them directly as they may change in the future.

TDS_datatds_data ()
 
const TDS_datatds_data () const
 

Checking

bool is_valid (bool verbose=false, int level=0) const
 This is a function for debugging purpose. More...
 

Member Typedef Documentation

◆ Cell_handle

typedef TriangulationDataStructure_3::Cell_handle TriangulationDataStructure_3::Cell::Cell_handle

◆ TDS_data

typedef TriangulationDataStructure_3::Cell_data TriangulationDataStructure_3::Cell::TDS_data

◆ Triangulation_data_structure

typedef TriangulationDataStructure_3 TriangulationDataStructure_3::Cell::Triangulation_data_structure

◆ Vertex_handle

typedef TriangulationDataStructure_3::Vertex_handle TriangulationDataStructure_3::Cell::Vertex_handle

Member Function Documentation

◆ has_neighbor() [1/2]

bool TriangulationDataStructure_3::Cell::has_neighbor ( Cell_handle  n) const

Returns true if n is a neighbor of c.

◆ has_neighbor() [2/2]

bool TriangulationDataStructure_3::Cell::has_neighbor ( Cell_handle  n,
int &  i 
) const

Returns true if n is a neighbor of c, and computes its index i in c.

◆ has_vertex() [1/2]

bool TriangulationDataStructure_3::Cell::has_vertex ( Vertex_handle  v) const

Returns true if v is a vertex of c.

◆ has_vertex() [2/2]

bool TriangulationDataStructure_3::Cell::has_vertex ( Vertex_handle  v,
int &  i 
) const

Returns true if v is a vertex of c, and computes its index i in c.

◆ index() [1/2]

int TriangulationDataStructure_3::Cell::index ( Cell_handle  n) const

Returns the index corresponding to neighboring cell n.

Precondition
n is a neighbor of c.

◆ index() [2/2]

int TriangulationDataStructure_3::Cell::index ( Vertex_handle  v) const

Returns the index of vertex v in c.

Precondition
v is a vertex of c.

◆ is_valid()

bool TriangulationDataStructure_3::Cell::is_valid ( bool  verbose = false,
int  level = 0 
) const

This is a function for debugging purpose.

Debugging Support

User defined local validity checking function.

◆ neighbor()

Cell_handle TriangulationDataStructure_3::Cell::neighbor ( int  i) const

Returns the neighbor i of c.

Precondition
\( i \in\{0, 1, 2, 3\}\).

◆ set_neighbor()

void TriangulationDataStructure_3::Cell::set_neighbor ( int  i,
Cell_handle  n 
)

Sets neighbor i to n.

Precondition
\( i \in\{0, 1, 2, 3\}\).

◆ set_neighbors()

void TriangulationDataStructure_3::Cell::set_neighbors ( Cell_handle  n0,
Cell_handle  n1,
Cell_handle  n2,
Cell_handle  n3 
)

Sets the neighbors pointers.

◆ set_vertex()

void TriangulationDataStructure_3::Cell::set_vertex ( int  i,
Vertex_handle  v 
)

Sets vertex i to v.

Precondition
\( i \in\{0, 1, 2, 3\}\).

◆ set_vertices()

void TriangulationDataStructure_3::Cell::set_vertices ( Vertex_handle  v0,
Vertex_handle  v1,
Vertex_handle  v2,
Vertex_handle  v3 
)

Sets the vertex pointers.

◆ tds_data() [1/2]

TDS_data& TriangulationDataStructure_3::Cell::tds_data ( )

◆ tds_data() [2/2]

const TDS_data& TriangulationDataStructure_3::Cell::tds_data ( ) const

◆ vertex()

Vertex_handle TriangulationDataStructure_3::Cell::vertex ( int  i) const

Returns the vertex i of c.

Precondition
\( i \in\{0, 1, 2, 3\}\).