mirror of https://github.com/CGAL/cgal
add version for Point_2/Vector_2
This commit is contained in:
parent
74a0aa8c20
commit
fbd24d665d
|
|
@ -47,6 +47,11 @@ public:
|
|||
PointC2(const FT &x, const FT &y)
|
||||
: base(x, y) {}
|
||||
|
||||
template <class T1, class T2>
|
||||
PointC2(T1 &&x, T2 &&y)
|
||||
: base(std::forward<T1>(x), std::forward<T2>(y))
|
||||
{}
|
||||
|
||||
PointC2(const FT &hx, const FT &hy, const FT &hw)
|
||||
: base(hx, hy, hw) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,11 @@ public:
|
|||
VectorC2() {}
|
||||
|
||||
VectorC2(const FT &x, const FT &y)
|
||||
: base(CGAL::make_array(x, y)) {}
|
||||
: base(Rep{x, y}) {}
|
||||
|
||||
template <class T1, class T2>
|
||||
VectorC2(T1 &&x, T2 &&y)
|
||||
: base(fwd_make_array<FT>(std::forward<T1>(x), std::forward<T2>(y))) {}
|
||||
|
||||
VectorC2(const FT &hx, const FT &hy, const FT &hw)
|
||||
: base( hw != FT(1) ? CGAL::make_array<FT>(hx/hw, hy/hw)
|
||||
|
|
|
|||
|
|
@ -3084,6 +3084,11 @@ namespace CartesianKernelFunctors {
|
|||
operator()(Return_base_tag, const RT& x, const RT& y) const
|
||||
{ return Rep(x, y); }
|
||||
|
||||
template <class T1, class T2>
|
||||
Rep
|
||||
operator()(T1&& x, T2&& y) const
|
||||
{ return Rep(std::forward<T1>(x), std::forward<T2>(y)); }
|
||||
|
||||
Rep // Point_2
|
||||
operator()(Return_base_tag, const RT& x, const RT& y, const RT& w) const
|
||||
{ return Rep(x, y, w); }
|
||||
|
|
@ -3533,6 +3538,12 @@ namespace CartesianKernelFunctors {
|
|||
operator()(Return_base_tag, const Point_2& p, const Point_2& q) const
|
||||
{ return Rep(q.x() - p.x(), q.y() - p.y()); }
|
||||
|
||||
// note that compared to Vector_3 this one is needed as it could be ambiguous
|
||||
// with operator()(Rbt,FT,FT) version
|
||||
Rep // Vector_2
|
||||
operator()(Return_base_tag, Point_2&& p, Point_2&& q) const
|
||||
{ return Rep(q.x() - p.x(), q.y() - p.y()); }
|
||||
|
||||
Rep // Vector_2
|
||||
operator()(Return_base_tag, const Origin&, const Point_2& q) const
|
||||
{ return Rep(q.x(), q.y()); }
|
||||
|
|
@ -3565,12 +3576,15 @@ namespace CartesianKernelFunctors {
|
|||
operator()(Return_base_tag, const RT& x, const RT& y) const
|
||||
{ return Rep(x, y); }
|
||||
|
||||
template<class T1, class T2>
|
||||
Rep // Vector_2
|
||||
operator()(Return_base_tag, T1&& x, T2&& y) const
|
||||
{ return Rep(/* std::forward<T1>(x), std::forward<T2>(y) */); }
|
||||
|
||||
Rep // Vector_2
|
||||
operator()(Return_base_tag, const RT& x, const RT& y, const RT& w) const
|
||||
{ return Rep(x, y, w); }
|
||||
|
||||
|
||||
|
||||
Vector_2
|
||||
operator()( const Point_2& p, const Point_2& q) const
|
||||
{ return this->operator()(Return_base_tag(), p, q); }
|
||||
|
|
|
|||
|
|
@ -84,6 +84,12 @@ public:
|
|||
: Rep(typename R::Construct_point_2()(Return_base_tag(), x, y))
|
||||
{}
|
||||
|
||||
template < typename T1, typename T2>
|
||||
Point_2(T1&& x, T2&& y)
|
||||
: Rep(typename R::Construct_point_2()(Return_base_tag(), std::forward<T1>(x),
|
||||
std::forward<T2>(y)))
|
||||
{}
|
||||
|
||||
Point_2(const RT& hx, const RT& hy, const RT& hw)
|
||||
: RPoint_2(typename R::Construct_point_2()(Return_base_tag(), hx, hy, hw))
|
||||
{}
|
||||
|
|
@ -255,7 +261,7 @@ extract(std::istream& is, Point_2<R>& p, const Cartesian_tag&)
|
|||
break;
|
||||
}
|
||||
if (is)
|
||||
p = Point_2<R>(x, y);
|
||||
p = Point_2<R>(std::move(x), std::move(y));
|
||||
return is;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,6 +91,12 @@ public:
|
|||
Vector_2(const T1 &x, const T2 &y)
|
||||
: RVector_2(typename R::Construct_vector_2()(Return_base_tag(), x,y)) {}
|
||||
|
||||
template < typename T1, typename T2 >
|
||||
Vector_2(T1&& x, T2&& y)
|
||||
: RVector_2(typename R::Construct_vector_2()(Return_base_tag(), std::forward<T1>(x),
|
||||
std::forward<T2>(y)))
|
||||
{}
|
||||
|
||||
Vector_2(const RT &x, const RT &y, const RT &w)
|
||||
: RVector_2(typename R::Construct_vector_2()(Return_base_tag(), x,y,w)) {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue