Remove more useless enum_cast<>.

This commit is contained in:
Sylvain Pion 2008-03-20 16:46:25 +00:00
parent 54648829af
commit 1d47b96e3c
7 changed files with 16 additions and 16 deletions

View File

@ -194,7 +194,7 @@ public:
*/ */
Oriented_side oriented_side(const Point_3 & p) const Oriented_side oriented_side(const Point_3 & p) const
{ {
return enum_cast<Oriented_side>(CGAL_NTS sign(m_a*p.x() + m_b*p.y() + m_c*p.z())); return CGAL_NTS sign(m_a*p.x() + m_b*p.y() + m_c*p.z());
} }
}; };

View File

@ -89,7 +89,7 @@ namespace CircularFunctors {
const Root_of_2 a01 = qy-py; const Root_of_2 a01 = qy-py;
const Root_of_2 a10 = rx-px; const Root_of_2 a10 = rx-px;
const Root_of_2 a11 = ry-py; const Root_of_2 a11 = ry-py;
return enum_cast<Orientation>(CGAL_NTS compare(a00*a11, a10*a01)); return CGAL_NTS compare(a00*a11, a10*a01);
} }
// template < class CK > // template < class CK >

View File

@ -51,9 +51,9 @@ public:
(less_x(s.source(), p) && less_x(s.target(), p)) ) ); (less_x(s.source(), p) && less_x(s.target(), p)) ) );
if( less_x( s.source(), s.target() ) ) if( less_x( s.source(), s.target() ) )
return enum_cast<Comparison_result>(orientation(p, s.source(), s.target() )); return orientation(p, s.source(), s.target());
else if ( less_x( s.target(), s.source() ) ) else if ( less_x( s.target(), s.source() ) )
return enum_cast<Comparison_result>(orientation(p, s.target(), s.source() )); return orientation(p, s.target(), s.source());
else { else {
if( less_y(p, s.source()) && less_y(p, s.target()) ) if( less_y(p, s.source()) && less_y(p, s.target()) )
return SMALLER; return SMALLER;

View File

@ -58,7 +58,7 @@ compare_21_11(const FT& A2, const FT& B2, const FT& C2,
FT p2 = B1 * (A1*B2 - A2*B1) - C2 * CGAL_NTS square(A1); FT p2 = B1 * (A1*B2 - A2*B1) - C2 * CGAL_NTS square(A1);
return enum_cast<Comparison_result>(CGAL_NTS sign(p2)); return CGAL_NTS sign(p2);
} }
/*2 2*/template <class FT> /*2 2*/template <class FT>
@ -97,7 +97,7 @@ compare_22_21( const FT& A1p, const FT& B1p, const FT& C1p,
FT P4 = calcP4(J,Jp,A1,C1,A2,C2); FT P4 = calcP4(J,Jp,A1,C1,A2,C2);
return enum_cast<Comparison_result>(- CGAL_NTS sign(P4)); return - CGAL_NTS sign(P4);
// if ( P4< FT(0) ) return LARGER; // r1 > l2 // if ( P4< FT(0) ) return LARGER; // r1 > l2
// if ( P4> FT(0) ) return SMALLER; // r1 < l2 // if ( P4> FT(0) ) return SMALLER; // r1 < l2
// return EQUAL; // return EQUAL;
@ -111,7 +111,7 @@ compare_22_12( const FT& A1, const FT& B1, const FT& C1,
// _22_12 boils down to _22_21 by : // _22_12 boils down to _22_21 by :
// - swapping the two polynomials // - swapping the two polynomials
// - changing the sign of the result // - changing the sign of the result
return opposite(compare_22_21(A2, B2, C2, A1, B1, C1)); return - compare_22_21(A2, B2, C2, A1, B1, C1);
} }
/*2 2*/template <class FT> /*2 2*/template <class FT>
@ -155,7 +155,7 @@ compare_22_11( const FT& A1p, const FT& B1p, const FT& C1p,
FT P4 = calcP4(I1,I2,K); FT P4 = calcP4(I1,I2,K);
return enum_cast<Comparison_result>(CGAL_NTS sign(P4)); return CGAL_NTS sign(P4);
} }
// J <= 0 // J <= 0
@ -173,7 +173,7 @@ compare_22_11( const FT& A1p, const FT& B1p, const FT& C1p,
FT P4 = calcP4(I1,I2,K); FT P4 = calcP4(I1,I2,K);
return enum_cast<Comparison_result>(- CGAL_NTS sign(P4)); return - CGAL_NTS sign(P4);
} }
/*2 2*/template <class FT> inline /*2 2*/template <class FT> inline

View File

@ -136,7 +136,7 @@ inline Uncertain<Sign> certified_sign_of_determinant2x2( const NT& a00
, const NT& a11 , const NT& a11
) )
{ {
return enum_cast<Sign>(certified_compare(a00*a11, a10*a01)) ; return certified_compare(a00*a11, a10*a01) ;
} }
CGAL_END_NAMESPACE CGAL_END_NAMESPACE

View File

@ -400,7 +400,7 @@ oriented_side_of_event_point_wrt_bisectorC2 ( intrusive_ptr< Trisegment_2<K> > c
, a, b, c , a, b, c
); );
rResult = enum_cast<Oriented_side>(certified_side_of_oriented_lineC2(a,b,c,p.x(),p.y())); rResult = certified_side_of_oriented_lineC2(a,b,c,p.x(),p.y());
CGAL_STSKEL_TRAITS_TRACE("Point is at " << rResult << " side of degenerate bisector through v01 " << p2str(v01)) ; CGAL_STSKEL_TRAITS_TRACE("Point is at " << rResult << " side of degenerate bisector through v01 " << p2str(v01)) ;
} }

View File

@ -59,9 +59,9 @@ power_testC2( const FT &px, const FT &py, const FT &pwt,
FT dry = ry - ty; FT dry = ry - ty;
FT drz = CGAL_NTS square(drx) + CGAL_NTS square(dry) - rwt + twt; FT drz = CGAL_NTS square(drx) + CGAL_NTS square(dry) - rwt + twt;
return enum_cast<Oriented_side>(sign_of_determinant3x3(dpx, dpy, dpz, return sign_of_determinant3x3(dpx, dpy, dpz,
dqx, dqy, dqz, dqx, dqy, dqz,
drx, dry, drz)); drx, dry, drz);
} }
@ -82,11 +82,11 @@ power_testC2( const FT &px, const FT &py, const FT &pwt,
// We do an orthogonal projection on the (x) axis, if possible. // We do an orthogonal projection on the (x) axis, if possible.
Comparison_result cmpx = CGAL_NTS compare(px, qx); Comparison_result cmpx = CGAL_NTS compare(px, qx);
if (cmpx != EQUAL) if (cmpx != EQUAL)
return Oriented_side(cmpx * sign_of_determinant2x2(dpx, dpz, dqx, dqz)); return cmpx * sign_of_determinant2x2(dpx, dpz, dqx, dqz);
// If not possible, then on the (y) axis. // If not possible, then on the (y) axis.
Comparison_result cmpy = CGAL_NTS compare(py, qy); Comparison_result cmpy = CGAL_NTS compare(py, qy);
return Oriented_side(cmpy * sign_of_determinant2x2(dpy, dpz, dqy, dqz)); return cmpy * sign_of_determinant2x2(dpy, dpz, dqy, dqz);
} }
CGAL_END_NAMESPACE CGAL_END_NAMESPACE