mirror of https://github.com/CGAL/cgal
add constructions for the intersection point of a plane by a line and of 2 lines
this is undocumented and allow to have a lazy node for this construction
This commit is contained in:
parent
0530b49686
commit
cba8456715
|
|
@ -1104,6 +1104,31 @@ namespace CommonKernelFunctors {
|
|||
{ return this->operator()(Return_base_tag(), min_hx, min_hy, min_hz, max_hx, max_hy, max_hz); }
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Construct_line_line_intersection_point_3
|
||||
{
|
||||
typedef typename K::Line_3 Line;
|
||||
typedef typename K::Point_3 Point;
|
||||
typename K::Construct_line_3 construct_line;
|
||||
public:
|
||||
typedef Point result_type;
|
||||
|
||||
Point
|
||||
operator()(const Point& l11, const Point& l12,
|
||||
const Point& l21, const Point& l22) const
|
||||
{
|
||||
Line l1 = construct_line(l11, l12);
|
||||
Line l2 = construct_line(l21, l22);
|
||||
|
||||
typename cpp11::result_of<typename K::Intersect_3(Line,Line)>::type
|
||||
res = typename K::Intersect_3()(l1,l2);
|
||||
CGAL_assertion(res!=boost::none);
|
||||
const Point* e_pt = boost::get<Point>(&(*res));
|
||||
CGAL_assertion(e_pt!=NULL);
|
||||
return *e_pt;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Construct_max_vertex_2
|
||||
{
|
||||
|
|
@ -1477,6 +1502,33 @@ namespace CommonKernelFunctors {
|
|||
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Construct_plane_line_intersection_point_3
|
||||
{
|
||||
typedef typename K::Plane_3 Plane;
|
||||
typedef typename K::Line_3 Line;
|
||||
typedef typename K::Point_3 Point;
|
||||
typename K::Construct_plane_3 construct_plane;
|
||||
typename K::Construct_line_3 construct_line;
|
||||
public:
|
||||
typedef Point result_type;
|
||||
|
||||
Point
|
||||
operator()(const Point& p1, const Point& p2, const Point& p3,
|
||||
const Point& l1, const Point& l2) const
|
||||
{
|
||||
Plane plane = construct_plane(p1, p2, p3);
|
||||
Line line = construct_line( l1, l2 );
|
||||
|
||||
typename cpp11::result_of<typename K::Intersect_3(Plane,Line)>::type
|
||||
res = typename K::Intersect_3()(plane,line);
|
||||
CGAL_assertion(res!=boost::none);
|
||||
const Point* e_pt = boost::get<Point>(&(*res));
|
||||
CGAL_assertion(e_pt!=NULL);
|
||||
return *e_pt;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename K>
|
||||
class Construct_point_on_2
|
||||
{
|
||||
|
|
|
|||
|
|
@ -302,6 +302,8 @@ CGAL_Kernel_cons(Construct_line_2,
|
|||
construct_line_2_object)
|
||||
CGAL_Kernel_cons(Construct_line_3,
|
||||
construct_line_3_object)
|
||||
CGAL_Kernel_cons(Construct_line_line_intersection_point_3,
|
||||
construct_line_line_intersection_point_3_object)
|
||||
CGAL_Kernel_cons(Construct_midpoint_2,
|
||||
construct_midpoint_2_object)
|
||||
CGAL_Kernel_cons(Construct_midpoint_3,
|
||||
|
|
@ -370,6 +372,8 @@ CGAL_Kernel_cons(Construct_perpendicular_vector_2,
|
|||
construct_perpendicular_vector_2_object)
|
||||
CGAL_Kernel_cons(Construct_plane_3,
|
||||
construct_plane_3_object)
|
||||
CGAL_Kernel_cons(Construct_plane_line_intersection_point_3,
|
||||
construct_plane_line_intersection_point_3_object)
|
||||
CGAL_Kernel_cons(Construct_point_on_2,
|
||||
construct_point_on_2_object)
|
||||
CGAL_Kernel_cons(Construct_point_on_3,
|
||||
|
|
|
|||
Loading…
Reference in New Issue