fixed min/max problem

This commit is contained in:
Andreas Fabri 2006-08-16 14:24:44 +00:00
parent 6830557518
commit b927eb413d
6 changed files with 44 additions and 44 deletions

View File

@ -108,11 +108,11 @@ public:
bool operator==(const Iso_cuboidC3& s) const; bool operator==(const Iso_cuboidC3& s) const;
bool operator!=(const Iso_cuboidC3& s) const; bool operator!=(const Iso_cuboidC3& s) const;
const Point_3 & min() const const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
return get(base).e0; return get(base).e0;
} }
const Point_3 & max() const const Point_3 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
return get(base).e1; return get(base).e1;
} }
@ -121,7 +121,7 @@ public:
Iso_cuboid_3 transform(const Aff_transformation_3 &t) const Iso_cuboid_3 transform(const Aff_transformation_3 &t) const
{ {
return Iso_cuboidC3(t.transform(min()), t.transform(max())); return Iso_cuboidC3(t.transform((this->min)()), t.transform((this->max)()));
} }
Bounded_side bounded_side(const Point_3& p) const; Bounded_side bounded_side(const Point_3& p) const;
@ -150,7 +150,7 @@ Iso_cuboidC3<R>::operator==(const Iso_cuboidC3<R>& r) const
{ // FIXME : predicate { // FIXME : predicate
if (CGAL::identical(base, r.base)) if (CGAL::identical(base, r.base))
return true; return true;
return min() == r.min() && max() == r.max(); return (this->min)() == (r.min)() && (this->max)() == (r.max)();
} }
template < class R > template < class R >
@ -166,7 +166,7 @@ inline
const typename Iso_cuboidC3<R>::FT & const typename Iso_cuboidC3<R>::FT &
Iso_cuboidC3<R>::xmin() const Iso_cuboidC3<R>::xmin() const
{ {
return min().x(); return (this->min)().x();
} }
template < class R > template < class R >
@ -174,7 +174,7 @@ inline
const typename Iso_cuboidC3<R>::FT & const typename Iso_cuboidC3<R>::FT &
Iso_cuboidC3<R>::ymin() const Iso_cuboidC3<R>::ymin() const
{ {
return min().y(); return (this->min)().y();
} }
template < class R > template < class R >
@ -182,7 +182,7 @@ inline
const typename Iso_cuboidC3<R>::FT & const typename Iso_cuboidC3<R>::FT &
Iso_cuboidC3<R>::zmin() const Iso_cuboidC3<R>::zmin() const
{ {
return min().z(); return (this->min)().z();
} }
template < class R > template < class R >
@ -190,7 +190,7 @@ inline
const typename Iso_cuboidC3<R>::FT & const typename Iso_cuboidC3<R>::FT &
Iso_cuboidC3<R>::xmax() const Iso_cuboidC3<R>::xmax() const
{ {
return max().x(); return (this->max)().x();
} }
template < class R > template < class R >
@ -198,7 +198,7 @@ inline
const typename Iso_cuboidC3<R>::FT & const typename Iso_cuboidC3<R>::FT &
Iso_cuboidC3<R>::ymax() const Iso_cuboidC3<R>::ymax() const
{ {
return max().y(); return (this->max)().y();
} }
template < class R > template < class R >
@ -206,7 +206,7 @@ inline
const typename Iso_cuboidC3<R>::FT & const typename Iso_cuboidC3<R>::FT &
Iso_cuboidC3<R>::zmax() const Iso_cuboidC3<R>::zmax() const
{ {
return max().z(); return (this->max)().z();
} }
template < class R > template < class R >
@ -245,15 +245,15 @@ Iso_cuboidC3<R>::vertex(int i) const
Construct_point_3 construct_point_3; Construct_point_3 construct_point_3;
switch (i%8) switch (i%8)
{ {
case 0: return min(); case 0: return (this->min)();
case 1: return construct_point_3(max().hx(), min().hy(), min().hz()); case 1: return construct_point_3((this->max)().hx(), (this->min)().hy(), (this->min)().hz());
case 2: return construct_point_3(max().hx(), max().hy(), min().hz()); case 2: return construct_point_3((this->max)().hx(), (this->max)().hy(), (this->min)().hz());
case 3: return construct_point_3(min().hx(), max().hy(), min().hz()); case 3: return construct_point_3((this->min)().hx(), (this->max)().hy(), (this->min)().hz());
case 4: return construct_point_3(min().hx(), max().hy(), max().hz()); case 4: return construct_point_3((this->min)().hx(), (this->max)().hy(), (this->max)().hz());
case 5: return construct_point_3(min().hx(), min().hy(), max().hz()); case 5: return construct_point_3((this->min)().hx(), (this->min)().hy(), (this->max)().hz());
case 6: return construct_point_3(max().hx(), min().hy(), max().hz()); case 6: return construct_point_3((this->max)().hx(), (this->min)().hy(), (this->max)().hz());
default: // case 7: default: // case 7:
return max(); return (this->max)();
} }
} }
@ -279,9 +279,9 @@ Bounded_side
Iso_cuboidC3<R>:: Iso_cuboidC3<R>::
bounded_side(const typename Iso_cuboidC3<R>::Point_3& p) const bounded_side(const typename Iso_cuboidC3<R>::Point_3& p) const
{ {
if (strict_dominance(p, min()) && strict_dominance(max(), p) ) if (strict_dominance(p, (this->min)()) && strict_dominance((this->max)(), p) )
return ON_BOUNDED_SIDE; return ON_BOUNDED_SIDE;
if (dominance(p, min()) && dominance(max(), p)) if (dominance(p, (this->min)()) && dominance((this->max)(), p))
return ON_BOUNDARY; return ON_BOUNDARY;
return ON_UNBOUNDED_SIDE; return ON_UNBOUNDED_SIDE;
} }
@ -328,9 +328,9 @@ CGAL_KERNEL_INLINE
bool bool
Iso_cuboidC3<R>::is_degenerate() const Iso_cuboidC3<R>::is_degenerate() const
{ // FIXME : predicate { // FIXME : predicate
return min().hx() == max().hx() return (this->min)().hx() == (this->max)().hx()
|| min().hy() == max().hy() || (this->min)().hy() == (this->max)().hy()
|| min().hz() == max().hz(); || (this->min)().hz() == (this->max)().hz();
} }
template < class R > template < class R >
@ -339,7 +339,7 @@ Bbox_3
Iso_cuboidC3<R>::bbox() const Iso_cuboidC3<R>::bbox() const
{ {
typename R::Construct_bbox_3 construct_bbox_3; typename R::Construct_bbox_3 construct_bbox_3;
return construct_bbox_3(min()) + construct_bbox_3(max()); return construct_bbox_3((this->min)()) + construct_bbox_3((this->max)());
} }
CGAL_END_NAMESPACE CGAL_END_NAMESPACE

