CGAL 5.2.1 - Cone-Based Spanners
CGAL::Construct_theta_graph_2< Traits_, Graph_ > Class Template Reference

#include <CGAL/Construct_theta_graph_2.h>

Definition

A template functor for constructing Theta graphs with a given set of 2D points and a given initial direction for the cone boundaries.

Template Parameters
Traits_Must be either CGAL::Exact_predicates_exact_constructions_kernel_with_root_of or CGAL::Exact_predicates_inexact_constructions_kernel.
Graph_The graph type to store the constructed cone based spanner. It must be boost::adjacency_list with Traits_::Point_2 as VertexProperties.
Examples:
Cone_spanners_2/dijkstra_theta.cpp, and Cone_spanners_2/theta_io.cpp.

Public Types

typedef Graph_ Graph
 the specific type of boost::adjacency_list. More...
 
typedef Traits::Point_2 Point_2
 the point type
 
typedef Traits::Direction_2 Direction_2
 the direction type
 

Public Member Functions

 Construct_theta_graph_2 (unsigned int k, Direction_2 initial_direction=Direction_2(1, 0), Cones_selected cones_selected=ALL_CONES)
 Constructor. More...
 
template<typename PointInputIterator >
Graph_ & operator() (const PointInputIterator &start, const PointInputIterator &end, Graph_ &g)
 Function operator to construct a Theta graph. More...
 
unsigned int number_of_cones () const
 returns the number of cones.
 
template<class DirectionOutputIterator >
DirectionOutputIterator directions (DirectionOutputIterator result)
 outputs the set of directions to the iterator result. More...
 

Member Typedef Documentation

◆ Graph

template<typename Traits_, typename Graph_>
typedef Graph_ CGAL::Construct_theta_graph_2< Traits_, Graph_ >::Graph

the specific type of boost::adjacency_list.

Constructor & Destructor Documentation

◆ Construct_theta_graph_2()

template<typename Traits_, typename Graph_>
CGAL::Construct_theta_graph_2< Traits_, Graph_ >::Construct_theta_graph_2 ( unsigned int  k,
Direction_2  initial_direction = Direction_2(1,0),
Cones_selected  cones_selected = ALL_CONES 
)

Constructor.

Parameters
kNumber of cones to divide space into
initial_directionA direction denoting one of the rays dividing the cones. This allows arbitary rotations of the rays that divide the plane. (default: positive x-axis)
cones_selectedIndicates whether even, odd or all cones are selected to construct graph.

Member Function Documentation

◆ directions()

template<typename Traits_, typename Graph_>
template<class DirectionOutputIterator >
DirectionOutputIterator CGAL::Construct_theta_graph_2< Traits_, Graph_ >::directions ( DirectionOutputIterator  result)

outputs the set of directions to the iterator result.

Template Parameters
DirectionOutputIteratoran OutputIterator with value type Direction_2.
Returns
result

◆ operator()()

template<typename Traits_, typename Graph_>
template<typename PointInputIterator >
Graph_& CGAL::Construct_theta_graph_2< Traits_, Graph_ >::operator() ( const PointInputIterator &  start,
const PointInputIterator &  end,
Graph_ &  g 
)

Function operator to construct a Theta graph.

For the details of this algorithm, please refer to the User Manual.

Template Parameters
PointInputIteratoran InputIterator with value type Point_2.
Parameters
[in]startAn iterator pointing to the first vertex of the input.
[in]endAn iterator pointing to the past-the-end location of the input.
[out]gThe constructed graph object.