1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef BOOST_POLYGON_SEGMENT_TRAITS_HPP
- #define BOOST_POLYGON_SEGMENT_TRAITS_HPP
- #include "isotropy.hpp"
- namespace boost {
- namespace polygon {
- template <typename Segment>
- struct segment_traits {
- typedef Segment segment_type;
- typedef typename segment_type::point_type point_type;
- typedef typename segment_type::coordinate_type coordinate_type;
- static point_type get(
- const segment_type& segment, direction_1d dir) {
- return segment.get(dir);
- }
- };
- template <typename Segment>
- struct segment_mutable_traits {
- typedef Segment segment_type;
- typedef typename segment_type::point_type point_type;
- typedef typename segment_type::coordinate_type coordinate_type;
- static void set(
- segment_type& segment, direction_1d dir, const point_type& point) {
- segment.set(dir, point);
- }
- static segment_type construct(const point_type& low, const point_type& high) {
- return segment_type(low, high);
- }
- };
- }
- }
- #endif
|