Add trick to get FT right for general PointRange AND for CGAL::Point_set_3

This commit is contained in:
Simon Giraudot 2018-01-11 14:04:19 +01:00
parent 9c1e045376
commit c52b32b744
5 changed files with 27 additions and 2 deletions

View File

@ -267,6 +267,17 @@ namespace CGAL {
> ::type const_type;
};
template<typename PointRange>
class GetFT
{
public:
typedef typename Kernel_traits<
typename std::iterator_traits<
typename PointRange::iterator
>::value_type
>::Kernel::FT type;
};
template<typename PointRange, typename NamedParameters>
class GetQueryPointMap
{

View File

@ -1180,6 +1180,13 @@ Point_set_3<Point, Vector>& operator+=(Point_set_3<Point, Vector>& ps,
/// \cond SKIP_IN_MANUAL
namespace Point_set_processing_3
{
template<typename Point, typename Vector>
class GetFT<CGAL::Point_set_3<Point, Vector> >
{
public:
typedef typename Kernel_traits<Point>::Kernel::FT type;
};
namespace parameters
{
template <typename Point, typename Vector>

View File

@ -241,7 +241,7 @@ compute_average_spacing(
// variant with default NP
template <typename ConcurrencyTag, typename PointRange>
typename Kernel_traits<typename std::iterator_traits<typename PointRange::iterator>::value_type>::Kernel::FT
typename Point_set_processing_3::GetFT<PointRange>::type
compute_average_spacing(
const PointRange& points,
unsigned int k) ///< number of neighbors.

View File

@ -731,7 +731,7 @@ estimate_global_range_scale(
/// \cond SKIP_IN_MANUAL
// variant with default NP
template <typename PointRange>
typename Kernel_traits<typename std::iterator_traits<typename PointRange::iterator>::value_type>::Kernel::FT
typename Point_set_processing_3::GetFT<PointRange>::type
estimate_global_range_scale(const PointRange& points)
{
return estimate_global_range_scale

View File

@ -562,6 +562,13 @@ namespace CGAL
{
namespace Point_set_processing_3
{
template<typename Kernel>
class GetFT<::Point_set_3<Kernel> >
{
public:
typedef typename Kernel::FT type;
};
namespace parameters
{
template <typename Kernel>