CGAL 5.1 - 2D Segment Delaunay Graphs
CGAL::Segment_Delaunay_graph_hierarchy_2< Gt, STag, DS > Class Template Reference

#include <CGAL/Segment_Delaunay_graph_hierarchy_2.h>

Inherits from

CGAL::Segment_Delaunay_graph_2< Gt, DS >.

Definition

We provide an alternative to the class Segment_Delaunay_graph_2<Gt,DS> for the incremental construction of the segment Delaunay graph.

The Segment_Delaunay_graph_hierarchy_2 class maintains a hierarchy of Delaunay graphs. There are two possibilities as to how this hierarchy is constructed.

In the first case the bottom-most level of the hierarchy contains the full segment Delaunay graph. The upper levels of the hierarchy contain only points that are either point sites or endpoints of segment sites in the bottom-most Delaunay graph. A point that is in level \( i\) (either as an individdual point or as the endpoint of a segment), is inserted in level \( i+1\) with probability \( 1/\alpha\) where \( \alpha>1\) is some constant. In the second case the upper levels of the hierarchy contains not only points but also segments. A site that is in level \( i\), is in level \( i+1\) with probability \( 1/\beta\) where \( \beta > 1\) is some constant.

The difference between the Segment_Delaunay_graph_2<Gt,DS> class and the Segment_Delaunay_graph_hierarchy_2 class (both versions of it) is on how the nearest neighbor location is done. Given a point \( p\) the location is done as follows: at the top most level we find the nearest neighbor of \( p\) as in the Segment_Delaunay_graph_2<Gt,DS> class. At every subsequent level \( i\) we use the nearest neighbor found at level \( i+1\) to find the nearest neighbor at level \( i\). This is a variant of the corresponding hierarchy for points found in [3]. The details are described in [4].

The class has three template parameters. The first and third have essentially the same semantics as in the Segment_Delaunay_graph_2<Gt,DS> class.

Template Parameters
Gtmust be a model of the SegmentDelaunayGraphTraits_2 concept.
STagThe second template parameter controls whether or not segments are added in the upper levels of the hierarchy. It's possible values are Tag_true and Tag_false. If it is set to Tag_true, segments are also inserted in the upper levels of the hierarchy. The value Tag_false indicates that only points are to be inserted in the upper levels of the hierarchy. The default value for the second template parameter is Tag_false.
DSmust be a model of the SegmentDelaunayGraphDataStructure_2 concept. However, the vertex base class that is to be used in the segment Delaunay graph data structure must be a model of the SegmentDelaunayGraphHierarchyVertexBase_2 concept. The third template parameter defaults to Triangulation_data_structure_2< Segment_Delaunay_graph_hierarchy_vertex_base_2< Segment_Delaunay_graph_vertex_base_2<Gt> >, Triangulation_face_base_2<Gt> >.

The Segment_Delaunay_graph_hierarchy_2 class derives publicly from the Segment_Delaunay_graph_2<Gt,DS> class. The interface is the same with its base class. In the sequel only additional types and methods defined are documented.

Is Model Of:

DefaultConstructible

CopyConstructible

Assignable

See also
SegmentDelaunayGraphDataStructure_2
SegmentDelaunayGraphTraits_2
SegmentDelaunayGraphHierarchyVertexBase_2
CGAL::Segment_Delaunay_graph_2<Gt,DS>
CGAL::Triangulation_data_structure_2<Vb,Fb>
CGAL::Segment_Delaunay_graph_traits_2<K,MTag>
CGAL::Segment_Delaunay_graph_traits_without_intersections_2<K,MTag>
CGAL::Segment_Delaunay_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>
CGAL::Segment_Delaunay_graph_filtered_traits_without_intersections_2<CK,CM,EK,EM,FK,FM>
CGAL::Segment_Delaunay_graph_hierarchy_vertex_base_2<Vbb>
Examples:
Segment_Delaunay_graph_2/sdg-filtered-traits.cpp, and Segment_Delaunay_graph_2/sdg-info-set.cpp.

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, Segment_Delaunay_graph_hierarchy_2< Gt, STag, DS > svdh)
 Writes the current state of the segment Delaunay graph hierarchy to an output stream. More...
 
std::istream & operator>> (std::istream &is, Segment_Delaunay_graph_hierarchy_2< Gt, STag, DS > svdh)
 Reads the state of the segment Delaunay graph hierarchy from an input stream.
 

