Add new constructor to Iso_rectangle_2(Point_2, Point_2, int).

The additional dummy "int" specifies that the 2 points are
the lower-left and upper-right corner.  This is more efficient
when one knows they are already in this configuration.

Same thing for Iso_cuboid_3, and the functors.

Use them in Cartesian_converter and Homogeneous_converter.
This commit is contained in:
Sylvain Pion
2006-08-03 09:40:12 +00:00
parent 64d8c5e77a
commit ea748e53d4
16 changed files with 91 additions and 31 deletions
@@ -2520,6 +2520,14 @@ namespace HomogeneousKernelFunctors {
typedef Iso_rectangle_2 result_type;
typedef Arity_tag< 2 > Arity;
Iso_rectangle_2
operator()(const Point_2& p, const Point_2& q, int) const
{
CGAL_kernel_assertion(p.x()<=q.x());
CGAL_kernel_assertion(p.y()<=q.y());
return Rep(p, q, 0);
}
Iso_rectangle_2
operator()(const Point_2& p, const Point_2& q) const
{
@@ -2530,7 +2538,7 @@ namespace HomogeneousKernelFunctors {
{
if ( px_g_qx && py_g_qy )
{
return Rep(q, p);
return Rep(q, p, 0);
}
else
{
@@ -2538,17 +2546,17 @@ namespace HomogeneousKernelFunctors {
{
return Rep(
Point_2(q.hx()*p.hw(), p.hy()*q.hw(), q.hw()*p.hw() ),
Point_2(p.hx()*q.hw(), q.hy()*p.hw(), q.hw()*p.hw() ));
Point_2(p.hx()*q.hw(), q.hy()*p.hw(), q.hw()*p.hw() ), 0);
}
if ( py_g_qy )
{
return Rep(
Point_2(p.hx()*q.hw(), q.hy()*p.hw(), q.hw()*p.hw() ),
Point_2(q.hx()*p.hw(), p.hy()*q.hw(), q.hw()*p.hw() ));
Point_2(q.hx()*p.hw(), p.hy()*q.hw(), q.hw()*p.hw() ), 0);
}
}
}
return Rep(p, q);
return Rep(p, q, 0);
}
Iso_rectangle_2
@@ -2564,7 +2572,7 @@ namespace HomogeneousKernelFunctors {
left.hw() * bottom.hw()),
Point_2(right.hx() * top.hw(),
top.hy() * right.hw(),
right.hw() * top.hw()));
right.hw() * top.hw()), 0);
}
Iso_rectangle_2
@@ -2574,7 +2582,7 @@ namespace HomogeneousKernelFunctors {
CGAL_kernel_precondition(min_hx <= max_hx);
CGAL_kernel_precondition(min_hy <= max_hy);
return Rep(Point_2(min_hx, min_hy),
Point_2(max_hx, max_hy));
Point_2(max_hx, max_hy), 0);
}
Iso_rectangle_2
@@ -2582,7 +2590,7 @@ namespace HomogeneousKernelFunctors {
const RT& max_hx, const RT& max_hy, const RT& hw) const
{
return Rep(Point_2(min_hx, min_hy, hw),
Point_2(max_hx, max_hy, hw));
Point_2(max_hx, max_hy, hw), 0);
}
};