View File

@ -56,11 +56,11 @@ public:
// CGAL_kernel_assertion(p<=q); // CGAL_kernel_assertion(p<=q);
} }
const Point_2 & min() const const Point_2 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
return get(base).e0; return get(base).e0;
} }
const Point_2 & max() const const Point_2 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
return get(base).e1; return get(base).e1;
} }

View File

@ -69,8 +69,8 @@ public:
const Point_3 & start() const; const Point_3 & start() const;
const Point_3 & end() const; const Point_3 & end() const;
const Point_3 & min() const; const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const;
const Point_3 & max() const; const Point_3 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const;
const Point_3 & vertex(int i) const; const Point_3 & vertex(int i) const;
const Point_3 & point(int i) const; const Point_3 & point(int i) const;
const Point_3 & operator[](int i) const; const Point_3 & operator[](int i) const;
@ -119,7 +119,7 @@ SegmentC3<R>::end() const
template < class R > template < class R >
inline inline
const typename SegmentC3<R>::Point_3 & const typename SegmentC3<R>::Point_3 &
SegmentC3<R>::min() const SegmentC3<R>::min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
return lexicographically_xyz_smaller(source(),target()) ? source() return lexicographically_xyz_smaller(source(),target()) ? source()
: target(); : target();
@ -128,7 +128,7 @@ SegmentC3<R>::min() const
template < class R > template < class R >
inline inline
const typename SegmentC3<R>::Point_3 & const typename SegmentC3<R>::Point_3 &
SegmentC3<R>::max() const SegmentC3<R>::max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
return lexicographically_xyz_smaller(source(),target()) ? target() return lexicographically_xyz_smaller(source(),target()) ? target()
: source(); : source();

View File

