Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Boost.Polygon library interval_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_INTERVAL_TRAITS_HPP
0013 #define BOOST_POLYGON_INTERVAL_TRAITS_HPP
0014 
0015 #include "isotropy.hpp"
0016 
0017 namespace boost {
0018 namespace polygon {
0019 
0020 template <typename Interval>
0021 struct interval_traits {
0022   typedef Interval interval_type;
0023   typedef typename interval_type::coordinate_type coordinate_type;
0024 
0025   static coordinate_type get(const interval_type& interval, direction_1d dir) {
0026     return interval.get(dir);
0027   }
0028 };
0029 
0030 template <typename Interval>
0031 struct interval_mutable_traits {
0032   typedef Interval interval_type;
0033   typedef typename interval_type::coordinate_type coordinate_type;
0034 
0035   static void set(
0036       interval_type& interval, direction_1d dir, coordinate_type value) {
0037     interval.set(dir, value);
0038   }
0039 
0040   static interval_type construct(coordinate_type low, coordinate_type high) {
0041     return interval_type(low, high);
0042   }
0043 };
0044 }  // polygon
0045 }  // boost
0046 
0047 #endif  // BOOST_POLICY_INTERVAL_TRAITS_HPP