Chris@16: // Boost.Polygon library interval_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_INTERVAL_TRAITS_HPP Chris@16: #define BOOST_POLYGON_INTERVAL_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 interval_traits { Chris@16: typedef Interval interval_type; Chris@16: typedef typename interval_type::coordinate_type coordinate_type; Chris@16: Chris@16: static coordinate_type get(const interval_type& interval, direction_1d dir) { Chris@16: return interval.get(dir); Chris@16: } Chris@16: }; Chris@16: Chris@16: template Chris@16: struct interval_mutable_traits { Chris@16: typedef Interval interval_type; Chris@16: typedef typename interval_type::coordinate_type coordinate_type; Chris@16: Chris@16: static void set( Chris@16: interval_type& interval, direction_1d dir, coordinate_type value) { Chris@16: interval.set(dir, value); Chris@16: } Chris@16: Chris@16: static interval_type construct(coordinate_type low, coordinate_type high) { Chris@16: return interval_type(low, high); Chris@16: } Chris@16: }; Chris@16: } // polygon Chris@16: } // boost Chris@16: Chris@16: #endif // BOOST_POLICY_INTERVAL_TRAITS_HPP