1 // Boost.Polygon library segment_traits.hpp header file
3 // Copyright (c) Intel Corporation 2008.
4 // Copyright (c) 2008-2012 Simonson Lucanus.
5 // Copyright (c) 2012-2012 Andrii Sydorchuk.
7 // See http://www.boost.org for updates, documentation, and revision history.
8 // Use, modification and distribution is subject to the Boost Software License,
9 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 #ifndef BOOST_POLYGON_SEGMENT_TRAITS_HPP
13 #define BOOST_POLYGON_SEGMENT_TRAITS_HPP
15 #include "isotropy.hpp"
20 template <typename Segment>
21 struct segment_traits {
22 typedef Segment segment_type;
23 typedef typename segment_type::point_type point_type;
24 typedef typename segment_type::coordinate_type coordinate_type;
26 static point_type get(
27 const segment_type& segment, direction_1d dir) {
28 return segment.get(dir);
32 template <typename Segment>
33 struct segment_mutable_traits {
34 typedef Segment segment_type;
35 typedef typename segment_type::point_type point_type;
36 typedef typename segment_type::coordinate_type coordinate_type;
39 segment_type& segment, direction_1d dir, const point_type& point) {
40 segment.set(dir, point);
43 static segment_type construct(const point_type& low, const point_type& high) {
44 return segment_type(low, high);
50 #endif // BOOST_POLYGON_SEGMENT_TRAITS_HPP