@ -1361,7 +1361,7 @@ namespace CartesianKernelFunctors {
const result_type & const result_type &
operator()(const Iso_rectangle_2& r) const operator()(const Iso_rectangle_2& r) const
{ {
return r.min().x(); return (r.min)().x();
} }
}; };
@ -1378,7 +1378,7 @@ namespace CartesianKernelFunctors {
const result_type & const result_type &
operator()(const Iso_rectangle_2& r) const operator()(const Iso_rectangle_2& r) const
{ {
return r.max().x(); return (r.max)().x();
} }
}; };
@ -1395,7 +1395,7 @@ namespace CartesianKernelFunctors {
const result_type & const result_type &
operator()(const Iso_rectangle_2& r) const operator()(const Iso_rectangle_2& r) const
{ {
return r.min().y(); return (r.min)().y();
} }
}; };
@ -1412,7 +1412,7 @@ namespace CartesianKernelFunctors {
const result_type & const result_type &
operator()(const Iso_rectangle_2& r) const operator()(const Iso_rectangle_2& r) const
{ {
return r.max().y(); return (r.max)().y();
} }
}; };
@ -1498,7 +1498,7 @@ namespace CartesianKernelFunctors {
operator()( const Iso_rectangle_2& r) const operator()( const Iso_rectangle_2& r) const
{ {
typename K::Construct_bbox_2 construct_bbox_2; typename K::Construct_bbox_2 construct_bbox_2;
return construct_bbox_2(r.min()) + construct_bbox_2(r.max()); return construct_bbox_2((r.min)()) + construct_bbox_2((r.max)());
} }
result_type result_type
@ -2771,9 +2771,9 @@ namespace CartesianKernelFunctors {
operator()( const Iso_rectangle_2& r, int i) const operator()( const Iso_rectangle_2& r, int i) const
{ {
switch (i%4) { switch (i%4) {
case 0: return r.min(); case 0: return (r.min)();
case 1: return Point_2(r.xmax(), r.ymin()); case 1: return Point_2(r.xmax(), r.ymin());
case 2: return r.max(); case 2: return (r.max)();
default: return Point_2(r.xmin(), r.ymax()); default: return Point_2(r.xmin(), r.ymax());
} }
} }

View File

@ -214,7 +214,7 @@ public:
operator()(const typename K1::Iso_rectangle_2 &a) const operator()(const typename K1::Iso_rectangle_2 &a) const
{ {
typedef typename K2::Iso_rectangle_2 Iso_rectangle_2; typedef typename K2::Iso_rectangle_2 Iso_rectangle_2;
return Iso_rectangle_2(operator()(a.min()), operator()(a.max()), 0); return Iso_rectangle_2(operator()((a.min)()), operator()((a.max)()), 0);
} }
@ -299,7 +299,7 @@ public:
operator()(const typename K1::Iso_cuboid_3 &a) const operator()(const typename K1::Iso_cuboid_3 &a) const
{ {
typedef typename K2::Iso_cuboid_3 Iso_cuboid_3; typedef typename K2::Iso_cuboid_3 Iso_cuboid_3;
return Iso_cuboid_3(operator()(a.min()), operator()(a.max()), 0); return Iso_cuboid_3(operator()((a.min)()), operator()((a.max)()), 0);
} }
std::pair<typename K2::Point_2, typename K2::Point_2> std::pair<typename K2::Point_2, typename K2::Point_2>

View File

@ -201,16 +201,16 @@ compare_y_at_xC2(const FT &px, const FT &py,
// compares the y-coordinates of p and the vertical projection of p on s. // compares the y-coordinates of p and the vertical projection of p on s.
// Precondition : p is in the x-range of s. // Precondition : p is in the x-range of s.
CGAL_kernel_precondition(px >= min(ssx, stx) && px <= max(ssx, stx)); CGAL_kernel_precondition(px >= (CGAL::min)(ssx, stx) && px <= (CGAL::max)(ssx, stx));
if (ssx < stx) if (ssx < stx)
return enum_cast<Comparison_result>(orientationC2(px, py, ssx, ssy, stx, sty)); return enum_cast<Comparison_result>(orientationC2(px, py, ssx, ssy, stx, sty));
else if (ssx > stx) else if (ssx > stx)
return enum_cast<Comparison_result>(orientationC2(px, py, stx, sty, ssx, ssy)); return enum_cast<Comparison_result>(orientationC2(px, py, stx, sty, ssx, ssy));
else { else {
if (py < min(sty, ssy)) if (py < (CGAL::min)(sty, ssy))
return SMALLER; return SMALLER;
if (py > max(sty, ssy)) if (py > (CGAL::max)(sty, ssy))
return LARGER; return LARGER;
return EQUAL; return EQUAL;
} }
@ -231,8 +231,8 @@ compare_y_at_x_segment_C2(const FT &px,
// - if the segments intersect, return EQUAL // - if the segments intersect, return EQUAL
// - if not, return the obvious SMALLER/LARGER. // - if not, return the obvious SMALLER/LARGER.
CGAL_kernel_precondition(px >= min(s1sx, s1tx) && px <= max(s1sx, s1tx)); CGAL_kernel_precondition(px >= (CGAL::min)(s1sx, s1tx) && px <= (CGAL::max)(s1sx, s1tx));
CGAL_kernel_precondition(px >= min(s2sx, s2tx) && px <= max(s2sx, s2tx)); CGAL_kernel_precondition(px >= (CGAL::min)(s2sx, s2tx) && px <= (CGAL::max)(s2sx, s2tx));
if (s1sx != s1tx && s2sx != s2tx) { if (s1sx != s1tx && s2sx != s2tx) {
FT s1stx = s1sx-s1tx; FT s1stx = s1sx-s1tx;