CGAL 4.4 - 3D Periodic Triangulations
|
#include <CGAL/Periodic_3_Delaunay_triangulation_3.h>
The class Periodic_3_Delaunay_triangulation_3
represents a Delaunay triangulation in three-dimensional periodic space.
Template Parameters
The first template argument PT
must be a model of the Periodic_3DelaunayTriangulationTraits_3
concept.
The second template argument TDS
must be a model of the TriangulationDataStructure_3
concept with some additional functionality in cells and vertices. Its default value is Triangulation_data_structure_3<Triangulation_vertex_base_3<PT,Periodic_3_triangulation_ds_vertex_base_3<>>,Triangulation_cell_base_3<PT,Periodic_3_triangulation_ds_cell_base_3<>>>
.
Periodic_3_triangulation_3
Creation | |
Periodic_3_Delaunay_triangulation_3 (const Iso_cuboid &domain=Iso_cuboid(0, 0, 0, 1, 1, 1), const Geom_traits &traits=Geom_traits()) | |
Creates an empty periodic Delaunay triangulation dt , with domain as original domain and possibly specifying a traits class traits . More... | |
Periodic_3_Delaunay_triangulation_3 (const Periodic_3_Delaunay_triangulation_3 &dt1) | |
Copy constructor. More... | |
template<class InputIterator > | |
Periodic_3_Delaunay_triangulation_3 (InputIterator first, InputIterator last, const Iso_cuboid &domain=Iso_cuboid(0, 0, 0, 1, 1, 1), const Geom_traits &traits=Geom_traits()) | |
Equivalent to constructing an empty triangulation with the optional domain and traits class arguments and calling insert(first,last) . More... | |
Insertion | |
The following methods insert points in the triangulation ensuring the empty sphere property of Delaunay triangulations. The inserted points need to lie in the original domain (see Section The Flat Torus of the user manual). In the degenerate case when there are co-spherical points, the Delaunay triangulation is known not to be uniquely defined. In this case, CGAL chooses a particular Delaunay triangulation using a symbolic perturbation scheme [2]. Note that insertion of a new point can cause a switch from computing in the 27-sheeted covering space to computing in the 1-sheeted covering space, which invalidates some | |
Vertex_handle | insert (const Point &p, Cell_handle start=Cell_handle()) |
Inserts point p in the triangulation and returns the corresponding vertex. More... | |
Vertex_handle | insert (const Point &p, Locate_type lt, Cell_handle loc, int li, int lj) |
Inserts point p in the triangulation and returns the corresponding vertex. More... | |
The following method allows one to insert several points. It returns the number of inserted points. | |
template<class InputIterator > | |
std::ptrdiff_t | insert (InputIterator first, InputIterator last, bool is_large_point_set=false) |
Inserts the points in the iterator range \( \left[\right.\)first , last \( \left.\right)\). More... | |
Point moving | |
Vertex_handle | move_point (Vertex_handle v, const Point &p) |
Moves the point stored in v to p , while preserving the Delaunay property. More... | |
Removal | |
When a vertex So, the problem reduces to triangulating a polyhedral region, while preserving its boundary, or to compute a constrained triangulation. This is known to be sometimes impossible: the Schönhardt polyhedron cannot be triangulated [4]. However, when dealing with Delaunay triangulations, the case of such polyhedra that cannot be re-triangulated cannot happen, so CGAL proposes a vertex removal. | |
void | remove (Vertex_handle v) |
Removes the vertex v from the triangulation. More... | |
template<class InputIterator > | |
std::ptrdiff_t | remove (InputIterator first, InputIterator beyond) |
Removes the vertices specified by the iterator range (first, beyond ) of value type Vertex_handle . More... | |
Queries | |
Bounded_side | side_of_sphere (Cell_handle c, const Point &p, const Offset &off=Offset(0, 0, 0)) const |
Returns a value indicating on which side of the circumscribed sphere of c the point-offset pair (p ,off ) lies. More... | |
Vertex_handle | nearest_vertex (Point p, Cell_handle c=Cell_handle()) |
Returns any nearest vertex to the point p , or the default constructed handle if the triangulation is empty. More... | |
Vertex_handle | nearest_vertex_in_cell (Cell_handle c, Point p, Offset off=Offset(0, 0, 0)) const |
Returns the vertex of the cell c that is nearest to the point-offset pair (p ,off ). More... | |
A point-offset pair ( The set of cells that are in conflict with ( | |
template<class OutputIteratorBoundaryFacets , class OutputIteratorCells , class OutputIteratorInternalFacets > | |
Triple < OutputIteratorBoundaryFacets, OutputIteratorCells, OutputIteratorInternalFacets > | find_conflicts (Point p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit) |
Computes the conflict hole induced by p . More... | |
template<class OutputIterator > | |
OutputIterator | vertices_in_conflict (Point p, Cell_handle c, OutputIterator res) |
Similar to find_conflicts() , but reports the vertices which are on the boundary of the conflict hole of p , in the output iterator res . More... | |
A face (cell, facet or edge) is said to be a Gabriel face iff its smallest circumscribing sphere do not enclose any vertex of the triangulation. Any Gabriel face belongs to the Delaunay triangulation, but the reciprocal is not true. The following member functions test the Gabriel property of Delaunay faces. | |
bool | is_Gabriel (Cell_handle c, int i) |
bool | is_Gabriel (Cell_handle c, int i, int j) |
bool | is_Gabriel (const Facet &f) |
bool | is_Gabriel (const Edge &e) |
Voronoi diagram | |
CGAL offers several functions to display the Voronoi diagram of a set of points in 3D. Note that a traits class providing exact constructions should be used in order to guarantee the computation of the Voronoi diagram (as opposed to computing the triangulation only, which requires only exact predicates). | |
Point | dual (Cell_handle c) const |
Returns the representative of the circumcenter of the four vertices of c that lies in the original domain domain . More... | |
Periodic_segment | dual (Facet f) const |
Returns the dual of facet f , which is a periodic segment. More... | |
Periodic_segment | dual (Cell_handle c, int i) const |
same as the previous method for facet (c,i) . More... | |
template<class OutputIterator > | |
OutputIterator | dual (Edge e, OutputIterator pts) const |
Returns in the output iterator the points of the dual polygon of edge e in the same order as the Facet_circulator returns facets incident to the edge e . More... | |
template<class OutputIterator > | |
OutputIterator | dual (Cell_handle c, int i, int j, OutputIterator pts) const |
same as the previous method for edge (c,i,j) . More... | |
template<class OutputIterator > | |
OutputIterator | dual (Vertex_handle v, OutputIterator pts) const |
Returns in the output iterator the points of the dual polyhedron of vertex v in no particular order. More... | |
template<class Stream > | |
Stream & | draw_dual (Stream &os) |
Sends the set of duals to all the facets of dt into os . More... | |
Geom_traits::FT | dual_volume (Vertex_handle v) const |
Returns the volume of the Voronoi cell dual to v . More... | |
Point | dual_centroid (Vertex_handle v) const |
Returns the centroid of the Voronoi cell dual to v . More... | |
Checking | |
These methods are mainly a debugging help for the users of advanced features. | |
bool | is_valid (bool verbose=false) const |
Checks the combinatorial validity of the triangulation and the validity of its geometric embedding (see Section Representation). More... | |
bool | is_valid (Cell_handle c, bool verbose=false) const |
Checks the combinatorial and geometric validity of the cell (see Section Representation). More... | |
CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::Periodic_3_Delaunay_triangulation_3 | ( | const Iso_cuboid & | domain = Iso_cuboid(0, 0, 0, 1, 1, 1) , |
const Geom_traits & | traits = Geom_traits() |
||
) |
Creates an empty periodic Delaunay triangulation dt
, with domain
as original domain and possibly specifying a traits class traits
.
domain
is a cube. CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::Periodic_3_Delaunay_triangulation_3 | ( | const Periodic_3_Delaunay_triangulation_3< PT, TDS > & | dt1 | ) |
Copy constructor.
CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::Periodic_3_Delaunay_triangulation_3 | ( | InputIterator | first, |
InputIterator | last, | ||
const Iso_cuboid & | domain = Iso_cuboid(0, 0, 0, 1, 1, 1) , |
||
const Geom_traits & | traits = Geom_traits() |
||
) |
Equivalent to constructing an empty triangulation with the optional domain and traits class arguments and calling insert(first,last)
.
value_type
of first
and last
are Point
s lying inside domain
and domain
is a cube. Stream& CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::draw_dual | ( | Stream & | os | ) |
Sends the set of duals to all the facets of dt
into os
.
Point CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual | ( | Cell_handle | c | ) | const |
Returns the representative of the circumcenter of the four vertices of c that lies in the original domain domain
.
Periodic_segment CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual | ( | Facet | f | ) | const |
Returns the dual of facet f
, which is a periodic segment.
Periodic_segment CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual | ( | Cell_handle | c, |
int | i | ||
) | const |
same as the previous method for facet (c,i)
.
OutputIterator CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual | ( | Edge | e, |
OutputIterator | pts | ||
) | const |
Returns in the output iterator the points of the dual polygon of edge e
in the same order as the Facet_circulator
returns facets incident to the edge e
.
The points form the dual polygon in \( \mathbb R^3\), so they do not necessarily all lie inside the original domain.
OutputIterator CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual | ( | Cell_handle | c, |
int | i, | ||
int | j, | ||
OutputIterator | pts | ||
) | const |
same as the previous method for edge (c,i,j)
.
OutputIterator CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual | ( | Vertex_handle | v, |
OutputIterator | pts | ||
) | const |
Returns in the output iterator the points of the dual polyhedron of vertex v
in no particular order.
The points form the dual polyhedron in \( \mathbb R^3\), so they do not necessarily lie all inside the original domain.
Point CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual_centroid | ( | Vertex_handle | v | ) | const |
Returns the centroid of the Voronoi cell dual to v
.
Geom_traits::FT CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::dual_volume | ( | Vertex_handle | v | ) | const |
Returns the volume of the Voronoi cell dual to v
.
Triple<OutputIteratorBoundaryFacets, OutputIteratorCells, OutputIteratorInternalFacets> CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::find_conflicts | ( | Point | p, |
Cell_handle | c, | ||
OutputIteratorBoundaryFacets | bfit, | ||
OutputIteratorCells | cit, | ||
OutputIteratorInternalFacets | ifit | ||
) |
Computes the conflict hole induced by p
.
The starting cell c
must be in conflict. Then this function returns respectively in the output iterators:
cit
: the cells in conflict.bfit
: the facets on the boundary, that is, the facets (t, i)
where the cell t
is in conflict, but t->neighbor(i)
is not.ifit
: the facets inside the hole, that is, delimiting two cells in conflict.Returns the pair composed of the resulting output iterators.
c
is in conflict with p
and p
lies in the original domain domain
. Vertex_handle CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::insert | ( | const Point & | p, |
Cell_handle | start = Cell_handle() |
||
) |
Inserts point p
in the triangulation and returns the corresponding vertex.
The optional argument start
is used as a starting place for the point location.
p
lies in the original domain domain
. Vertex_handle CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::insert | ( | const Point & | p, |
Locate_type | lt, | ||
Cell_handle | loc, | ||
int | li, | ||
int | lj | ||
) |
Inserts point p
in the triangulation and returns the corresponding vertex.
Similar to the above insert()
function, but takes as additional parameter the return values of a previous location query. See description of Periodic_3_triangulation_3::locate()
.
p
lies in the original domain domain
. std::ptrdiff_t CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::insert | ( | InputIterator | first, |
InputIterator | last, | ||
bool | is_large_point_set = false |
||
) |
Inserts the points in the iterator range \( \left[\right.\)first
, last
\( \left.\right)\).
Returns the number of inserted points. This function uses spatial sorting (cf. chapter Spatial Sorting) and therefore is not guaranteed to insert the points following the order of InputIterator
. If the third argument is_large_point_set
is set to true
a heuristic for optimizing the insertion of large point sets is applied.
value_type
of first
and last
are Point
s lying inside domain
. bool CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::is_Gabriel | ( | Cell_handle | c, |
int | i | ||
) |
bool CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::is_Gabriel | ( | Cell_handle | c, |
int | i, | ||
int | j | ||
) |
bool CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::is_Gabriel | ( | const Facet & | f | ) |
bool CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::is_Gabriel | ( | const Edge & | e | ) |
bool CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::is_valid | ( | bool | verbose = false | ) | const |
Checks the combinatorial validity of the triangulation and the validity of its geometric embedding (see Section Representation).
Also checks that all the circumscribing spheres of cells are empty.
When verbose
is set to true, messages describing the first invalidity encountered are printed.
bool CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::is_valid | ( | Cell_handle | c, |
bool | verbose = false |
||
) | const |
Checks the combinatorial and geometric validity of the cell (see Section Representation).
Also checks that the circumscribing sphere of cells is empty.
When verbose
is set to true, messages are printed to give a precise indication of the kind of invalidity encountered.
Vertex_handle CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::move_point | ( | Vertex_handle | v, |
const Point & | p | ||
) |
Moves the point stored in v
to p
, while preserving the Delaunay property.
This performs an action semantically equivalent to remove(v)
followed by insert(p)
, but is supposedly faster when the point has not moved much. Returns the handle to the new vertex.
p
lies in the original domain domain
. Vertex_handle CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::nearest_vertex | ( | Point | p, |
Cell_handle | c = Cell_handle() |
||
) |
Returns any nearest vertex to the point p
, or the default constructed handle if the triangulation is empty.
The optional argument c
is a hint specifying where to start the search. It always returns a vertex corresponding to a point inside domain
even if computing in a multiply sheeted covering space.
c
is a cell of dt
and p
lies in the original domain domain
. Vertex_handle CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::nearest_vertex_in_cell | ( | Cell_handle | c, |
Point | p, | ||
Offset | off = Offset(0, 0, 0) |
||
) | const |
Returns the vertex of the cell c
that is nearest to the point-offset pair (p
,off
).
p
lies in the original domain domain
. void CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::remove | ( | Vertex_handle | v | ) |
Removes the vertex v
from the triangulation.
When computing in the 27-sheeted covering space it removes all 27 copies of v
.
std::ptrdiff_t CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::remove | ( | InputIterator | first, |
InputIterator | beyond | ||
) |
Removes the vertices specified by the iterator range (first, beyond
) of value type Vertex_handle
.
remove()
is called for each element of the range. The number of vertices removed is returned; this number does not account for periodic copies of removed vertices.
Unique_vertex_iterator
. Bounded_side CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::side_of_sphere | ( | Cell_handle | c, |
const Point & | p, | ||
const Offset & | off = Offset(0, 0, 0) |
||
) | const |
Returns a value indicating on which side of the circumscribed sphere of c
the point-offset pair (p
,off
) lies.
More precisely, it returns:
ON_BOUNDED_SIDE
if (p
,off
) is inside the sphere.ON_BOUNDARY
if (p
,off
) on the boundary of the sphere.ON_UNBOUNDED_SIDE
if (p
,off
) lies outside the sphere. p
lies in the original domain domain
. OutputIterator CGAL::Periodic_3_Delaunay_triangulation_3< PT, TDS >::vertices_in_conflict | ( | Point | p, |
Cell_handle | c, | ||
OutputIterator | res | ||
) |
Similar to find_conflicts()
, but reports the vertices which are on the boundary of the conflict hole of p
, in the output iterator res
.
Returns the resulting output iterator.
c
is in conflict with p
and p
lies in the original domain domain
.