- Access functions of objects (like .x() ) now return const references.

This commit is contained in:
Sylvain Pion 2001-10-02 16:37:02 +00:00
parent 2305dae1a3
commit 23bd618932
45 changed files with 563 additions and 641 deletions

View File

@ -1,3 +1,6 @@
Version 6.29 (2 October 2001)
- Access functions of objects (like .x() ) now return const references.
Version 6.28 (13 September 2001)
- More missing typenames.

View File

@ -111,17 +111,17 @@ public:
bool operator==(const Self &s) const;
bool operator!=(const Self &s) const;
Point_2 center() const
const Point_2 & center() const
{
return Ptr()->center;
}
FT squared_radius() const
const FT & squared_radius() const
{
return Ptr()->squared_radius;
}
Orientation orientation() const
Orientation orientation() const
{
return Ptr()->orient;
}

View File

@ -98,12 +98,12 @@ public:
Self operator-() const;
FT delta(int i) const;
FT dx() const
const FT & delta(int i) const;
const FT & dx() const
{
return Ptr()->e0;
}
FT dy() const
const FT & dy() const
{
return Ptr()->e1;
}
@ -211,7 +211,7 @@ DirectionC2<R CGAL_CTAG>::operator-() const
template < class R >
CGAL_KERNEL_INLINE
typename DirectionC2<R CGAL_CTAG>::FT
const typename DirectionC2<R CGAL_CTAG>::FT &
DirectionC2<R CGAL_CTAG>::delta(int i) const
{
CGAL_kernel_precondition( ( i == 0 ) || ( i == 1 ) );

View File

@ -83,29 +83,29 @@ public:
Self operator-() const;
FT delta(int i) const;
FT dx() const
const FT & delta(int i) const;
const FT & dx() const
{
return Ptr()->e0;
}
FT dy() const
const FT & dy() const
{
return Ptr()->e1;
}
FT dz() const
const FT & dz() const
{
return Ptr()->e2;
}
FT hdx() const
const FT & hdx() const
{
return dx();
}
FT hdy() const
const FT & hdy() const
{
return dy();
}
FT hdz() const
const FT & hdz() const
{
return dz();
}
@ -154,7 +154,7 @@ DirectionC3<R CGAL_CTAG>::operator-() const
}
template < class R >
typename DirectionC3<R CGAL_CTAG>::FT
const typename DirectionC3<R CGAL_CTAG>::FT &
DirectionC3<R CGAL_CTAG>::delta(int i) const
{
CGAL_kernel_precondition( i >= 0 && i <= 2 );

View File

@ -88,11 +88,11 @@ public:
bool operator==(const Self& s) const;
bool operator!=(const Self& s) const;
Point_3 min() const
const Point_3 & min() const
{
return Ptr()->e0;
}
Point_3 max() const
const Point_3 & max() const
{
return Ptr()->e1;
}
@ -111,14 +111,14 @@ public:
bool has_on_unbounded_side(const Point_3& p) const;
bool is_degenerate() const;
Bbox_3 bbox() const;
FT xmin() const;
FT ymin() const;
FT zmin() const;
FT xmax() const;
FT ymax() const;
FT zmax() const;
FT min_coord(int i) const;
FT max_coord(int i) const;
const FT & xmin() const;
const FT & ymin() const;
const FT & zmin() const;
const FT & xmax() const;
const FT & ymax() const;
const FT & zmax() const;
const FT & min_coord(int i) const;
const FT & max_coord(int i) const;
FT volume() const;
};
@ -147,7 +147,7 @@ Iso_cuboidC3<R CGAL_CTAG>::operator!=(const Iso_cuboidC3<R CGAL_CTAG>& r) const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::xmin() const
{
return min().x();
@ -155,7 +155,7 @@ Iso_cuboidC3<R CGAL_CTAG>::xmin() const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::ymin() const
{
return min().y();
@ -163,7 +163,7 @@ Iso_cuboidC3<R CGAL_CTAG>::ymin() const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::zmin() const
{
return min().z();
@ -171,7 +171,7 @@ Iso_cuboidC3<R CGAL_CTAG>::zmin() const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::xmax() const
{
return max().x();
@ -179,7 +179,7 @@ Iso_cuboidC3<R CGAL_CTAG>::xmax() const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::ymax() const
{
return max().y();
@ -187,7 +187,7 @@ Iso_cuboidC3<R CGAL_CTAG>::ymax() const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::zmax() const
{
return max().z();
@ -195,7 +195,7 @@ Iso_cuboidC3<R CGAL_CTAG>::zmax() const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::min_coord(int i) const
{
CGAL_kernel_precondition( i == 0 || i == 1 || i == 2 );
@ -209,7 +209,7 @@ Iso_cuboidC3<R CGAL_CTAG>::min_coord(int i) const
template < class R >
inline
typename Iso_cuboidC3<R CGAL_CTAG>::FT
const typename Iso_cuboidC3<R CGAL_CTAG>::FT &
Iso_cuboidC3<R CGAL_CTAG>::max_coord(int i) const
{
CGAL_kernel_precondition( i == 0 || i == 1 || i == 2 );
@ -225,7 +225,7 @@ template < class R >
CGAL_KERNEL_LARGE_INLINE
typename Iso_cuboidC3<R CGAL_CTAG>::Point_3
Iso_cuboidC3<R CGAL_CTAG>::vertex(int i) const
{ // FIXME : construction
{
switch (i%8)
{
case 0: return min();
@ -235,9 +235,9 @@ Iso_cuboidC3<R CGAL_CTAG>::vertex(int i) const
case 4: return Point_3(min().hx(), max().hy(), max().hz());
case 5: return Point_3(min().hx(), min().hy(), max().hz());
case 6: return Point_3(max().hx(), min().hy(), max().hz());
case 7: return max();
default: // case 7:
return max();
}
return Point_3(); // FIXME : why ?
}
template < class R >

View File

@ -97,11 +97,11 @@ public:
bool operator==(const Self &s) const;
bool operator!=(const Self &s) const;
Point_2 min() const
const Point_2 & min() const
{
return Ptr()->e0;
}
Point_2 max() const
const Point_2 & max() const
{
return Ptr()->e1;
}
@ -124,12 +124,12 @@ public:
Bbox_2 bbox() const;
FT xmin() const;
FT ymin() const;
FT xmax() const;
FT ymax() const;
FT min_coord(int i) const;
FT max_coord(int i) const;
const FT & xmin() const;
const FT & ymin() const;
const FT & xmax() const;
const FT & ymax() const;
const FT & min_coord(int i) const;
const FT & max_coord(int i) const;
FT area() const;
};
@ -160,7 +160,7 @@ operator!=(const Iso_rectangleC2<R CGAL_CTAG> &r) const
template < class R >
inline
typename Iso_rectangleC2<R CGAL_CTAG>::FT
const typename Iso_rectangleC2<R CGAL_CTAG>::FT &
Iso_rectangleC2<R CGAL_CTAG>::xmin() const
{
return min().x();
@ -168,7 +168,7 @@ Iso_rectangleC2<R CGAL_CTAG>::xmin() const
template < class R >
inline
typename Iso_rectangleC2<R CGAL_CTAG>::FT
const typename Iso_rectangleC2<R CGAL_CTAG>::FT &
Iso_rectangleC2<R CGAL_CTAG>::ymin() const
{
return min().y();
@ -176,7 +176,7 @@ Iso_rectangleC2<R CGAL_CTAG>::ymin() const
template < class R >
inline
typename Iso_rectangleC2<R CGAL_CTAG>::FT
const typename Iso_rectangleC2<R CGAL_CTAG>::FT &
Iso_rectangleC2<R CGAL_CTAG>::xmax() const
{
return max().x();
@ -184,7 +184,7 @@ Iso_rectangleC2<R CGAL_CTAG>::xmax() const
template < class R >
inline
typename Iso_rectangleC2<R CGAL_CTAG>::FT
const typename Iso_rectangleC2<R CGAL_CTAG>::FT &
Iso_rectangleC2<R CGAL_CTAG>::ymax() const
{
return max().y();
@ -192,7 +192,7 @@ Iso_rectangleC2<R CGAL_CTAG>::ymax() const
template < class R >
inline
typename Iso_rectangleC2<R CGAL_CTAG>::FT
const typename Iso_rectangleC2<R CGAL_CTAG>::FT &
Iso_rectangleC2<R CGAL_CTAG>::min_coord(int i) const
{
CGAL_kernel_precondition( i == 0 || i == 1 );
@ -204,7 +204,7 @@ Iso_rectangleC2<R CGAL_CTAG>::min_coord(int i) const
template < class R >
inline
typename Iso_rectangleC2<R CGAL_CTAG>::FT
const typename Iso_rectangleC2<R CGAL_CTAG>::FT &
Iso_rectangleC2<R CGAL_CTAG>::max_coord(int i) const
{
CGAL_kernel_precondition( i == 0 || i == 1 );

View File

@ -84,15 +84,15 @@ public:
bool operator==(const Self &l) const;
bool operator!=(const Self &l) const;
FT a() const
const FT & a() const
{
return Ptr()->e0;
}
FT b() const
const FT & b() const
{
return Ptr()->e1;
}
FT c() const
const FT & c() const
{
return Ptr()->e2;
}

View File

@ -83,11 +83,11 @@ public:
Plane_3 perpendicular_plane(const Point_3 &p) const;
Self opposite() const;
Point_3 point() const
const Point_3 & point() const
{
return Ptr()->basepoint;
}
Direction_3 direction() const
const Direction_3 & direction() const
{
return Ptr()->direction;
}

View File

@ -90,19 +90,19 @@ public:
bool operator==(const Self &p) const;
bool operator!=(const Self &p) const;
FT a() const
const FT & a() const
{
return Ptr()->e0;
}
FT b() const
const FT & b() const
{
return Ptr()->e1;
}
FT c() const
const FT & c() const
{
return Ptr()->e2;
}
FT d() const
const FT & d() const
{
return Ptr()->e3;
}

View File

@ -85,20 +85,20 @@ public:
PointC2(const Vector_2 &v)
: Point_handle_2_(v) {}
FT x() const
const FT& x() const
{
return Ptr()->e0;
}
FT y() const
const FT& y() const
{
return Ptr()->e1;
}
FT hx() const
const FT& hx() const
{
return x();
}
FT hy() const
const FT& hy() const
{
return y();
}
@ -107,9 +107,9 @@ public:
return FT(1);
}
FT cartesian(int i) const;
const FT& cartesian(int i) const;
FT homogeneous(int i) const;
FT operator[](int i) const
const FT& operator[](int i) const
{
return cartesian(i);
}
@ -144,7 +144,7 @@ public:
template < class R >
CGAL_KERNEL_INLINE
typename PointC2<R CGAL_CTAG>::FT
const typename PointC2<R CGAL_CTAG>::FT &
PointC2<R CGAL_CTAG>::cartesian(int i) const
{
CGAL_kernel_precondition( (i == 0) || (i == 1) );

View File

@ -81,28 +81,28 @@ public:
return !(*this == p);
}
FT x() const
const FT & x() const
{
return Ptr()->e0;
}
FT y() const
const FT & y() const
{
return Ptr()->e1;
}
FT z() const
const FT & z() const
{
return Ptr()->e2;
}
FT hx() const
const FT & hx() const
{
return x();
}
FT hy() const
const FT & hy() const
{
return y();
}
FT hz() const
const FT & hz() const
{
return z();
}
@ -111,8 +111,8 @@ public:
return FT(1);
}
FT cartesian(int i) const;
FT operator[](int i) const;
const FT & cartesian(int i) const;
const FT & operator[](int i) const;
FT homogeneous(int i) const;
int dimension() const
@ -133,7 +133,7 @@ public:
template < class R >
inline
typename PointC3<R CGAL_CTAG>::FT
const typename PointC3<R CGAL_CTAG>::FT &
PointC3<R CGAL_CTAG>::cartesian(int i) const
{
CGAL_kernel_precondition( (i>=0) && (i<=2) );
@ -146,7 +146,7 @@ PointC3<R CGAL_CTAG>::cartesian(int i) const
template < class R >
inline
typename PointC3<R CGAL_CTAG>::FT
const typename PointC3<R CGAL_CTAG>::FT &
PointC3<R CGAL_CTAG>::operator[](int i) const
{
return cartesian(i);

View File

@ -74,13 +74,13 @@ public:
bool operator==(const Self &r) const;
bool operator!=(const Self &r) const;
Point_2 start() const;
Point_2 source() const
const Point_2 & start() const;
const Point_2 & source() const
{
return Ptr()->e0;
}
Point_2 point(int i) const;
Point_2 second_point() const
const Point_2 & second_point() const
{
return Ptr()->e1;
}
@ -125,7 +125,7 @@ RayC2<R CGAL_CTAG>::operator!=(const RayC2<R CGAL_CTAG> &r) const
template < class R >
inline
typename RayC2<R CGAL_CTAG>::Point_2
const typename RayC2<R CGAL_CTAG>::Point_2 &
RayC2<R CGAL_CTAG>::start() const
{
return source();

View File

@ -64,12 +64,12 @@ public:
bool operator==(const Self &r) const;
bool operator!=(const Self &r) const;
Point_3 start() const;
Point_3 source() const
const Point_3 & start() const;
const Point_3 & source() const
{
return Ptr()->e0;
}
Point_3 second_point() const
const Point_3 & second_point() const
{
return Ptr()->e1;
}
@ -113,7 +113,7 @@ RayC3<R CGAL_CTAG>::operator!=(const RayC3<R CGAL_CTAG> &r) const
template < class R >
inline
typename RayC3<R CGAL_CTAG>::Point_3
const typename RayC3<R CGAL_CTAG>::Point_3 &
RayC3<R CGAL_CTAG>::start() const
{
return source();

View File

@ -77,23 +77,23 @@ public:
bool operator==(const Self &s) const;
bool operator!=(const Self &s) const;
Point_2 source() const
const Point_2 & source() const
{
return Ptr()->e0;
}
Point_2 target() const
const Point_2 & target() const
{
return Ptr()->e1;
}
Point_2 start() const;
Point_2 end() const;
const Point_2 & start() const;
const Point_2 & end() const;
Point_2 min() const;
Point_2 max() const;
Point_2 vertex(int i) const;
Point_2 point(int i) const;
Point_2 operator[](int i) const;
const Point_2 & min() const;
const Point_2 & max() const;
const Point_2 & vertex(int i) const;
const Point_2 & point(int i) const;
const Point_2 & operator[](int i) const;
FT squared_length() const;
@ -133,7 +133,7 @@ SegmentC2<R CGAL_CTAG>::operator!=(const SegmentC2<R CGAL_CTAG> &s) const
template < class R >
inline
typename SegmentC2<R CGAL_CTAG>::Point_2
const typename SegmentC2<R CGAL_CTAG>::Point_2 &
SegmentC2<R CGAL_CTAG>::start() const
{
return source();
@ -141,7 +141,7 @@ SegmentC2<R CGAL_CTAG>::start() const
template < class R >
inline
typename SegmentC2<R CGAL_CTAG>::Point_2
const typename SegmentC2<R CGAL_CTAG>::Point_2 &
SegmentC2<R CGAL_CTAG>::end() const
{
return target();
@ -149,7 +149,7 @@ SegmentC2<R CGAL_CTAG>::end() const
template < class R >
CGAL_KERNEL_INLINE
typename SegmentC2<R CGAL_CTAG>::Point_2
const typename SegmentC2<R CGAL_CTAG>::Point_2 &
SegmentC2<R CGAL_CTAG>::min() const
{
return lexicographically_xy_smaller(source(),target()) ? source() : target();
@ -157,7 +157,7 @@ SegmentC2<R CGAL_CTAG>::min() const
template < class R >
CGAL_KERNEL_INLINE
typename SegmentC2<R CGAL_CTAG>::Point_2
const typename SegmentC2<R CGAL_CTAG>::Point_2 &
SegmentC2<R CGAL_CTAG>::max() const
{
return lexicographically_xy_smaller(source(),target()) ? target() : source();
@ -165,7 +165,7 @@ SegmentC2<R CGAL_CTAG>::max() const
template < class R >
CGAL_KERNEL_INLINE
typename SegmentC2<R CGAL_CTAG>::Point_2
const typename SegmentC2<R CGAL_CTAG>::Point_2 &
SegmentC2<R CGAL_CTAG>::vertex(int i) const
{
return (i%2 == 0) ? source() : target();
@ -173,7 +173,7 @@ SegmentC2<R CGAL_CTAG>::vertex(int i) const
template < class R >
CGAL_KERNEL_INLINE
typename SegmentC2<R CGAL_CTAG>::Point_2
const typename SegmentC2<R CGAL_CTAG>::Point_2 &
SegmentC2<R CGAL_CTAG>::point(int i) const
{
return (i%2 == 0) ? source() : target();
@ -181,7 +181,7 @@ SegmentC2<R CGAL_CTAG>::point(int i) const
template < class R >
inline
typename SegmentC2<R CGAL_CTAG>::Point_2
const typename SegmentC2<R CGAL_CTAG>::Point_2 &
SegmentC2<R CGAL_CTAG>::operator[](int i) const
{
return vertex(i);

View File

@ -64,23 +64,23 @@ public:
bool operator==(const Self &s) const;
bool operator!=(const Self &s) const;
Point_3 source() const
const Point_3 & source() const
{
return Ptr()->e0;
}
Point_3 target() const
const Point_3 & target() const
{
return Ptr()->e1;
}
Point_3 start() const;
Point_3 end() const;
const Point_3 & start() const;
const Point_3 & end() const;
Point_3 min() const;
Point_3 max() const;
Point_3 vertex(int i) const;
Point_3 point(int i) const;
Point_3 operator[](int i) const;
const Point_3 & min() const;
const Point_3 & max() const;
const Point_3 & vertex(int i) const;
const Point_3 & point(int i) const;
const Point_3 & operator[](int i) const;
FT squared_length() const;
@ -119,14 +119,14 @@ SegmentC3<R CGAL_CTAG>::operator!=(const SegmentC3<R CGAL_CTAG> &s) const
}
template < class R >
typename SegmentC3<R CGAL_CTAG>::Point_3
const typename SegmentC3<R CGAL_CTAG>::Point_3 &
SegmentC3<R CGAL_CTAG>::start() const
{
return source();
}
template < class R >
typename SegmentC3<R CGAL_CTAG>::Point_3
const typename SegmentC3<R CGAL_CTAG>::Point_3 &
SegmentC3<R CGAL_CTAG>::end() const
{
return target();
@ -134,7 +134,7 @@ SegmentC3<R CGAL_CTAG>::end() const
template < class R >
inline
typename SegmentC3<R CGAL_CTAG>::Point_3
const typename SegmentC3<R CGAL_CTAG>::Point_3 &
SegmentC3<R CGAL_CTAG>::min() const
{
return lexicographically_xyz_smaller(source(),target()) ? source()
@ -143,7 +143,7 @@ SegmentC3<R CGAL_CTAG>::min() const
template < class R >
inline
typename SegmentC3<R CGAL_CTAG>::Point_3
const typename SegmentC3<R CGAL_CTAG>::Point_3 &
SegmentC3<R CGAL_CTAG>::max() const
{
return lexicographically_xyz_smaller(source(),target()) ? target()
@ -152,7 +152,7 @@ SegmentC3<R CGAL_CTAG>::max() const
template < class R >
inline
typename SegmentC3<R CGAL_CTAG>::Point_3
const typename SegmentC3<R CGAL_CTAG>::Point_3 &
SegmentC3<R CGAL_CTAG>::vertex(int i) const
{
return (i%2 == 0) ? source() : target();
@ -160,7 +160,7 @@ SegmentC3<R CGAL_CTAG>::vertex(int i) const
template < class R >
inline
typename SegmentC3<R CGAL_CTAG>::Point_3
const typename SegmentC3<R CGAL_CTAG>::Point_3 &
SegmentC3<R CGAL_CTAG>::point(int i) const
{
return (i%2 == 0) ? source() : target();
@ -168,7 +168,7 @@ SegmentC3<R CGAL_CTAG>::point(int i) const
template < class R >
inline
typename SegmentC3<R CGAL_CTAG>::Point_3
const typename SegmentC3<R CGAL_CTAG>::Point_3 &
SegmentC3<R CGAL_CTAG>::operator[](int i) const
{
return vertex(i);

View File

@ -109,11 +109,11 @@ public:
bool operator==(const Self &) const;
bool operator!=(const Self &) const;
Point_3 center() const
const Point_3 & center() const
{
return Ptr()->center;
}
FT squared_radius() const
const FT & squared_radius() const
{
// Returns the square of the radius (instead of the radius itself,
// which would require square roots)

View File

@ -60,8 +60,8 @@ public:
const Point_3 &s)
: Tetrahedron_handle_3_(Tetrahedron_ref_3(p, q, r, s)) {}
Point_3 vertex(int i) const;
Point_3 operator[](int i) const;
const Point_3 & vertex(int i) const;
const Point_3 & operator[](int i) const;
bool operator==(const Self &t) const;
bool operator!=(const Self &t) const;
@ -131,7 +131,7 @@ operator!=(const TetrahedronC3<R CGAL_CTAG> &t) const
}
template < class R >
typename TetrahedronC3<R CGAL_CTAG>::Point_3
const typename TetrahedronC3<R CGAL_CTAG>::Point_3 &
TetrahedronC3<R CGAL_CTAG>::
vertex(int i) const
{
@ -148,7 +148,7 @@ vertex(int i) const
template < class R >
inline
typename TetrahedronC3<R CGAL_CTAG>::Point_3
const typename TetrahedronC3<R CGAL_CTAG>::Point_3 &
TetrahedronC3<R CGAL_CTAG>::
operator[](int i) const
{

View File

@ -72,8 +72,8 @@ public:
bool operator==(const Self &s) const;
bool operator!=(const Self &s) const;
Point_2 vertex(int i) const;
Point_2 operator[](int i) const;
const Point_2 & vertex(int i) const;
const Point_2 & operator[](int i) const;
Self opposite() const;
Self transform(const Aff_transformation_2 &t) const
@ -132,7 +132,7 @@ TriangleC2<R CGAL_CTAG>::operator!=(const TriangleC2<R CGAL_CTAG> &t) const
template < class R >
CGAL_KERNEL_MEDIUM_INLINE
typename TriangleC2<R CGAL_CTAG>::Point_2
const typename TriangleC2<R CGAL_CTAG>::Point_2 &
TriangleC2<R CGAL_CTAG>::vertex(int i) const
{
if (i>2) i = i%3;
@ -144,7 +144,7 @@ TriangleC2<R CGAL_CTAG>::vertex(int i) const
template < class R >
inline
typename TriangleC2<R CGAL_CTAG>::Point_2
const typename TriangleC2<R CGAL_CTAG>::Point_2 &
TriangleC2<R CGAL_CTAG>::operator[](int i) const
{
return vertex(i);

View File

@ -73,8 +73,8 @@ public:
bool has_on(const Point_3 &p) const;
bool is_degenerate() const;
Point_3 vertex(int i) const;
Point_3 operator[](int i) const;
const Point_3 & vertex(int i) const;
const Point_3 & operator[](int i) const;
Bbox_3 bbox() const;
@ -109,7 +109,7 @@ TriangleC3<R CGAL_CTAG>::operator!=(const TriangleC3<R CGAL_CTAG> &t) const
}
template < class R >
typename TriangleC3<R CGAL_CTAG>::Point_3
const typename TriangleC3<R CGAL_CTAG>::Point_3 &
TriangleC3<R CGAL_CTAG>::vertex(int i) const
{
if (i<0) i=(i%3)+3;
@ -121,7 +121,7 @@ TriangleC3<R CGAL_CTAG>::vertex(int i) const
template < class R >
inline
typename TriangleC3<R CGAL_CTAG>::Point_3
const typename TriangleC3<R CGAL_CTAG>::Point_3 &
TriangleC3<R CGAL_CTAG>::operator[](int i) const
{
return vertex(i);

View File

@ -93,20 +93,20 @@ public:
bool operator==(const Null_vector &) const;
bool operator!=(const Null_vector &p) const;
FT x() const
const FT & x() const
{
return Ptr()->e0;
}
FT y() const
const FT & y() const
{
return Ptr()->e1;
}
FT hx() const
const FT & hx() const
{
return x();
}
FT hy() const
const FT & hy() const
{
return y();
}
@ -115,8 +115,8 @@ public:
return FT(1);
}
FT cartesian(int i) const;
FT operator[](int i) const;
const FT & cartesian(int i) const;
const FT & operator[](int i) const;
FT homogeneous(int i) const;
int dimension() const
@ -179,7 +179,7 @@ VectorC2<R CGAL_CTAG>::operator!=(const Null_vector &v) const
template < class R >
CGAL_KERNEL_INLINE
typename VectorC2<R CGAL_CTAG>::FT
const typename VectorC2<R CGAL_CTAG>::FT &
VectorC2<R CGAL_CTAG>::cartesian(int i) const
{
CGAL_kernel_precondition( (i == 0) || (i == 1) );
@ -188,7 +188,7 @@ VectorC2<R CGAL_CTAG>::cartesian(int i) const
template < class R >
inline
typename VectorC2<R CGAL_CTAG>::FT
const typename VectorC2<R CGAL_CTAG>::FT &
VectorC2<R CGAL_CTAG>::operator[](int i) const
{
return cartesian(i);

View File

@ -82,28 +82,28 @@ public:
bool operator==(const Null_vector &) const;
bool operator!=(const Null_vector &) const;
FT x() const
const FT & x() const
{
return Ptr()->e0;
}
FT y() const
const FT & y() const
{
return Ptr()->e1;
}
FT z() const
const FT & z() const
{
return Ptr()->e2;
}
FT hx() const
const FT & hx() const
{
return x();
}
FT hy() const
const FT & hy() const
{
return y();
}
FT hz() const
const FT & hz() const
{
return z();
}
@ -112,8 +112,8 @@ public:
return FT(1);
}
FT cartesian(int i) const;
FT operator[](int i) const;
const FT & cartesian(int i) const;
const FT & operator[](int i) const;
FT homogeneous(int i) const;
int dimension() const
@ -175,7 +175,7 @@ VectorC3<R CGAL_CTAG>::operator!=(const Null_vector &v) const
template < class R >
inline
typename VectorC3<R CGAL_CTAG>::FT
const typename VectorC3<R CGAL_CTAG>::FT &
VectorC3<R CGAL_CTAG>::cartesian(int i) const
{
CGAL_kernel_precondition( (i>=0) && (i<3) );
@ -186,7 +186,7 @@ VectorC3<R CGAL_CTAG>::cartesian(int i) const
template < class R >
inline
typename VectorC3<R CGAL_CTAG>::FT
const typename VectorC3<R CGAL_CTAG>::FT &
VectorC3<R CGAL_CTAG>::operator[](int i) const
{
return cartesian(i);

View File

@ -1,3 +1,6 @@
2.39 (2 October 2001)
- Access functions of objects (like .x() ) now return const references.
2.38 (15 August 2001)
- SunPro patches.

View File

@ -456,9 +456,9 @@ class Reflection_repH2 : public Aff_transformation_rep_baseH2<R>
general_form() const
{
const RT mRT2 = - RT(2);
const RT& a = l.a_ref();
const RT& b = l.b_ref();
const RT& c = l.c_ref();
const RT& a = l.a();
const RT& b = l.b();
const RT& c = l.c();
RT de = a*a + b*b;
RT aa = b*b - a*a;
RT bb = a*a - b*b;

View File

@ -123,13 +123,13 @@ public:
CircleH2<R>
orthogonal_transform(const Aff_transformationH2<R>&) const;
PointH2<R>
const PointH2<R> &
center() const;
Orientation
orientation() const;
FT
const FT &
squared_radius() const;
CircleH2<R>
@ -160,13 +160,13 @@ public:
template <class R>
inline
PointH2<R>
const PointH2<R> &
CircleH2<R>::center() const
{ return Ptr()->center; }
template <class R>
inline
typename CircleH2<R>::FT
const typename CircleH2<R>::FT &
CircleH2<R>::squared_radius() const
{ return Ptr()->squared_radius; }

View File

@ -55,8 +55,8 @@ public:
bool operator==(const Iso_rectangleH2<R>& s) const;
bool operator!=(const Iso_rectangleH2<R>& s) const;
PointH2<R> min() const;
PointH2<R> max() const;
const PointH2<R> & min() const;
const PointH2<R> & max() const;
PointH2<R> vertex(int i) const;
PointH2<R> operator[](int i) const;
@ -150,13 +150,13 @@ Iso_rectangleH2<R>::operator!=(const Iso_rectangleH2<R>& r) const
template < class R >
inline
PointH2<R>
const PointH2<R> &
Iso_rectangleH2<R>::min() const
{ return Ptr()->e0; }
template < class R >
inline
PointH2<R>
const PointH2<R> &
Iso_rectangleH2<R>::max() const
{ return Ptr()->e1; }
@ -229,12 +229,11 @@ Iso_rectangleH2<R>::vertex(int i) const
min().hw()*max().hw() );
case 2:
return max();
case 3:
default: // case 3:
return PointH2<R>( min().hx()*max().hw(),
max().hy()*min().hw(),
min().hw()*max().hw() );
}
return PointH2<R>();
}
template < class R >

View File

@ -51,12 +51,9 @@ public:
bool operator==(const LineH2<R>& l) const ;
bool operator!=(const LineH2<R>& l) const ;
RT a() const;
RT b() const;
RT c() const;
const RT& a_ref() const { return Ptr()->e0; }
const RT& b_ref() const { return Ptr()->e1; }
const RT& c_ref() const { return Ptr()->e2; }
const RT & a() const { return Ptr()->e0; }
const RT & b() const { return Ptr()->e1; }
const RT & c() const { return Ptr()->e2; }
FT x_at_y(FT y) const;
FT y_at_x(FT x) const;
@ -146,25 +143,6 @@ LineH2<R>::LineH2(const PointH2<R>& p,
p.hx()*q.hy() - p.hy()*q.hx() ) );
}
template < class R >
inline
typename LineH2<R>::RT
LineH2<R>::a() const
{ return Ptr()->e0; }
template < class R >
inline
typename LineH2<R>::RT
LineH2<R>::b() const
{ return Ptr()->e1; }
template < class R >
inline
typename LineH2<R>::RT
LineH2<R>::c() const
{ return Ptr()->e2; }
template < class R >
CGAL_KERNEL_INLINE
typename LineH2<R>::FT

View File

@ -25,10 +25,6 @@
#ifndef CGAL_PVDH2_H
#define CGAL_PVDH2_H
#define CGAL_POINTH2_H
#define CGAL_VECTORH2_H
#define CGAL_DIRECTIONH2_H
#include <CGAL/homogeneous_classes.h>
#include <CGAL/Origin.h>
#include <CGAL/Bbox_2.h>
@ -57,21 +53,16 @@ public:
bool operator==( const PointH2<R>& p) const;
bool operator!=( const PointH2<R>& p) const;
RT hx() const { return Ptr()->e0; };
RT hy() const { return Ptr()->e1; };
RT hw() const { return Ptr()->e2; };
const RT & hx() const { return Ptr()->e0; };
const RT & hy() const { return Ptr()->e1; };
const RT & hw() const { return Ptr()->e2; };
FT x() const { return FT(hx()) / FT(hw()); };
FT y() const { return FT(hy()) / FT(hw()); };
FT cartesian(int i) const;
FT operator[](int i) const;
RT homogeneous(int i) const;
// and for efficiency in the predicates:
const RT& hx_ref() const { return Ptr()->e0; };
const RT& hy_ref() const { return Ptr()->e1; };
const RT& hw_ref() const { return Ptr()->e2; };
const RT & homogeneous(int i) const;
int dimension() const;
Bbox_2 bbox() const;
@ -104,15 +95,15 @@ public:
bool operator==( const Null_vector&) const;
bool operator!=( const Null_vector& v) const;
RT hx() const { return Ptr()->e0; };
RT hy() const { return Ptr()->e1; };
RT hw() const { return Ptr()->e2; };
const RT & hx() const { return Ptr()->e0; };
const RT & hy() const { return Ptr()->e1; };
const RT & hw() const { return Ptr()->e2; };
FT x() const { return FT(hx()) / FT(hw()); };
FT y() const { return FT(hy()) / FT(hw()); };
FT cartesian(int i) const;
RT homogeneous(int i) const;
const RT & homogeneous(int i) const;
FT operator[](int i) const;
int dimension() const;
@ -165,12 +156,12 @@ public:
VectorH2<R> to_vector() const;
RT x() const { return Ptr()->e0; };
RT y() const { return Ptr()->e1; };
const RT & x() const { return Ptr()->e0; };
const RT & y() const { return Ptr()->e1; };
RT delta(int i) const;
RT dx() const { return Ptr()->e0; };
RT dy() const { return Ptr()->e1; };
const RT & delta(int i) const;
const RT & dx() const { return Ptr()->e0; };
const RT & dy() const { return Ptr()->e1; };
DirectionH2<R> perpendicular(const Orientation &o) const;
DirectionH2<R> transform(const Aff_transformationH2<R> &) const;
@ -245,7 +236,7 @@ PointH2<R>::cartesian(int i) const
template < class R >
CGAL_KERNEL_INLINE
typename PointH2<R>::RT
const typename PointH2<R>::RT &
PointH2<R>::homogeneous(int i) const
{
CGAL_kernel_precondition( (i>=0) && (i<=2) );
@ -361,7 +352,7 @@ VectorH2<R>::cartesian(int i) const
template < class R >
CGAL_KERNEL_INLINE
typename VectorH2<R>::RT
const typename VectorH2<R>::RT &
VectorH2<R>::homogeneous(int i) const
{
CGAL_kernel_precondition( (i>=0) && (i<=2) );
@ -476,7 +467,7 @@ DirectionH2<R>::operator-() const
template <class R >
CGAL_KERNEL_INLINE
typename DirectionH2<R>::RT
const typename DirectionH2<R>::RT &
DirectionH2<R>::delta(int i) const
{
CGAL_kernel_precondition( ( i == 0 ) || ( i == 1 ) );

View File

@ -35,8 +35,7 @@ public:
Ray_repH2(const PointH2<R>& fp, const PointH2<R>& sp)
: start(fp), second(sp) {}
PointH2<R> start;
PointH2<R> second;
PointH2<R> start, second;
};
template < class R >
@ -47,8 +46,7 @@ public:
Simple_Ray_repH2(const PointH2<R>& fp, const PointH2<R>& sp)
: start(fp), second(sp) {}
PointH2<R> start;
PointH2<R> second;
PointH2<R> start, second;
};
template < class R_ >
@ -73,9 +71,9 @@ public:
bool operator==(const RayH2<R>& r) const;
bool operator!=(const RayH2<R>& r) const;
PointH2<R> start() const;
PointH2<R> source() const;
PointH2<R> second_point() const;
const PointH2<R> & start() const;
const PointH2<R> & source() const;
const PointH2<R> & second_point() const;
PointH2<R> point(int i) const;
DirectionH2<R> direction() const;
LineH2<R> supporting_line() const;
@ -93,13 +91,13 @@ public:
template < class R >
inline
PointH2<R>
const PointH2<R> &
RayH2<R>::source() const
{ return Ptr()->start; }
template < class R >
inline
PointH2<R>
const PointH2<R> &
RayH2<R>::start() const
{ return Ptr()->start; }
@ -109,11 +107,11 @@ DirectionH2<R>
RayH2<R>::direction() const
{
CGAL_kernel_precondition( !is_degenerate() );
return DirectionH2<R>( Ptr()->second - Ptr()->start );
return DirectionH2<R>( second_point() - start() );
}
template < class R >
inline
PointH2<R>
const PointH2<R> &
RayH2<R>::second_point() const
{
CGAL_kernel_precondition( !is_degenerate() );
@ -144,7 +142,7 @@ template < class R >
inline
RayH2<R>
RayH2<R>::opposite() const
{ return RayH2<R>( Ptr()->start, - direction() ); }
{ return RayH2<R>( start(), - direction() ); }
template < class R >
CGAL_KERNEL_INLINE
@ -152,8 +150,7 @@ RayH2<R>
RayH2<R>::
transform(const Aff_transformationH2<R> & t) const
{
return RayH2<R>(t.transform(Ptr()->start),
t.transform(Ptr()->second) );
return RayH2<R>(t.transform(start()), t.transform(second_point()) );
}
#ifndef CGAL_NO_OSTREAM_INSERT_RAYH2
@ -206,21 +203,21 @@ CGAL_KERNEL_INLINE
bool
RayH2<R>::has_on(const PointH2<R> p) const
{
return ( ( p == start() )
||(DirectionH2<R>(p - Ptr()->start) == direction() ) );
return p == start() || DirectionH2<R>(p - start()) == direction();
}
template < class R >
CGAL_KERNEL_INLINE
bool
RayH2<R>::is_degenerate() const
{ return ( (Ptr()->start == Ptr()->second) ); }
{ return start() == Ptr()->second; }
template < class R >
inline
bool
RayH2<R>::collinear_has_on(const PointH2<R> p) const
{ return has_on(p); }
template < class R >
CGAL_KERNEL_INLINE
bool

View File

@ -38,8 +38,7 @@ public:
Segment_repH2(const PointH2<R>& sp, const PointH2<R>& ep)
: start(sp), end(ep) {}
PointH2<R> start;
PointH2<R> end;
PointH2<R> start, end;
};
template < class R >
@ -50,8 +49,7 @@ public:
Simple_Segment_repH2(const PointH2<R>& sp, const PointH2<R>& ep)
: start(sp), end(ep) {}
PointH2<R> start;
PointH2<R> end;
PointH2<R> start, end;
};
template < class R_ >
@ -82,16 +80,16 @@ public:
bool operator==(const SegmentH2<R>& s) const;
bool operator!=(const SegmentH2<R>& s) const;
PointH2<R> source() const;
PointH2<R> target() const;
PointH2<R> start() const;
PointH2<R> end() const;
PointH2<R> vertex(int i) const;
PointH2<R> point(int i) const;
PointH2<R> operator[](int i) const;
PointH2<R> min() const;
PointH2<R> max() const;
PointH2<R> other_vertex(const PointH2<R>& p) const;
const PointH2<R> & source() const;
const PointH2<R> & target() const;
const PointH2<R> & start() const;
const PointH2<R> & end() const;
const PointH2<R> & vertex(int i) const;
const PointH2<R> & point(int i) const;
const PointH2<R> & operator[](int i) const;
const PointH2<R> & min() const;
const PointH2<R> & max() const;
const PointH2<R> & other_vertex(const PointH2<R>& p) const;
bool is_horizontal() const;
bool is_vertical() const;
@ -115,31 +113,31 @@ public:
template < class R >
inline
PointH2<R>
const PointH2<R> &
SegmentH2<R>::source() const
{ return Ptr()->start; }
template < class R >
inline
PointH2<R>
const PointH2<R> &
SegmentH2<R>::start() const
{ return Ptr()->start; }
template < class R >
inline
PointH2<R>
const PointH2<R> &
SegmentH2<R>::target() const
{ return Ptr()->end; }
template < class R >
inline
PointH2<R>
const PointH2<R> &
SegmentH2<R>::end() const
{ return Ptr()->end; }
template < class R >
CGAL_KERNEL_INLINE
PointH2<R>
const PointH2<R> &
SegmentH2<R>::min() const
{
return
@ -148,7 +146,7 @@ SegmentH2<R>::min() const
template < class R >
CGAL_KERNEL_INLINE
PointH2<R>
const PointH2<R> &
SegmentH2<R>::max() const
{
return
@ -157,7 +155,7 @@ SegmentH2<R>::max() const
template < class R >
CGAL_KERNEL_INLINE
PointH2<R>
const PointH2<R> &
SegmentH2<R>::other_vertex(const PointH2<R>& p) const
{
CGAL_kernel_precondition( (p == end()) || (p == start()) );
@ -166,26 +164,21 @@ SegmentH2<R>::other_vertex(const PointH2<R>& p) const
template < class R >
CGAL_KERNEL_INLINE
PointH2<R>
const PointH2<R> &
SegmentH2<R>::vertex(int i) const
{
switch (i%2)
{
case 0: return Ptr()->start;
case 1: return Ptr()->end;
};
return PointH2<R>(); // otherwise the SGI compiler complains
return (i%2 == 0) ? start() : end();
}
template < class R >
inline
PointH2<R>
const PointH2<R> &
SegmentH2<R>::point(int i) const
{ return vertex(i); }
template < class R >
inline
PointH2<R>
const PointH2<R> &
SegmentH2<R>::operator[](int i) const
{ return vertex(i); }
@ -193,7 +186,7 @@ template < class R >
CGAL_KERNEL_INLINE
typename SegmentH2<R>::FT
SegmentH2<R>::squared_length() const
{ return (Ptr()->end - Ptr()->start) * (Ptr()->end - Ptr()->start); }
{ return (end() - start()) * (end() - start()); }
template < class R >
CGAL_KERNEL_INLINE
@ -201,7 +194,7 @@ DirectionH2<R>
SegmentH2<R>::direction() const
{
CGAL_kernel_precondition( !is_degenerate() );
return DirectionH2<R>( Ptr()->end - Ptr()->start );
return DirectionH2<R>( end() - start() );
}
template < class R >
@ -210,14 +203,14 @@ LineH2<R>
SegmentH2<R>::supporting_line() const
{
CGAL_kernel_precondition( !is_degenerate() );
return LineH2<R>(Ptr()->start, Ptr()->end);
return LineH2<R>(start(), end());
}
template < class R >
CGAL_KERNEL_INLINE
SegmentH2<R>
SegmentH2<R>::opposite() const
{ return SegmentH2<R>(Ptr()->end, Ptr()->start); }
{ return SegmentH2<R>(end(), start()); }
template < class R >
CGAL_KERNEL_INLINE
@ -225,8 +218,7 @@ SegmentH2<R>
SegmentH2<R>::
transform(const Aff_transformationH2<R>& t) const
{
return SegmentH2<R>(t.transform(Ptr()->start),
t.transform(Ptr()->end) );
return SegmentH2<R>(t.transform(start()), t.transform(end()) );
}
template < class R >

View File

@ -118,8 +118,8 @@ public:
// bool oriented_equal( const TriangleH2<R>& ) const;
// bool unoriented_equal( const TriangleH2<R>& ) const;
PointH2<R> vertex(int i) const;
PointH2<R> operator[](int i) const;
const PointH2<R> & vertex(int i) const;
const PointH2<R> & operator[](int i) const;
FT area() const;
};
@ -130,7 +130,7 @@ public:
template <class R>
CGAL_KERNEL_INLINE
PointH2<R>
const PointH2<R> &
TriangleH2<R>::vertex(int i) const
{
if (i>2) i = i%3;
@ -140,7 +140,7 @@ TriangleH2<R>::vertex(int i) const
template <class R>
inline
PointH2<R>
const PointH2<R> &
TriangleH2<R>::operator[](int i) const
{ return vertex(i); }

View File

@ -51,13 +51,13 @@ compare_angle_with_x_axis(const DirectionH2<R>& d1,
// PointH2<R> p1 = ORIGIN + d1.vector(); // Commented out
// PointH2<R> p2 = ORIGIN + d2.vector(); // Commented out
CGAL_kernel_precondition( RT0 < p1.hw_ref() );
CGAL_kernel_precondition( RT0 < p2.hw_ref() );
CGAL_kernel_precondition( RT0 < p1.hw() );
CGAL_kernel_precondition( RT0 < p2.hw() );
int x_sign1 = static_cast<int>(CGAL_NTS sign( p1.hx_ref() ));
int x_sign2 = static_cast<int>(CGAL_NTS sign( p2.hx_ref() ));
int y_sign1 = static_cast<int>(CGAL_NTS sign( p1.hy_ref() ));
int y_sign2 = static_cast<int>(CGAL_NTS sign( p2.hy_ref() ));
int x_sign1 = static_cast<int>(CGAL_NTS sign( p1.hx() ));
int x_sign2 = static_cast<int>(CGAL_NTS sign( p2.hx() ));
int y_sign1 = static_cast<int>(CGAL_NTS sign( p1.hy() ));
int y_sign2 = static_cast<int>(CGAL_NTS sign( p2.hy() ));
if ( y_sign1 * y_sign2 < 0)
{

View File

@ -51,12 +51,12 @@ equal_xy(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phx*qhw;
RT qV = qhx*phw;
@ -75,12 +75,12 @@ compare_xy(const PointH2<R>& p, const PointH2<R>& q)
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phx*qhw;
RT qV = qhx*phw;
@ -119,12 +119,12 @@ lexicographically_xy_smaller_or_equal(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phx * qhw;
RT qV = qhx * phw;
@ -150,12 +150,12 @@ lexicographically_xy_smaller(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phx * qhw;
RT qV = qhx * phw;
@ -188,12 +188,12 @@ lexicographically_xy_larger(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phx * qhw;
RT qV = qhx * phw;
@ -217,12 +217,12 @@ compare_yx(const PointH2<R>& p, const PointH2<R>& q)
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phy*qhw;
RT qV = qhy*phw;
@ -258,12 +258,12 @@ lexicographically_yx_smaller_or_equal(const PointH2<R>& p, const PointH2<R>& q)
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phy * qhw;
RT qV = qhy * phw;
@ -287,12 +287,12 @@ lexicographically_yx_smaller(const PointH2<R>& p, const PointH2<R>& q)
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phy * qhw;
RT qV = qhy * phw;
@ -325,12 +325,12 @@ lexicographically_yx_larger(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
RT pV = phy * qhw;
RT qV = qhy * phw;
@ -356,10 +356,10 @@ compare_x(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhw = q.hw();
const RT RT0 = RT(0);
RT com = phx * qhw - qhx * phw;
if ( com < RT0 )
@ -381,10 +381,10 @@ compare_y(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT RT0 = RT(0);
RT com = phy * qhw - qhy * phw;
if ( com < RT0 )
@ -407,15 +407,15 @@ orientation( const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
const RT RT0 = RT(0);
// | A B |
@ -429,9 +429,9 @@ orientation( const PointH2<R>& p,
RT det = A*D - B*C;
/*
RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() )
+ p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() )
+ p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() );
RT det_old = p.hx() * (q.hy()*r.hw() - q.hw()*r.hy() )
+ p.hy() * (q.hw()*r.hx() - q.hx()*r.hw() )
+ p.hw() * (q.hx()*r.hy() - q.hy()*r.hx() );
if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) )
{
@ -466,15 +466,15 @@ left_turn( const PointH2<R>& p, const PointH2<R>& q, const PointH2<R>& r)
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
const RT RT0 = RT(0);
// | A B |
@ -488,9 +488,9 @@ left_turn( const PointH2<R>& p, const PointH2<R>& q, const PointH2<R>& r)
RT det = A*D - B*C;
/*
RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() )
+ p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() )
+ p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() );
RT det_old = p.hx() * (q.hy()*r.hw() - q.hw()*r.hy() )
+ p.hy() * (q.hw()*r.hx() - q.hx()*r.hw() )
+ p.hw() * (q.hx()*r.hy() - q.hy()*r.hx() );
if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) )
{
@ -519,15 +519,15 @@ right_turn( const PointH2<R>& p, const PointH2<R>& q, const PointH2<R>& r)
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
const RT RT0 = RT(0);
// | A B |
@ -541,9 +541,9 @@ right_turn( const PointH2<R>& p, const PointH2<R>& q, const PointH2<R>& r)
RT det = A*D - B*C;
/*
RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() )
+ p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() )
+ p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() );
RT det_old = p.hx() * (q.hy()*r.hw() - q.hw()*r.hy() )
+ p.hy() * (q.hw()*r.hx() - q.hx()*r.hw() )
+ p.hw() * (q.hx()*r.hy() - q.hy()*r.hx() );
if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) )
{
@ -574,15 +574,15 @@ collinear( const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
const RT RT0 = RT(0);
// | A B |
@ -596,9 +596,9 @@ collinear( const PointH2<R>& p,
RT det = A*D - B*C;
/*
RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() )
+ p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() )
+ p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() );
RT det_old = p.hx() * (q.hy()*r.hw() - q.hw()*r.hy() )
+ p.hy() * (q.hw()*r.hx() - q.hx()*r.hw() )
+ p.hw() * (q.hx()*r.hy() - q.hy()*r.hx() );
if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) )
{
@ -618,15 +618,15 @@ side_of_bounded_circle( const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& thx = t.hx_ref();
const RT& thy = t.hy_ref();
const RT& thw = t.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& thx = t.hx();
const RT& thy = t.hy();
const RT& thw = t.hw();
return Bounded_side( CGAL_NTS compare((thx*phw-phx*thw)*(qhx*thw-thx*qhw),
(thy*phw-phy*thw)*(thy*qhw-qhy*thw)) );
@ -642,18 +642,18 @@ side_of_bounded_circle( const PointH2<R>& q,
{
typedef typename R::RT RT;
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& shx = s.hx_ref();
const RT& shy = s.hy_ref();
const RT& shw = s.hw_ref();
const RT& thx = t.hx_ref();
const RT& thy = t.hy_ref();
const RT& thw = t.hw_ref();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
const RT& shx = s.hx();
const RT& shy = s.hy();
const RT& shw = s.hw();
const RT& thx = t.hx();
const RT& thy = t.hy();
const RT& thw = t.hw();
const RT RT0 = RT(0);
CGAL_kernel_precondition( ! collinear(q,r,s) );
@ -714,18 +714,18 @@ side_of_oriented_circle( const PointH2<R>& q,
{
typedef typename R::RT RT;
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& shx = s.hx_ref();
const RT& shy = s.hy_ref();
const RT& shw = s.hw_ref();
const RT& thx = t.hx_ref();
const RT& thy = t.hy_ref();
const RT& thw = t.hw_ref();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
const RT& shx = s.hx();
const RT& shy = s.hy();
const RT& shw = s.hw();
const RT& thx = t.hx();
const RT& thy = t.hy();
const RT& thw = t.hw();
const RT RT0 = RT(0);
CGAL_kernel_precondition( ! collinear(q,r,s) );
@ -780,15 +780,15 @@ collinear_are_ordered_along_line( const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
if ( !(phx * rhw == rhx * phw ) ) // non-vertical ?
{
@ -835,15 +835,15 @@ collinear_are_strictly_ordered_along_line( const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& rhx = r.hx_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
const RT& rhx = r.hx();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
if ( !(phx * rhw == rhx * phw ) )
{
@ -884,14 +884,14 @@ inline
bool
x_equal( const PointH2<R>& p,
const PointH2<R>& q )
{ return ( p.hx_ref()*q.hw_ref() == q.hx_ref()*p.hw_ref() ); }
{ return ( p.hx()*q.hw() == q.hx()*p.hw() ); }
template <class R>
inline
bool
y_equal( const PointH2<R>& p,
const PointH2<R>& q )
{ return ( p.hy_ref()*q.hw_ref() == q.hy_ref()*p.hw_ref() ); }
{ return ( p.hy()*q.hw() == q.hy()*p.hw() ); }
template <class R>
CGAL_KERNEL_MEDIUM_INLINE
@ -901,12 +901,12 @@ _where_wrt_L_wedge( const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhw = q.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhw = q.hw();
Sign xs = CGAL_NTS sign( qhx*phw - phx*qhw ); // sign( qx - px )
Sign ys = CGAL_NTS sign( qhy*phw - phy*qhw ); // sign( qy - py )
@ -932,14 +932,14 @@ compare_deltax_deltay(const PointH2<R>& p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhw = q.hw_ref();
const RT& rhy = r.hy_ref();
const RT& rhw = r.hw_ref();
const RT& shy = s.hy_ref();
const RT& shw = s.hw_ref();
const RT& phx = p.hx();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhw = q.hw();
const RT& rhy = r.hy();
const RT& rhw = r.hw();
const RT& shy = s.hy();
const RT& shw = s.hw();
const RT tbc1 = CGAL_NTS abs(phx*qhw - qhx*phw) * rhw*shw;
const RT tbc2 = CGAL_NTS abs(rhy*shw - shy*rhw) * phw*qhw;

View File

@ -1,3 +1,6 @@
2.36 (2 October 2001)
- Access functions of objects (like .x() ) now return const references.
2.35 (15 August 2001)
- SunPro patches.

View File

@ -58,8 +58,8 @@ public:
bool operator==(const Iso_cuboidH3<R>& s) const;
bool operator!=(const Iso_cuboidH3<R>& s) const;
PointH3<R> min() const;
PointH3<R> max() const;
const PointH3<R> & min() const;
const PointH3<R> & max() const;
PointH3<R> vertex(int i) const;
PointH3<R> operator[](int i) const;
@ -175,13 +175,13 @@ operator!=(const Iso_cuboidH3<R>& r) const
template < class R >
inline
PointH3<R>
const PointH3<R> &
Iso_cuboidH3<R>::min() const
{ return Ptr()->e0; }
template < class R >
inline
PointH3<R>
const PointH3<R> &
Iso_cuboidH3<R>::max() const
{ return Ptr()->e1; }
@ -273,9 +273,8 @@ Iso_cuboidH3<R>::vertex(int i) const
max().hz(), min().hw() );
case 6: return PointH3<R>( max().hx(), min().hy(),
max().hz(), min().hw() );
case 7: return max();
default: /*case 7:*/ return max();
}
return PointH3<R>();
}
template < class R >

View File

@ -92,11 +92,11 @@ public:
PlaneH3<R> perpendicular_plane(const PointH3<R>& p) const;
LineH3<R> opposite() const;
PointH3<R> point() const;
const PointH3<R> & point() const;
PointH3<R> point(int i) const;
PointH3<R> projection(const PointH3<R>& p) const;
DirectionH3<R>
const DirectionH3<R> &
direction() const;
bool has_on( const PointH3<R>& p ) const;
@ -126,7 +126,7 @@ CGAL_BEGIN_NAMESPACE
template < class R >
inline
PointH3<R>
const PointH3<R> &
LineH3<R>::point() const
{ return Ptr()->basepoint; }
@ -138,7 +138,7 @@ LineH3<R>::point(int i) const
template < class R >
inline
DirectionH3<R>
const DirectionH3<R> &
LineH3<R>::direction() const
{ return Ptr()->direction; }
@ -153,7 +153,7 @@ template < class R >
CGAL_KERNEL_INLINE
LineH3<R>
LineH3<R>::opposite() const
{ return LineH3<R>( Ptr()->basepoint, -(Ptr()->direction ) ); }
{ return LineH3<R>( point(), -direction() ); }
template < class R >
CGAL_KERNEL_LARGE_INLINE
@ -233,8 +233,7 @@ CGAL_KERNEL_INLINE
bool
LineH3<R>::operator==(const LineH3<R>& l) const
{
return ( (l.direction() == Ptr()->direction )
&&(l.has_on( Ptr()->basepoint ) ) );
return l.direction() == direction() && l.has_on( point() );
}
#ifdef CGAL_CFG_TYPENAME_BUG

View File

@ -63,12 +63,12 @@ class PointH3
FT x() const;
FT y() const;
FT z() const;
RT hx() const;
RT hy() const;
RT hz() const;
RT hw() const;
const RT & hx() const;
const RT & hy() const;
const RT & hz() const;
const RT & hw() const;
const RT & homogeneous(int i) const;
FT cartesian(int i) const;
RT homogeneous(int i) const;
FT operator[](int i) const;
int dimension() const;
@ -82,11 +82,6 @@ class PointH3
bool operator==( const PointH3<R>& p) const;
bool operator!=( const PointH3<R>& p) const;
const RT& hx_ref() const;
const RT& hy_ref() const;
const RT& hz_ref() const;
const RT& hw_ref() const;
};
@ -127,12 +122,12 @@ class VectorH3
FT x() const;
FT y() const;
FT z() const;
RT hx() const;
RT hy() const;
RT hz() const;
RT hw() const;
const RT & hx() const;
const RT & hy() const;
const RT & hz() const;
const RT & hw() const;
const RT & homogeneous(int i) const;
FT cartesian(int i) const;
RT homogeneous(int i) const;
FT operator[](int i) const;
int dimension() const;
@ -196,17 +191,17 @@ class DirectionH3
VectorH3<R> to_vector() const;
RT dx() const;
RT dy() const;
RT dz() const;
RT x() const;
RT y() const;
RT z() const;
RT hx() const;
RT hy() const;
RT hz() const;
const RT & dx() const;
const RT & dy() const;
const RT & dz() const;
const RT & x() const;
const RT & y() const;
const RT & z() const;
const RT & hx() const;
const RT & hy() const;
const RT & hz() const;
RT delta(int i) const;
const RT & delta(int i) const;
};
#ifdef CGAL_CFG_TYPENAME_BUG
@ -224,8 +219,7 @@ PointH3<R>::PointH3(const Origin&)
template < class R >
CGAL_KERNEL_CTOR_INLINE
PointH3<R>::PointH3(const RT& x, const RT& y, const RT& z,
const RT& w)
PointH3<R>::PointH3(const RT& x, const RT& y, const RT& z, const RT& w)
{
if ( w < RT(0) )
{ initialize_with( Point_ref_3(-x,-y,-z,-w)); }
@ -253,52 +247,28 @@ PointH3<R>::z() const
template < class R >
inline
typename PointH3<R>::RT
const typename PointH3<R>::RT &
PointH3<R>::hx() const
{ return Ptr()->hx() ; }
template < class R >
inline
typename PointH3<R>::RT
const typename PointH3<R>::RT &
PointH3<R>::hy() const
{ return Ptr()->hy() ; }
template < class R >
inline
typename PointH3<R>::RT
const typename PointH3<R>::RT &
PointH3<R>::hz() const
{ return Ptr()->hz() ; }
template < class R >
inline
typename PointH3<R>::RT
const typename PointH3<R>::RT &
PointH3<R>::hw() const
{ return Ptr()->hw(); }
template < class R >
inline
const typename PointH3<R>::RT&
PointH3<R>::hx_ref() const
{ return Ptr()->e0 ; }
template < class R >
inline
const typename PointH3<R>::RT&
PointH3<R>::hy_ref() const
{ return Ptr()->e1 ; }
template < class R >
inline
const typename PointH3<R>::RT&
PointH3<R>::hz_ref() const
{ return Ptr()->e2 ; }
template < class R >
inline
const typename PointH3<R>::RT&
PointH3<R>::hw_ref() const
{ return Ptr()->e3; }
template < class R >
inline
int
@ -321,7 +291,7 @@ PointH3<R>::cartesian(int i) const
template < class R >
CGAL_KERNEL_INLINE
typename PointH3<R>::RT
const typename PointH3<R>::RT &
PointH3<R>::homogeneous(int i) const
{
CGAL_kernel_precondition(i == 0 || i == 1 || i == 2 || i == 3);
@ -439,25 +409,25 @@ VectorH3<R>::z() const
template < class R >
inline
typename VectorH3<R>::RT
const typename VectorH3<R>::RT &
VectorH3<R>::hx() const
{ return Ptr()->hx() ; }
template < class R >
inline
typename VectorH3<R>::RT
const typename VectorH3<R>::RT &
VectorH3<R>::hy() const
{ return Ptr()->hy() ; }
template < class R >
inline
typename VectorH3<R>::RT
const typename VectorH3<R>::RT &
VectorH3<R>::hz() const
{ return Ptr()->hz() ; }
template < class R >
inline
typename VectorH3<R>::RT
const typename VectorH3<R>::RT &
VectorH3<R>::hw() const
{ return Ptr()->hw() ; }
@ -483,7 +453,7 @@ VectorH3<R>::cartesian(int i) const
template < class R >
CGAL_KERNEL_INLINE
typename VectorH3<R>::RT
const typename VectorH3<R>::RT &
VectorH3<R>::homogeneous(int i) const
{
CGAL_kernel_precondition(i == 0 || i == 1 || i == 2 || i == 3);
@ -543,7 +513,7 @@ DirectionH3<R>::DirectionH3(const RT& x, const RT& y, const RT& z,
template <class R >
CGAL_KERNEL_INLINE
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::delta(int i) const
{
switch (i)
@ -557,55 +527,55 @@ DirectionH3<R>::delta(int i) const
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::dx() const
{ return Ptr()->e0; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::x() const
{ return Ptr()->e0; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::hx() const
{ return Ptr()->e0; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::dy() const
{ return Ptr()->e1; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::y() const
{ return Ptr()->e1; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::hy() const
{ return Ptr()->e1; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::dz() const
{ return Ptr()->e2; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::z() const
{ return Ptr()->e2; }
template <class R >
inline
typename DirectionH3<R>::RT
const typename DirectionH3<R>::RT &
DirectionH3<R>::hz() const
{ return Ptr()->e2; }

View File

@ -64,13 +64,13 @@ class PlaneH3
PlaneH3(const PointH3<R>&, const VectorH3<R>& );
PlaneH3(const PointH3<R>&, const DirectionH3<R>&, const DirectionH3<R>& );
RT a() const;
RT b() const;
RT c() const;
RT d() const;
const RT & a() const;
const RT & b() const;
const RT & c() const;
const RT & d() const;
bool operator==( const PlaneH3<R>& ) const;
bool operator!=( const PlaneH3<R>& ) const;
bool operator==( const PlaneH3<R>& ) const;
bool operator!=( const PlaneH3<R>& ) const;
LineH3<R> perpendicular_line(const PointH3<R>& ) const;
PlaneH3<R> opposite() const; // plane with opposite orientation
@ -261,25 +261,25 @@ PlaneH3<R>::PlaneH3(const PointH3<R>& p,
template < class R >
inline
typename PlaneH3<R>::RT
const typename PlaneH3<R>::RT &
PlaneH3<R>::a() const
{ return Ptr()->e0; }
template < class R >
inline
typename PlaneH3<R>::RT
const typename PlaneH3<R>::RT &
PlaneH3<R>::b() const
{ return Ptr()->e1; }
template < class R >
inline
typename PlaneH3<R>::RT
const typename PlaneH3<R>::RT &
PlaneH3<R>::c() const
{ return Ptr()->e2; }
template < class R >
inline
typename PlaneH3<R>::RT
const typename PlaneH3<R>::RT &
PlaneH3<R>::d() const
{ return Ptr()->e3; }

View File

@ -80,11 +80,11 @@ class RayH3
RayH3( const PointH3<R>& sp, const DirectionH3<R>& d)
: Ray_handle_3_(Ray_ref_3(sp, d)) {}
PointH3<R> start() const;
PointH3<R> source() const;
const PointH3<R> & start() const;
const PointH3<R> & source() const;
PointH3<R> second_point() const;
PointH3<R> point(int i) const;
DirectionH3<R> direction() const;
const DirectionH3<R> & direction() const;
LineH3<R> supporting_line() const;
RayH3<R> opposite() const;
RayH3<R> transform( const Aff_transformationH3<R> & t) const;
@ -98,23 +98,23 @@ class RayH3
template < class R >
inline
PointH3<R>
const PointH3<R> &
RayH3<R>::source() const
{ return Ptr()->startpoint; }
template < class R >
inline
PointH3<R>
const PointH3<R> &
RayH3<R>::start() const
{ return Ptr()->startpoint; }
template < class R >
inline
DirectionH3<R>
const DirectionH3<R> &
RayH3<R>::direction() const
{
CGAL_kernel_precondition( !is_degenerate() );
return DirectionH3<R>( Ptr()->direction );
return Ptr()->direction;
}

View File

@ -37,10 +37,10 @@ public:
RepH3(const NT& a0, const NT& a1, const NT& a2, const NT& a3)
: e0(a0), e1(a1), e2(a2), e3(a3) {}
NT hx() const { return e0; }
NT hy() const { return e1; }
NT hz() const { return e2; }
NT hw() const { return e3; } // homogenizing component
const NT & hx() const { return e0; }
const NT & hy() const { return e1; }
const NT & hz() const { return e2; }
const NT & hw() const { return e3; } // homogenizing component
};
template <class NT>
@ -53,10 +53,10 @@ public:
Simple_RepH3(const NT& a0, const NT& a1, const NT& a2, const NT& a3)
: e0(a0), e1(a1), e2(a2), e3(a3) {}
NT hx() const { return e0; }
NT hy() const { return e1; }
NT hz() const { return e2; }
NT hw() const { return e3; } // homogenizing component
const NT & hx() const { return e0; }
const NT & hy() const { return e1; }
const NT & hz() const { return e2; }
const NT & hw() const { return e3; } // homogenizing component
};
CGAL_END_NAMESPACE

View File

@ -37,12 +37,11 @@ public:
Segment_repH3(const PointH3<R>& sp, const PointH3<R>& ep)
: startpoint(sp), endpoint(ep) {}
PointH3<R> start() const { return startpoint; }
PointH3<R> end() const { return endpoint; }
const PointH3<R> & start() const { return startpoint; }
const PointH3<R> & end() const { return endpoint; }
private:
PointH3<R> startpoint;
PointH3<R> endpoint;
PointH3<R> startpoint, endpoint;
};
template < class R >
@ -53,12 +52,11 @@ public:
Simple_Segment_repH3(const PointH3<R>& sp, const PointH3<R>& ep)
: startpoint(sp), endpoint(ep) {}
PointH3<R> start() const { return startpoint; }
PointH3<R> end() const { return endpoint; }
const PointH3<R> & start() const { return startpoint; }
const PointH3<R> & end() const { return endpoint; }
private:
PointH3<R> startpoint;
PointH3<R> endpoint;
PointH3<R> startpoint, endpoint;
};
template < class R_ >
@ -79,16 +77,16 @@ public:
SegmentH3( const PointH3<R>& sp, const PointH3<R>& ep)
: Segment_handle_3_(Segment_ref_3(sp, ep)) {}
PointH3<R> source() const;
PointH3<R> target() const;
const PointH3<R> & source() const;
const PointH3<R> & target() const;
PointH3<R> start() const;
PointH3<R> end() const;
PointH3<R> min() const;
PointH3<R> max() const;
PointH3<R> vertex(int i) const;
PointH3<R> point(int i) const;
PointH3<R> operator[](int i) const;
const PointH3<R> & start() const;
const PointH3<R> & end() const;
const PointH3<R> & min() const;
const PointH3<R> & max() const;
const PointH3<R> & vertex(int i) const;
const PointH3<R> & point(int i) const;
const PointH3<R> & operator[](int i) const;
FT squared_length() const;
DirectionH3<R>
@ -108,31 +106,31 @@ public:
template < class R >
inline
PointH3<R>
const PointH3<R> &
SegmentH3<R>::source() const
{ return Ptr()->start(); }
template < class R >
inline
PointH3<R>
const PointH3<R> &
SegmentH3<R>::target() const
{ return Ptr()->end(); }
template < class R >
inline
PointH3<R>
const PointH3<R> &
SegmentH3<R>::start() const
{ return Ptr()->start(); }
template < class R >
inline
PointH3<R>
const PointH3<R> &
SegmentH3<R>::end() const
{ return Ptr()->end(); }
template < class R >
CGAL_KERNEL_INLINE
PointH3<R>
const PointH3<R> &
SegmentH3<R>::min() const
{
return
@ -141,29 +139,28 @@ SegmentH3<R>::min() const
template < class R >
CGAL_KERNEL_INLINE
PointH3<R>
const PointH3<R> &
SegmentH3<R>::max() const
{
return
lexicographically_xyz_smaller_or_equal(source(),target()) ?
return lexicographically_xyz_smaller_or_equal(source(),target()) ?
target() : source();
}
template < class R >
inline
PointH3<R>
const PointH3<R> &
SegmentH3<R>::vertex(int i) const
{ return ( i%2 == 0 ) ? start() : end() ; }
template < class R >
inline
PointH3<R>
const PointH3<R> &
SegmentH3<R>::point(int i) const
{ return ( i%2 == 0 ) ? start() : end() ; }
template < class R >
inline
PointH3<R>
const PointH3<R> &
SegmentH3<R>::operator[](int i) const
{ return ( i%2 == 0 ) ? start() : end() ; }

View File

@ -110,29 +110,21 @@ class SphereH3
operator!=(const SphereH3<R>& s) const
{ return !(*this == s); }
PointH3<R>
center() const;
const PointH3<R> & center() const;
FT
squared_radius() const;
const FT & squared_radius() const;
Orientation
orientation() const;
Orientation orientation() const;
SphereH3<R>
orthogonal_transform(const Aff_transformationH3<R>& t) const;
SphereH3<R> orthogonal_transform(const Aff_transformationH3<R>& t) const;
bool
is_degenerate() const;
bool is_degenerate() const;
SphereH3<R>
opposite() const;
SphereH3<R> opposite() const;
Bbox_3
bbox() const;
Bbox_3 bbox() const;
Oriented_side
oriented_side(const PointH3<R>& p) const;
Oriented_side oriented_side(const PointH3<R>& p) const;
bool
has_on_boundary(const PointH3<R>& p) const
@ -156,7 +148,6 @@ class SphereH3
bool
has_on_unbounded_side(const PointH3<R>& p) const
{ return bounded_side(p)==ON_UNBOUNDED_SIDE; }
};
@ -231,13 +222,13 @@ SphereH3<R>::operator==(const SphereH3<R>& s) const
template <class R>
inline
PointH3<R>
const PointH3<R> &
SphereH3<R>::center() const
{ return Ptr()->center; }
template <class R>
inline
typename SphereH3<R>::FT
const typename SphereH3<R>::FT &
SphereH3<R>::squared_radius() const
{ return Ptr()->squared_radius; }

View File

@ -93,8 +93,8 @@ public:
const PointH3<R> &s)
: Tetrahedron_handle_3_(Tetrahedron_ref_3(p,q,r,s)) {}
PointH3<R> vertex(int i) const;
PointH3<R> operator[](int i) const;
const PointH3<R> & vertex(int i) const;
const PointH3<R> & operator[](int i) const;
bool operator==(const TetrahedronH3<R> &t) const;
bool operator!=(const TetrahedronH3<R> &t) const;
Bbox_3 bbox() const;
@ -119,8 +119,10 @@ CGAL_KERNEL_INLINE
bool
TetrahedronH3<R>::operator==(const TetrahedronH3<R> &t) const
{
if ( Ptr() == t.Ptr() ) return true;
if ( orientation() != t.orientation() ) return false;
if ( identical(t) )
return true;
if ( orientation() != t.orientation() )
return false;
std::vector< PointH3<R> > V1;
std::vector< PointH3<R> > V2;
@ -147,7 +149,7 @@ TetrahedronH3<R>::operator!=(const TetrahedronH3<R> &t) const
template < class R >
CGAL_KERNEL_INLINE
PointH3<R>
const PointH3<R> &
TetrahedronH3<R>::vertex(int i) const
{
switch (i%4)
@ -155,16 +157,16 @@ TetrahedronH3<R>::vertex(int i) const
case 0: return Ptr()->container.e0;
case 1: return Ptr()->container.e1;
case 2: return Ptr()->container.e2;
case 3: return Ptr()->container.e3;
default: /*case 3:*/ return Ptr()->container.e3;
}
return PointH3<R>();
}
template < class R >
inline
PointH3<R>
const PointH3<R> &
TetrahedronH3<R>::operator[](int i) const
{ return vertex(i); }
template < class R >
inline
bool

View File

@ -61,8 +61,8 @@ public:
bool nondegenerate_has_on(const PointH3<R> &p) const;
bool is_degenerate() const;
PointH3<R> vertex(int i) const;
PointH3<R> operator[](int i) const;
const PointH3<R> & vertex(int i) const;
const PointH3<R> & operator[](int i) const;
FT squared_area() const;
@ -91,7 +91,7 @@ TriangleH3<R>::operator!=(const TriangleH3<R> &t) const
template < class R >
CGAL_KERNEL_INLINE
PointH3<R>
const PointH3<R> &
TriangleH3<R>::vertex(int i) const
{
if (i<0) i=(i%3)+3;
@ -103,7 +103,7 @@ TriangleH3<R>::vertex(int i) const
template < class R >
inline
PointH3<R>
const PointH3<R> &
TriangleH3<R>::operator[](int i) const
{ return vertex(i); }

View File

@ -21,6 +21,4 @@
// coordinator : MPI, Saarbruecken (<Stefan.Schirra@mpi-sb.mpg.de>)
// ======================================================================
#ifndef CGAL_PVDH3_H
#include <CGAL/PVDH3.h>
#endif // CGAL_PVDH3_H

View File

@ -265,8 +265,8 @@ CGAL_KERNEL_INLINE
bool
equal_xy(const PointH3<R> &p, const PointH3<R> &q)
{
return (p.hx_ref() * q.hw_ref() == q.hx_ref() * p.hw_ref() )
&& (p.hy_ref() * q.hw_ref() == q.hy_ref() * p.hw_ref() );
return (p.hx() * q.hw() == q.hx() * p.hw() )
&& (p.hy() * q.hw() == q.hy() * p.hw() );
}
template < class R > // ??? -> ==
@ -274,29 +274,29 @@ CGAL_KERNEL_INLINE
bool
equal_xyz(const PointH3<R> &p, const PointH3<R> &q)
{
return (p.hx_ref() * q.hw_ref() == q.hx_ref() * p.hw_ref() )
&& (p.hy_ref() * q.hw_ref() == q.hy_ref() * p.hw_ref() )
&& (p.hz_ref() * q.hw_ref() == q.hz_ref() * p.hw_ref() );
return (p.hx() * q.hw() == q.hx() * p.hw() )
&& (p.hy() * q.hw() == q.hy() * p.hw() )
&& (p.hz() * q.hw() == q.hz() * p.hw() );
}
template < class R >
CGAL_KERNEL_INLINE
bool
less_x(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hx_ref() * q.hw_ref() < q.hx_ref() * p.hw_ref() ); }
{ return (p.hx() * q.hw() < q.hx() * p.hw() ); }
template < class R >
CGAL_KERNEL_INLINE
bool
less_y(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hy_ref() * q.hw_ref() < q.hy_ref() * p.hw_ref() ); }
{ return (p.hy() * q.hw() < q.hy() * p.hw() ); }
template < class R >
CGAL_KERNEL_INLINE
bool
less_z(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hz_ref() * q.hw_ref() < q.hz_ref() * p.hw_ref() ); }
{ return (p.hz() * q.hw() < q.hz() * p.hw() ); }
CGAL_END_NAMESPACE
@ -502,18 +502,18 @@ side_of_bounded_sphere(const PointH3<R> &p,
{
typedef typename R::RT RT;
const RT& phx = p.hx_ref();
const RT& phy = p.hy_ref();
const RT& phz = p.hz_ref();
const RT& phw = p.hw_ref();
const RT& qhx = q.hx_ref();
const RT& qhy = q.hy_ref();
const RT& qhz = q.hz_ref();
const RT& qhw = q.hw_ref();
const RT& thx = t.hx_ref();
const RT& thy = t.hy_ref();
const RT& thz = t.hz_ref();
const RT& thw = t.hw_ref();
const RT& phx = p.hx();
const RT& phy = p.hy();
const RT& phz = p.hz();
const RT& phw = p.hw();
const RT& qhx = q.hx();
const RT& qhy = q.hy();
const RT& qhz = q.hz();
const RT& qhw = q.hw();
const RT& thx = t.hx();
const RT& thy = t.hy();
const RT& thz = t.hz();
const RT& thw = t.hw();
return Bounded_side( CGAL_NTS sign((thx*phw-phx*thw)*(qhx*thw-thx*qhw)
+ (thy*phw-phy*thw)*(qhy*thw-thy*qhw)