Do the same for the weight

This commit is contained in:
Andreas Fabri 2018-06-08 14:00:12 +01:00
parent 73ed26ba75
commit c844a0b788
2 changed files with 9 additions and 14 deletions

View File

@ -320,10 +320,11 @@ public:
// typedef void Compute_z_3; // to detect where .z() is called
// typedef void Construct_point_3; // to detect where the ctor is called
/*
struct Compute_weight_2 : public BaseClass::Compute_weight_2
{
typedef typename Kernel_::FT FT;
typedef typename Kernel_::Point_2 Point_2;
typedef typename Kernel_::Weighted_point_2 Weighted_point_2;
FT operator()(const Weighted_point_2& p) const
@ -339,17 +340,16 @@ public:
FT
> LR;
LR * lr = dynamic_cast<LR*>(p.ptr());
if(lr){
std::cout << "return l2" << std::endl;
return lr->l2;
}
std::cout << "call base class" << std::endl;
return BaseClass().compute_weight_2_object()(p);
}
};
*/
struct Construct_point_2 : public BaseClass::Construct_point_2
{
@ -400,17 +400,14 @@ public:
LR * lr = dynamic_cast<LR*>(p.ptr());
if(lr){
//std::cout << "construct point first dynamic cast return l2" << std::endl;
return lr->l1;
} else {
LRint* lrint = dynamic_cast<LRint*>(p.ptr());
if(lrint){
//std::cout << "construct point second dynamic cast return l2" << std::endl;
return lrint->l1;
}
}
//std::cout << "construct point call base class" << std::endl;
return BaseClass().construct_point_2_object()(p);
}
@ -489,12 +486,12 @@ public:
return Construct_point_3();
}
/*
Compute_weight_2 compute_weight_2_object() const
{
return Compute_weight_2();
}
*/
Assign_2
assign_2_object() const

View File

@ -67,17 +67,15 @@ bool _test_cls_weighted_point_2(const R& )
// accessors
CGAL::Point_2<R> p1;
// p1 = wp1.point();
p1 = wp1.point();
p1 = wp2.point();
assert(p1 == p0);
std::cout << "\nA"<< std::endl;
p1 = wp3.point();
FT w = wp3.weight();
assert(w == iw);
std::cout << "\nB"<< std::endl;
w = wp7.weight();
// no need to test the other operations as they use Point_2 operations (which