Types

Segment_Delaunay_graph_hierarchy_2 introduces the following types in addition to those introduced by its base class Segment_Delaunay_graph_2<Gt,DS>.

typedef STag Segments_in_hierarchy_tag
 A type for the STag template parameter.
 
typedef CGAL::Segment_Delaunay_graph_2< Gt, DS > Base
 A type for the base class.
 

Creation

In addition to the default and copy constructors, the following constructors are defined:

 Segment_Delaunay_graph_hierarchy_2 (Gt gt=Gt())
 Creates a hierarchy of segment Delaunay graphs using gt as geometric traits.
 
template<class Input_iterator >
 Segment_Delaunay_graph_hierarchy_2 (Input_iterator first, Input_iterator beyond, Gt gt=Gt())
 Creates a segment Delaunay graph hierarchy using gt as geometric traits and inserts all sites in the range [first, beyond). More...
 

Additional Inherited Members

- Public Types inherited from CGAL::Segment_Delaunay_graph_2< Gt, DS >
typedef Gt Geom_traits
 A type for the geometric traits.
 
typedef DS Data_structure
 A type for the underlying data structure.
 
typedef Data_structure Triangulation_data_structure
 This type has been added so that the Segment_Delaunay_graph_2 class is a model of the DelaunayGraph_2 concept.
 
typedef DS::size_type size_type
 Size type (an unsigned integral type)
 
typedef Gt::Point_2 Point_2
 A type for the point defined in the geometric traits.
 
typedef Gt::Site_2 Site_2
 A type for the segment Delaunay graph site, defined in the geometric traits.
 
typedef unspecified_type Point_container
 A type for the container of points.
 
typedef Point_container::iterator Point_handle
 A handle for points in the point container.
 
typedef DS::Edge Edge
 The edge type. More...
 
typedef DS::Vertex Vertex
 A type for a vertex.
 
typedef DS::Face Face
 A type for a face.
 
typedef DS::Vertex_handle Vertex_handle
 A type for a handle to a vertex.
 
typedef DS::Face_handle Face_handle
 A type for a handle to a face.
 
typedef DS::Vertex_circulator Vertex_circulator
 A type for a circulator over vertices incident to a given vertex.
 
typedef DS::Face_circulator Face_circulator
 A type for a circulator over faces incident to a given vertex.
 
typedef DS::Edge_circulator Edge_circulator
 A type for a circulator over edges incident to a given vertex.
 
typedef DS::Vertex_iterator All_vertices_iterator
 A type for an iterator over all vertices.
 
typedef DS::Face_iterator All_faces_iterator
 A type for an iterator over all faces.
 
typedef DS::Edge_iterator All_edges_iterator
 A type for an iterator over all edges.
 
typedef unspecified_type Finite_vertices_iterator
 A type for an iterator over finite vertices.
 
typedef unspecified_type Finite_faces_iterator
 A type for an iterator over finite faces.
 
typedef unspecified_type Finite_edges_iterator
 A type for an iterator over finite edges.
 
typedef unspecified_type Input_sites_iterator
 A type for a bidirectional iterator over all input sites.
 
typedef unspecified_type Output_sites_iterator
 A type for a bidirectional iterator over all output sites (the sites in the Delaunay graph).
 
- Public Member Functions inherited from CGAL::Segment_Delaunay_graph_2< Gt, DS >
Input_sites_iterator input_sites_begin ()
 Starts at an arbitrary input site.
 
Input_sites_iterator input_sites_end ()
 Past-the-end iterator.
 
Output_sites_iterator output_sites_begin ()
 Starts at an arbitrary output site.
 
Output_sites_iterator output_sites_end ()
 Past-the-end iterator.
 
 Segment_Delaunay_graph_2 (Gt gt=Gt())
 Creates the segment Delaunay graph using gt as geometric traits.
 
template<class Input_iterator >
 Segment_Delaunay_graph_2 (Input_iterator first, Input_iterator beyond, Gt gt=Gt())
 Creates the segment Delaunay graph using gt as geometric traits and inserts all sites in the range [first, beyond). More...
 
Geom_traits geom_traits ()
 Returns a reference to the segment Delaunay graph traits object.
 
int dimension ()
 Returns the dimension of the segment Delaunay graph. More...
 
size_type number_of_vertices ()
 Returns the number of finite vertices of the segment Delaunay graph.
 
