|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71119 - in branches/release/boost/geometry: . algorithms algorithms/detail algorithms/detail/overlay arithmetic core domains domains/gis/io/wkt geometries iterators multi policies ranges strategies strategies/agnostic strategies/cartesian util views
From: barend.gehrels_at_[hidden]
Date: 2011-04-08 11:41:41
Author: barendgehrels
Date: 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
New Revision: 71119
URL: http://svn.boost.org/trac/boost/changeset/71119
Log:
Merged 71027,71093,71117 (centroid nD plus convert to detail)
Added:
branches/release/boost/geometry/algorithms/detail/convert.hpp
- copied unchanged from r71118, /trunk/boost/geometry/algorithms/detail/convert.hpp
Removed:
branches/release/boost/geometry/algorithms/convert.hpp
branches/release/boost/geometry/util/copy.hpp
Properties modified:
branches/release/boost/geometry/ (props changed)
branches/release/boost/geometry/algorithms/ (props changed)
branches/release/boost/geometry/arithmetic/ (props changed)
branches/release/boost/geometry/core/ (props changed)
branches/release/boost/geometry/domains/ (props changed)
branches/release/boost/geometry/geometries/ (props changed)
branches/release/boost/geometry/geometry.hpp (contents, props changed)
branches/release/boost/geometry/iterators/ (props changed)
branches/release/boost/geometry/multi/ (props changed)
branches/release/boost/geometry/policies/ (props changed)
branches/release/boost/geometry/ranges/ (props changed)
branches/release/boost/geometry/strategies/ (props changed)
branches/release/boost/geometry/util/ (props changed)
branches/release/boost/geometry/views/ (props changed)
Text files modified:
branches/release/boost/geometry/algorithms/append.hpp | 2
branches/release/boost/geometry/algorithms/centroid.hpp | 6 ++--
branches/release/boost/geometry/algorithms/detail/convert_point_to_point.hpp | 4 +-
branches/release/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp | 6 ++--
branches/release/boost/geometry/algorithms/detail/overlay/convert_ring.hpp | 8 +++---
branches/release/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp | 4 +-
branches/release/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp | 4 +-
branches/release/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp | 18 +++++++-------
branches/release/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp | 6 ++--
branches/release/boost/geometry/algorithms/envelope.hpp | 1
branches/release/boost/geometry/algorithms/simplify.hpp | 4 +-
branches/release/boost/geometry/core/radian_access.hpp | 2
branches/release/boost/geometry/domains/gis/io/wkt/write_wkt.hpp | 4 +-
branches/release/boost/geometry/geometries/box.hpp | 6 ++--
branches/release/boost/geometry/geometry.hpp | 1
branches/release/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp | 1
branches/release/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp | 51 ++++++++++++++++++++++-----------------
branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp | 8 +++---
branches/release/boost/geometry/strategies/strategy_transform.hpp | 16 ++++++------
branches/release/boost/geometry/util/write_dsv.hpp | 2 -
20 files changed, 78 insertions(+), 76 deletions(-)
Modified: branches/release/boost/geometry/algorithms/append.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/append.hpp (original)
+++ branches/release/boost/geometry/algorithms/append.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -51,7 +51,7 @@
int = 0, int = 0)
{
typename geometry::point_type<Geometry>::type copy;
- geometry::detail::convert::convert_point_to_point(point, copy);
+ geometry::detail::conversion::convert_point_to_point(point, copy);
traits::push_back<Geometry>::apply(geometry, copy);
}
};
Modified: branches/release/boost/geometry/algorithms/centroid.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/centroid.hpp (original)
+++ branches/release/boost/geometry/algorithms/centroid.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -28,7 +28,7 @@
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/tag_cast.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/distance.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/strategies/centroid.hpp>
@@ -83,7 +83,7 @@
static inline void apply(Point const& point, PointCentroid& centroid,
Strategy const&)
{
- geometry::convert(point, centroid);
+ geometry::detail::convert(point, centroid);
}
};
@@ -163,7 +163,7 @@
else // if (n == 1)
{
// Take over the first point in a "coordinate neutral way"
- geometry::convert(*boost::begin(range), centroid);
+ geometry::detail::convert(*boost::begin(range), centroid);
return false;
}
return true;
Deleted: branches/release/boost/geometry/algorithms/convert.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/convert.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
+++ (empty file)
@@ -1,264 +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_CONVERT_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP
-
-
-#include <cstddef>
-
-#include <boost/numeric/conversion/cast.hpp>
-#include <boost/range.hpp>
-
-#include <boost/geometry/algorithms/append.hpp>
-#include <boost/geometry/algorithms/assign.hpp>
-#include <boost/geometry/algorithms/for_each.hpp>
-#include <boost/geometry/algorithms/detail/convert_point_to_point.hpp>
-
-#include <boost/geometry/core/cs.hpp>
-#include <boost/geometry/geometries/concepts/check.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace convert
-{
-
-template
-<
- typename Point,
- typename Box,
- std::size_t Index,
- std::size_t Dimension,
- std::size_t DimensionCount
->
-struct point_to_box
-{
- static inline void apply(Point const& point, Box& box)
- {
- typedef typename coordinate_type<Box>::type coordinate_type;
-
- set<Index, Dimension>(box,
- boost::numeric_cast<coordinate_type>(get<Dimension>(point)));
- point_to_box
- <
- Point, Box,
- Index, Dimension + 1, DimensionCount
- >::apply(point, box);
- }
-};
-
-
-template
-<
- typename Point,
- typename Box,
- std::size_t Index,
- std::size_t DimensionCount
->
-struct point_to_box<Point, Box, Index, DimensionCount, DimensionCount>
-{
- static inline void apply(Point const& , Box& )
- {}
-};
-
-
-}} // namespace detail::convert
-#endif // DOXYGEN_NO_DETAIL
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-template
-<
- typename Tag1, typename Tag2,
- std::size_t DimensionCount,
- typename Geometry1, typename Geometry2
->
-struct convert
-{
-};
-
-
-template
-<
- typename Tag,
- std::size_t DimensionCount,
- typename Geometry1, typename Geometry2
->
-struct convert<Tag, Tag, DimensionCount, Geometry1, Geometry2>
-{
- // Same geometry type -> copy coordinates from G1 to G2
- // Actually: we try now to just copy it
- static inline void apply(Geometry1 const& source, Geometry2& destination)
- {
- destination = source;
- }
-};
-
-
-template
-<
- std::size_t DimensionCount,
- typename Geometry1, typename Geometry2
->
-struct convert<point_tag, point_tag, DimensionCount, Geometry1, Geometry2>
- : detail::convert::point_to_point<Geometry1, Geometry2, 0, DimensionCount>
-{};
-
-
-template <std::size_t DimensionCount, typename Ring1, typename Ring2>
-struct convert<ring_tag, ring_tag, DimensionCount, Ring1, Ring2>
-{
- static inline void apply(Ring1 const& source, Ring2& destination)
- {
- geometry::clear(destination);
- for (typename boost::range_iterator<Ring1 const>::type it
- = boost::begin(source);
- it != boost::end(source);
- ++it)
- {
- geometry::append(destination, *it);
- }
- }
-};
-
-
-template <typename Box, typename Ring>
-struct convert<box_tag, ring_tag, 2, Box, Ring>
-{
- static inline void apply(Box const& box, Ring& ring)
- {
- // go from box to ring -> add coordinates in correct order
- geometry::clear(ring);
- typename point_type<Box>::type point;
-
- geometry::assign(point, get<min_corner, 0>(box), get<min_corner, 1>(box));
- geometry::append(ring, point);
-
- geometry::assign(point, get<min_corner, 0>(box), get<max_corner, 1>(box));
- geometry::append(ring, point);
-
- geometry::assign(point, get<max_corner, 0>(box), get<max_corner, 1>(box));
- geometry::append(ring, point);
-
- geometry::assign(point, get<max_corner, 0>(box), get<min_corner, 1>(box));
- geometry::append(ring, point);
-
- geometry::assign(point, get<min_corner, 0>(box), get<min_corner, 1>(box));
- geometry::append(ring, point);
- }
-};
-
-
-template <typename Box, typename Polygon>
-struct convert<box_tag, polygon_tag, 2, Box, Polygon>
-{
- static inline void apply(Box const& box, Polygon& polygon)
- {
- typedef typename ring_type<Polygon>::type ring_type;
-
- convert
- <
- box_tag, ring_tag,
- 2, Box, ring_type
- >::apply(box, exterior_ring(polygon));
- }
-};
-
-
-template <typename Point, std::size_t DimensionCount, typename Box>
-struct convert<point_tag, box_tag, DimensionCount, Point, Box>
-{
- static inline void apply(Point const& point, Box& box)
- {
- detail::convert::point_to_box
- <
- Point, Box, min_corner, 0, DimensionCount
- >::apply(point, box);
- detail::convert::point_to_box
- <
- Point, Box, max_corner, 0, DimensionCount
- >::apply(point, box);
- }
-};
-
-
-template <typename Ring, std::size_t DimensionCount, typename Polygon>
-struct convert<ring_tag, polygon_tag, DimensionCount, Ring, Polygon>
-{
- static inline void apply(Ring const& ring, Polygon& polygon)
- {
- typedef typename ring_type<Polygon>::type ring_type;
- convert
- <
- ring_tag, ring_tag, DimensionCount,
- Ring, ring_type
- >::apply(ring, exterior_ring(polygon));
- }
-};
-
-
-template <typename Polygon, std::size_t DimensionCount, typename Ring>
-struct convert<polygon_tag, ring_tag, DimensionCount, Polygon, Ring>
-{
- static inline void apply(Polygon const& polygon, Ring& ring)
- {
- typedef typename ring_type<Polygon>::type ring_type;
-
- convert
- <
- ring_tag, ring_tag, DimensionCount,
- ring_type, Ring
- >::apply(exterior_ring(polygon), ring);
- }
-};
-
-
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-/*!
-\brief Converts one geometry to another geometry
-\details The convert algorithm converts one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only
-if it is possible and applicable.
-\ingroup convert
-\tparam Geometry1 \tparam_geometry
-\tparam Geometry2 \tparam_geometry
-\param geometry1 \param_geometry (source)
-\param geometry2 \param_geometry (target)
- */
-template <typename Geometry1, typename Geometry2>
-inline void convert(Geometry1 const& geometry1, Geometry2& geometry2)
-{
- concept::check_concepts_and_equal_dimensions<Geometry1 const, Geometry2>();
-
- dispatch::convert
- <
- typename tag<Geometry1>::type,
- typename tag<Geometry2>::type,
- dimension<Geometry1>::type::value,
- Geometry1,
- Geometry2
- >::apply(geometry1, geometry2);
-}
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP
Modified: branches/release/boost/geometry/algorithms/detail/convert_point_to_point.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/detail/convert_point_to_point.hpp (original)
+++ branches/release/boost/geometry/algorithms/detail/convert_point_to_point.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -28,7 +28,7 @@
{
#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace convert
+namespace detail { namespace conversion
{
@@ -60,7 +60,7 @@
-}} // namespace detail::convert
+}} // namespace detail::conversion
#endif // DOXYGEN_NO_DETAIL
}} // namespace boost::geometry
Modified: branches/release/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp (original)
+++ branches/release/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -13,7 +13,7 @@
#include <boost/geometry/algorithms/append.hpp>
#include <boost/geometry/algorithms/clear.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/util/select_coordinate_type.hpp>
#include <boost/geometry/geometries/segment.hpp>
@@ -181,8 +181,8 @@
++previous, ++vertex)
{
point_type p1, p2;
- geometry::convert(*previous, p1);
- geometry::convert(*vertex, p2);
+ geometry::detail::convert(*previous, p1);
+ geometry::detail::convert(*vertex, p2);
// Clip the segment. Five situations:
// 1. Segment is invisible, finish line if any (shouldn't occur)
Modified: branches/release/boost/geometry/algorithms/detail/overlay/convert_ring.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/detail/overlay/convert_ring.hpp (original)
+++ branches/release/boost/geometry/algorithms/detail/overlay/convert_ring.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -19,7 +19,7 @@
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
namespace boost { namespace geometry
@@ -50,7 +50,7 @@
{
if (! append)
{
- geometry::convert(source, destination);
+ geometry::detail::convert(source, destination);
if (reverse)
{
boost::reverse(destination);
@@ -69,7 +69,7 @@
{
if (! append)
{
- geometry::convert(source, exterior_ring(destination));
+ geometry::detail::convert(source, exterior_ring(destination));
if (reverse)
{
boost::reverse(exterior_ring(destination));
@@ -79,7 +79,7 @@
{
interior_rings(destination).resize(
interior_rings(destination).size() + 1);
- geometry::convert(source, interior_rings(destination).back());
+ geometry::detail::convert(source, interior_rings(destination).back());
if (reverse)
{
boost::reverse(interior_rings(destination).back());
Modified: branches/release/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp (original)
+++ branches/release/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -17,7 +17,7 @@
#include <boost/geometry/core/ring_type.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/views/closeable_view.hpp>
#include <boost/geometry/views/reversible_view.hpp>
@@ -71,7 +71,7 @@
rview_type view(cview);
- geometry::convert(*(boost::begin(view) + index), point);
+ geometry::detail::convert(*(boost::begin(view) + index), point);
return true;
}
};
Modified: branches/release/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp (original)
+++ branches/release/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -12,7 +12,7 @@
#include <cstddef>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
@@ -64,7 +64,7 @@
{
TurnInfo tp;
- geometry::convert(result.template get<0>().intersections[i], tp.point);
+ geometry::detail::convert(result.template get<0>().intersections[i], tp.point);
*out++ = tp;
}
Modified: branches/release/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp (original)
+++ branches/release/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -14,7 +14,7 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/strategies/intersection.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
@@ -94,7 +94,7 @@
DirInfo const& dir_info)
{
ti.method = method_touch_interior;
- geometry::convert(intersection_info.intersections[0], ti.point);
+ geometry::detail::convert(intersection_info.intersections[0], ti.point);
// Both segments of q touch segment p somewhere in its interior
// 1) We know: if q comes from LEFT or RIGHT
@@ -213,7 +213,7 @@
DirInfo const& dir_info)
{
ti.method = method_touch;
- geometry::convert(intersection_info.intersections[0], ti.point);
+ geometry::detail::convert(intersection_info.intersections[0], ti.point);
int const side_qi_p1 = dir_info.sides.template get<1, 0>();
int const side_qk_p1 = SideStrategy::apply(pi, pj, qk);
@@ -376,7 +376,7 @@
<< " qk " << get<0>(qk) << " , " << get<1>(qk)
<< std::endl;
#endif
-
+
}
};
@@ -404,7 +404,7 @@
{
ti.method = method_equal;
// Copy the SECOND intersection point
- geometry::convert(intersection_info.intersections[1], ti.point);
+ geometry::detail::convert(intersection_info.intersections[1], ti.point);
int const side_pk_q2 = SideStrategy::apply(qj, qk, pk);
int const side_pk_p = SideStrategy::apply(pi, pj, pk);
@@ -486,7 +486,7 @@
DirInfo const& dir_info)
{
ti.method = method_collinear;
- geometry::convert(intersection_info.intersections[1], ti.point);
+ geometry::detail::convert(intersection_info.intersections[1], ti.point);
int const arrival = dir_info.arrival[0];
// Should not be 0, this is checked before
@@ -585,7 +585,7 @@
// If P arrives within Q, set info on P (which is done above, index=0),
// this turn-info belongs to the second intersection point, index=1
// (see e.g. figure CLO1)
- geometry::convert(intersection_info.intersections[1 - Index], tp.point);
+ geometry::detail::convert(intersection_info.intersections[1 - Index], tp.point);
return true;
}
@@ -661,7 +661,7 @@
DirInfo const& dir_info)
{
ti.method = method_crosses;
- geometry::convert(intersection_info.intersections[0], ti.point);
+ geometry::detail::convert(intersection_info.intersections[0], ti.point);
// In all casees:
// If Q crosses P from left to right
@@ -877,7 +877,7 @@
#ifdef BOOST_GEOMETRY_DEBUG_GET_TURNS
std::cout << "get_turns, nyi: " << method << std::endl;
#endif
- break;
+ break;
}
return out;
Modified: branches/release/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp (original)
+++ branches/release/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -21,7 +21,7 @@
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/detail/overlay/clip_linestring.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp>
#include <boost/geometry/algorithms/detail/overlay/overlay.hpp>
@@ -65,7 +65,7 @@
for (std::size_t i = 0; i < is.count; i++)
{
PointOut p;
- geometry::convert(is.intersections[i], p);
+ geometry::detail::convert(is.intersections[i], p);
*out++ = p;
}
return out;
@@ -95,7 +95,7 @@
it = boost::begin(turns); it != boost::end(turns); ++it)
{
PointOut p;
- geometry::convert(it->point, p);
+ geometry::detail::convert(it->point, p);
*out++ = p;
}
return out;
Modified: branches/release/boost/geometry/algorithms/envelope.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/envelope.hpp (original)
+++ branches/release/boost/geometry/algorithms/envelope.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -19,7 +19,6 @@
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/expand.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
Modified: branches/release/boost/geometry/algorithms/simplify.hpp
==============================================================================
--- branches/release/boost/geometry/algorithms/simplify.hpp (original)
+++ branches/release/boost/geometry/algorithms/simplify.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -32,7 +32,7 @@
#include <boost/geometry/strategies/concepts/simplify_concept.hpp>
#include <boost/geometry/algorithms/clear.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/algorithms/num_interior_rings.hpp>
@@ -181,7 +181,7 @@
static inline void apply(Point const& point, Point& out,
Distance const& max_distance, Strategy const& strategy)
{
- geometry::convert(point, out);
+ geometry::detail::convert(point, out);
}
};
Modified: branches/release/boost/geometry/core/radian_access.hpp
==============================================================================
--- branches/release/boost/geometry/core/radian_access.hpp (original)
+++ branches/release/boost/geometry/core/radian_access.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -78,7 +78,7 @@
}
};
-// Specialize, any "degree" coordinate system will convert to radian
+// Specialize, any "degree" coordinate system will be converted to radian
// but only for dimension 0,1 (so: dimension 2 and heigher are untouched)
template
Modified: branches/release/boost/geometry/domains/gis/io/wkt/write_wkt.hpp
==============================================================================
--- branches/release/boost/geometry/domains/gis/io/wkt/write_wkt.hpp (original)
+++ branches/release/boost/geometry/domains/gis/io/wkt/write_wkt.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -24,7 +24,7 @@
#include <boost/geometry/algorithms/assign.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>
@@ -199,7 +199,7 @@
// Convert to ring, then stream
typedef model::ring<point_type> ring_type;
ring_type ring;
- geometry::convert(box, ring);
+ geometry::detail::convert(box, ring);
os << "POLYGON(";
wkt_sequence<ring_type>::apply(os, ring);
os << ")";
Modified: branches/release/boost/geometry/geometries/box.hpp
==============================================================================
--- branches/release/boost/geometry/geometries/box.hpp (original)
+++ branches/release/boost/geometry/geometries/box.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -18,7 +18,7 @@
#include <boost/concept/assert.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
@@ -57,8 +57,8 @@
*/
inline box(Point const& min_corner, Point const& max_corner)
{
- geometry::convert(min_corner, m_min_corner);
- geometry::convert(max_corner, m_max_corner);
+ geometry::detail::convert(min_corner, m_min_corner);
+ geometry::detail::convert(max_corner, m_max_corner);
}
inline Point const& min_corner() const { return m_min_corner; }
Modified: branches/release/boost/geometry/geometry.hpp
==============================================================================
--- branches/release/boost/geometry/geometry.hpp (original)
+++ branches/release/boost/geometry/geometry.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -40,7 +40,6 @@
#include <boost/geometry/algorithms/buffer.hpp>
#include <boost/geometry/algorithms/centroid.hpp>
#include <boost/geometry/algorithms/clear.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/convex_hull.hpp>
#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/difference.hpp>
Modified: branches/release/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp (original)
+++ branches/release/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -20,7 +20,6 @@
#include <boost/range.hpp>
#include <boost/geometry/core/cs.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/strategies/distance.hpp>
Modified: branches/release/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp (original)
+++ branches/release/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -13,10 +13,9 @@
#ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_CENTROID_WEIGHTED_LENGTH_HPP
#define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_CENTROID_WEIGHTED_LENGTH_HPP
-#include <cstddef>
-
-#include <boost/array.hpp>
#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/arithmetic/arithmetic.hpp>
+#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/util/select_most_precise.hpp>
#include <boost/geometry/strategies/centroid.hpp>
#include <boost/geometry/strategies/default_distance_result.hpp>
@@ -37,16 +36,19 @@
template <typename Type, std::size_t DimensionCount>
struct weighted_length_sums
{
+ typedef typename geometry::model::point
+ <
+ Type, DimensionCount,
+ cs::cartesian
+ > work_point;
+
Type length;
- boost::array<Type, DimensionCount> average_sum;
+ work_point average_sum;
inline weighted_length_sums()
: length(Type())
{
- for (std::size_t i = 0; i < DimensionCount; i++)
- {
- average_sum[i] = Type();
- }
+ geometry::assign_zero(average_sum);
}
};
}
@@ -66,7 +68,11 @@
>::type distance_type;
public :
- typedef detail::weighted_length_sums<distance_type, 2> state_type;
+ typedef detail::weighted_length_sums
+ <
+ distance_type,
+ geometry::dimension<Point>::type::value
+ > state_type;
static inline void apply(PointOfSegment const& p1,
PointOfSegment const& p2, state_type& state)
@@ -74,13 +80,12 @@
distance_type const d = geometry::distance(p1, p2);
state.length += d;
- distance_type two(2);
-
- // Might be made generic for N dimensions using specializations
- distance_type const mx = (get<0>(p1) + get<0>(p2)) / two;
- distance_type const my = (get<1>(p1) + get<1>(p2)) / two;
- state.average_sum[0] += d * mx;
- state.average_sum[1] += d * my;
+ typename state_type::work_point weighted_median;
+ geometry::assign_zero(weighted_median);
+ geometry::add_point(weighted_median, p1);
+ geometry::add_point(weighted_median, p2);
+ geometry::multiply_value(weighted_median, d/2);
+ geometry::add_point(state.average_sum, weighted_median);
}
static inline bool result(state_type const& state, Point& centroid)
@@ -88,8 +93,9 @@
distance_type const zero = distance_type();
if (! geometry::math::equals(state.length, zero))
{
- set<0>(centroid, state.average_sum[0] / state.length);
- set<1>(centroid, state.average_sum[1] / state.length);
+ assign_zero(centroid);
+ add_point(centroid, state.average_sum);
+ divide_value(centroid, state.length);
return true;
}
@@ -103,13 +109,15 @@
namespace services
{
-// Register this strategy for linestrings and polygons, in two or three dimensions
-template <typename Point, typename Geometry>
+
+// Register this strategy for linear geometries, in all dimensions
+
+template <std::size_t N, typename Point, typename Geometry>
struct default_strategy
<
cartesian_tag,
linear_tag,
- 2,
+ N,
Point,
Geometry
>
@@ -122,7 +130,6 @@
};
-
} // namespace services
Modified: branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp (original)
+++ branches/release/boost/geometry/strategies/cartesian/distance_projected_point.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -22,7 +22,7 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/point_type.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/arithmetic/dot_product.hpp>
@@ -132,8 +132,8 @@
// For consistency we define w also in FP
fp_vector_type v, w;
- geometry::convert(p2, v);
- geometry::convert(p, w);
+ geometry::detail::convert(p2, v);
+ geometry::detail::convert(p, w);
subtract_point(v, p1);
subtract_point(w, p1);
@@ -163,7 +163,7 @@
>::apply(strategy);
fp_point_type projected;
- geometry::convert(p1, projected);
+ geometry::detail::convert(p1, projected);
multiply_value(v, b);
add_point(projected, v);
Modified: branches/release/boost/geometry/strategies/strategy_transform.hpp
==============================================================================
--- branches/release/boost/geometry/strategies/strategy_transform.hpp (original)
+++ branches/release/boost/geometry/strategies/strategy_transform.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -20,7 +20,7 @@
#include <boost/numeric/conversion/cast.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/detail/convert.hpp>
#include <boost/geometry/arithmetic/arithmetic.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
@@ -104,7 +104,7 @@
// Defensive check, dimensions are equal, selected by specialization
assert_dimension_equal<P1, P2>();
- geometry::convert(p1, p2);
+ geometry::detail::convert(p1, p2);
return true;
}
};
@@ -312,14 +312,14 @@
typedef copy_per_coordinate<P1, P2> type;
};
-/// Specialization to convert from degree to radian for any coordinate system / point type combination
+/// Specialization to transform from degree to radian for any coordinate system / point type combination
template <typename CoordSysTag, template<typename> class CoordSys, typename P1, typename P2>
struct default_strategy<CoordSysTag, CoordSysTag, CoordSys<degree>, CoordSys<radian>, 2, 2, P1, P2>
{
typedef degree_radian_vv<P1, P2, std::multiplies> type;
};
-/// Specialization to convert from radian to degree for any coordinate system / point type combination
+/// Specialization to transform from radian to degree for any coordinate system / point type combination
template <typename CoordSysTag, template<typename> class CoordSys, typename P1, typename P2>
struct default_strategy<CoordSysTag, CoordSysTag, CoordSys<radian>, CoordSys<degree>, 2, 2, P1, P2>
{
@@ -341,28 +341,28 @@
typedef degree_radian_vv_3<P1, P2, std::divides> type;
};
-/// Specialization to convert from unit sphere(phi,theta) to XYZ
+/// Specialization to transform from unit sphere(phi,theta) to XYZ
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<spherical_tag, cartesian_tag, CoordSys1, CoordSys2, 2, 3, P1, P2>
{
typedef from_spherical_2_to_cartesian_3<P1, P2> type;
};
-/// Specialization to convert from sphere(phi,theta,r) to XYZ
+/// Specialization to transform from sphere(phi,theta,r) to XYZ
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<spherical_tag, cartesian_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
{
typedef from_spherical_3_to_cartesian_3<P1, P2> type;
};
-/// Specialization to convert from XYZ to unit sphere(phi,theta)
+/// Specialization to transform from XYZ to unit sphere(phi,theta)
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<cartesian_tag, spherical_tag, CoordSys1, CoordSys2, 3, 2, P1, P2>
{
typedef from_cartesian_3_to_spherical_2<P1, P2> type;
};
-/// Specialization to convert from XYZ to sphere(phi,theta,r)
+/// Specialization to transform from XYZ to sphere(phi,theta,r)
template <typename CoordSys1, typename CoordSys2, typename P1, typename P2>
struct default_strategy<cartesian_tag, spherical_tag, CoordSys1, CoordSys2, 3, 3, P1, P2>
{
Deleted: branches/release/boost/geometry/util/copy.hpp
==============================================================================
--- branches/release/boost/geometry/util/copy.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
+++ (empty file)
@@ -1,87 +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_UTIL_COPY_HPP
-#define BOOST_GEOMETRY_UTIL_COPY_HPP
-
-#if defined(BOOST_MSVC_FULL_VER)
-#pragma message ("copy_coordinates is deprecated. Use 'convert'")
-#else
-#warning "copy_coordinates is deprecated. Use 'convert'"
-#endif
-
-
-
-#include <cstddef>
-
-#include <boost/concept/requires.hpp>
-#include <boost/concept_check.hpp>
-
-#include <boost/geometry/geometries/concepts/point_concept.hpp>
-
-#include <boost/numeric/conversion/cast.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace copy
-{
-
-template <typename Src, typename Dst, std::size_t D, std::size_t N>
-struct copy_coordinates
-{
- static inline void copy(Src const& source, Dst& dest)
- {
- typedef typename coordinate_type<Dst>::type coordinate_type;
-
- set<D>(dest, boost::numeric_cast<coordinate_type>(get<D>(source)));
- copy_coordinates<Src, Dst, D + 1, N>::copy(source, dest);
- }
-};
-
-template <typename Src, typename Dst, std::size_t N>
-struct copy_coordinates<Src, Dst, N, N>
-{
- static inline void copy(Src const& , Dst& )
- {
- }
-};
-
-}} // namespace detail::copy
-#endif // DOXYGEN_NO_DETAIL
-
-
-// Deprecated!
-// This is the same as "convert", but this is specific to point, convert is more generic
-template <typename Src, typename Dst>
-inline void copy_coordinates(Src const& source, Dst& dest)
-{
- BOOST_CONCEPT_ASSERT( (concept::ConstPoint<Src>) );
- BOOST_CONCEPT_ASSERT( (concept::Point<Dst>) );
-
-
- //assert_dimension_equal<Dst, Src>();
- detail::copy::copy_coordinates
- <
- Src,
- Dst,
- 0,
- dimension<Src>::type::value
- >::copy(source, dest);
-}
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_UTIL_COPY_HPP
Modified: branches/release/boost/geometry/util/write_dsv.hpp
==============================================================================
--- branches/release/boost/geometry/util/write_dsv.hpp (original)
+++ branches/release/boost/geometry/util/write_dsv.hpp 2011-04-08 11:41:37 EDT (Fri, 08 Apr 2011)
@@ -23,8 +23,6 @@
#include <boost/range.hpp>
#include <boost/typeof/typeof.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
-
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.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