Replace CGAL::get() with CGAL::get_pointee_or_identity() and remove using get::

This commit is contained in:
Andreas Fabri 2015-04-30 11:31:21 +02:00 committed by Laurent Rineau
parent 7d60976754
commit 8c20bd91c2
37 changed files with 117 additions and 118 deletions

View File

@ -62,17 +62,17 @@ public:
const Point_2 & center() const
{
return get(base).template get<0>();
return get_pointee_or_identity(base).template get<0>();
}
const FT & squared_radius() const
{
return get(base).template get<1>();
return get_pointee_or_identity(base).template get<1>();
}
Orientation orientation() const
{
return get(base).template get<2>();
return get_pointee_or_identity(base).template get<2>();
}
};

View File

@ -126,7 +126,7 @@ public:
const Plane_3& supporting_plane() const
{
return get(base).second;
return get_pointee_or_identity(base).second;
}
const Sphere_3& supporting_sphere() const
@ -146,7 +146,7 @@ public:
const Sphere_3& diametral_sphere() const
{
return get(base).first;
return get_pointee_or_identity(base).first;
}
double approximate_area() const

View File

@ -64,11 +64,11 @@ public:
const RT & dx() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const RT & dy() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
};

View File

@ -76,15 +76,15 @@ public:
const FT & dx() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const FT & dy() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
const FT & dz() const
{
return get(base)[2];
return get_pointee_or_identity(base)[2];
}
const FT & hdx() const

View File

@ -111,11 +111,11 @@ public:
const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const Point_3 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
Point_3 vertex(int i) const;
Point_3 operator[](int i) const;

View File

@ -59,11 +59,11 @@ public:
const Point_2 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const Point_2 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
};

View File

@ -61,15 +61,15 @@ public:
const FT & a() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const FT & b() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
const FT & c() const
{
return get(base)[2];
return get_pointee_or_identity(base)[2];
}
};

View File

@ -75,12 +75,12 @@ public:
const Point_3 & point() const
{
return get(base).first;
return get_pointee_or_identity(base).first;
}
const Vector_3 & to_vector() const
{
return get(base).second;
return get_pointee_or_identity(base).second;
}
Direction_3 direction() const

View File

@ -87,19 +87,19 @@ public:
const FT & a() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const FT & b() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
const FT & c() const
{
return get(base)[2];
return get_pointee_or_identity(base)[2];
}
const FT & d() const
{
return get(base)[3];
return get_pointee_or_identity(base)[3];
}
Line_3 perpendicular_line(const Point_3 &p) const;

View File

@ -55,13 +55,13 @@ public:
const Point_2&
source() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const Point_2 &
second_point() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
typename R_::Boolean is_degenerate() const

View File

@ -67,11 +67,11 @@ public:
const Point_3 & source() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const Point_3 & second_point() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
Point_3 point(int i) const;

View File

@ -53,13 +53,13 @@ public:
const Point_2 &
source() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const Point_2 &
target() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
};

View File

@ -60,11 +60,11 @@ public:
const Point_3 & source() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const Point_3 & target() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
const Point_3 & start() const;

View File

@ -109,17 +109,17 @@ public:
const Point_3_ & center() const
{
return get(base).template get<0>();
return get_pointee_or_identity(base).template get<0>();
}
const FT & squared_radius() const
{
// Returns the square of the radius (instead of the radius itself,
// which would require square roots)
return get(base).template get<1>();
return get_pointee_or_identity(base).template get<1>();
}
Orientation orientation() const
{
return get(base).template get<2>();
return get_pointee_or_identity(base).template get<2>();
}
// A circle is degenerate if its (squared) radius is null or negative

View File

@ -119,10 +119,10 @@ vertex(int i) const
else if (i>3) i=i%4;
switch (i)
{
case 0: return get(base)[0];
case 1: return get(base)[1];
case 2: return get(base)[2];
default: return get(base)[3];
case 0: return get_pointee_or_identity(base)[0];
case 1: return get_pointee_or_identity(base)[1];
case 2: return get_pointee_or_identity(base)[2];
default: return get_pointee_or_identity(base)[3];
}
}

