Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75782 - in trunk/boost/geometry/algorithms: . detail
From: barend.gehrels_at_[hidden]
Date: 2011-12-03 05:25:49


Author: barendgehrels
Date: 2011-12-03 05:25:48 EST (Sat, 03 Dec 2011)
New Revision: 75782
URL: http://svn.boost.org/trac/boost/changeset/75782

Log:
Added segment-to-segment conversion, therefore box_to_box is now indexed_to_indexed.
This also fixes last weeks accidental (but still working...) reversal of index/dimension
Added:
   trunk/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp
      - copied, changed from r75686, /trunk/boost/geometry/algorithms/detail/convert_box_to_box.hpp
Removed:
   trunk/boost/geometry/algorithms/detail/convert_box_to_box.hpp
Text files modified:
   trunk/boost/geometry/algorithms/convert.hpp | 14 +++++++++++-
   trunk/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp | 42 ++++++++++++++++++++--------------------
   2 files changed, 33 insertions(+), 23 deletions(-)

Modified: trunk/boost/geometry/algorithms/convert.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/convert.hpp (original)
+++ trunk/boost/geometry/algorithms/convert.hpp 2011-12-03 05:25:48 EST (Sat, 03 Dec 2011)
@@ -29,7 +29,7 @@
 #include <boost/geometry/algorithms/detail/assign_box_corners.hpp>
 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
 #include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
-#include <boost/geometry/algorithms/detail/convert_box_to_box.hpp>
+#include <boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp>
 
 #include <boost/geometry/views/closeable_view.hpp>
 #include <boost/geometry/views/reversible_view.hpp>
@@ -260,7 +260,17 @@
     typename Box1, typename Box2
>
 struct convert<false, box_tag, box_tag, DimensionCount, Box1, Box2>
- : detail::conversion::box_to_box<Box1, Box2, 0, DimensionCount>
+ : detail::conversion::indexed_to_indexed<Box1, Box2, 0, DimensionCount>
+{};
+
+
+template
+<
+ std::size_t DimensionCount,
+ typename Segment1, typename Segment2
+>
+struct convert<false, segment_tag, segment_tag, DimensionCount, Segment1, Segment2>
+ : detail::conversion::indexed_to_indexed<Segment1, Segment2, 0, DimensionCount>
 {};
 
 

Deleted: trunk/boost/geometry/algorithms/detail/convert_box_to_box.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/convert_box_to_box.hpp 2011-12-03 05:25:48 EST (Sat, 03 Dec 2011)
+++ (empty file)
@@ -1,80 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-
-// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
-// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
-
-// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
-// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
-
-// 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_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_BOX_TO_BOX_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_BOX_TO_BOX_HPP
-
-
-#include <cstddef>
-
-#include <boost/numeric/conversion/cast.hpp>
-#include <boost/geometry/core/access.hpp>
-#include <boost/geometry/core/coordinate_dimension.hpp>
-#include <boost/geometry/core/coordinate_type.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace conversion
-{
-
-
-template
-<
- typename Source,
- typename Destination,
- std::size_t Dimension,
- std::size_t DimensionCount
->
-struct box_to_box
-{
- static inline void apply(Source const& source, Destination& destination)
- {
- typedef typename coordinate_type<Destination>::type coordinate_type;
-
- geometry::set<Dimension, min_corner>(destination,
- boost::numeric_cast<coordinate_type>(
- geometry::get<Dimension, min_corner>(source)));
- geometry::set<Dimension, max_corner>(destination,
- boost::numeric_cast<coordinate_type>(
- geometry::get<Dimension, max_corner>(source)));
- box_to_box<Source, Destination, Dimension + 1, DimensionCount>::apply(
- source, destination);
- }
-};
-
-template <typename Source, typename Destination, std::size_t DimensionCount>
-struct box_to_box<Source, Destination, DimensionCount, DimensionCount>
-{
- static inline void apply(Source const& , Destination& )
- {}
-};
-
-
-template <typename Source, typename Destination>
-inline void convert_box_to_box(Source const& source, Destination& destination)
-{
- box_to_box<Source, Destination, 0, dimension<Destination>::value>::apply(
- source, destination);
-}
-
-
-
-}} // namespace detail::conversion
-#endif // DOXYGEN_NO_DETAIL
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_BOX_TO_BOX_HPP

Copied: trunk/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp (from r75686, /trunk/boost/geometry/algorithms/detail/convert_box_to_box.hpp)
==============================================================================
--- /trunk/boost/geometry/algorithms/detail/convert_box_to_box.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp 2011-12-03 05:25:48 EST (Sat, 03 Dec 2011)
@@ -11,8 +11,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_BOX_TO_BOX_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_BOX_TO_BOX_HPP
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP
 
 
 #include <cstddef>
@@ -38,43 +38,43 @@
     std::size_t Dimension,
     std::size_t DimensionCount
>
-struct box_to_box
+struct indexed_to_indexed
 {
     static inline void apply(Source const& source, Destination& destination)
     {
         typedef typename coordinate_type<Destination>::type coordinate_type;
 
- geometry::set<Dimension, min_corner>(destination,
+ geometry::set<min_corner, Dimension>(destination,
             boost::numeric_cast<coordinate_type>(
- geometry::get<Dimension, min_corner>(source)));
- geometry::set<Dimension, max_corner>(destination,
+ geometry::get<min_corner, Dimension>(source)));
+ geometry::set<max_corner, Dimension>(destination,
             boost::numeric_cast<coordinate_type>(
- geometry::get<Dimension, max_corner>(source)));
- box_to_box<Source, Destination, Dimension + 1, DimensionCount>::apply(
- source, destination);
+ geometry::get<max_corner, Dimension>(source)));
+
+ indexed_to_indexed
+ <
+ Source, Destination,
+ Dimension + 1, DimensionCount
+ >::apply(source, destination);
     }
 };
 
-template <typename Source, typename Destination, std::size_t DimensionCount>
-struct box_to_box<Source, Destination, DimensionCount, DimensionCount>
+template
+<
+ typename Source,
+ typename Destination,
+ std::size_t DimensionCount
+>
+struct indexed_to_indexed<Source, Destination, DimensionCount, DimensionCount>
 {
     static inline void apply(Source const& , Destination& )
     {}
 };
 
 
-template <typename Source, typename Destination>
-inline void convert_box_to_box(Source const& source, Destination& destination)
-{
- box_to_box<Source, Destination, 0, dimension<Destination>::value>::apply(
- source, destination);
-}
-
-
-
 }} // namespace detail::conversion
 #endif // DOXYGEN_NO_DETAIL
 
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_BOX_TO_BOX_HPP
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_INDEXED_TO_INDEXED_HPP


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