CGAL 5.0.3 - 3D Triangulation Data Structure
|
At the base level (see the Software Design sections of the Chapters Triangulation and Triangulation Datastructure), a cell stores handles to its four vertices and to its four neighbor cells. The vertices and neighbors are indexed 0, 1, 2 and 3. Neighbor i
lies opposite to vertex i
.
Since the Triangulation data structure is the class which defines the handle types, the cell base class has to be somehow parameterized by the Triangulation data structure. But since it is itself parameterized by the cell and vertex base classes, there is a cycle in the definition of these classes. In order to break the cycle, the base classes for vertex and cell which are given as arguments for the Triangulation data structure use void
as Triangulation data structure parameter, and the Triangulation data structure then uses a rebind-like mechanism (similar to the one specified in std::allocator
) in order to put itself as parameter to the vertex and cell classes. The rebound base classes so obtained are the classes which are used as base classes for the final vertex and cell classes. More information can be found in Section Software Design.
TriangulationDSVertexBase_3
TriangulationVertexBase_3
TriangulationHierarchyVertexBase_3
TriangulationCellBase_3
Types | |
A model of the concept | |
template<typename TDS2 > | |
using | Rebind_TDS = unspecified_type |
This template class has to define a type Rebind_TDS<TDS2>::Other which is the rebound cell, that is, the one whose Triangulation_data_structure will be the actually used one. More... | |
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 |
Creation | |
Cell_base () | |
Default constructor. | |
Cell_base (Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3) | |
Initializes the vertices with v0, v1, v2, v3 . More... | |
Cell_base (Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) | |
Initializes the vertices with v0, v1, v2, v3 and the neighbors with n0, n1, n2, n3 . | |
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 v . More... | |
bool | has_vertex (Vertex_handle v) |
True iff v is a vertex of c . | |
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 . | |
Cell_handle | neighbor (int i) const |
Returns the neighbor i of c . More... | |
int | index (Cell_handle n) const |
Returns the index of cell n in c . More... | |
bool | has_neighbor (Cell_handle n) |
Returns true if n is a neighbor of c . | |
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 . | |
Setting | |
void | set_vertex (int i, Vertex_handle v) |
Sets vertex i to v . More... | |
void | set_vertices () |
Sets the vertices to the default constructed handle. | |
void | set_vertices (Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3) |
Sets the vertices. | |
void | set_neighbor (int i, Cell_handle n) |
Sets neighbor i to n . More... | |
void | set_neighbors () |
Sets the neighbors to the default constructed handle. | |
void | set_neighbors (Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) |
Sets the neighbors. | |
Checking | |
bool | is_valid (bool verbose=false, int level=0) const |
Performs any desired geometric test on a cell. More... | |
Members for Compact_container | |
Advanced
These member functions are required by See the documentation of | |
void * | for_compact_container () const |
void *& | for_compact_container () |
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_data & | tds_data () |
const TDS_data & | tds_data () const |
I/O | |
istream & | operator>> (istream &is, TriangulationDSCellBase_3 &c) |
Inputs the possible non combinatorial information given by the cell. | |
ostream & | operator<< (ostream &os, const TriangulationDSCellBase_3 &c) |
Outputs the possible non combinatorial information given by the cell. | |
using TriangulationDSCellBase_3::Rebind_TDS = unspecified_type |
This template class has to define a type Rebind_TDS<TDS2>::Other
which is the rebound cell, that is, the one whose Triangulation_data_structure
will be the actually used one.
Rebind_TDS<TDS2>::Other
will be the real base class of Triangulation_data_structure_3::Cell
.
TriangulationDSCellBase_3::Cell_base | ( | Vertex_handle | v0, |
Vertex_handle | v1, | ||
Vertex_handle | v2, | ||
Vertex_handle | v3 | ||
) |
Initializes the vertices with v0, v1, v2, v3
.
Neighbors are initialized to the default constructed handle.
int TriangulationDSCellBase_3::index | ( | Vertex_handle | v | ) | const |
Returns the index of v
.
v
is a vertex of c
int TriangulationDSCellBase_3::index | ( | Cell_handle | n | ) | const |
Returns the index of cell n
in c
.
n
is a neighbor of c
. bool TriangulationDSCellBase_3::is_valid | ( | bool | verbose = false , |
int | level = 0 |
||
) | const |
Performs any desired geometric test on a cell.
This is a function for debugging purpose.
When verbose
is set to true
, messages are printed to give a precise indication of the kind of invalidity encountered. level
increases the level of testing.
Cell_handle TriangulationDSCellBase_3::neighbor | ( | int | i | ) | const |
Returns the neighbor i
of c
.
void TriangulationDSCellBase_3::set_neighbor | ( | int | i, |
Cell_handle | n | ||
) |
Sets neighbor i
to n
.
void TriangulationDSCellBase_3::set_vertex | ( | int | i, |
Vertex_handle | v | ||
) |
Sets vertex i
to v
.
Vertex_handle TriangulationDSCellBase_3::vertex | ( | int | i | ) | const |
Returns the vertex i
of c
.