File indexing completed on 2025-01-18 09:48:03
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
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 }
0048 }
0049
0050 #endif