CGAL 6.1 - dD Triangulations

Loading...
Searching...
No Matches
List of all members
TriangulationDataStructure::FullCell Concept Reference
Reference Manual » Concepts

## Definition

The concept `TriangulationDataStructure::FullCell` describes the type used by a `TriangulationDataStructure` to store the full cells.

It sets requirements of combinatorial nature only, as geometry is not concerned here. In the context of triangulation, the term full cell refers to a face of maximal dimension. This maximality characteristic is emphasized by using the adjective full.

A `TriangulationDataStructure::FullCell` is responsible for storing handles to the vertices of the full cell as well as handles to the adjacent full cells. Two full cells are said to be adjacent when they share a facet. Adjacent full cells are called hereafter neighbors.

Has models
  `CGAL::Triangulation_ds_full_cell<TriangulationDataStructure_, DSFullCellStoragePolicy>`
  `CGAL::Triangulation_full_cell<TriangulationTraits_, Data, TriangulationDSFullCell_>`

See also
  `TriangulationDataStructure::FullCell`
  `TriangulationDataStructure::Face`
  `TriangulationDataStructure`

## Types
typedef unspecified_type | Vertex_handle
| A handle to a vertex, which must be the same as the nested type `TriangulationDataStructure::Vertex_handle`.
typedef unspecified_type | Vertex_handle_iterator
| An iterator over the handles to the vertices of the full cell.
typedef unspecified_type | Full_cell_handle
| A handle to a full cell, which must be the same as the nested type `TriangulationDataStructure::Full_cell_handle`.
typedef TriangulationDataStructure::Full_cell_data | TDS_data
| A data member of this type has to be stored and accessible through access function below.

## Access Functions
int | maximal_dimension () const
| Returns one less than the maximum number of vertices that the full cell can store.
Vertex_handle_iterator | vertices_begin () const
| Returns an iterator to the first `Vertex_handle` stored in the full cell.
Vertex_handle_iterator | vertices_end () const
| Returns an iterator pointing beyond the last `Vertex_handle` stored in the full cell.
Vertex_handle | vertex (const int i) const
| Returns the `i`-th vertex of the full cell.
Full_cell_handle | neighbor (const int i) const
| Returns the full cell opposite to the `i`-th vertex of the full cell `c`.
int | mirror_index (const int i) const
| Returns the index of `c` in its \( i^{th}\) neighbor (`c.neighbor(i)`).
int | index (Full_cell_handle n) const
| Returns the index `i` such that `c.neighbor(i)==n`.
int | index (Vertex_handle v) const
| Returns the index `i` of the vertex `v` such that `c.vertex(i)==v`.

## 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.
const TDS_data & | tds_data () const
| Returns the data member of type `TDS_data`.
TDS_data & | tds_data ()
| Same as above, but returns a reference to a non-`const` object.
Vertex_handle | mirror_vertex (const int i, const int cur_dim) const
| Returns a handle to the mirror vertex of the `i`-th vertex of full cell `c`.

## Update Functions
void | set_vertex (const int i, Vertex_handle v)
| Sets the \( i\)-th vertex of the full cell.
void | set_neighbor (const int i, Full_cell_handle n)
| Sets the `i`-th neighbor of `c` to `n`.
void | set_mirror_index (const int i, const int index)
| Sets the mirror index of the \( i\)-th vertex of `c` to `index`.
void | swap_vertices (int d1, int d2)
| Switches the orientation of the full cell `c` by swapping its vertices with index `d1` and `d2`.

## Queries
bool | has_vertex (Vertex_handle v) const
| Returns `true` if the vertex `v` is a vertex of the full cell `c`.
bool | has_vertex (Vertex_handle v, int &ret) const
| Returns `true` and sets the value of `ret` to the index of `v` in `c` if the vertex `v` is a vertex of the full cell `c`.
bool | has_neighbor (Full_cell_handle n) const
| Returns `true` if the full cell `n` is a neighbor of the full cell `c`.
bool | has_neighbor (Full_cell_handle n, int &ret) const
| Returns `true` and sets the value of `ret` to the index of `n` as a neighbor of `c` if the full cell `n` is a neighbor of the full cell `c`.

## Validity Check
bool | is_valid (bool verbose=false) const
| This is a function for debugging purpose.

## Input/Output
These operators can be used directly and are called by the I/O operator of class `TriangulationDataStructure`.
template<class TriangulationDataStructure >
std::ostream & | operator<< (std::ostream &os, const Triangulation_ds_full_cell< TriangulationDataStructure > &c)
| Writes (possibly) non-combinatorial information about full cell `c` to the stream `os`.
template<class TriangulationDataStructure >
std::istream & | operator>> (std::istream &is, Triangulation_ds_full_cell< TriangulationDataStructure > &c)
| Reads from stream `is` the full cell information written by `operator<<`.

## Member Function Documentation

## ◆ has_neighbor() [1/2]

bool TriangulationDataStructure::FullCell::has_neighbor | ( | Full_cell_handle | n | ) | const

Returns `true` if the full cell `n` is a neighbor of the full cell `c`.

Returns `false` otherwise.

## ◆ has_neighbor() [2/2]

bool TriangulationDataStructure::FullCell::has_neighbor | ( | Full_cell_handle | n,
|  | int & | ret
| ) |  | const

