remove an obsolete method : nearest_intersection_to_right

This commit is contained in:
Julien Hazebrouck 2005-08-24 12:33:02 +00:00
parent f50d57925c
commit 3bbdcd43b4
5 changed files with 0 additions and 134 deletions

View File

@ -134,10 +134,6 @@ struct Curved_kernel
// Construct_min_vertex_2 and Construct_max_vertex_2 should be added
// to be removed
typedef CircularFunctors::Nearest_intersection_to_right_2<Self>
Nearest_intersection_to_right_2;
Get_equation
get_equation_object() const
{ return Get_equation(); }
@ -186,9 +182,6 @@ struct Curved_kernel
construct_intersections_2_object() const
{ return Construct_intersections_2(); }
Nearest_intersection_to_right_2
nearest_intersection_to_right_2_object() const
{ return Nearest_intersection_to_right_2(); }
Split_2
split_2_object() const

View File

@ -328,22 +328,6 @@ namespace CircularFunctors {
};
template < class CK >
class Nearest_intersection_to_right_2
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_endpoint_2 Circular_arc_endpoint_2;
public:
typedef bool result_type;
result_type
operator()(const Circular_arc_2 &A1, const Circular_arc_2 &A2,
const Circular_arc_endpoint_2 &pt,
Circular_arc_endpoint_2 &p1, Circular_arc_endpoint_2 &p2) const
{ return nearest_intersection_to_right<CK>(A1, A2, pt, p1, p2); }
};
template < class CK >
class Split_2

View File

@ -623,89 +623,6 @@ namespace CircularFunctors {
}
template < class CK >
bool
nearest_intersection_to_right(const typename CK::Circular_arc_2 &a1,
const typename CK::Circular_arc_2 &a2,
const typename CK::Circular_arc_endpoint_2 &pt,
typename CK::Circular_arc_endpoint_2 &p1,
typename CK::Circular_arc_endpoint_2 &p2)
{
typedef typename CK::Circular_arc_endpoint_2 Circular_arc_endpoint_2;
CGAL_kernel_precondition(a1.is_x_monotone());
CGAL_kernel_precondition(a2.is_x_monotone());
// Overlapping curves.
if (a1.supporting_circle() == a2.supporting_circle()) {
// The ranges need to overlap in order for the curves to overlap.
if (compare_x<CK>(a1.left(), a2.right()) > 0 ||
compare_x<CK>(a2.left(), a1.right()) > 0)
return false;
// They both need to be on the same upper/lower part.
if (a1.on_upper_part() != a2.on_upper_part()) {
// But they could share the right vertical tangent point.
if (a1.right() == a2.right() &&
compare_x<CK>(pt, a1.right()) < 0) {
p1 = p2 = a1.right();
return true;
}
// Or they could share the left vertical tangent point.
if (a1.left() == a2.left() &&
compare_x<CK>(pt, a1.left()) < 0) {
p1 = p2 = a1.left();
return true;
}
return false;
}
// We know they overlap, determine the extremities of the common subcurve
// TODO : We should use std::max and std::min, but they require less_x_2.
const Circular_arc_endpoint_2 & tmp2 = compare_x<CK>(a1.right(), a2.right())
< 0 ? a1.right() : a2.right();
// Now we need to compare that with pt.
if (compare_x<CK>(pt, tmp2) != SMALLER)
return false;
p2 = tmp2;
const Circular_arc_endpoint_2 & tmp1 =
compare_x<CK>(a1.left(), a2.left()) > 0 ? a1.left() : a2.left();
if (compare_x<CK>(pt, tmp1) != SMALLER) {
p1 = pt;
return true;
}
p1 = tmp1;
return true;
}
// We need to check that the supporting circles
// do intersect before going further.
if (! do_intersect(a1.supporting_circle(),
a2.supporting_circle())) {
return false;
}
// Get the two intersection points of the supporting circles.
Circular_arc_endpoint_2 left (a1.supporting_circle(), a2.supporting_circle(), true);
Circular_arc_endpoint_2 right(a1.supporting_circle(), a2.supporting_circle(), false);
// We also need to check that these intersection points are on the arc.
if (has_on<CK>(a1, left) &&
has_on<CK>(a2, left) &&
compare_xy<CK>(left, pt) > 0) {
p1 = p2 = left;
return true;
}
if (has_on<CK>(a1, right) &&
has_on<CK>(a2, right) &&
compare_xy<CK>(right, pt) > 0) {
p1 = p2 = right;
return true;
}
// no intersection.
return false;
}
template < class CK >
bool

View File

@ -49,10 +49,6 @@ template <class CK>
// Construct_min_vertex_2 and Construct_max_vertex_2 should be added
// to be removed
typedef CGALi::Nearest_intersection_to_right_2<Self>
Nearest_intersection_to_right_2;
@ -105,9 +101,6 @@ template <class CK>
construct_intersections_2_object() const
{ return Construct_intersections_2(); }
Nearest_intersection_to_right_2
nearest_intersection_to_right_2_object() const
{ return Nearest_intersection_to_right_2(); }
Split_2
split_2_object() const

View File

@ -345,27 +345,6 @@ class Do_overlap_2
};
template < class HK >
class Nearest_intersection_to_right_2
{
typedef typename HK::Curved_kernel CK;
typedef typename HK::Circular_arc_2 Circular_arc_2;
typedef typename HK::Circular_arc_endpoint_2 Circular_arc_endpoint_2;
public:
typedef bool result_type;
result_type
operator()(const Circular_arc_2 &A1, const Circular_arc_2 &A2,
const Circular_arc_endpoint_2 &pt,
Circular_arc_endpoint_2 &p1, Circular_arc_endpoint_2 &p2) const
{ return CK().nearest_intersection_to_right_2_object()(A1.arc(), A2.arc(), pt, p1, p2); }
};
template < class HK >
class Split_2
{