Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:47:59

0001 // Boost.Polygon library point_traits.hpp header file
0002 
0003 // Copyright (c) Intel Corporation 2008.
0004 // Copyright (c) 2008-2012 Simonson Lucanus.
0005 // Copyright (c) 2012-2012 Andrii Sydorchuk.
0006 
0007 // See http://www.boost.org for updates, documentation, and revision history.
0008 // Use, modification and distribution is subject to the Boost Software License,
0009 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 
0012 #ifndef BOOST_POLYGON_POINT_TRAITS_HPP
0013 #define BOOST_POLYGON_POINT_TRAITS_HPP
0014 
0015 #include "isotropy.hpp"
0016 
0017 namespace boost {
0018 namespace polygon {
0019 
0020 template <typename PointType>
0021 struct point_traits {
0022   typedef PointType point_type;
0023   typedef typename point_type::coordinate_type coordinate_type;
0024 
0025   static coordinate_type get(
0026       const point_type& point, orientation_2d orient) {
0027     return point.get(orient);
0028   }
0029 };
0030 
0031 template <typename PointType>
0032 struct point_mutable_traits {
0033   typedef PointType point_type;
0034   typedef typename point_type::coordinate_type coordinate_type;
0035 
0036   static void set(
0037       point_type& point, orientation_2d orient, coordinate_type value) {
0038     point.set(orient, value);
0039   }
0040 
0041   static point_type construct(coordinate_type x, coordinate_type y) {
0042     return point_type(x, y);
0043   }
0044 };
0045 }  // polygon
0046 }  // boost
0047 
0048 #endif  // BOOST_POLYGON_POINT_TRAITS_HPP