summaryrefslogtreecommitdiff
path: root/boost/polygon/point_traits.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/polygon/point_traits.hpp')
-rw-r--r--boost/polygon/point_traits.hpp71
1 files changed, 42 insertions, 29 deletions
diff --git a/boost/polygon/point_traits.hpp b/boost/polygon/point_traits.hpp
index 504fa355f5..5bc43d1514 100644
--- a/boost/polygon/point_traits.hpp
+++ b/boost/polygon/point_traits.hpp
@@ -1,35 +1,48 @@
-/*
- Copyright 2008 Intel Corporation
-
- Use, modification and distribution are subject to the Boost Software License,
- Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-*/
+// Boost.Polygon library point_traits.hpp header file
+
+// Copyright (c) Intel Corporation 2008.
+// Copyright (c) 2008-2012 Simonson Lucanus.
+// Copyright (c) 2012-2012 Andrii Sydorchuk.
+
+// See http://www.boost.org for updates, documentation, and revision history.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
#ifndef BOOST_POLYGON_POINT_TRAITS_HPP
#define BOOST_POLYGON_POINT_TRAITS_HPP
#include "isotropy.hpp"
-namespace boost { namespace polygon{
- template <typename T>
- struct point_traits {
- typedef typename T::coordinate_type coordinate_type;
-
- static inline coordinate_type get(const T& point, orientation_2d orient) {
- return point.get(orient);
- }
- };
-
- template <typename T>
- struct point_mutable_traits {
- static inline void set(T& point, orientation_2d orient, typename point_traits<T>::coordinate_type value) {
- point.set(orient, value);
- }
- static inline T construct(typename point_traits<T>::coordinate_type x_value, typename point_traits<T>::coordinate_type y_value) {
- return T(x_value, y_value);
- }
- };
-}
-}
-#endif
+namespace boost {
+namespace polygon {
+
+template <typename PointType>
+struct point_traits {
+ typedef PointType point_type;
+ typedef typename point_type::coordinate_type coordinate_type;
+
+ static coordinate_type get(
+ const point_type& point, orientation_2d orient) {
+ return point.get(orient);
+ }
+};
+
+template <typename PointType>
+struct point_mutable_traits {
+ typedef PointType point_type;
+ typedef typename point_type::coordinate_type coordinate_type;
+
+ static void set(
+ point_type& point, orientation_2d orient, coordinate_type value) {
+ point.set(orient, value);
+ }
+
+ static point_type construct(coordinate_type x, coordinate_type y) {
+ return point_type(x, y);
+ }
+};
+} // polygon
+} // boost
+#endif // BOOST_POLYGON_POINT_TRAITS_HPP