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

The cell class Tds::Cell of a triangulation data structure stores four pointers to its four vertices and four pointers to its four neighbors The vertices are indexed 0, 1, 2, and 3 in positive 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 reference.)

Types

The class Tds::Cell defines the following types.

typedef Tds::Vertex
Vertex;
typedef Tds::Cell Cell;

Creation

The constructors of a cell do not insert it into any triangulation data structure. To add a cell into a given triangulation data structure, the add_cell() method of the triangulation data structure must be used. Note that a given cell can only be inserted into one triangulation data structure.

Tds::Cell c;
Introduces a cell c and initializes all vertices and neighbors with NULL.


Tds::Cell c ( Vertex* v0, Vertex* v1, Vertex* v2, Vertex* v3);
Introduces a cell c, and initializes its vertices. The neighbors are initialized with NULL.


Tds::Cell c ( Vertex* v0,
Vertex* v1,
Vertex* v2,
Vertex* v3,
Cell* n0,
Cell* n1,
Cell* n2,
Cell* n3);
Introduces a cell c, and initializes its vertices and neighbors.

Access Functions

Vertex* c.vertex ( int i) Returns the vertex i of c.
Precondition: i {0, 1, 2, 3}.
int c.index ( const Vertex* v)
Returns the index of vertex v in c.
Precondition: v is a vertex of c.
bool c.has_vertex ( const Vertex* v)
Returns true if v is a vertex of c.
bool c.has_vertex ( const Vertex* v, int & i)
Returns true if v is a vertex of c, and computes its index i in c.

Cell* c.neighbor ( int i)
Returns the neighbor i of c.
Precondition: i {0, 1, 2, 3}.
int c.index ( const Cell* n)
Returns the index corresponding to neighboring cell n.
Precondition: n is a neighbor of c.
bool c.has_neighbor ( const Cell* n)
Returns true if n is a neighbor of c.
bool c.has_neighbor ( const Cell* n, int & i)
Returns true if n is a neighbor of c, and computes its index i in c.

Vertex* c.mirror_vertex ( int i)
Returns the vertex of the neighbor of cthat is opposite to c.
Precondition: i {0, 1, 2, 3}.

int c.mirror_index ( int i)
Returns the index of c in its ith neighbor.
Precondition: i {0, 1, 2, 3}.

Setting

void c.set_vertex ( int i, Vertex* v)
Sets vertex i to v.
Precondition: i {0, 1, 2, 3}.
void
c.set_vertices ( Vertex* v0,
Vertex* v1,
Vertex* v2,
Vertex* v3)
Sets the vertex pointers.

void c.set_neighbor ( int i, Cell* n)
Sets neighbor i to n.
Precondition: i {0, 1, 2, 3}.
void
c.set_neighbors ( Cell* n0,
Cell* n1,
Cell* n2,
Cell* n3)
Sets the neighbors pointers.

Checking

bool c.is_valid ( int dim=3, bool verbose = false)
dim is the dimension of the triangulation, with default value 3.
In dimension 3 (resp. 2, 1) this function must check that the cell shares three (resp. two, one) vertices with its neighbors, and these neighbors have a correct reciprocal neighboring link. Moreover, the consistency of the orientations of common faces must be checked.
The validity of all the vertices of the cell must be checked.
The validity of the base cell is also checked.
When verbose is set to true, messages are printed to give a precise indication of the kind of invalidity encountered.


Next: Class declaration of Triangulation_data_structure_3<Vb,Cb>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.