Remove casts to Comparison_result.

They are useless since we merged the various enum types.
This commit is contained in:
Sylvain Pion 2008-04-09 12:46:22 +00:00
parent b0f2c77fdc
commit 643ea487a0
8 changed files with 21 additions and 25 deletions

View File

@ -257,7 +257,7 @@ public:
CGAL::Comparison_result c= compare(pt,Coordinate_index(i)); CGAL::Comparison_result c= compare(pt,Coordinate_index(i));
if (c != CGAL::EQUAL) { if (c != CGAL::EQUAL) {
if (line().to_vector()[i] >0) return c; if (line().to_vector()[i] >0) return c;
else return CGAL::Comparison_result(-c); else return -c;
} }
} }
return CGAL::EQUAL; return CGAL::EQUAL;

View File

@ -265,7 +265,7 @@ struct Arrangement_of_spheres_traits_3 {
sphere0, sphere0,
pt, pt,
return CGAL::EQUAL, return CGAL::EQUAL,
return Comparison_result(-cr), return -cr,
return cr, return cr,
return cr, return cr,
return cr); return cr);
@ -295,7 +295,7 @@ struct Arrangement_of_spheres_traits_3 {
sphere, sphere,
pt, pt,
return CGAL::EQUAL, return CGAL::EQUAL,
return Comparison_result(-crrs), return -crrs,
return crrs, return crrs,
return crrs, return crrs,
return crrs); return crrs);
@ -391,7 +391,7 @@ struct Arrangement_of_spheres_traits_3 {
if (compare_c(sp, p.x(),CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) == EQUAL) return EQUAL; if (compare_c(sp, p.x(),CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) == EQUAL) return EQUAL;
if (p.x()>0 && compare_c(sp, p.x(), CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) == LARGER if (p.x()>0 && compare_c(sp, p.x(), CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) == LARGER
|| p.x()<0 && compare_c(sp, p.x(), CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) == SMALLER ){ || p.x()<0 && compare_c(sp, p.x(), CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) == SMALLER ){
return Comparison_result(-c0); return -c0;
} else return c0; } else return c0;
} else { } else {
return c0; return c0;
@ -436,7 +436,7 @@ struct Arrangement_of_spheres_traits_3 {
const Sphere_point_3& b, const Sphere_point_3& b,
Coordinate_index C) const { Coordinate_index C) const {
if (C != CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) { if (C != CGAL_AOS3_INTERNAL_NS::sweep_coordinate()) {
return Comparison_result(-compare_to_rule_c(b,a.key(),C)); return -compare_to_rule_c(b,a.key(),C);
} else { } else {
return a.coord().compare_c(b, C); return a.coord().compare_c(b, C);
} }

View File

@ -96,8 +96,7 @@ compare_xC2(const FT &la, const FT &lb, const FT &lc,
FT den2 = det2x2_by_formula( la, lb, h2a, h2b); FT den2 = det2x2_by_formula( la, lb, h2a, h2b);
Sign s = Sign (CGAL_NTS sign(den1) * CGAL_NTS sign(den2)); Sign s = Sign (CGAL_NTS sign(den1) * CGAL_NTS sign(den2));
CGAL_kernel_assertion( s != ZERO ); CGAL_kernel_assertion( s != ZERO );
return Comparison_result( s * sign_of_determinant(num1, return s * sign_of_determinant(num1, num2, den1, den2);
num2, den1, den2));
*/ */
FT num1 = det2x2_by_formula( la, lc, h1a, h1c); FT num1 = det2x2_by_formula( la, lc, h1a, h1c);
FT num2 = det2x2_by_formula( la, lc, h2a, h2c); FT num2 = det2x2_by_formula( la, lc, h2a, h2c);

View File

@ -280,7 +280,7 @@ class Env_plane_traits_3 : public Arr_linear_traits_2<Kernel_>
y2 = p2.y(); y2 = p2.y();
Sign s2 = CGAL_NTS sign(-b3*x1+a3*y1-(-b3*x2+a3*y2)); Sign s2 = CGAL_NTS sign(-b3*x1+a3*y1-(-b3*x2+a3*y2));
return (Comparison_result(s1 * s2)); return s1 * s2;
} }
}; };

