Remove casts to Oriented_side.

They are useless since we merged the various enum types.
This commit is contained in:
Sylvain Pion 2008-04-09 12:35:10 +00:00
parent b740e90de0
commit b0f2c77fdc
19 changed files with 64 additions and 64 deletions

View File

@ -615,7 +615,7 @@ protected:
if (csp== EQUAL) continue;
Comparison_result csl= compare_c(s, pt[i], Coordinate_index(i));
if (csl== CGAL::EQUAL) return ON_ORIENTED_BOUNDARY;
else if (csl != csp) return Oriented_side(-os);
else if (csl != csp) return -os;
else return os;
}
CGAL_error();

View File

@ -458,11 +458,10 @@ side_of_oriented_circleC2(const FT &px, const FT &py,
const FT &rx, const FT &ry,
const FT &tx, const FT &ty)
{
// Oriented_side(
// sign_of_determinant(px, py, px*px + py*py, 1,
// qx, qy, qx*qx + qy*qy, 1,
// rx, ry, rx*rx + ry*ry, 1,
// tx, ty, tx*tx + ty*ty, 1));
// tx, ty, tx*tx + ty*ty, 1);
// We first translate so that p is the new origin.
FT qpx = qx-px;
FT qpy = qy-py;
@ -475,7 +474,7 @@ side_of_oriented_circleC2(const FT &px, const FT &py,
// rpx, rpy, square(rpx) + square(rpy),
// tpx, tpy, square(tpx) + square(tpy)));
return sign_of_determinant<FT>( qpx*tpy - qpy*tpx, tpx*(tx-qx) + tpy*(ty-qy),
qpx*rpy - qpy*rpx, rpx*(rx-qx) + rpy*(ry-qy));
qpx*rpy - qpy*rpx, rpx*(rx-qx) + rpy*(ry-qy));
}
template < class FT >

View File

@ -4377,7 +4377,7 @@ namespace HomogeneousKernelFunctors {
ot = orientation(t.vertex(0), t.vertex(1), t.vertex(2));
if (o1 == ot && o2 == ot && o3 == ot) // ot cannot be COLLINEAR
return Oriented_side(ot);
return ot;
return
(o1 == COLLINEAR
&& collinear_are_ordered_along_line(t.vertex(0), p, t.vertex(1))) ||
@ -4386,7 +4386,7 @@ namespace HomogeneousKernelFunctors {
(o3 == COLLINEAR
&& collinear_are_ordered_along_line(t.vertex(2), p, t.vertex(3)))
? ON_ORIENTED_BOUNDARY
: Oriented_side(-ot);
: -ot;
}
};

View File

@ -48,7 +48,7 @@ side_of_plane_centered_sphere_translateC3(
rx,ry,rz);
CGAL_assertion(den != ZERO);
return Oriented_side(den * num);
return den * num;
}
template < class RT>
@ -114,7 +114,7 @@ side_of_plane_centered_sphere_translateC3(
qx,qy,qz);
}
CGAL_assertion(den != ZERO);
return Oriented_side(den * num);
return den * num;
}
template < class RT>

View File

