1 // Copyright (c) 1999,2001
2 // Utrecht University (The Netherlands),
3 // ETH Zurich (Switzerland),
4 // INRIA Sophia-Antipolis (France),
5 // Max-Planck-Institute Saarbruecken (Germany),
6 // and Tel-Aviv University (Israel).  All rights reserved.
7 //
8 // This file is part of CGAL (www.cgal.org)
9 //
10 // $URL: https://github.com/CGAL/cgal/blob/v5.3/Homogeneous_kernel/include/CGAL/Homogeneous/Data_accessorH2.h $
11 // $Id: Data_accessorH2.h 0779373 2020-03-26T13:31:46+01:00 Sébastien Loriot
12 // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
13 //
14 //
15 // Author(s)     : Stefan Schirra
16 
17 
18 #ifndef CGAL_DATA_ACCESSORH2_H
19 #define CGAL_DATA_ACCESSORH2_H
20 
21 namespace CGAL {
22 
23 template < class R >
24 class Data_accessorH2
25 {
26 public:
27     typedef typename R::FT FT;
28     typedef typename R::RT RT;
29     typedef typename R::Point_2      Point_2;
30 
get_hx(const Point_2 & p)31     RT  get_hx( const Point_2 & p) const { return( p.hx()); }
get_hy(const Point_2 & p)32     RT  get_hy( const Point_2 & p) const { return( p.hy()); }
get_hw(const Point_2 & p)33     RT  get_hw( const Point_2 & p) const { return( p.hw()); }
34 
35     void
get(const Point_2 & p,RT & hx,RT & hy,RT & hw)36     get( const Point_2 & p, RT& hx, RT& hy, RT& hw) const
37     {
38         hx = get_hx( p);
39         hy = get_hy( p);
40         hw = get_hw( p);
41     }
42 
43     void
set(Point_2 & p,const RT & hx,const RT & hy,const RT & hw)44     set( Point_2& p, const RT & hx, const RT & hy, const RT & hw) const
45     {
46         p = Point_2( hx, hy, hw);
47     }
48 };
49 
50 } //namespace CGAL
51 
52 #endif // CGAL_DATA_ACCESSORH2_H
53