Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:48:03

0001 // Boost.Polygon library segment_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_SEGMENT_TRAITS_HPP
0013 #define BOOST_POLYGON_SEGMENT_TRAITS_HPP
0014 
0015 #include "isotropy.hpp"
0016 
0017 namespace boost {
0018 namespace polygon {
0019 
0020 template <typename Segment>
0021 struct segment_traits {
0022   typedef Segment segment_type;
0023   typedef typename segment_type::point_type point_type;
0024   typedef typename segment_type::coordinate_type coordinate_type;
0025 
0026   static point_type get(
0027       const segment_type& segment, direction_1d dir) {
0028     return segment.get(dir);
0029   }
0030 };
0031 
0032 template <typename Segment>
0033 struct segment_mutable_traits {
0034   typedef Segment segment_type;
0035   typedef typename segment_type::point_type point_type;
0036   typedef typename segment_type::coordinate_type coordinate_type;
0037 
0038   static void set(
0039       segment_type& segment, direction_1d dir, const point_type& point) {
0040     segment.set(dir, point);
0041   }
0042 
0043   static segment_type construct(const point_type& low, const point_type& high) {
0044     return segment_type(low, high);
0045   }
0046 };
0047 }  // polygon
0048 }  // boost
0049 
0050 #endif  // BOOST_POLYGON_SEGMENT_TRAITS_HPP