Chris@16: // Boost.Polygon library segment_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_SEGMENT_TRAITS_HPP Chris@16: #define BOOST_POLYGON_SEGMENT_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 segment_traits { Chris@16: typedef Segment segment_type; Chris@16: typedef typename segment_type::point_type point_type; Chris@16: typedef typename segment_type::coordinate_type coordinate_type; Chris@16: Chris@16: static point_type get( Chris@16: const segment_type& segment, direction_1d dir) { Chris@16: return segment.get(dir); Chris@16: } Chris@16: }; Chris@16: Chris@16: template Chris@16: struct segment_mutable_traits { Chris@16: typedef Segment segment_type; Chris@16: typedef typename segment_type::point_type point_type; Chris@16: typedef typename segment_type::coordinate_type coordinate_type; Chris@16: Chris@16: static void set( Chris@16: segment_type& segment, direction_1d dir, const point_type& point) { Chris@16: segment.set(dir, point); Chris@16: } Chris@16: Chris@16: static segment_type construct(const point_type& low, const point_type& high) { Chris@16: return segment_type(low, high); Chris@16: } Chris@16: }; Chris@16: } // polygon Chris@16: } // boost Chris@16: Chris@16: #endif // BOOST_POLYGON_SEGMENT_TRAITS_HPP