diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h index faffed7b765..d9d873b0847 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h @@ -60,6 +60,9 @@ public: PlaneC3(const Point_3 &p, const Vector_3 &v) { *this = plane_from_point_direction(p, v.direction()); } + PlaneC3(Origin o, const Vector_3 &v) + { *this = plane_from_point_direction(o, v.direction()); } + PlaneC3(const FT &a, const FT &b, const FT &c, const FT &d) : base(CGAL::make_array(a, b, c, d)) {} diff --git a/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h b/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h index 1d64331c04a..b58026145cd 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/plane_constructions_3.h @@ -53,6 +53,15 @@ plane_from_point_direction(const typename R::Point_3 &p, return PlaneC3(A, B, C, D); } + template +CGAL_KERNEL_LARGE_INLINE +PlaneC3 +plane_from_point_direction(Origin o, + const typename R::Direction_3 &d) +{ + return PlaneC3(d.dx(), d.dy(), d.dz(), 0); +} + } //namespace CGAL #endif // CGAL_CARTESIAN_PLANE_CONSTRUCTIONS_3_H diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h b/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h index c7f8ab25a80..a3f5e33858f 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/PlaneH3.h @@ -58,6 +58,7 @@ public: PlaneH3(const Ray_3&, const Point_3& ); PlaneH3(const Point_3&, const Direction_3& ); PlaneH3(const Point_3&, const Vector_3& ); + PlaneH3(Origin, const Vector_3& ); PlaneH3(const Point_3&, const Direction_3&, const Direction_3& ); const RT & a() const; @@ -239,6 +240,17 @@ PlaneH3::PlaneH3(const typename PlaneH3::Point_3& p, -(ov.hx()*p.hx() + ov.hy()*p.hy() + ov.hz()*p.hz() ) ); } +template < class R > +CGAL_KERNEL_INLINE +PlaneH3::PlaneH3(Origin, + const typename PlaneH3::Vector_3& ov) +{ + new_rep( ov.hx(), + ov.hy(), + ov.hz(), + RT(0) ); +} + template < class R > CGAL_KERNEL_INLINE PlaneH3::PlaneH3(const typename PlaneH3::Point_3& p, diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index b70bab2baa1..47efb69a69a 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -2046,6 +2046,10 @@ namespace CommonKernelFunctors { operator()(Return_base_tag, const Point_3& p, const Vector_3& v) const { return Rep(p, v); } + Rep // Plane_3 + operator()(Return_base_tag, Origin o, const Vector_3& v) const + { return Rep(o, v); } + Rep // Plane_3 operator()(Return_base_tag, const Line_3& l, const Point_3& p) const { return Rep(l, p); } diff --git a/Kernel_23/include/CGAL/Plane_3.h b/Kernel_23/include/CGAL/Plane_3.h index df4d378ac4c..9da820ba47f 100644 --- a/Kernel_23/include/CGAL/Plane_3.h +++ b/Kernel_23/include/CGAL/Plane_3.h @@ -78,6 +78,9 @@ public: Plane_3(const Point_3& p, const Vector_3& v) : Rep(typename R::Construct_plane_3()(Return_base_tag(), p, v)) {} + Plane_3(Origin o, const Vector_3& v) + : Rep(typename R::Construct_plane_3()(Return_base_tag(), o, v)) {} + Plane_3(const RT& a, const RT& b, const RT& c, const RT& d) : Rep(typename R::Construct_plane_3()(Return_base_tag(), a, b, c, d)) {} diff --git a/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h b/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h index 62340fa6055..fca5b82ee18 100644 --- a/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h +++ b/Nef_S2/include/CGAL/Nef_S2/Sphere_segment.h @@ -43,7 +43,7 @@ Sphere_segment_rep(const Point& p1, const Point& p2, CGAL_warning(p1 != p2.antipode()); CGAL_assertion(p1 != p2.antipode()); if ( p1 == p2 ) { - Plane_3 h(Point_3(CGAL::ORIGIN),(p1-CGAL::ORIGIN)); + Plane_3 h(CGAL::ORIGIN, (p1-CGAL::ORIGIN)); c_ = Sphere_circle(Plane_3(Point_3(CGAL::ORIGIN),h.base1())); } if (!shorter_arc) c_ = c_.opposite();