CGAL 5.6.3 - Cone-Based Spanners

Loading...
Searching...
No Matches
List of all members | Public Types | Public Member Functions
CGAL::Compute_cone_boundaries_2< Traits_ > Class Template Reference
Cone-Based Spanners Reference

`#include <CGAL/Compute_cone_boundaries_2.h>`

## Definition

template<typename Traits_>
class CGAL::Compute_cone_boundaries_2< Traits_ >

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.

## Public Member Functions
template<class DirectionOutputIterator >
DirectionOutputIterator | operator() (const unsigned int cone_number, const Direction_2 &initial_direction, DirectionOutputIterator result)
| The operator().

## 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.

Template Parameters

  DirectionOutputIterator | an `OutputIterator` with value type `Direction_2`.

Parameters

  cone_number | The number of cones
  initial_direction | The direction of the first ray
  result | The output iterator