View File

@ -57,9 +57,9 @@ public:
{
if (i>2) i = i%3;
else if (i<0) i = (i%3) + 3;
return (i==0) ? get(base)[0] :
(i==1) ? get(base)[1] :
get(base)[2];
return (i==0) ? get_pointee_or_identity(base)[0] :
(i==1) ? get_pointee_or_identity(base)[1] :
get_pointee_or_identity(base)[2];
}
const Point_2 &

View File

@ -95,9 +95,9 @@ TriangleC3<R>::vertex(int i) const
{
if (i<0) i=(i%3)+3;
else if (i>2) i=i%3;
return (i==0) ? get(base)[0] :
(i==1) ? get(base)[1] :
get(base)[2];
return (i==0) ? get_pointee_or_identity(base)[0] :
(i==1) ? get_pointee_or_identity(base)[1] :
get_pointee_or_identity(base)[2];
}
template < class R >

View File

@ -65,12 +65,12 @@ public:
const FT & x() const
{
return CGAL::get(base)[0];
return CGAL::get_pointee_or_identity(base)[0];
}
const FT & y() const
{
return CGAL::get(base)[1];
return CGAL::get_pointee_or_identity(base)[1];
}
const FT & hx() const
@ -90,12 +90,12 @@ public:
Cartesian_const_iterator cartesian_begin() const
{
return CGAL::get(base).begin();
return CGAL::get_pointee_or_identity(base).begin();
}
Cartesian_const_iterator cartesian_end() const
{
return CGAL::get(base).end();
return CGAL::get_pointee_or_identity(base).end();
}
};

View File

@ -80,15 +80,15 @@ public:
const FT_ & x() const
{
return get(base)[0];
return get_pointee_or_identity(base)[0];
}
const FT_ & y() const
{
return get(base)[1];
return get_pointee_or_identity(base)[1];
}
const FT_ & z() const
{
return get(base)[2];
return get_pointee_or_identity(base)[2];
}
const FT_ & hx() const
@ -110,12 +110,12 @@ public:
Cartesian_const_iterator cartesian_begin() const
{
return get(base).begin();
return get_pointee_or_identity(base).begin();
}
Cartesian_const_iterator cartesian_end() const
{
return get(base).end();
return get_pointee_or_identity(base).end();
}
const FT_ & cartesian(int i) const;

View File

