Boost logo

Boost-Commit :

From: lucanus.j.simonson_at_[hidden]
Date: 2008-05-13 16:31:58


Author: ljsimons
Date: 2008-05-13 16:31:57 EDT (Tue, 13 May 2008)
New Revision: 45341
URL: http://svn.boost.org/trac/boost/changeset/45341

Log:
concept types inherit from eachtoher
Text files modified:
   sandbox/gtl/gtl/point_3d_concept.h | 9 ----
   sandbox/gtl/gtl/polygon_with_holes_concept.h | 73 ---------------------------------------
   2 files changed, 2 insertions(+), 80 deletions(-)

Modified: sandbox/gtl/gtl/point_3d_concept.h
==============================================================================
--- sandbox/gtl/gtl/point_3d_concept.h (original)
+++ sandbox/gtl/gtl/point_3d_concept.h 2008-05-13 16:31:57 EDT (Tue, 13 May 2008)
@@ -5,7 +5,7 @@
   Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
   http://www.boost.org/LICENSE_1_0.txt).
 */
-struct point_3d_concept {
+struct point_3d_concept : point_concept {
   point_3d_concept() {}
 
   template <typename point_3d_type>
@@ -13,10 +13,6 @@
     typedef typename point_3d_traits<point_3d_type>::coordinate_type component_type;
   };
 
- template <orientation_2d_enum orient, typename T>
- static inline typename point_traits<T>::coordinate_type get(const T& point) {
- return point_traits<T>::get(point, orient); }
-
   template <orientation_3d_enum orient, typename T>
   static inline typename point_3d_traits<T>::coordinate_type get(const T& point) {
     return point_3d_traits<T>::get(point, orient); }
@@ -25,9 +21,6 @@
   static inline typename point_3d_traits<T>::coordinate_type get(const T& point, orientation_3d orient) {
     return point_3d_traits<T>::get(point, orient); }
   
- template <orientation_2d_enum orient, typename T, typename coordinate_type>
- static inline void set(T& point, coordinate_type value) {
- point_traits<T>::set(point, orient, value); }
   template <orientation_3d_enum orient, typename T, typename coordinate_type>
   static inline void set(T& point, coordinate_type value) {
     point_traits<T>::set(point, orient, value); }

Modified: sandbox/gtl/gtl/polygon_with_holes_concept.h
==============================================================================
--- sandbox/gtl/gtl/polygon_with_holes_concept.h (original)
+++ sandbox/gtl/gtl/polygon_with_holes_concept.h 2008-05-13 16:31:57 EDT (Tue, 13 May 2008)
@@ -6,44 +6,15 @@
   http://www.boost.org/LICENSE_1_0.txt).
 */
 
-struct polygon_with_holes_concept {
+struct polygon_with_holes_concept : polygon_concept {
 public:
 
- template<typename polygon_with_holes_type, typename iterator_type>
- static void set(polygon_with_holes_type& polygon, iterator_type input_begin, iterator_type input_end) {
- polygon_traits<polygon_with_holes_type>::set(polygon, input_begin, input_end);
- }
-
- template<typename polygon_with_holes_type, typename rectangle_type>
- static void set(polygon_with_holes_type& polygon, const rectangle_type& rect) {
- typename polygon_traits<polygon_with_holes_type>::coordinate_type coords[4] =
- {rectangle_concept::xl(rect), rectangle_concept::yl(rect),
- rectangle_concept::xh(rect), rectangle_concept::yh(rect)};
- set(polygon, coords, coords+4);
- }
-
- template<typename polygon_with_holes_type, typename point_iterator_type>
- static void set_points(polygon_with_holes_type& polygon, point_iterator_type begin_point, point_iterator_type end_point) {
- return set(iterator_points_to_compact<point_iterator_type, typename point_iterator_type::value_type>(begin_point),
- iterator_points_to_compact<point_iterator_type, typename point_iterator_type::value_type>(end_point));
- }
-
   template<typename polygon_with_holes_type, typename hole_iterator_type>
   static void set_holes(polygon_with_holes_type& polygon, hole_iterator_type holes_begin, hole_iterator_type holes_end) {
     polygon_with_holes_traits<polygon_with_holes_type>::set_holes(polygon, holes_begin, holes_end);
   }
 
   template <typename polygon_with_holes_type>
- static typename polygon_traits<polygon_with_holes_type>::iterator_type begin(const polygon_with_holes_type& polygon) {
- return polygon_traits<polygon_with_holes_type>::begin(polygon);
- }
-
- template <typename polygon_with_holes_type>
- static typename polygon_traits<polygon_with_holes_type>::iterator_type end(const polygon_with_holes_type& polygon) {
- return polygon_traits<polygon_with_holes_type>::end(polygon);
- }
-
- template <typename polygon_with_holes_type>
   static typename polygon_with_holes_traits<polygon_with_holes_type>::iterator_holes_type begin_holes(const polygon_with_holes_type& polygon) {
     return polygon_with_holes_traits<polygon_with_holes_type>::begin_holes(polygon);
   }
@@ -53,32 +24,6 @@
     return polygon_with_holes_traits<polygon_with_holes_type>::end_holes(polygon);
   }
   
- template <typename polygon_with_holes_type>
- static iterator_compact_to_points<typename polygon_traits<polygon_with_holes_type>::iterator_type,
- point_data<typename polygon_traits<polygon_with_holes_type>::coordinate_type> >
- begin_points(const polygon_with_holes_type& polygon) {
- return iterator_compact_to_points<typename polygon_traits<polygon_with_holes_type>::iterator_type,
- point_data<typename polygon_traits<polygon_with_holes_type>::coordinate_type> > (begin(polygon), end(polygon));
- }
-
- template <typename polygon_with_holes_type>
- static iterator_compact_to_points<typename polygon_traits<polygon_with_holes_type>::iterator_type,
- point_data<typename polygon_traits<polygon_with_holes_type>::coordinate_type> >
- end_points(const polygon_with_holes_type& polygon) {
- return iterator_compact_to_points<typename polygon_traits<polygon_with_holes_type>::iterator_type,
- point_data<typename polygon_traits<polygon_with_holes_type>::coordinate_type> > (end(polygon), end(polygon));
- }
-
- template<typename T, class iT>
- static T construct(iT inputBegin, iT inputEnd) { return polygon_traits<T>::construct(inputBegin, inputEnd); }
-
- template<typename polygon_with_holes_type, typename rectangle_type>
- static polygon_with_holes_type construct_from_rectangle(const rectangle_type& rect) {
- polygon_with_holes_type poly;
- set(poly, rect);
- return poly;
- }
-
   template <typename polygon_with_holes_type_1, typename polygon_with_holes_type_2>
   static polygon_with_holes_type_1 copy_construct(const polygon_with_holes_type_2& polygon) {
     polygon_with_holes_type_1 retval;
@@ -88,11 +33,6 @@
   }
 
   template <typename polygon_with_holes_type>
- static std::size_t size(const polygon_with_holes_type& polygon) {
- return polygon_traits<polygon_with_holes_type>::size(polygon);
- }
-
- template <typename polygon_with_holes_type>
   static std::size_t size_holes(const polygon_with_holes_type& polygon) {
     return polygon_with_holes_traits<polygon_with_holes_type>::size_holes(polygon);
   }
@@ -105,17 +45,6 @@
   }
 
   template <typename polygon_with_holes_type>
- static rectangle_data<typename polygon_traits<polygon_with_holes_type>::coordinate_type>
- bounding_box(const polygon_with_holes_type& polygon) {
- return polygon_concept::bounding_box(polygon);
- }
-
- template <typename polygon_with_holes_type>
- static direction_1d winding(const polygon_with_holes_type& polygon){
- return polygon_concept::winding(polygon);
- }
-
- template <typename polygon_with_holes_type>
   static typename polygon_with_holes_traits<polygon_with_holes_type>::coordinate_type
   area(const polygon_with_holes_type& polygon) {
     typename polygon_traits<polygon_with_holes_type>::coordinate_type retval = polygon_concept::area(polygon);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk