partial work after Mael's review

This commit is contained in:
Andreas Fabri 2021-09-29 15:14:54 +01:00
parent 1e9cad98a8
commit c8d2761f45
1 changed files with 10 additions and 42 deletions

View File

@ -128,15 +128,14 @@ public:
}
result_type
operator()(const Tetrahedron_3 &t, const Bbox_3& b) const
{
Get_approx<Point_3> get_approx;
double px, py, pz;
{
const Point_3& p = t[0];
for(int i = 0; i < 4; ++i) {
const Point_3& p = t[i];
if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) &&
fit_in_double(get_approx(p).z(), pz) )
{
@ -148,49 +147,18 @@ public:
}
}
{
const Point_3& p = t[1];
if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) &&
fit_in_double(get_approx(p).z(), pz) )
{
if( (px >= b.xmin() && px <= b.xmax()) && (py >= b.ymin() && py <= b.ymax()) && (pz >= b.zmin() && pz <= b.zmax()) ){
return true;
}
}else{
return Base::operator()(t,b);
}
}
{
const Point_3& p = t[2];
if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) &&
fit_in_double(get_approx(p).z(), pz) )
{
if( (px >= b.xmin() && px <= b.xmax()) && (py >= b.ymin() && py <= b.ymax()) && (pz >= b.zmin() && pz <= b.zmax()) ){
return true;
}
}else{
return Base::operator()(t,b);
}
}
{
const Point_3& p = t[3];
if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) &&
fit_in_double(get_approx(p).z(), pz) )
{
if( (px >= b.xmin() && px <= b.xmax()) && (py >= b.ymin() && py <= b.ymax()) && (pz >= b.zmin() && pz <= b.zmax()) ){
return true;
}
}
}
return Base::operator()(t,b);
}
result_type
operator()(const Bbox_3& b, const Tetrahedron_3 &t) const
{
return this->operator()(t, b);
}
result_type
operator()(const Bbox_3& b, const Ray_3 &r) const
{