@ -57,7 +57,7 @@ namespace CGAL {
public:
const Sphere_3& reference_sphere(){
return get_ref_sphere(get(base).template get<0>());
return get_ref_sphere(get_pointee_or_identity(base).template get<0>());
};
@ -228,17 +228,17 @@ namespace CGAL {
const Circle_3& supporting_circle() const
{
return get(base).template get<0>();
return get_pointee_or_identity(base).template get<0>();
}
const Circular_arc_point_3& source() const
{
return get(base).template get<1>();
return get_pointee_or_identity(base).template get<1>();
}
const Circular_arc_point_3& target() const
{
return get(base).template get<2>();
return get_pointee_or_identity(base).template get<2>();
}
Plane_3 supporting_plane() const {

View File

@ -207,14 +207,14 @@ public:
}
}
const Root_of_2 & x() const { return get(base).x(); }
const Root_of_2 & y() const { return get(base).y(); }
const Root_of_2 & z() const { return get(base).z(); }
const Root_of_2 & x() const { return get_pointee_or_identity(base).x(); }
const Root_of_2 & y() const { return get_pointee_or_identity(base).y(); }
const Root_of_2 & z() const { return get_pointee_or_identity(base).z(); }
const Root_for_spheres_2_3 & coordinates() const { return get(base); }
const Root_for_spheres_2_3 & coordinates() const { return get_pointee_or_identity(base); }
const CGAL::Bbox_3 bbox() const {
return get(base).bbox();
return get_pointee_or_identity(base).bbox();
}
bool operator==(const Circular_arc_point_3 &) const;

View File

@ -150,17 +150,17 @@ namespace CGAL {
const Line_3& supporting_line() const
{
return get(base).template get<0>();
return get_pointee_or_identity(base).template get<0>();
}
const Circular_arc_point_3& source() const
{
return get(base).template get<1>();
return get_pointee_or_identity(base).template get<1>();
}
const Circular_arc_point_3& target() const
{
return get(base).template get<2>();
return get_pointee_or_identity(base).template get<2>();
}
const Circular_arc_point_3& lower_xyz_extremity() const

View File

@ -115,13 +115,13 @@ template <class R>
inline
const typename CircleH2<R>::Point_2 &
CircleH2<R>::center() const
{ return get(base).template get<0>(); }
{ return get_pointee_or_identity(base).template get<0>(); }
template <class R>
inline
const typename CircleH2<R>::FT &
CircleH2<R>::squared_radius() const
{ return get(base).template get<1>(); }
{ return get_pointee_or_identity(base).template get<1>(); }
template <class R>
CGAL_KERNEL_INLINE
@ -137,7 +137,7 @@ template <class R>
inline
Orientation
CircleH2<R>::orientation() const
{ return get(base).template get<2>(); }
{ return get_pointee_or_identity(base).template get<2>(); }
template <class R>
CGAL_KERNEL_INLINE

View File

@ -78,12 +78,12 @@ public:
Vector_2 to_vector() const;
const RT & x() const { return CGAL::get(base)[0]; }
const RT & y() const { return CGAL::get(base)[1]; }
const RT & x() const { return CGAL::get_pointee_or_identity(base)[0]; }
const RT & y() const { return CGAL::get_pointee_or_identity(base)[1]; }
const RT & delta(int i) const;
const RT & dx() const { return CGAL::get(base)[0]; }
const RT & dy() const { return CGAL::get(base)[1]; }
const RT & dx() const { return CGAL::get_pointee_or_identity(base)[0]; }
const RT & dy() const { return CGAL::get_pointee_or_identity(base)[1]; }
};

View File

@ -82,15 +82,15 @@ public:
Vector_3 to_vector() const;
Vector_3 vector() const { return to_vector(); }
const RT & dx() const { return get(base)[0]; }
const RT & dy() const { return get(base)[1]; }
const RT & dz() const { return get(base)[2]; }
const RT & x() const { return get(base)[0]; }
const RT & y() const { return get(base)[1]; }
const RT & z() const { return get(base)[2]; }
const RT & hx() const { return get(base)[0]; }
const RT & hy() const { return get(base)[1]; }
const RT & hz() const { return get(base)[2]; }
const RT & dx() const { return get_pointee_or_identity(base)[0]; }
const RT & dy() const { return get_pointee_or_identity(base)[1]; }
const RT & dz() const { return get_pointee_or_identity(base)[2]; }
const RT & x() const { return get_pointee_or_identity(base)[0]; }
const RT & y() const { return get_pointee_or_identity(base)[1]; }
const RT & z() const { return get_pointee_or_identity(base)[2]; }
const RT & hx() const { return get_pointee_or_identity(base)[0]; }
const RT & hy() const { return get_pointee_or_identity(base)[1]; }
const RT & hz() const { return get_pointee_or_identity(base)[2]; }
};
template <class R >

View File

@ -213,13 +213,13 @@ template < class R >
inline
const typename Iso_cuboidH3<R>::Point_3 &
Iso_cuboidH3<R>::min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ return get(base)[0]; }
{ return get_pointee_or_identity(base)[0]; }
template < class R >
inline
const typename Iso_cuboidH3<R>::Point_3 &
Iso_cuboidH3<R>::max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ return get(base)[1]; }
{ return get_pointee_or_identity(base)[1]; }
template < class R >
inline