Returns `true` and sets the value of `ret` to the index of `n` as a neighbor of `c` if the full cell `n` is a neighbor of the full cell `c`.

Returns `false` otherwise.

## ◆ has_vertex() [1/2]

bool TriangulationDataStructure::FullCell::has_vertex | ( | Vertex_handle | v | ) | const

Returns `true` if the vertex `v` is a vertex of the full cell `c`.

Returns `false` otherwise.

## ◆ has_vertex() [2/2]

bool TriangulationDataStructure::FullCell::has_vertex | ( | Vertex_handle | v,
|  | int & | ret
| ) |  | const

Returns `true` and sets the value of `ret` to the index of `v` in `c` if the vertex `v` is a vertex of the full cell `c`.

Returns `false` otherwise.

## ◆ index() [1/2]

int TriangulationDataStructure::FullCell::index | ( | Full_cell_handle | n | ) | const

Returns the index `i` such that `c.neighbor(i)==n`.

Precondition
  `n` must be a neighbor of `c`.

## ◆ index() [2/2]

int TriangulationDataStructure::FullCell::index | ( | Vertex_handle | v | ) | const

Returns the index `i` of the vertex `v` such that `c.vertex(i)==v`.

Precondition
  `v` must be a vertex of the `c`.

## ◆ is_valid()

bool TriangulationDataStructure::FullCell::is_valid | ( | bool | verbose = `false` | ) | const

This is a function for debugging purpose.

Debugging Support

Performs some validity checks on the full cell `c`.

It must at least check that for each existing neighbor `n`, `c` is also a neighbor of `n`.

Returns `true` if all the tests pass, `false` if any test fails. See the documentation for the models of this concept to see the additional (if any) validity checks that they implement.

## ◆ maximal_dimension()

int TriangulationDataStructure::FullCell::maximal_dimension | ( |  | ) | const

Returns one less than the maximum number of vertices that the full cell can store.

This does not return the dimension of the actual full cell stored in `c`.

## ◆ mirror_index()

int TriangulationDataStructure::FullCell::mirror_index | ( | const int | i | ) | const

Returns the index of `c` in its \( i^{th}\) neighbor (`c.neighbor(i)`).

If the returned integer is not negative, it holds that `c.neighbor(i)->neighbor(j) == c`. Returns `-1` if `c` has no adjacent full cell of index `i`.

Precondition
  \(0 \leq i \leq \) `maximal_dimension()`.

## ◆ mirror_vertex()

Vertex_handle TriangulationDataStructure::FullCell::mirror_vertex | ( | const int | i,
|  | const int | cur_dim
| ) |  | const

Returns a handle to the mirror vertex of the `i`-th vertex of full cell `c`.

`cur_dim` is the current dimension of the triangulation data structure.

Advanced

This function works even if the adjacency information stored in the neighbor full cell `*c.neighbor(i)` is corrupted. This is useful when temporary corruption is necessary during surgical operations on a triangulation.

Precondition
  \(0 \leq i,\) `cur_dim` \( \leq \) `maximal_dimension()`.

## ◆ neighbor()

Full_cell_handle TriangulationDataStructure::FullCell::neighbor | ( | const int | i | ) | const

Returns the full cell opposite to the `i`-th vertex of the full cell `c`.

Precondition
  \(0 \leq i \leq \)`maximal_dimension()`.

## ◆ set_mirror_index()

void TriangulationDataStructure::FullCell::set_mirror_index | ( | const int | i,
|  | const int | index
| ) |  |

Sets the mirror index of the \( i\)-th vertex of `c` to `index`.

This corresponds to the index, in `c->neighbor(i)`, of the full cell `c`.

Note: a model of this concept may choose not to store mirror indices, in which case this function should do nothing.

Precondition
  \(0 \leq i \leq \)`maximal_dimension()`.

## ◆ set_neighbor()

void TriangulationDataStructure::FullCell::set_neighbor | ( | const int | i,
|  | Full_cell_handle | n
| ) |  |

Sets the `i`-th neighbor of `c` to `n`.

Full cell `n` is opposite to the \( i\)-th vertex of `c`.

Precondition
  \(0 \leq i \leq \)`maximal_dimension()`.

## ◆ set_vertex()

void TriangulationDataStructure::FullCell::set_vertex | ( | const int | i,
|  | Vertex_handle | v
| ) |  |

Sets the \( i\)-th vertex of the full cell.

Precondition
  \(0 \leq i \leq \) `maximal_dimension()`.

## ◆ swap_vertices()

void TriangulationDataStructure::FullCell::swap_vertices | ( | int | d1,
|  | int | d2
| ) |  |

Switches the orientation of the full cell `c` by swapping its vertices with index `d1` and `d2`.

Precondition
  \(0 \leq d1,d2 \leq \)`maximal_dimension()`.

## ◆ tds_data()

const TDS_data & TriangulationDataStructure::FullCell::tds_data | ( |  | ) | const

Returns the data member of type `TDS_data`.

It is typically used to mark the full cell as visited during operations on a `TriangulationDataStructure`.

## ◆ vertex()

Vertex_handle TriangulationDataStructure::FullCell::vertex | ( | const int | i | ) | const

Returns the `i`-th vertex of the full cell.

Precondition
  \(0 \leq i \leq \) `maximal_dimension()`.