View File

@ -773,9 +773,9 @@ public:
Sign res = CGAL_NTS sign(z1 - z2); Sign res = CGAL_NTS sign(z1 - z2);
if (parent.m_is_lower) if (parent.m_is_lower)
return Comparison_result(res); return res;
else else
return Comparison_result(-res); return -res;
} }
// second method of compare in point // second method of compare in point
@ -825,7 +825,7 @@ public:
Algebraic(1), Algebraic(1),
A1, A1,
A2); A2);
return Comparison_result(res); return res;
} }
}; };
@ -1034,7 +1034,7 @@ public:
Sign sign3 = (compare_on_right ? (CGAL_NTS sign(1)) : Sign sign3 = (compare_on_right ? (CGAL_NTS sign(1)) :
(CGAL_NTS sign(-1))); (CGAL_NTS sign(-1)));
return Comparison_result(sign1 * sign2 * sign3); return sign1 * sign2 * sign3;
} }
else if (C1 != 0 && C2 == 0) else if (C1 != 0 && C2 == 0)

View File

@ -842,7 +842,7 @@ public:
FT x1 = p1.x(), y1 = p1.y(), x2 = p2.x(), y2 = p2.y(); FT x1 = p1.x(), y1 = p1.y(), x2 = p2.x(), y2 = p2.y();
Sign s2 = CGAL_NTS sign(-b3*x1+a3*y1-(-b3*x2+a3*y2)); Sign s2 = CGAL_NTS sign(-b3*x1+a3*y1-(-b3*x2+a3*y2));
return (Comparison_result(s1 * s2)); return s1 * s2;
} }
}; };

View File

@ -513,7 +513,7 @@ public:
flip(Edge(f, 1)); flip(Edge(f, 1));
} else { } else {
CGAL::Comparison_result cx02= traits_.compare(f->vertex(0)->point(), f->vertex(2)->point(), 0); CGAL::Comparison_result cx02= traits_.compare(f->vertex(0)->point(), f->vertex(2)->point(), 0);
if (cx02 == CGAL::Comparison_result(-cx12)) { if (cx02 == -cx12) {
flip(Edge(f,2)); flip(Edge(f,2));
} else { } else {
flip(Edge(f,0)); flip(Edge(f,0));

View File

@ -24,9 +24,7 @@
#include <CGAL/determinant.h> #include <CGAL/determinant.h>
#include <CGAL/enum.h> #include <CGAL/enum.h>
//-------------------------------------------------------------------
CGAL_BEGIN_NAMESPACE CGAL_BEGIN_NAMESPACE
//-------------------------------------------------------------------
template < class FT > template < class FT >
Comparison_result Comparison_result
@ -35,15 +33,14 @@ compare_power_distanceC3(
const FT &qx, const FT &qy, const FT &qz, const FT &qw, const FT &qx, const FT &qy, const FT &qz, const FT &qw,
const FT &rx, const FT &ry, const FT &rz, const FT &rw) const FT &rx, const FT &ry, const FT &rz, const FT &rw)
{ {
FT dqx = qx - px; FT dqx = qx - px;
FT dqy = qy - py; FT dqy = qy - py;
FT dqz = qz - pz; FT dqz = qz - pz;
FT drx = rx - px; FT drx = rx - px;
FT dry = ry - py; FT dry = ry - py;
FT drz = rz - pz; FT drz = rz - pz;
return Comparison_result((Sign) CGAL_NTS sign ( return CGAL_NTS compare(dqx*dqx + dqy*dqy + dqz*dqz - qw,
(dqx*dqx + dqy*dqy + dqz*dqz - qw ) drx*drx + dry*dry + drz*drz - rw);
- (drx*drx + dry*dry + drz*drz - rw ) ));
} }