@ -60,7 +60,7 @@ other.
\ccConstructor{template <class ForwardIterator>
Hyperplane_d<Kernel>(ForwardIterator first, ForwardIterator last,
Point_d<Kernel> o, Oriented_side side = Oriented_side(0))}{constructs
Point_d<Kernel> o, Oriented_side side = ON_ORIENTED_BOUNDARY)}{constructs
some hyperplane that passes through the points in \ccc{set
[first,last)}. If \ccc{side} is \ccc{ON_POSITIVE_SIDE} or
\ccc{ON_NEGATIVE_SIDE} then \ccc{o} is on that side of the

View File

@ -113,7 +113,7 @@ construct_from_points(ForwardIterator first, ForwardIterator last,
template <class ForwardIterator>
HyperplaneCd(ForwardIterator first, ForwardIterator last,
const PointCd<FT,LA>& o,
Oriented_side side = Oriented_side(0))
Oriented_side side = ON_ORIENTED_BOUNDARY)
: Base( Tuple(o.dimension()+1) )
{ construct_from_points(first,last,o,side); }
@ -183,7 +183,7 @@ Oriented_side oriented_side(const PointCd<FT,LA>& p) const
{
CGAL_assertion_msg(dimension()==p.dimension(),
"HyperplaneCd::oriented_side: dimensions do not agree.");
return Oriented_side(CGAL_NTS sign(value_at(p)));
return CGAL_NTS sign(value_at(p));
}
bool has_on(const PointCd<FT,LA>& p) const

View File

@ -180,7 +180,7 @@ construct_from_points(ForwardIterator first, ForwardIterator last,
template <class ForwardIterator>
HyperplaneHd(ForwardIterator first, ForwardIterator last,
const PointHd<RT,LA>& o,
Oriented_side side = Oriented_side(0))
Oriented_side side = ON_ORIENTED_BOUNDARY)
/*{\Mcreate constructs some hyperplane that passes through the points
in |set [first,last)|. If |side| is |ON_POSITIVE_SIDE| or
|ON_NEGATIVE_SIDE| then |o| is on that side of the constructed
@ -279,7 +279,7 @@ Oriented_side oriented_side(const PointHd<RT,LA>& p) const
{
CGAL_assertion_msg((dimension()==p.dimension()),
"HyperplaneHd::oriented_side: dimensions do not agree.");
return Oriented_side(CGAL_NTS sign(value_at(p)));
return CGAL_NTS sign(value_at(p));
}
bool has_on(const PointHd<RT,LA>& p) const

View File

@ -20,6 +20,7 @@
//
//
// Author(s) : Michael Seel
#ifndef CGAL_HYPERPLANE_D_H
#define CGAL_HYPERPLANE_D_H
@ -27,7 +28,8 @@ CGAL_BEGIN_NAMESPACE
template <class pR>
class Hyperplane_d : public pR::Hyperplane_d_base
{ public:
{
public:
typedef typename pR::Hyperplane_d_base Base;
typedef Hyperplane_d<pR> Self;
typedef pR R;
@ -60,8 +62,8 @@ class Hyperplane_d : public pR::Hyperplane_d_base
template <class ForwardIterator>
Hyperplane_d(ForwardIterator first, ForwardIterator last,
const Point_d<R>& o, Oriented_side side = Oriented_side(0)) :
Base(first,last,o,side) {}
const Point_d<R>& o, Oriented_side side = ON_ORIENTED_BOUNDARY)
: Base(first,last,o,side) {}
Vector_d<R> orthogonal_vector() const
{ return Base::orthogonal_vector(); }
@ -75,4 +77,5 @@ class Hyperplane_d : public pR::Hyperplane_d_base
};
CGAL_END_NAMESPACE
#endif //CGAL_HYPERPLANE_D_H

View File

@ -232,7 +232,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last,
M(d,j + 1) = hj; Sum += hj*hj;
}
M(d,d) = Sum;
return Oriented_side( - LA::sign_of_determinant(M) );
return - LA::sign_of_determinant(M);
}
};

View File

@ -239,7 +239,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last,
Sum += hj*hj;
}
M(d,d) = Sum;
return Oriented_side( - LA::sign_of_determinant(M) );
return - LA::sign_of_determinant(M);
}
};

View File

@ -307,7 +307,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last,
M(d,j + 1) = hj; Sum += hj*hj;
}
M(d,d) = Sum;
return Oriented_side( - LA::sign_of_determinant(M) );
return - LA::sign_of_determinant(M);
}
};

View File

@ -311,7 +311,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last,
Sum += hj*hj;
}
M(d,d) = Sum;
return Oriented_side( - LA::sign_of_determinant(M) );
return - LA::sign_of_determinant(M);
}
};

View File

@ -1377,13 +1377,13 @@ side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2,
// and positively oriented
Orientation o;
if (points[i] == &p3 && (o = orientation(p0,p1,p2,p)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p2 && (o = orientation(p0,p1,p,p3)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p1 && (o = orientation(p0,p,p2,p3)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p0 && (o = orientation(p,p1,p2,p3)) != COPLANAR )
return Oriented_side(o);
return o;
}
CGAL_triangulation_assertion(false);

View File

@ -636,7 +636,7 @@ power_test(const Face_handle &f, const Weighted_point &p) const
return power_test(f->vertex(ccw(i))->point(),
f->vertex( cw(i))->point(),p);
return Oriented_side(o);
return o;
}
template < class Gt, class Tds >

View File

@ -76,10 +76,10 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const RT &pwt,
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw;
return Oriented_side(sign_of_determinant(dphx, dphy, dpz, dphw,
dqhx, dqhy, dqz, dqhw,
drhx, drhy, drz, drhw,
dthx, dthy, dtz, dthw));
return sign_of_determinant(dphx, dphy, dpz, dphw,
dqhx, dqhy, dqz, dqhw,
drhx, drhy, drz, drhw,
dthx, dthy, dtz, dthw);
}
@ -115,10 +115,9 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const RT &pwt,
RT dthw = CGAL_NTS square(thw);
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw;
return Oriented_side(CGAL_NTS compare(pa, qa) *
sign_of_determinant(pa, dpz, dphw,
qa, dqz, dqhw,
ta, dtz, dthw));
return CGAL_NTS compare(pa, qa) * sign_of_determinant(pa, dpz, dphw,
qa, dqz, dqhw,
ta, dtz, dthw);
}
CGAL_END_NAMESPACE

View File

@ -1056,13 +1056,13 @@ side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2,
// and positively oriented
Orientation o;
if (points[i] == &p3 && (o = orientation(p0,p1,p2,p)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p2 && (o = orientation(p0,p1,p,p3)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p1 && (o = orientation(p0,p,p2,p3)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p0 && (o = orientation(p,p1,p2,p3)) != COPLANAR )
return Oriented_side(o);
return o;
}
CGAL_triangulation_assertion(false);

View File

@ -910,13 +910,13 @@ side_of_oriented_power_sphere(const Weighted_point &p0,
// and positively oriented
Orientation o;
if (points[i] == &p3 && (o = orientation(p0,p1,p2,p)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p2 && (o = orientation(p0,p1,p,p3)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p1 && (o = orientation(p0,p,p2,p3)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p0 && (o = orientation(p,p1,p2,p3)) != COPLANAR )
return Oriented_side(o);
return o;
}
CGAL_triangulation_assertion(false);
@ -1021,11 +1021,11 @@ side_of_oriented_power_circle(const Weighted_point &p0,
// and positively oriented
Orientation o;
if (points[i] == &p2 && (o = coplanar_orientation(p0,p1,p)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p1 && (o = coplanar_orientation(p0,p,p2)) != COPLANAR )
return Oriented_side(o);
return o;
if (points[i] == &p0 && (o = coplanar_orientation(p,p1,p2)) != COPLANAR )
return Oriented_side(o);
return o;
}
CGAL_triangulation_assertion(false);

View File

@ -57,10 +57,10 @@ power_testC3( const FT &px, const FT &py, const FT &pz, const FT &pwt,
FT dst = CGAL_NTS square(dsx) + CGAL_NTS square(dsy) +
CGAL_NTS square(dsz) - swt + twt;
return Oriented_side( - sign_of_determinant(dpx, dpy, dpz, dpt,
dqx, dqy, dqz, dqt,
drx, dry, drz, drt,
dsx, dsy, dsz, dst));
return - sign_of_determinant(dpx, dpy, dpz, dpt,
dqx, dqy, dqz, dqt,
drx, dry, drz, drt,
dsx, dsy, dsz, dst);
}
@ -94,23 +94,23 @@ power_testC3( const FT &px, const FT &py, const FT &pz, const FT &pwt,
dqx, dqy, dqt,
drx, dry, drt);
if (cmp != ZERO)
return Oriented_side(cmp * sign_of_determinant(px-rx, py-ry,
qx-rx, qy-ry));
return cmp * sign_of_determinant(px-rx, py-ry,
qx-rx, qy-ry);
// Projection on the (xz) plane.
cmp = sign_of_determinant(dpx, dpz, dpt,
dqx, dqz, dqt,
drx, drz, drt);
if (cmp != ZERO)
return Oriented_side(cmp * sign_of_determinant(px-rx, pz-rz,
qx-rx, qz-rz));
return cmp * sign_of_determinant(px-rx, pz-rz,
qx-rx, qz-rz);
// Projection on the (yz) plane.
cmp = sign_of_determinant(dpy, dpz, dpt,
dqy, dqz, dqt,
dry, drz, drt);
return Oriented_side(cmp * sign_of_determinant(py-ry, pz-rz,
qy-ry, qz-rz));
return cmp * sign_of_determinant(py-ry, pz-rz,
qy-ry, qz-rz);
}
@ -136,26 +136,25 @@ power_testC3( const FT &px, const FT &py, const FT &pz, const FT &pwt,
// We do an orthogonal projection on the (x) axis, if possible.
cmp = CGAL_NTS compare(px, qx);
if (cmp != EQUAL)
return Oriented_side(cmp * sign_of_determinant(dpx, dpt, dqx, dqt));
return cmp * sign_of_determinant(dpx, dpt, dqx, dqt);
// We do an orthogonal projection on the (y) axis, if possible.
cmp = CGAL_NTS compare(py, qy);
if (cmp != EQUAL)
return Oriented_side(cmp * sign_of_determinant(dpy, dpt, dqy, dqt));
return cmp * sign_of_determinant(dpy, dpt, dqy, dqt);
// We do an orthogonal projection on the (z) axis.
cmp = CGAL_NTS compare(pz, qz);
return Oriented_side(cmp * sign_of_determinant(dpz, dpt, dqz, dqt));
return cmp * sign_of_determinant(dpz, dpt, dqz, dqt);
}
template <class FT>
Oriented_side
power_testC3(const FT &pwt, const FT &qwt)
{
return Oriented_side((Comparison_result) CGAL_NTS compare(qwt, pwt));
return CGAL_NTS compare(qwt, pwt);
}
CGAL_END_NAMESPACE
#endif // CGAL_REGULAR_TRIANGULATION_FTC3_H

View File

@ -71,11 +71,11 @@ power_testH3(
RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) +
CGAL_NTS square(thz) - twt*dthw;
return Oriented_side(- sign_of_determinant(dphx, dphy, dphz, dpz, dphw,
dqhx, dqhy, dqhz, dqz, dqhw,
drhx, drhy, drhz, drz, drhw,
dshx, dshy, dshz, dsz, dshw,
dthx, dthy, dthz, dtz, dthw));
return - sign_of_determinant(dphx, dphy, dphz, dpz, dphw,
dqhx, dqhy, dqhz, dqz, dqhw,
drhx, drhy, drhz, drz, drhw,
dshx, dshy, dshz, dsz, dshw,
dthx, dthy, dthz, dtz, dthw);
}
// The 2 degenerate are not speed critical, and they are quite boring and error