File indexing completed on 2025-01-18 09:48:03
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_POLYGON_RECTANGLE_TRAITS_HPP
0009 #define BOOST_POLYGON_RECTANGLE_TRAITS_HPP
0010
0011 #include "isotropy.hpp"
0012
0013 namespace boost { namespace polygon{
0014
0015 template <typename T, typename enable = gtl_yes>
0016 struct rectangle_traits {};
0017 template <typename T>
0018 struct rectangle_traits<T, gtl_no> {};
0019
0020 template <typename T>
0021 struct rectangle_traits<T, typename gtl_same_type<typename T::interval_type, typename T::interval_type>::type> {
0022 typedef typename T::coordinate_type coordinate_type;
0023 typedef typename T::interval_type interval_type;
0024 static inline interval_type get(const T& rectangle, orientation_2d orient) {
0025 return rectangle.get(orient); }
0026 };
0027
0028 template <typename T>
0029 struct rectangle_mutable_traits {
0030 template <typename T2>
0031 static inline void set(T& rectangle, orientation_2d orient, const T2& interval) {
0032 rectangle.set(orient, interval); }
0033 template <typename T2, typename T3>
0034 static inline T construct(const T2& interval_horizontal,
0035 const T3& interval_vertical) {
0036 return T(interval_horizontal, interval_vertical); }
0037 };
0038 }
0039 }
0040 #endif