restored Less_distance_to_point_[23] with default constructors

This commit is contained in:
Susan Hert 2001-07-18 09:49:26 +00:00
parent 5b00a1c107
commit e1daaf83b8
22 changed files with 138 additions and 29 deletions

View File

@ -1,3 +1,6 @@
2.32 (?? July 2001)
- restored Less_distance_to_point_[23] with default constructors
2.31 (12 July 2001)
- Kernel_traits<>
- Kernel::FT, Kernel::RT

View File

@ -183,6 +183,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}:
\ccGlue
\ccNestedType{Compare_angle_with_x_axis_2}{}
\ccGlue
\ccNestedType{Less_distance_to_point_2}{}
\ccGlue
\ccNestedType{Less_signed_distance_to_line_2}{}
\ccGlue
\ccNestedType{Less_rotate_ccw_2}{}
@ -411,6 +413,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}:
\ccGlue
\ccNestedType{Less_signed_distance_to_plane_3}{}
\ccGlue
\ccNestedType{Less_distance_to_point_3}{}
\ccGlue
\ccNestedType{Compare_distance_3}{}
\ccGlue
\ccNestedType{Collinear_3}{}
@ -601,6 +605,8 @@ an \ccc{_object} suffix.
\ccGlue
\ccMemberFunction{Kernel::Compare_distance_2 compare_distance_2_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Less_distance_to_point_2 less_distance_to_point_2_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Compare_angle_with_x_axis_2 compare_angle_with_x_axis_2_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Less_signed_distance_to_line_2 less_signed_distance_to_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{}
@ -797,6 +803,8 @@ an \ccc{_object} suffix.
\ccGlue
\ccMemberFunction{Kernel::Compare_distance_3 compare_distance_3_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Less_distance_to_point_3 less_distance_to_point_3_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Collinear_3 collinear_3_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Coplanar_3 coplanar_3_object() const ;}{}

View File

@ -0,0 +1,12 @@
\begin{ccRefFunctionObjectConcept}{Kernel::Less_distance_to_point_2}
A model for this must provide:
\ccCreationVariable{fo}
\ccMemberFunction{bool operator()(const Kernel::Point_2&p,
const Kernel::Point_2&q,
const Kernel::Point_2&r);}
{returns true iff the distance of $q$ to $p$ is
smaller than the distance of $r$ to $p$.}
\end{ccRefFunctionObjectConcept}

View File

@ -0,0 +1,12 @@
\begin{ccRefFunctionObjectConcept}{Kernel::Less_distance_to_point_3}
A model for this must provide:
\ccCreationVariable{fo}
\ccMemberFunction{bool operator()(const Kernel::Point_3&p,
const Kernel::Point_3&q,
const Kernel::Point_3&r);}
{returns true iff the distance of $q$ to $p$ is
smaller than the distance of $r$ to $p$.}
\end{ccRefFunctionObjectConcept}

View File

@ -477,6 +477,10 @@
\KernelRefLayout
\input{Ref/Kernel_Leftturn_2.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_distance_to_point_2.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_distance_to_point_3.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_rotate_ccw_2.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_signed_distance_to_line_2.tex} %ck

View File

@ -1,3 +1,6 @@
3.52 (18 July 2001)
- changed Less_distance_to_point_[23] to use default construction
3.51 (12 July 2001)
- Add Kernel_traits<>.

View File

@ -239,6 +239,9 @@ CGAL_Kernel_pred(CGALi::Compare_x_at_y,
CGAL_Kernel_pred(CGALi::Compare_distance<Point_2>,
Compare_distance_2,
compare_distance_2_object)
CGAL_Kernel_pred(CGAL ::p_Less_dist_to_point<Point_2>,
Less_distance_to_point_2,
less_distance_to_point_2_object)
CGAL_Kernel_pred(CGALi::Compare_angle_with_x_axis<Direction_2>,
Compare_angle_with_x_axis_2,
compare_angle_with_x_axis_2_object)
@ -533,6 +536,9 @@ CGAL_Kernel_pred(CGALi::Compare_xyz,
CGAL_Kernel_pred(CGALi::Compare_distance<Point_3>,
Compare_distance_3,
compare_distance_3_object)
CGAL_Kernel_pred(CGAL ::p_Less_dist_to_point<Point_3>,
Less_distance_to_point_3,
less_distance_to_point_3_object)
CGAL_Kernel_pred2(CGALi::Less_signed_distance_to_plane<Plane_3, Point_3>,
Less_signed_distance_to_plane_3,
less_signed_distance_to_plane_3_object)

View File

@ -33,11 +33,6 @@
// The following are like constructive predicate, and are deprecated !
#ifndef CGAL_NO_DEPRECATED_CODE
typedef CGAL ::p_Less_dist_to_point<Point_2> Less_distance_to_point_2;
Less_distance_to_point_2
less_distance_to_point_2_object(const Point_2& p) const // XXX
{ return Less_distance_to_point_2(p); }
typedef CGAL ::p_Less_dist_to_line_2p<Point_2> Less_signed_distance_to_line_2;
Less_signed_distance_to_line_2
less_signed_distance_to_line_2_object(const Point_2& p,
@ -54,10 +49,5 @@ Left_of_line_2
left_of_line_2_object(const Point_2& p, const Point_2& q) const // XXX XXX
{ return Left_of_line_2(p,q); }
typedef CGAL ::p_Less_dist_to_point<Point_3> Less_distance_to_point_3;
Less_distance_to_point_3
less_distance_to_point_3_object(const Point_3& p) const // XXX
{ return Less_distance_to_point_3(p); }
#endif // CGAL_NO_DEPRECATED_CODE

View File

@ -32,6 +32,8 @@ class p_Left_of_line_2p
{
public:
typedef bool result_type;
typedef Arity_tag< 1 > Arity;
p_Left_of_line_2p(const Point& a, const Point& b)
: p_a(a), p_b(b)
@ -50,6 +52,7 @@ class p_Right_of_line_2p
{
public:
typedef bool result_type;
typedef Arity_tag< 1 > Arity;
p_Right_of_line_2p(const Point& a, const Point& b)
: p_a(a), p_b(b)
@ -68,6 +71,7 @@ class p_Left_of_line_2p_safer
{
public:
typedef bool result_type;
typedef Arity_tag< 1 > Arity;
p_Left_of_line_2p_safer(const Point& a, const Point& b)
: p_a(a), p_b(b)
@ -89,6 +93,7 @@ template <class Point>
struct p_Less_xy
{
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
bool operator()( const Point& p1, const Point& p2) const
{ return lexicographically_xy_smaller( p1, p2); }
@ -98,6 +103,7 @@ template <class Point>
struct p_Greater_xy
{
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
bool operator()( const Point& p1, const Point& p2) const
{ return lexicographically_xy_larger( p1, p2); }
@ -107,6 +113,7 @@ template <class Point>
struct p_Less_yx
{
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
bool operator()( const Point& p1, const Point& p2) const
{ return lexicographically_yx_smaller( p1, p2); }
@ -116,6 +123,7 @@ template <class Point>
struct p_Greater_yx
{
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
bool operator()( const Point& p1, const Point& p2) const
{ return lexicographically_yx_larger( p1, p2); }
@ -126,6 +134,7 @@ class p_Less_dist_to_line_2p
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
p_Less_dist_to_line_2p(const Point& a, const Point& b)
: p_a(a), p_b(b)
@ -159,6 +168,7 @@ class p_Less_negative_dist_to_line_2p
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
p_Less_negative_dist_to_line_2p(const Point& a, const Point& b)
: p_a(a), p_b(b)
@ -192,6 +202,7 @@ class p_Less_rotate_ccw
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
p_Less_rotate_ccw(const Point& p) : rot_point(p)
{}
@ -229,6 +240,7 @@ class p_Less_rotate_ccw_safer
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
p_Less_rotate_ccw_safer(const Point& p) : rot_point(p)
{}
@ -266,6 +278,7 @@ class p_Less_rotate_ccw_E
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
p_Less_rotate_ccw_E(const Point& p) : rot_point(p)
{}
@ -300,6 +313,7 @@ class r_Right_of_line
{
public:
typedef bool result_type;
typedef Arity_tag< 1 > Arity;
typedef typename R::Point_2 Point;
typedef typename R::Line_2 Line;
@ -322,6 +336,7 @@ class r_Left_of_line
{
public:
typedef bool result_type;
typedef Arity_tag< 1 > Arity;
typedef typename R::Point_2 Point;
typedef typename R::Line_2 Line;
@ -338,6 +353,7 @@ private:
bool is_deg;
};
/*
template <class Point>
class p_Less_dist_to_point
{
@ -352,12 +368,28 @@ class p_Less_dist_to_point
private:
Point _p;
};
*/
template <class Point>
class p_Less_dist_to_point
{
public:
typedef bool result_type;
typedef Arity_tag< 3 > Arity;
p_Less_dist_to_point( )
{}
bool operator()( const Point& p0, const Point& p1, const Point& p2) const
{ return has_smaller_dist_to_point(p0, p1, p2); }
};
template <class R>
class r_Less_negative_dist_to_line
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
typedef typename R::Point_2 Point;
typedef typename R::Line_2 Line;
@ -392,6 +424,7 @@ class r_Less_dist_to_line
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
typedef typename R::Point_2 Point;
typedef typename R::Line_2 Line;
@ -425,6 +458,7 @@ class r_Less_in_direction
{
public:
typedef bool result_type;
typedef Arity_tag< 2 > Arity;
typedef typename R::RT RT;
typedef typename R::Direction_2 Direction;
@ -460,6 +494,7 @@ template <class Point>
struct p_Leftturn
{
typedef bool result_type;
typedef Arity_tag< 3 > Arity;
bool operator()(const Point& p, const Point& q, const Point& r) const
{ return leftturn(p,q,r); }
@ -469,6 +504,7 @@ template <class Point>
struct p_Rightturn
{
typedef bool result_type;
typedef Arity_tag< 3 > Arity;
bool operator()(const Point& p, const Point& q, const Point& r) const
{ return rightturn(p,q,r); }

View File

@ -1,3 +1,6 @@
3.31 (18 July 2001)
- restored Less_distance_to_point_[23] with default constructors
3.30 (10 July 2001)
- additions of function objects following discussion of kernel traits
- New predicate : coplanar_orientation(3 points).

View File

@ -174,15 +174,11 @@ _test_fctobj_point_line_2(const Point&, const Line& )
std::cout << '.';
CGAL::Less_distance_to_point_2< Point> has_smaller_dist_to_point_p4(p4);
assert( has_smaller_dist_to_point_p4(p9,p1) );
assert( has_smaller_dist_to_point_p4(p6,p5) );
CGAL::Less_distance_to_point_2< Point> has_smaller_dist_to_point_p9(p9);
assert( has_smaller_dist_to_point_p9(p9,p6) );
CGAL::Less_distance_to_point_2< Point> has_smaller_dist_to_point_p8(p8);
assert(!has_smaller_dist_to_point_p8(p3,p3) );
CGAL::Less_distance_to_point_2< Point> has_smaller_dist_to_point();
assert( has_smaller_dist_to_point(p4,p9,p1) );
assert( has_smaller_dist_to_point(p4,p6,p5) );
assert( has_smaller_dist_to_point(p9,p9,p6) );
assert(!has_smaller_dist_to_point(p8,p3,p3) );
std::cout << '.';

View File

@ -426,6 +426,10 @@ test_new_2(const R& rep)
Comparison_result tmp34cc = compare_x_at_y(l2,l3,l4);
Comparison_result tmp34dd = compare_x_at_y(l2,l3,l4,l5);
typename R::Less_distance_to_point_2 less_distance_to_point
= rep.less_distance_to_point_2_object();
bool tmp35 = less_distance_to_point(p2, p3,p4);
typename R::Compare_distance_2 compare_dist
= rep.compare_distance_2_object();
Comparison_result tmp34ab = compare_dist(p1,p2,p3);
@ -577,7 +581,7 @@ test_new_2(const R& rep)
use(tmp52b); use(tmp52a); use(tmp51b); use(tmp51a); use(tmp50b); use(tmp50a);
use(tmp49b); use(tmp49a); use(tmp48b); use(tmp48a); use(tmp47); use(tmp46);
use(tmp45); use(tmp44); use(tmp43); use(tmp42); use(tmp41); use(tmp40);
use(tmp39); use(tmp38); use(tmp37); use(tmp36); use(tmp34d);
use(tmp39); use(tmp38); use(tmp37); use(tmp36); use(tmp35); use(tmp34d);
use(tmp34c); use(tmp34b); use(tmp34a); use(tmp32d); use(tmp32c); use(tmp32b);
use(tmp32a); use(tmp31d); use(tmp31c); use(tmp31b); use(tmp31a); use(tmp30);
use(tmp26); use(tmp25); use(tmp24);

View File

@ -448,6 +448,10 @@ test_new_3(const R& rep)
= rep.compare_xyz_3_object();
Comparison_result tmp27 = compare_xyz(p2,p3);
typename R::Less_distance_to_point_3 less_distance_to_point
= rep.less_distance_to_point_3_object();
bool tmp28 = less_distance_to_point(p4,p2,p3);
typename R::Less_signed_distance_to_plane_3 less_signed_distance_to_plane
= rep.less_signed_distance_to_plane_3_object();
bool tmp28a = less_signed_distance_to_plane(tmp8,p2,p3);
@ -585,7 +589,7 @@ test_new_3(const R& rep)
use(tmp12d); use(tmp12e); use(tmp12f); use(tmp12g); use(tmp12l);
use(tmp12h); use(tmp12i); use(tmp12j); use(tmp12k); use(tmp36c); use(tmp36d);
use(tmp16); use(tmp18); use(tmp19); use(tmp20); use(tmp21);
use(tmp26); use(tmp30a); use(tmp30b); use(tmp34ab);
use(tmp26); use(tmp28); use(tmp30a); use(tmp30b); use(tmp34ab);
use(tmp39a);
return true;

View File

@ -15,6 +15,7 @@ CXXFLAGS = \
$(TESTSUITE_CXXFLAGS) \
$(EXTRA_FLAGS) \
-I../Kernel/include \
-pedantic \
$(CGAL_CXXFLAGS) \
$(DEBUG_OPT)

View File

@ -15,6 +15,7 @@ CXXFLAGS = \
$(TESTSUITE_CXXFLAGS) \
$(EXTRA_FLAGS) \
-I../Kernel/include \
-pedantic \
$(CGAL_CXXFLAGS) \
$(DEBUG_OPT)

View File

@ -1,3 +1,6 @@
3.18 (?? July 2001)
- changed Less_distsance_to_point_2 to use default construction
3.17 (27 June 2001)
- Put the IO operators back in, they are needed by Borland.

View File

@ -231,14 +231,11 @@ class Compare_distance_to_point_2
template <class Point>
class Less_distance_to_point_2
: public CGAL_STD::binary_function< Point, Point, bool>
{
public:
Less_distance_to_point_2( const Point& p) : _p(p) {}
bool operator()( const Point& q, const Point& r)
{ return has_smaller_dist_to_point( _p,q,r); }
private:
Point _p;
Less_distance_to_point_2( ) {}
bool operator()( const Point& p, const Point& q, const Point& r)
{ return has_smaller_dist_to_point(p,q,r); }
};
template <class Point, class Line>

View File

@ -183,6 +183,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}:
\ccGlue
\ccNestedType{Compare_angle_with_x_axis_2}{}
\ccGlue
\ccNestedType{Less_distance_to_point_2}{}
\ccGlue
\ccNestedType{Less_signed_distance_to_line_2}{}
\ccGlue
\ccNestedType{Less_rotate_ccw_2}{}
@ -411,6 +413,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}:
\ccGlue
\ccNestedType{Less_signed_distance_to_plane_3}{}
\ccGlue
\ccNestedType{Less_distance_to_point_3}{}
\ccGlue
\ccNestedType{Compare_distance_3}{}
\ccGlue
\ccNestedType{Collinear_3}{}
@ -601,6 +605,8 @@ an \ccc{_object} suffix.
\ccGlue
\ccMemberFunction{Kernel::Compare_distance_2 compare_distance_2_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Less_distance_to_point_2 less_distance_to_point_2_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Compare_angle_with_x_axis_2 compare_angle_with_x_axis_2_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Less_signed_distance_to_line_2 less_signed_distance_to_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{}
@ -797,6 +803,8 @@ an \ccc{_object} suffix.
\ccGlue
\ccMemberFunction{Kernel::Compare_distance_3 compare_distance_3_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Less_distance_to_point_3 less_distance_to_point_3_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Collinear_3 collinear_3_object() const ;}{}
\ccGlue
\ccMemberFunction{Kernel::Coplanar_3 coplanar_3_object() const ;}{}

View File

@ -477,6 +477,10 @@
\KernelRefLayout
\input{Ref/Kernel_Leftturn_2.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_distance_to_point_2.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_distance_to_point_3.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_rotate_ccw_2.tex} %ck
\KernelRefLayout
\input{Ref/Kernel_Less_signed_distance_to_line_2.tex} %ck

View File

@ -239,6 +239,9 @@ CGAL_Kernel_pred(CGALi::Compare_x_at_y,
CGAL_Kernel_pred(CGALi::Compare_distance<Point_2>,
Compare_distance_2,
compare_distance_2_object)
CGAL_Kernel_pred(CGAL ::p_Less_dist_to_point<Point_2>,
Less_distance_to_point_2,
less_distance_to_point_2_object)
CGAL_Kernel_pred(CGALi::Compare_angle_with_x_axis<Direction_2>,
Compare_angle_with_x_axis_2,
compare_angle_with_x_axis_2_object)
@ -533,6 +536,9 @@ CGAL_Kernel_pred(CGALi::Compare_xyz,
CGAL_Kernel_pred(CGALi::Compare_distance<Point_3>,
Compare_distance_3,
compare_distance_3_object)
CGAL_Kernel_pred(CGAL ::p_Less_dist_to_point<Point_3>,
Less_distance_to_point_3,
less_distance_to_point_3_object)
CGAL_Kernel_pred2(CGALi::Less_signed_distance_to_plane<Plane_3, Point_3>,
Less_signed_distance_to_plane_3,
less_signed_distance_to_plane_3_object)

View File

@ -426,6 +426,10 @@ test_new_2(const R& rep)
Comparison_result tmp34cc = compare_x_at_y(l2,l3,l4);
Comparison_result tmp34dd = compare_x_at_y(l2,l3,l4,l5);
typename R::Less_distance_to_point_2 less_distance_to_point
= rep.less_distance_to_point_2_object();
bool tmp35 = less_distance_to_point(p2, p3,p4);
typename R::Compare_distance_2 compare_dist
= rep.compare_distance_2_object();
Comparison_result tmp34ab = compare_dist(p1,p2,p3);
@ -577,7 +581,7 @@ test_new_2(const R& rep)
use(tmp52b); use(tmp52a); use(tmp51b); use(tmp51a); use(tmp50b); use(tmp50a);
use(tmp49b); use(tmp49a); use(tmp48b); use(tmp48a); use(tmp47); use(tmp46);
use(tmp45); use(tmp44); use(tmp43); use(tmp42); use(tmp41); use(tmp40);
use(tmp39); use(tmp38); use(tmp37); use(tmp36); use(tmp34d);
use(tmp39); use(tmp38); use(tmp37); use(tmp36); use(tmp35); use(tmp34d);
use(tmp34c); use(tmp34b); use(tmp34a); use(tmp32d); use(tmp32c); use(tmp32b);
use(tmp32a); use(tmp31d); use(tmp31c); use(tmp31b); use(tmp31a); use(tmp30);
use(tmp26); use(tmp25); use(tmp24);

View File

@ -448,6 +448,10 @@ test_new_3(const R& rep)
= rep.compare_xyz_3_object();
Comparison_result tmp27 = compare_xyz(p2,p3);
typename R::Less_distance_to_point_3 less_distance_to_point
= rep.less_distance_to_point_3_object();
bool tmp28 = less_distance_to_point(p4,p2,p3);
typename R::Less_signed_distance_to_plane_3 less_signed_distance_to_plane
= rep.less_signed_distance_to_plane_3_object();
bool tmp28a = less_signed_distance_to_plane(tmp8,p2,p3);
@ -585,7 +589,7 @@ test_new_3(const R& rep)
use(tmp12d); use(tmp12e); use(tmp12f); use(tmp12g); use(tmp12l);
use(tmp12h); use(tmp12i); use(tmp12j); use(tmp12k); use(tmp36c); use(tmp36d);
use(tmp16); use(tmp18); use(tmp19); use(tmp20); use(tmp21);
use(tmp26); use(tmp30a); use(tmp30b); use(tmp34ab);
use(tmp26); use(tmp28); use(tmp30a); use(tmp30b); use(tmp34ab);
use(tmp39a);
return true;