size_type number_of_faces ()
 Returns the number of faces (both finite and infinite) of the segment Delaunay graph.
 
size_type number_of_input_sites ()
 Return the number of input sites.
 
size_type number_of_output_sites ()
 Return the number of output sites. More...
 
Face_handle infinite_face ()
 Returns a face incident to the infinite_vertex.
 
Vertex_handle infinite_vertex ()
 Returns the infinite_vertex.
 
Vertex_handle finite_vertex ()
 Returns a vertex distinct from the infinite_vertex. More...
 
Data_structure data_structure ()
 Returns a reference to the segment Delaunay graph data structure object.
 
Data_structure tds ()
 Same as data_structure(). More...
 
Point_container point_container ()
 Returns a reference to the point container object.
 
Finite_vertices_iterator finite_vertices_begin ()
 Starts at an arbitrary finite vertex.
 
Finite_vertices_iterator finite_vertices_end ()
 Past-the-end iterator.
 
Finite_edges_iterator finite_edges_begin ()
 Starts at an arbitrary finite edge.
 
Finite_edges_iterator finite_edges_end ()
 Past-the-end iterator.
 
Finite_faces_iterator finite_faces_begin ()
 Starts at an arbitrary finite face.
 
Finite_faces_iterator finite_faces_end () const
 Past-the-end iterator.
 
All_vertices_iterator all_vertices_begin ()
 Starts at an arbitrary vertex.
 
All_vertices_iterator all_vertices_end ()
 Past-the-end iterator.
 
All_edges_iterator all_edges_begin ()
 Starts at an arbitrary edge.
 
All_edges_iterator all_edges_end ()
 Past-the-end iterator.
 
All_faces_iterator all_faces_begin ()
 Starts at an arbitrary face.
 
All_faces_iterator all_faces_end ()
 Past-the-end iterator.
 
Face_circulator incident_faces (Vertex_handle v)
 Starts at an arbitrary face incident to v.
 
Face_circulator incident_faces (Vertex_handle v, Face_handle f)
 Starts at face f. More...
 
Edge_circulator incident_edges (Vertex_handle v)
 Starts at an arbitrary edge incident to v.
 
Edge_circulator incident_edges (Vertex_handle v, Face_handle f)
 Starts at the first edge of f incident to v, in counterclockwise order around v. More...
 
Vertex_circulator incident_vertices (Vertex_handle v)
 Starts at an arbitrary vertex incident to v.
 
Vertex_circulator incident_vertices (Vertex_handle v, Face_handle f)
 Starts at the first vertex of f adjacent to v in counterclockwise order around v. More...
 
bool is_infinite (Vertex_handle v) const
 true, iff v is the infinite_vertex.
 
bool is_infinite (Face_handle f) const
 true, iff face f is infinite.
 
bool is_infinite (Face_handle f, int i) const
 true, iff edge (f,i) is infinite.
 
bool is_infinite (Edge e) const
 true, iff edge e is infinite.
 
bool is_infinite (Edge_circulator ec) const
 true, iff edge *ec is infinite.
 
template<class Input_iterator >
size_type insert (Input_iterator first, Input_iterator beyond)
 Inserts the sites in the range [first,beyond). More...
 
template<class Input_iterator >
size_type insert (Input_iterator first, Input_iterator beyond, Tag_false)
 Same as the previous method. More...
 
template<class Input_iterator >
size_type insert (Input_iterator first, Input_iterator beyond, Tag_true)
 Decomposes the range [first,beyond) into a range of input points and a range of input segments that are respectively passed to insert_segments() and insert_points(). More...
 
template<class PointIterator >
std::size_t insert_points (PointIterator first, PointIterator beyond)
 Inserts the points in the range [first,beyond) as sites. More...
 
template<class SegmentIterator >
std::size_t insert_segments (SegmentIterator first, SegmentIterator beyond)
 Inserts the segments in the range [first,beyond) as sites. More...
 
template<class PointIterator , class IndicesIterator >
std::size_t insert_segments (PointIterator points_first, PointIterator points_beyond, IndicesIterator indices_first, IndicesIterator indices_beyond)
 Same as above except that each segment is given as a pair of indices of the points in the range [points_first, points_beyond). More...
 
Vertex_handle insert (Point_2 p)
 Inserts the point p in the segment Delaunay graph. More...
 
