\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)

CGAL 4.8 - Spatial Sorting

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
CGAL::Hilbert_sort_on_sphere_3< Traits, PolicyTag > Class Template Reference
Function Objects

`#include <CGAL/Hilbert_sort_on_sphere_3.h>`

## Definition

The function object `Hilbert_sort_on_sphere_3` sorts iterator ranges of `Traits::Point_3` along a Hilbert curve on a given sphere.

Actually, it approximates a Hilbert curve on that sphere by a Hilbert curve on a certain cube. For each face of that cube, it calls an appropriate version of `Hilbert_sort_2` which sorts a subset of the iterator range. `Hilbert_sort_2` in each face is called with the median or the middle policy depending on the `PolicyTag`. The input points are supposed to be close to the input sphere. If input points are not close to the input sphere, this function still works, but it might not be a good sorting function.

Template Parameters

  Traits | must be a model for `SpatialSortingTraits_3`.

## Creation
| Hilbert_sort_on_sphere_3 (const Traits &traits=Traits(), double sq_r=1.0, const Traits::Point_3 &p=Traits::Point_3(0, 0, 0))
| constructs an instance with `traits` as traits class instance, `sq_r` as the squared_radius of the given sphere, and `p` as the center of the given sphere. More...

## Operations
template<class RandomAccessIterator >
void | operator() (RandomAccessIterator begin, RandomAccessIterator end) const
| It sorts the range `[begin, end)` along a hilbert curve on the sphere centered at `p` with squared radius `sq_r`; these arguments are passed in the construction of the object `Hilbert_sort_on_sphere_3`. More...

## Constructor & Destructor Documentation

template<typename Traits , typename PolicyTag >

CGAL::Hilbert_sort_on_sphere_3< Traits, PolicyTag >::Hilbert_sort_on_sphere_3 | ( | const Traits & | traits = `Traits()`,
|  | double | sq_r = `1.0`,
|  | const Traits::Point_3 & | p = `Traits::Point_3(0, 0, 0)`
| ) |  |

constructs an instance with `traits` as traits class instance, `sq_r` as the squared_radius of the given sphere, and `p` as the center of the given sphere.

Precondition
  The value of \(sq\_r\) should be greater than 0.

## Member Function Documentation

template<typename Traits , typename PolicyTag >
template<class RandomAccessIterator >

void CGAL::Hilbert_sort_on_sphere_3< Traits, PolicyTag >::operator() | ( | RandomAccessIterator | begin,
|  | RandomAccessIterator | end
| ) |  | const

It sorts the range `[begin, end)` along a hilbert curve on the sphere centered at `p` with squared radius `sq_r`; these arguments are passed in the construction of the object `Hilbert_sort_on_sphere_3`.

Template Parameters

  RandomAccessIterator | must be an iterator with value type `Traits::Point_3`.