CGAL 5.3 - Cone-Based Spanners
CGAL::Compute_cone_boundaries_2< Traits_ > Class Template Reference

#include <CGAL/Compute_cone_boundaries_2.h>

Definition

The functor for computing the directions of cone boundaries with a given cone number and a given initial direction.

This computation can be either inexact by simply dividing an approximate \( \pi \) by the cone number (which is quick), or exact by using roots of polynomials (requiring number types such as CORE::Expr or leda_real, which are slow). The inexact computation is done by the general functor definition, while the exact computation is done by a specialization of this functor.

In the construction of cone-based spanners such as Yao graph and Theta graph implemented by this package, this functor is called first to compute the cone boundaries. Of course, this functor can also be used in other applications where the plane needs to be divided into equally-angled cones.

Template Parameters
Traits_Must be either CGAL::Exact_predicates_exact_constructions_kernel_with_root_of or CGAL::Exact_predicates_inexact_constructions_kernel.
Examples:
Cone_spanners_2/compute_cones.cpp.

Public Types

typedef Traits::Direction_2 Direction_2
 the direction type. More...
 

Public Member Functions

template<class DirectionOutputIterator >
DirectionOutputIterator operator() (const unsigned int cone_number, const Direction_2 &initial_direction, DirectionOutputIterator result)
 The operator(). More...
 

Member Typedef Documentation

◆ Direction_2

template<typename Traits_>
typedef Traits::Direction_2 CGAL::Compute_cone_boundaries_2< Traits_ >::Direction_2

the direction type.

Member Function Documentation

◆ operator()()

template<typename Traits_>
template<class DirectionOutputIterator >
DirectionOutputIterator CGAL::Compute_cone_boundaries_2< Traits_ >::operator() ( const unsigned int  cone_number,
const Direction_2 initial_direction,
DirectionOutputIterator  result 
)

The operator().

The direction of the first ray can be specified by the parameter initial_direction, which allows the first ray to start at any direction. This operator first places the initial_direction at the position pointed by result. Then, it calculates the remaining directions (cone boundaries) and output them to result in the counterclockwise order. Finally, the past-the-end iterator for the resulting directions is returned.

\tparam DirectionOutputIterator  an `OutputIterator` with value type `Direction_2`.
Parameters
cone_numberThe number of cones
initial_directionThe direction of the first ray
resultThe output iterator