View File

@ -69,13 +69,13 @@ template < class R >
inline
const typename Iso_rectangleH2<R>::Point_2 &
Iso_rectangleH2<R>::min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ return get(base)[0]; }
{ return get_pointee_or_identity(base)[0]; }
template < class R >
inline
const typename Iso_rectangleH2<R>::Point_2 &
Iso_rectangleH2<R>::max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ return get(base)[1]; }
{ return get_pointee_or_identity(base)[1]; }
template < class R >
CGAL_KERNEL_INLINE

View File

@ -58,9 +58,9 @@ public:
bool operator==(const LineH2<R>& l) const;
bool operator!=(const LineH2<R>& l) const;
const RT & a() const { return get(base)[0]; }
const RT & b() const { return get(base)[1]; }
const RT & c() const { return get(base)[2]; }
const RT & a() const { return get_pointee_or_identity(base)[0]; }
const RT & b() const { return get_pointee_or_identity(base)[1]; }
const RT & c() const { return get_pointee_or_identity(base)[2]; }
};

View File

@ -258,25 +258,25 @@ template < class R >
inline
const typename PlaneH3<R>::RT &
PlaneH3<R>::a() const
{ return get(base)[0]; }
{ return get_pointee_or_identity(base)[0]; }
template < class R >
inline
const typename PlaneH3<R>::RT &
PlaneH3<R>::b() const
{ return get(base)[1]; }
{ return get_pointee_or_identity(base)[1]; }
template < class R >
inline
const typename PlaneH3<R>::RT &
PlaneH3<R>::c() const
{ return get(base)[2]; }
{ return get_pointee_or_identity(base)[2]; }
template < class R >
inline
const typename PlaneH3<R>::RT &
PlaneH3<R>::d() const
{ return get(base)[3]; }
{ return get_pointee_or_identity(base)[3]; }
template < class R >
CGAL_KERNEL_INLINE

View File

@ -84,20 +84,20 @@ template < class R >
inline
const typename RayH3<R>::Point_3 &
RayH3<R>::source() const
{ return get(base).first; }
{ return get_pointee_or_identity(base).first; }
template < class R >
inline
const typename RayH3<R>::Point_3 &
RayH3<R>::start() const
{ return get(base).first; }
{ return get_pointee_or_identity(base).first; }
template < class R >
inline
const typename RayH3<R>::Vector_3 &
RayH3<R>::to_vector() const
{
return get(base).second;
return get_pointee_or_identity(base).second;
}
template < class R >

View File

@ -182,19 +182,19 @@ template <class R>
inline
const typename SphereH3<R>::Point_3 &
SphereH3<R>::center() const
{ return get(base).template get<0>(); }
{ return get_pointee_or_identity(base).template get<0>(); }
template <class R>
inline
const typename SphereH3<R>::FT &
SphereH3<R>::squared_radius() const
{ return get(base).template get<1>(); }
{ return get_pointee_or_identity(base).template get<1>(); }
template <class R>
inline
Orientation
SphereH3<R>::orientation() const
{ return get(base).template get<2>(); }
{ return get_pointee_or_identity(base).template get<2>(); }
template <class R>
inline

View File

