Chris@16: // Boost.Polygon library point_traits.hpp header file Chris@16: Chris@16: // Copyright (c) Intel Corporation 2008. Chris@16: // Copyright (c) 2008-2012 Simonson Lucanus. Chris@16: // Copyright (c) 2012-2012 Andrii Sydorchuk. Chris@16: Chris@16: // See http://www.boost.org for updates, documentation, and revision history. Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_POLYGON_POINT_TRAITS_HPP Chris@16: #define BOOST_POLYGON_POINT_TRAITS_HPP Chris@16: Chris@16: #include "isotropy.hpp" Chris@16: Chris@16: namespace boost { Chris@16: namespace polygon { Chris@16: Chris@16: template Chris@16: struct point_traits { Chris@16: typedef PointType point_type; Chris@16: typedef typename point_type::coordinate_type coordinate_type; Chris@16: Chris@16: static coordinate_type get( Chris@16: const point_type& point, orientation_2d orient) { Chris@16: return point.get(orient); Chris@16: } Chris@16: }; Chris@16: Chris@16: template Chris@16: struct point_mutable_traits { Chris@16: typedef PointType point_type; Chris@16: typedef typename point_type::coordinate_type coordinate_type; Chris@16: Chris@16: static void set( Chris@16: point_type& point, orientation_2d orient, coordinate_type value) { Chris@16: point.set(orient, value); Chris@16: } Chris@16: Chris@16: static point_type construct(coordinate_type x, coordinate_type y) { Chris@16: return point_type(x, y); Chris@16: } Chris@16: }; Chris@16: } // polygon Chris@16: } // boost Chris@16: Chris@16: #endif // BOOST_POLYGON_POINT_TRAITS_HPP