This commit is contained in:
Andreas Fabri 2012-10-30 13:01:20 +00:00
parent c22dcc53a5
commit f7bd575b2c
11 changed files with 26 additions and 56 deletions

View File

@ -6,30 +6,26 @@ namespace CGAL {
`Hilbert_policy` is a policy class which can be used to parameterize a strategy policy
in order to specify the strategy for spatial sorting.
`Hilbert_policy<Median>`
or
`Hilbert_policy<Middle>`
can be passed to
as parameter to
`hilbert_sort` to choose the sorting policy.
`Hilbert_policy<Median>` or `Hilbert_policy<Middle>`
can be passed as parameter to
`hilbert_sort()` to choose the sorting policy.
### Parameters ###
`Tag` can only be either `Median` or `Middle` currently.
\tparam Tag must be either `Median` or `Middle`.
\models ::DefaultConstructible, CopyConstructible
\sa `Median`
\sa `Middle`
\sa `Hilbert_sort__median_policy`
\sa `Hilbert_sort__middle_policy`
\sa `Hilbert_sort_median_policy`
\sa `Hilbert_sort_middle_policy`
*/
template< typename Tag >
class Hilbert_policy {
public:
/// @}
}; /* end Hilbert_policy */
} /* end namespace CGAL */
@ -41,19 +37,9 @@ namespace CGAL {
A typedef to `Hilbert_policy<Median>`.
\sa `Median`
\sa `Middle`
\sa `Hilbert_policy`
\sa `Hilbert_sort__middle_policy`
*/
class Hilbert_sort_median_policy {
public:
/// @}
}; /* end Hilbert_sort_median_policy */
typedef Hilbert_policy<Median> Hilbert_sort_median_policy;
} /* end namespace CGAL */
namespace CGAL {
@ -63,19 +49,9 @@ namespace CGAL {
A typedef to `Hilbert_policy<Middle>`.
\sa `Median`
\sa `Middle`
\sa `Hilbert_sort__median_policy`
\sa `Hilbert_policy`
*/
class Hilbert_sort_middle_policy {
public:
/// @}
}; /* end Hilbert_sort_middle_policy */
typedef Hilbert_policy<Middle> Hilbert_sort_middle_policy;
} /* end namespace CGAL */
namespace CGAL {
@ -101,7 +77,6 @@ as parameter to
class Median {
public:
/// @}
}; /* end Median */
} /* end namespace CGAL */
@ -129,7 +104,6 @@ as parameter to
class Middle {
public:
/// @}
}; /* end Middle */
} /* end namespace CGAL */

View File

@ -32,7 +32,7 @@ Hilbert_sort_2(const Traits &traits = Traits());
/*!
sorts the range [`begin`, `end`).
\requires `RandomAccessIterator::value_type` equals to `Traits::Point_2`.
\requires `std::iterator_traits<RandomAccessIterator>::value_type` equals to `Traits::Point_2`.
*/
template <class RandomAccessIterator> void operator() (RandomAccessIterator begin, RandomAccessIterator end) const;

View File

@ -31,7 +31,7 @@ Hilbert_sort_3(const Traits &traits = Traits());
/*!
sorts the range [`begin`, `end`).
\requires `RandomAccessIterator::value_type` equals to `Traits::Point_3`.
\requires `std::iterator_traits<RandomAccessIterator>::value_type` equals to `Traits::Point_3`.
*/
template <class RandomAccessIterator> void operator() (RandomAccessIterator begin, RandomAccessIterator end) const;

View File

@ -31,7 +31,7 @@ Hilbert_sort_d(const Traits &traits = Traits());
/*!
sorts the range [`begin`, `end`).
\requires `RandomAccessIterator::value_type` equals to `Traits::Point_d`.
\requires `std::iterator_traits<RandomAccessIterator>::value_type` equals to `Traits::Point_d`.
*/
template <class RandomAccessIterator> void operator() (RandomAccessIterator begin, RandomAccessIterator end) const;

View File

@ -8,10 +8,9 @@ reorder of the keys instead of the points, the comparisons being done on the ass
In other words, the traits provides to a spatial sort algorithm a point type which is a key,
while the actual point type is `Base_traits::Point_2`.
### Requirements ###
`Base_traits` is a model for `SpatialSortingTraits_2`.
`PointPropertyMap` is a model of <A HREF="http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html">boost::ReadablePropertyMap</A>
\tparam Base_traits must be a model for `SpatialSortingTraits_2`.
\tparam PointPropertyMap must be a model of <A HREF="http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html">boost::ReadablePropertyMap</A>
with `Base_traits::Point_2` as `value_type`.
\models ::SpatialSortingTraits_2

