A class Tds<Vb,Fb> that satisfies the requirements for a triangulation data structure class must provide the following types and operations.
| |
Vertex
| |
| |
Cell type
|
| ||
| (c,i,j) is the edge of cell c whose vertices indices are i and j. (See Section .) | |
| ||
| (c,i) is the facet of c opposite to the vertex of index i. (See Section .) |
The following iterators allow one to visit all the vertices, edges, facets and cells of the triangulation data structure. They are all bidirectional, non-mutable iterators.
| |
| |
| |
|
The following circulators allow us to visit all the cells and facets incident to a given edge. They are bidirectional and non-mutable.
| |
|
| |
A default constructor.
| |
| |
Copy constructor. All the vertices and cells are duplicated.
|
|
| Assignment. All the vertices and cells are duplicated. |
The previous two methods are equivalent.
|
| |
Swaps tds and tds1. There is no copy of cells and vertices, thus this method runs in constant time. This method should be preferred to tds=tds1 or tds(tds1) when tds1 is deleted after that. | ||
|
| |
tds1 is copied into tds. If , the vertex of tds
corresponding to v is returned, otherwise NULL is returned. Precondition: The optional argument v is a vertex of tds1. | ||
|
| Destructor. All vertices and cells are deleted, and tds itself is deleted. |
|
| The dimension of the triangulated topological sphere. |
|
| |
The number of vertices. Note that the triangulation data structure has one more vertex than an associated geometric triangulation, if there is one, since the infinite vertex is a standard vertex and is thus also counted. |
|
| |
The number of cells. Returns 0 if tds.dimension(). | ||
|
| |
The number of facets. Returns 0 if tds.dimension(). | ||
|
| |
The number of edges. Returns 0 if tds.dimension(). |
|
| |
Sets the dimension to n. | ||
|
| |
Sets the number of vertices to n. |
|
| |||
Tests whether v is a vertex of tds. | ||||
|
| |||
Tests whether (c,i,j) is an edge of tds. Answers false when dimension() . | ||||
|
| |||
Tests whether (u,v) is an edge of tds. If the edge is found, it computes a cell c having this edge and the indices i and j of the vertices u and v, in this order. | ||||
|
| |||
Tests whether (c,i) is a facet of tds. Answers false when dimension() . | ||||
|
| |||
Tests whether (u,v,w) is a facet of tds. If the facet is found, it computes a cell c having this facet and the indices i, j and k of the vertices u, v and w, in this order. | ||||
|
| |||
Tests whether c is a cell of tds. Answers false when dimension() . | ||||
|
| |||
Tests whether (u,v,w,t) is a cell of tds. If the cell c is found, it computes the indices i, j, k and l of the vertices u, v, w and t in c, in this order. |
Two kinds of flips exist for a three-dimensional triangulation. They are reciprocal. To be flipped, an edge must be incident to three tetrahedra. During the flip, these three tetrahedra disappear and two tetrahedra appear. Figure (left) shows the edge that is flipped as bold dashed, and one of its three incident facets is shaded. On the right, the facet shared by the two new tetrahedra is dashed.
Flips are possible only if the tetrahedra to be created do not already exist.
The following methods guarantee the validity of the resulting 3D combinatorial triangulation.
Flips for a 2d triangulation are not implemented yet
|
| |
|
| |
Before flipping, these methods check that edge e=(c,i,j) is flippable (which is quite expensive). They return false or true according to this test. | ||
|
| |
|
| |
Should be preferred to the previous methods when the edge is
known to be flippable. Precondition: The edge is flippable. | ||
|
| |
|
| |
Before flipping, these methods check that facet f=(c,i) is flippable (which is quite expensive). They return false or true according to this test. | ||
|
| |
|
| |
Should be preferred to the previous methods when the facet is
known to be flippable. Precondition: The facet is flippable. |
The following modifier member functions guarantee the combinatorial validity of the resulting triangulation.
|
| |||
Inserts vertex v in cell c. Cell c is split into four
new cells, each of these cells being formed with v and a facet
of c. Precondition: tds.dimension() and c is a cell of tds. | ||||
|
| |||
Inserts vertex v in facet f. In dimension 3, the two
incident cells are split into 3 new cells; in dimension 2, the facet is
split into 3 facets. Precondition: tds.dimension() and f is a facet of tds. | ||||
|
| |||
Inserts v in facet i of c. Precondition: tds.dimension() , in dimension 3, in dimension 2 and (c,i) is a facet of tds. | ||||
|
| |||
Inserts vertex v in edge e. In dimension 3, all the
incident cells are split into 2 new cells; in dimension 2, the 2
incident facets are split into 2 new facets; in dimension 1, the edge is
split into 2 new edges. Precondition: tds.dimension() and e is an edge of tds. | ||||
|
| |||
Inserts v in edge of c. Precondition: tds.dimension() . , in dimension 3, in dimension 2, in dimension 1 and (c,i,j) is an edge of tds. | ||||
|
| |||
Transforms a triangulation of the sphere of into the
triangulation of the sphere of by adding vertex v:
v is linked to all the vertices to triangulate one of the two
halfspheres of dimension . Vertex star is used to
triangulate the second halfsphere (when there is an associated
geometric triangulation, star is in fact the vertex associated with
its infinite vertex). See
Figure . The numbering of the cells is such that, if f was a face of maximal dimension in the initial triangulation, then (f,v) (in this order) is the corresponding face in the new triangulation. If the boolean reorient is set to true, all the faces of maximal dimension are given the opposite orientation. This method can be used to insert the first two vertices in an empty triangulation. Precondition: tds.dimension() . When tds.number_of_vertices() , and star is a vertex of tds. |
Figure: insert_increase_dimension (1-dimensional case)
|
| |
Removes v. The incident faces of maximal dimension incident to
v are replaced by a single face of the same dimension. This
operation is exactly reciprocal to tds.insert_in_cell(v). Precondition: v is a vertex of degree tds.dimension()+1. not yet implemented | ||
|
| Deletes all cells and vertices. tds is reset as a triangulation data structure constructed by the default constructor. |
In addition to these requirements, in order to be used as a triangulation data structure by the class Delaunay_triangulation_3<Traits,Tds>, the triangulation must offer the following method:
|
| |||
Replaces all the cells in region by the cells formed by v
and the facets on the boundary of region. Precondition: tds.dimension() . region is a non-empty set of connected cells of t (this precondition is not checked but must be satisfied). c is an element of region whose facet of index i lies on the boundary of region (this precondition is not checked but must be satisfied). |
|
| |||
Adds an already constructed cell to the triangulation data structure. Precondition: c != NULL. | ||||
|
| Creates a cell and adds it to the triangulation data structure. Its vertices and neighbors are initialized to NULL. The setting functions of the cell can be used later to modify them. | ||
|
| |||
Creates a cell and adds it into the triangulation data structure. Initializes the vertices of the cell, its neighbor pointers being initialized with NULL. | ||||
|
| |||
Creates a cell, initializes its vertices and neighbors, and adds it into the triangulation data structure. | ||||
|
| |||
Removes the cell from the triangulation data structure and deletes it. Precondition: The cell is a cell of tds. |
|
| Returns cells_end() when tds.dimension() . | ||
|
|
|||
|
| |||
Returns facets_end() when tds.dimension() . | ||||
|
|
|||
|
| Returns edges_end() when tds.dimension() . | ||
|
|
|||
|
| |||
Returns vertices_end() when tds.number_of_vertices() 1. | ||||
|
| |||
|
| |||
Starts at an arbitrary cell incident to e. Precondition: tds.dimension() | ||||
|
| |||
As above for edge (i,j) of c. | ||||
|
| |||
Starts at cell start. Precondition: tds.dimension() and start is incident to e. | ||||
|
| |||
As above for edge (i,j) of c. |
The following circulators on facets are defined only in dimension 3, though facets are defined also in dimension 2: there are only two facets sharing an edge in dimension 2.
|
| |||
Starts at an arbitrary facet incident to e. Precondition: tds.dimension() | ||||
|
| |||
As above for edge (i,j) of c. | ||||
|
| |||
Starts at facet start. Precondition: start is incident to e. | ||||
|
| |||
Starts at facet of index f in start. | ||||
|
| |||
As above for edge (i,j) of c. | ||||
|
| |||
As above for edge (i,j) of c and facet (start,f). |
|
| |||
Computes the set cells of all cells incident to v. If
tds.dimension() then the set is empty. The optional
argument c will be used for initializing the set. Precondition: v NULL, tds.is_vertex(v) and the optional argument c is a cell having v as a vertex. | ||||
|
| |||
Computes the set vertices of all vertices incident to v. If
tds.number_of_vertices() then the set is empty. The optional
argument c will be used for finding a first vertex of the set. Precondition: v NULL, tds.is_vertex(v) and the optional argument c is a cell having v as a vertex. |
|
| |
Reads a combinatorial triangulation from is and assigns it to t | ||
|
| |
Writes t into the stream os |
The information stored in the iostream is: the dimension, the number of vertices, the number of cells, the indices of the vertices of each cell, then the indices of the neighbors of each cell, where the index corresponds to the preceding list of cells. When dimension 3, the same information is stored for faces of maximal dimension instead of cells.