@ -95,9 +95,9 @@ public:
bool operator==( const Null_vector&) const;
bool operator!=( const Null_vector& v) const;
const RT & hx() const { return CGAL::get(base)[0]; };
const RT & hy() const { return CGAL::get(base)[1]; };
const RT & hw() const { return CGAL::get(base)[2]; };
const RT & hx() const { return CGAL::get_pointee_or_identity(base)[0]; };
const RT & hy() const { return CGAL::get_pointee_or_identity(base)[1]; };
const RT & hw() const { return CGAL::get_pointee_or_identity(base)[2]; };
FT x() const { return FT(hx()) / FT(hw()); };
FT y() const { return FT(hy()) / FT(hw()); };
@ -108,13 +108,13 @@ public:
Cartesian_const_iterator cartesian_begin() const
{
return make_cartesian_const_iterator_begin(CGAL::get(base).begin(),
boost::prior(CGAL::get(base).end()));
return make_cartesian_const_iterator_begin(CGAL::get_pointee_or_identity(base).begin(),
boost::prior(CGAL::get_pointee_or_identity(base).end()));
}
Cartesian_const_iterator cartesian_end() const
{
return make_cartesian_const_iterator_end(boost::prior(CGAL::get(base).end()));
return make_cartesian_const_iterator_end(boost::prior(CGAL::get_pointee_or_identity(base).end()));
}
int dimension() const;
@ -181,7 +181,7 @@ const typename VectorH2<R>::RT &
VectorH2<R>::homogeneous(int i) const
{
CGAL_kernel_precondition( (i>=0) && (i<=2) );
return CGAL::get(base)[i];
return CGAL::get_pointee_or_identity(base)[i];
}
template < class R >

View File

@ -100,10 +100,10 @@ public:
: base( w >= RT(0) ? CGAL::make_array(x, y, z, w)
: CGAL::make_array<RT>(-x, -y, -z, -w) ) {}
const RT & hx() const { return get(base)[0]; }
const RT & hy() const { return get(base)[1]; }
const RT & hz() const { return get(base)[2]; }
const RT & hw() const { return get(base)[3]; }
const RT & hx() const { return get_pointee_or_identity(base)[0]; }
const RT & hy() const { return get_pointee_or_identity(base)[1]; }
const RT & hz() const { return get_pointee_or_identity(base)[2]; }
const RT & hw() const { return get_pointee_or_identity(base)[3]; }
FT x() const { return FT(hx())/FT(hw()); }
FT y() const { return FT(hy())/FT(hw()); }
FT z() const { return FT(hz())/FT(hw()); }
@ -113,13 +113,13 @@ public:
Cartesian_const_iterator cartesian_begin() const
{
return make_cartesian_const_iterator_begin(get(base).begin(),
boost::prior(get(base).end()));
return make_cartesian_const_iterator_begin(get_pointee_or_identity(base).begin(),
boost::prior(get_pointee_or_identity(base).end()));
}
Cartesian_const_iterator cartesian_end() const
{
return make_cartesian_const_iterator_end(boost::prior(get(base).end()));
return make_cartesian_const_iterator_end(boost::prior(get_pointee_or_identity(base).end()));
}
int dimension() const { return 3; };
@ -159,7 +159,7 @@ const typename VectorH3<R>::RT &
VectorH3<R>::homogeneous(int i) const
{
CGAL_kernel_precondition(i == 0 || i == 1 || i == 2 || i == 3);
return get(base)[i];
return get_pointee_or_identity(base)[i];
}
template < class R >

View File

@ -93,7 +93,7 @@ public:
const Point_3 & start() const;
const Point_3 & source() const
{
return get(base).e0;
return get_pointee_or_identity(base).e0;
}
Direction_3 direction() const;

View File

@ -63,7 +63,7 @@ public:
const Rep& rep() const
{
return CGAL::get(data);
return CGAL::get_pointee_or_identity(data);
}
#ifdef CGAL_CXX11

View File

@ -36,7 +36,6 @@
namespace CGAL {
using ::get;
/// \cond SKIP_DOXYGEN
/// Property map that accesses a value from an iterator

View File

@ -292,7 +292,7 @@ template <class T> inline bool identical(const T &t1, const T &t2) { return &t1
template <class T, class Allocator>
inline
const T&
get(const Handle_for<T, Allocator> &h)
get_pointee_or_identity(const Handle_for<T, Allocator> &h)
{
return *(h.Ptr());
}
@ -300,7 +300,7 @@ get(const Handle_for<T, Allocator> &h)
template <class T>
inline
const T&
get(const T &t)
get_pointee_or_identity(const T &t)
{
return t;
}