Distinguish between FT and RT so that Homogeneous uses RT-based vector scaling

This commit is contained in:
Mael Rouxel-Labbé 2019-07-26 19:20:32 +02:00
parent 27f7b48ec8
commit a45ccab351
2 changed files with 24 additions and 2 deletions

View File

@ -3098,7 +3098,16 @@ namespace HomogeneousKernelFunctors {
} }
Point_2 Point_2
operator()(const Line_2& l, const FT i) const operator()(const Line_2& l, const RT& i) const
{
Point_2 p = K().construct_point_2_object()(l);
Vector_2 v = K().construct_vector_2_object()(l);
return K().construct_translated_point_2_object()
(p, K().construct_scaled_vector_2_object()(v, i));
}
Point_2
operator()(const Line_2& l, const FT& i) const
{ {
Point_2 p = K().construct_point_2_object()(l); Point_2 p = K().construct_point_2_object()(l);
Vector_2 v = K().construct_vector_2_object()(l); Vector_2 v = K().construct_vector_2_object()(l);

View File

@ -31,6 +31,7 @@
#include <CGAL/Kernel/Return_base_tag.h> #include <CGAL/Kernel/Return_base_tag.h>
#include <CGAL/Dimension.h> #include <CGAL/Dimension.h>
#include <CGAL/IO/io.h> #include <CGAL/IO/io.h>
#include <CGAL/Kernel/mpl.h>
namespace CGAL { namespace CGAL {
@ -211,7 +212,19 @@ public:
} }
Point_2 Point_2
point(const FT i) const point(const int i) const
{
return R().construct_point_2_object()(*this, RT(i));
}
Point_2
point(const RT& i) const
{
return R().construct_point_2_object()(*this,i);
}
Point_2
point(const typename First_if_different<FT, RT>::Type& i) const
{ {
return R().construct_point_2_object()(*this,i); return R().construct_point_2_object()(*this,i);
} }