View File

@ -8,10 +8,9 @@ reorder of the keys instead of the points, the comparisons being done on the ass
In other words, the traits provides to a spatial sort algorithm a point type which is a key,
while the actual point type is `Base_traits::Point_3`.
### Requirements ###
`Base_traits` is a model for `SpatialSortingTraits_3`.
`PointPropertyMap` is a model of <A HREF="http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html">boost::ReadablePropertyMap</A>
\tparam Base_traits must be a model for `SpatialSortingTraits_3`.
\tparam PointPropertyMap must be a model of <A HREF="http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html">boost::ReadablePropertyMap</A>
with `Base_traits::Point_3` as `value_type`.
\models ::SpatialSortingTraits_3

View File

@ -8,10 +8,9 @@ reorder of the keys instead of the points, the comparisons being done on the ass
In other words, the traits provides to a spatial sort algorithm a point type which is a key,
while the actual point type is `Base_traits::Point_d`.
### Requirements ###
`Base_traits` is a model for `SpatialSortingTraits_d`.
`PointPropertyMap` is a model of <A HREF="http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html">boost::ReadablePropertyMap</A>
\tparam Base_traits must be a model for `SpatialSortingTraits_d`.
\tparam PointPropertyMap must be a model of <A HREF="http://www.boost.org/doc/libs/release/libs/property_map/doc/ReadablePropertyMap.html">boost::ReadablePropertyMap</A>
with `Base_traits::Point_d` as `value_type`.
\models ::SpatialSortingTraits_d

View File

@ -9,14 +9,14 @@ along a Hilbert curve.
sorts the range [`begin`,`end`) in place.
The default traits class `Default_traits` is the kernel in which the type
`RandomAccessIterator::value_type` is defined.
`std::iterator_traits<RandomAccessIterator>::value_type` is defined.
The default policy is `Hilbert_sort_median_policy()` and the
other option is `Hilbert_sort_middle_policy()`.
### Requirements ###
<OL>
<LI>`RandomAccessIterator::value_type` is convertible to
<LI>`std::iterator_traits<RandomAccessIterator>::value_type` is convertible to
`Traits::Point_2`, `Traits::Point_3`, or `Traits::Point_d`.
<LI>`Traits` is a model for concept `SpatialSortingTraits_2`,
`SpatialSortingTraits_3`, or `SpatialSortingTraits_d`.

View File

@ -11,7 +11,7 @@ of being close in the order.
sorts the range [`begin`,`end`) in place.
The default traits class `Default_traits` is the kernel in which the type
`RandomAccessIterator::value_type` is defined.
`std::iterator_traits<RandomAccessIterator>::value_type` is defined.
The default policy is `Hilbert_sort_median_policy()` and the
other option is `Hilbert_sort_middle_policy()`.
@ -21,7 +21,7 @@ The default values for the thresholds and the ratio depends on the dimension.
### Requirements ###
<OL>
<LI>`RandomAccessIterator::value_type` is convertible to
<LI>`std::iterator_traits<RandomAccessIterator>::value_type` is convertible to
`Traits::Point_2`, `Traits::Point_3`, or `Traits::Point_d`.
<LI>`Traits` is a model for concept `SpatialSortingTraits_2`,
`SpatialSortingTraits_3`, or `SpatialSortingTraits_d`.

View File

@ -9,7 +9,7 @@ primitives (objects and predicates) that the sorting algorithms use.
`SpatialSortingTraits_d` defines the complete set of primitives required in these
functions and functors.
\hasModel Any \cgal \f$ d\f$ dimensional kernel.
\hasModel Any \cgal `d`-dimensional kernel.
\hasModel `CGAL::Spatial_sort_traits_adapter_d<Base_traits,PointPropertyMap>`
*/

View File

@ -141,9 +141,8 @@ as an alternative.
\cgalexample{Spatial_sorting/myPoint.cpp}
## Sorting Arbitrary Types ##
## Sorting Arbitrary Types ## {#secsort_any_type}
\anchor secsort_any_type
The spatial sorting traits class provides a point type and
functors for comparing, for example, the `x`-coordinates
of two points.
@ -157,9 +156,9 @@ which allows to obtain a point from whatever you want to sort.
The following examples illustrate the usage of these traits class adapters.
## Sorting Using Pairs of Points and Integers ##
## Sorting Using Pairs of Points and Integers ## {#secsort_any_type_2}
\anchor secsort_any_type_2
In this example program, the sorted sequence of points is retrieved
using a vector of pairs of points and integers.
\cgalexample{Spatial_sorting/sp_sort_using_property_map_2.cpp}