Vertex_handle insert (Point_2 p, Vertex_handle vnear)
 Inserts p in the segment Delaunay graph using the site associated with vnear as an estimate for the nearest neighbor of p. More...
 
Vertex_handle insert (Point_2 p1, Point_2 p2)
 Inserts the closed segment with endpoints p1 and p2 in the segment Delaunay graph. More...
 
Vertex_handle insert (Point_2 p1, Point_2 p2, Vertex_handle vnear)
 Inserts the segment whose endpoints are p1 and p2 in the segment Delaunay graph using the site associated with vnear as an estimate for the nearest neighbor of p1. More...
 
Vertex_handle insert (Site_2 s)
 Inserts the site s in the segment Delaunay graph. More...
 
Vertex_handle insert (Site_2 s, Vertex_handle vnear)
 Inserts s in the segment Delaunay graph using the site associated with vnear as an estimate for the nearest neighbor of s, if s is a point, or the first endpoint of s, if s is a segment. More...
 
Vertex_handle nearest_neighbor (Point_2 p)
 Finds the nearest neighbor of the point p. More...
 
Vertex_handle nearest_neighbor (Point_2 p, Vertex_handle vnear)
 Finds the nearest neighbor of the point p using the site associated with vnear as an estimate for the nearest neighbor of p. More...
 
template<class Stream >
Stream & draw_dual (Stream &str)
 Draws the segment Voronoi diagram to the stream str. More...
 
template<class Stream >
Stream & draw_skeleton (Stream &str)
 Draws the segment Voronoi diagram to the stream str, except the edges of the diagram corresponding to a segment and its endpoints. More...
 
template<class Stream >
Stream & draw_dual_edge (Edge e, Stream &str)
 Draws the edge e of the segment Voronoi diagram to the stream str. More...
 
template<class Stream >
Stream & draw_dual_edge (Edge_circulator ec, Stream &str)
 Draws the edge *ec of the segment Voronoi diagram to the stream str. More...
 
template<class Stream >
Stream & draw_dual_edge (All_edges_iterator eit, Stream &str)
 Draws the edge *eit of the segment Voronoi diagram to the stream str. More...
 
template<class Stream >
Stream & draw_dual_edge (Finite_edges_iterator eit, Stream &str)
 Draws the edge *eit of the segment Voronoi diagram to the stream str. More...
 
void file_output (std::ostream &os)
 Writes the current state of the segment Delaunay graph to an output stream. More...
 
void file_input (std::istream &is)
 Reads the state of the segment Delaunay graph from an input stream.
 
std::ostream & operator<< (std::ostream &os, Segment_Delaunay_graph_2< Gt, DS > sdg)
 Writes the current state of the segment Delaunay graph to an output stream.
 
std::istream & operator>> (std::istream &is, Segment_Delaunay_graph_2< Gt, DS > sdg)
 Reads the state of the segment Delaunay graph from an input stream.
 
bool is_valid (bool verbose=false, int level=1)
 Checks the validity of the segment Delaunay graph. More...
 
void clear ()
 Clears all contents of the segment Delaunay graph.
 
void swap (Segment_Delaunay_graph_2< Gt, DS > other)
 The segment Delaunay graphs other and *this are swapped. More...
 

Constructor & Destructor Documentation

◆ Segment_Delaunay_graph_hierarchy_2()

template<typename Gt , typename STag , typename DS >
template<class Input_iterator >
CGAL::Segment_Delaunay_graph_hierarchy_2< Gt, STag, DS >::Segment_Delaunay_graph_hierarchy_2 ( Input_iterator  first,
Input_iterator  beyond,
Gt  gt = Gt() 
)

Creates a segment Delaunay graph hierarchy using gt as geometric traits and inserts all sites in the range [first, beyond).

Input_iterator must be a model of InputIterator. The value type of Input_iterator must be either Point_2 or Site_2.

Friends And Related Function Documentation

◆ operator
template<typename Gt , typename STag , typename DS >
std::ostream & operator<< ( std::ostream &  os,
Segment_Delaunay_graph_hierarchy_2< Gt, STag, DS >  svdh 
)
related

Writes the current state of the segment Delaunay graph hierarchy to an output stream.

In particular, all sites in the diagram are written to the stream (represented through appropriate input sites), as well as the underlying combinatorial hierarchical data structure.

Examples:
Segment_Delaunay_graph_2/sdg-red-blue-info.cpp.