Weisheng Si, Quincy Tse and Frédérk Paradis
This package provides functors for constructing two kinds of cone-based spanners: Yao graph and Theta graph, given a set of vertices on the plane and the directions of cone boundaries. Both exact and inexact constructions are supported. In exact construction, the cone boundaries are calculated using the roots of polynomials, thus avoiding the use of \( \pi \), which cannot be represented exactly. In inexact construction, the cone boundaries are calculated using the approximate \( \pi \) value defined in CGAL, which is still accurate enough for most applications. Moreover, for visualization purpose, this package provides a global function to generate the data and script files used by Gnuplot to plot the constructed graphs. This package also provides options for the Half Yao graph and the Half Theta graph.
Functors
Functions
Enumerations
|
template<typename Graph > |
void | CGAL::gnuplot_output_2 (const Graph &g, const std::string &prefix) |
| Output a set of files used by Gnuplot to plot g . More...
|
|
◆ Cones_selected
#include <CGAL/Cone_spanners_enum_2.h>
An enum of the choice of cones in cone spanners.
Enumerator |
---|
EVEN_CONES | Select even cones.
|
ODD_CONES | Select odd cones.
|
ALL_CONES | Select all cones.
|
◆ gnuplot_output_2()
template<typename Graph >
void CGAL::gnuplot_output_2 |
( |
const Graph & |
g, |
|
|
const std::string & |
prefix |
|
) |
| |
#include <CGAL/gnuplot_output_2.h>
Output a set of files used by Gnuplot to plot g
.
The files that are generated for Gnuplot are: (1) prefix.v (vertex list) (2) prefix.plt (Gnuplot script), This script will read prefix.v as input to plot the vertex list. The edge list is also included in this script.
Notes: (1) If these files already exists, this function will overwrite these files. (2) Parallel and self-edges cannot be plotted.
- Template Parameters
-
Graph | The type of the graph to be plotted. For this function to work, the graph type must be boost::adjacency_list with CGAL::Point_2 as the VertexProperties . |
- Parameters
-
g | A boost::adjacency_list graph with CGAL::Point_2 as the VertexProperties to be plotted |
prefix | The prefix of the output files names |
- Examples:
- Cone_spanners_2/theta_io.cpp.