CGAL 6.0 - Spatial Sorting
Loading...
Searching...
No Matches
CGAL::Hilbert_sort_on_sphere_3< Traits, PolicyTag > Class Template Reference

#include <CGAL/Hilbert_sort_on_sphere_3.h>

Definition

template<typename Traits, typename PolicyTag>
class CGAL::Hilbert_sort_on_sphere_3< Traits, PolicyTag >

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
Traitsmust be a model for SpatialSortingTraits_3.
PolicyTagis used to specify the strategy policy. Possible values are Hilbert_sort_median_policy (the default policy) or Hilbert_sort_middle_policy .

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.
 

Operations

template<class InputPointIterator >
void operator() (InputPointIterator begin, InputPointIterator 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.
 

Constructor & Destructor Documentation

◆ Hilbert_sort_on_sphere_3()

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

◆ operator()()

template<typename Traits , typename PolicyTag >
template<class InputPointIterator >
void CGAL::Hilbert_sort_on_sphere_3< Traits, PolicyTag >::operator() ( InputPointIterator  begin,
InputPointIterator  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
InputPointIteratormust be a model of RandomAccessIterator with value type Traits::Point_3.