mirror of https://github.com/CGAL/cgal
Add Plane_3 constructor with Origin/Vector_3
This commit is contained in:
parent
2edb6dcf32
commit
71bba3e226
|
|
@ -60,6 +60,9 @@ public:
|
||||||
PlaneC3(const Point_3 &p, const Vector_3 &v)
|
PlaneC3(const Point_3 &p, const Vector_3 &v)
|
||||||
{ *this = plane_from_point_direction<R>(p, v.direction()); }
|
{ *this = plane_from_point_direction<R>(p, v.direction()); }
|
||||||
|
|
||||||
|
PlaneC3(Origin o, const Vector_3 &v)
|
||||||
|
{ *this = plane_from_point_direction<R>(o, v.direction()); }
|
||||||
|
|
||||||
PlaneC3(const FT &a, const FT &b, const FT &c, const FT &d)
|
PlaneC3(const FT &a, const FT &b, const FT &c, const FT &d)
|
||||||
: base(CGAL::make_array(a, b, c, d)) {}
|
: base(CGAL::make_array(a, b, c, d)) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,15 @@ plane_from_point_direction(const typename R::Point_3 &p,
|
||||||
return PlaneC3<R>(A, B, C, D);
|
return PlaneC3<R>(A, B, C, D);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class R>
|
||||||
|
CGAL_KERNEL_LARGE_INLINE
|
||||||
|
PlaneC3<R>
|
||||||
|
plane_from_point_direction(Origin o,
|
||||||
|
const typename R::Direction_3 &d)
|
||||||
|
{
|
||||||
|
return PlaneC3<R>(d.dx(), d.dy(), d.dz(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_CARTESIAN_PLANE_CONSTRUCTIONS_3_H
|
#endif // CGAL_CARTESIAN_PLANE_CONSTRUCTIONS_3_H
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ public:
|
||||||
PlaneH3(const Ray_3&, const Point_3& );
|
PlaneH3(const Ray_3&, const Point_3& );
|
||||||
PlaneH3(const Point_3&, const Direction_3& );
|
PlaneH3(const Point_3&, const Direction_3& );
|
||||||
PlaneH3(const Point_3&, const Vector_3& );
|
PlaneH3(const Point_3&, const Vector_3& );
|
||||||
|
PlaneH3(Origin, const Vector_3& );
|
||||||
PlaneH3(const Point_3&, const Direction_3&, const Direction_3& );
|
PlaneH3(const Point_3&, const Direction_3&, const Direction_3& );
|
||||||
|
|
||||||
const RT & a() const;
|
const RT & a() const;
|
||||||
|
|
@ -239,6 +240,17 @@ PlaneH3<R>::PlaneH3(const typename PlaneH3<R>::Point_3& p,
|
||||||
-(ov.hx()*p.hx() + ov.hy()*p.hy() + ov.hz()*p.hz() ) );
|
-(ov.hx()*p.hx() + ov.hy()*p.hy() + ov.hz()*p.hz() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < class R >
|
||||||
|
CGAL_KERNEL_INLINE
|
||||||
|
PlaneH3<R>::PlaneH3(Origin,
|
||||||
|
const typename PlaneH3<R>::Vector_3& ov)
|
||||||
|
{
|
||||||
|
new_rep( ov.hx(),
|
||||||
|
ov.hy(),
|
||||||
|
ov.hz(),
|
||||||
|
RT(0) );
|
||||||
|
}
|
||||||
|
|
||||||
template < class R >
|
template < class R >
|
||||||
CGAL_KERNEL_INLINE
|
CGAL_KERNEL_INLINE
|
||||||
PlaneH3<R>::PlaneH3(const typename PlaneH3<R>::Point_3& p,
|
PlaneH3<R>::PlaneH3(const typename PlaneH3<R>::Point_3& p,
|
||||||
|
|
|
||||||
|
|
@ -2046,6 +2046,10 @@ namespace CommonKernelFunctors {
|
||||||
operator()(Return_base_tag, const Point_3& p, const Vector_3& v) const
|
operator()(Return_base_tag, const Point_3& p, const Vector_3& v) const
|
||||||
{ return Rep(p, v); }
|
{ 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
|
Rep // Plane_3
|
||||||
operator()(Return_base_tag, const Line_3& l, const Point_3& p) const
|
operator()(Return_base_tag, const Line_3& l, const Point_3& p) const
|
||||||
{ return Rep(l, p); }
|
{ return Rep(l, p); }
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,9 @@ public:
|
||||||
Plane_3(const Point_3& p, const Vector_3& v)
|
Plane_3(const Point_3& p, const Vector_3& v)
|
||||||
: Rep(typename R::Construct_plane_3()(Return_base_tag(), p, 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)
|
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)) {}
|
: Rep(typename R::Construct_plane_3()(Return_base_tag(), a, b, c, d)) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ Sphere_segment_rep(const Point& p1, const Point& p2,
|
||||||
CGAL_warning(p1 != p2.antipode());
|
CGAL_warning(p1 != p2.antipode());
|
||||||
CGAL_assertion(p1 != p2.antipode());
|
CGAL_assertion(p1 != p2.antipode());
|
||||||
if ( p1 == p2 ) {
|
if ( p1 == p2 ) {
|
||||||
Plane_3 h(Point_3(CGAL::ORIGIN),(p1-CGAL::ORIGIN));
|
Plane_3 h(CGAL::ORIGIN, (p1-CGAL::ORIGIN));
|
||||||
c_ = Sphere_circle<R_>(Plane_3(Point_3(CGAL::ORIGIN),h.base1()));
|
c_ = Sphere_circle<R_>(Plane_3(Point_3(CGAL::ORIGIN),h.base1()));
|
||||||
}
|
}
|
||||||
if (!shorter_arc) c_ = c_.opposite();
|
if (!shorter_arc) c_ = c_.opposite();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue