mirror of https://github.com/CGAL/cgal
fix min/max problem
This commit is contained in:
parent
62c4b56a44
commit
7b073e29e5
|
|
@ -255,6 +255,7 @@ namespace CGAL {
|
||||||
template < typename Kernel_ >
|
template < typename Kernel_ >
|
||||||
struct Iso_box_d : public Handle_for< Kernel_d::Iso_box_d_rep<Kernel_> >
|
struct Iso_box_d : public Handle_for< Kernel_d::Iso_box_d_rep<Kernel_> >
|
||||||
{
|
{
|
||||||
|
BOOST_USING_STD_MAX();
|
||||||
typedef Kernel_ Kernel;
|
typedef Kernel_ Kernel;
|
||||||
typedef Kernel_ R;
|
typedef Kernel_ R;
|
||||||
|
|
||||||
|
|
@ -365,9 +366,9 @@ public:
|
||||||
|
|
||||||
FT max_coord(int i) const { return ptr()->upper[i]; }
|
FT max_coord(int i) const { return ptr()->upper[i]; }
|
||||||
|
|
||||||
const Point_d& min() const { return ptr()->lower; }
|
const Point_d& min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return ptr()->lower; }
|
||||||
|
|
||||||
const Point_d& max() const { return ptr()->upper; }
|
const Point_d& max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return ptr()->upper; }
|
||||||
|
|
||||||
FT volume() const { return volume(Rep_tag()); }
|
FT volume() const { return volume(Rep_tag()); }
|
||||||
|
|
||||||
|
|
@ -388,7 +389,7 @@ inline bool
|
||||||
operator==(const Iso_box_d<Kernel>& b1, Iso_box_d<Kernel>& b2)
|
operator==(const Iso_box_d<Kernel>& b1, Iso_box_d<Kernel>& b2)
|
||||||
{
|
{
|
||||||
CGAL_precondition(b1.dimension() == b2.dimension());
|
CGAL_precondition(b1.dimension() == b2.dimension());
|
||||||
return b1.min() == b2.min() && b1.max() == b2.max();
|
return (b1.min)() == (b2.min)() && (b1.max)() == (b2.max)();
|
||||||
}
|
}
|
||||||
|
|
||||||
template < typename Kernel >
|
template < typename Kernel >
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ template <class R> std::ostream& operator<<
|
||||||
|
|
||||||
template <class p_R>
|
template <class p_R>
|
||||||
class Segment_d : public Handle_for< Pair_d<p_R> > {
|
class Segment_d : public Handle_for< Pair_d<p_R> > {
|
||||||
|
|
||||||
|
BOOST_USING_STD_MAX();
|
||||||
|
|
||||||
typedef Pair_d<p_R> Pair;
|
typedef Pair_d<p_R> Pair;
|
||||||
typedef Handle_for<Pair> Base;
|
typedef Handle_for<Pair> Base;
|
||||||
typedef Segment_d<p_R> Self;
|
typedef Segment_d<p_R> Self;
|
||||||
|
|
@ -110,14 +113,14 @@ Point_d<R> point(int i) const { return vertex(i); }
|
||||||
Point_d<R> operator[](int i) const { return vertex(i); }
|
Point_d<R> operator[](int i) const { return vertex(i); }
|
||||||
/*{\Marrop returns |vertex(i)|.}*/
|
/*{\Marrop returns |vertex(i)|.}*/
|
||||||
|
|
||||||
Point_d<R> min() const
|
Point_d<R> min BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||||
/*{\Mop returns the lexicographically smaller vertex.}*/
|
/*{\Mop returns the lexicographically smaller vertex.}*/
|
||||||
{ typename R::Compare_lexicographically_d cmp;
|
{ typename R::Compare_lexicographically_d cmp;
|
||||||
if (cmp(source(),target()) == CGAL::SMALLER) return source();
|
if (cmp(source(),target()) == CGAL::SMALLER) return source();
|
||||||
else return target();
|
else return target();
|
||||||
}
|
}
|
||||||
|
|
||||||
Point_d<R> max() const
|
Point_d<R> max BOOST_PREVENT_MACRO_SUBSTITUTION () const
|
||||||
/*{\Mop returns the lexicographically larger vertex.}*/
|
/*{\Mop returns the lexicographically larger vertex.}*/
|
||||||
{ typename R::Compare_lexicographically_d cmp;
|
{ typename R::Compare_lexicographically_d cmp;
|
||||||
if (cmp(source(),target()) == SMALLER) return target();
|
if (cmp(source(),target()) == SMALLER) return target();
|
||||||
|
|
|
||||||
|
|
@ -440,8 +440,8 @@ Segment_d_Segment_d_pair<R>::intersection_type()
|
||||||
_s2.point(0),_s2.point(1),_ip,l1,l2);
|
_s2.point(0),_s2.point(1),_ip,l1,l2);
|
||||||
|
|
||||||
if (res == Int_obj_type::LINE)
|
if (res == Int_obj_type::LINE)
|
||||||
{ Point_d p1 = _s1.min(), p2 = _s1.max();
|
{ Point_d p1 = (_s1.min)(), p2 = (_s1.max)();
|
||||||
Point_d q1 = _s2.min(), q2 = _s2.max();
|
Point_d q1 = (_s2.min)(), q2 = (_s2.max)();
|
||||||
Point_d s,t;
|
Point_d s,t;
|
||||||
// now order the for points along the line
|
// now order the for points along the line
|
||||||
typename R::Position_on_line_d pos;
|
typename R::Position_on_line_d pos;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue