|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68803 - in trunk/boost/geometry: . algorithms algorithms/detail algorithms/detail/overlay core extensions/gis/io/shapelib extensions/io/svg multi multi/algorithms multi/algorithms/detail/overlay multi/core multi/iterators multi/util util
From: barend.gehrels_at_[hidden]
Date: 2011-02-12 10:26:51
Author: barendgehrels
Date: 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
New Revision: 68803
URL: http://svn.boost.org/trac/boost/changeset/68803
Log:
Replaced is_multi by tag_cast as planned (see also http://barendgehrels.blogspot.com/2010/10/tag-dispatching-and-inheritance.html)
Moved num_geometries to algorithms/ folder
Created new file num_interior_rings.hpp (extracted from interior_rings.hpp)
Added:
trunk/boost/geometry/algorithms/num_geometries.hpp
- copied, changed from r68727, /trunk/boost/geometry/core/num_geometries.hpp
trunk/boost/geometry/algorithms/num_interior_rings.hpp (contents, props changed)
trunk/boost/geometry/core/tag_cast.hpp (contents, props changed)
trunk/boost/geometry/multi/algorithms/num_geometries.hpp
- copied, changed from r68727, /trunk/boost/geometry/multi/core/num_geometries.hpp
trunk/boost/geometry/multi/algorithms/num_interior_rings.hpp (contents, props changed)
Removed:
trunk/boost/geometry/core/num_geometries.hpp
trunk/boost/geometry/multi/core/num_geometries.hpp
Text files modified:
trunk/boost/geometry/algorithms/append.hpp | 1
trunk/boost/geometry/algorithms/clear.hpp | 3 +
trunk/boost/geometry/algorithms/convex_hull.hpp | 5 ---
trunk/boost/geometry/algorithms/detail/disjoint.hpp | 1
trunk/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp | 19 +++++-------
trunk/boost/geometry/algorithms/disjoint.hpp | 26 ++++++-----------
trunk/boost/geometry/algorithms/distance.hpp | 58 +++++++++++++++------------------------
trunk/boost/geometry/algorithms/equals.hpp | 24 +++++-----------
trunk/boost/geometry/algorithms/for_each.hpp | 32 ++++++++-------------
trunk/boost/geometry/algorithms/num_geometries.hpp | 37 ++++++++++++++++++------
trunk/boost/geometry/algorithms/num_points.hpp | 41 +++++++++++++--------------
trunk/boost/geometry/algorithms/simplify.hpp | 1
trunk/boost/geometry/algorithms/transform.hpp | 3 +
trunk/boost/geometry/core/interior_rings.hpp | 54 ------------------------------------
trunk/boost/geometry/core/is_multi.hpp | 51 ----------------------------------
trunk/boost/geometry/core/tag.hpp | 29 +++++++++----------
trunk/boost/geometry/core/tags.hpp | 23 +++++++++++----
trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp | 1
trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object_multi.hpp | 1
trunk/boost/geometry/extensions/io/svg/svg_mapper.hpp | 38 ++++++++++++++++---------
trunk/boost/geometry/geometry.hpp | 3 +
trunk/boost/geometry/multi/algorithms/clear.hpp | 12 -------
trunk/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp | 4 +-
trunk/boost/geometry/multi/algorithms/distance.hpp | 17 ++++++----
trunk/boost/geometry/multi/algorithms/equals.hpp | 3 --
trunk/boost/geometry/multi/algorithms/for_each.hpp | 19 ++++++------
trunk/boost/geometry/multi/algorithms/num_geometries.hpp | 18 +++++------
trunk/boost/geometry/multi/algorithms/num_points.hpp | 11 ------
trunk/boost/geometry/multi/algorithms/simplify.hpp | 1
trunk/boost/geometry/multi/core/interior_rings.hpp | 22 ---------------
trunk/boost/geometry/multi/core/is_multi.hpp | 49 ---------------------------------
trunk/boost/geometry/multi/core/tags.hpp | 20 ++++++------
trunk/boost/geometry/multi/iterators/range_type.hpp | 2 -
trunk/boost/geometry/multi/multi.hpp | 4 +-
trunk/boost/geometry/multi/util/for_each_range.hpp | 20 ++++++------
trunk/boost/geometry/multi/util/write_dsv.hpp | 4 +-
trunk/boost/geometry/util/as_range.hpp | 1
trunk/boost/geometry/util/for_each_range.hpp | 10 ++----
trunk/boost/geometry/util/write_dsv.hpp | 23 ++++++++------
39 files changed, 249 insertions(+), 442 deletions(-)
Modified: trunk/boost/geometry/algorithms/append.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/append.hpp (original)
+++ trunk/boost/geometry/algorithms/append.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -17,6 +17,7 @@
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/algorithms/num_interior_rings.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/util/copy.hpp>
Modified: trunk/boost/geometry/algorithms/clear.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/clear.hpp (original)
+++ trunk/boost/geometry/algorithms/clear.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -16,6 +16,7 @@
#include <boost/geometry/core/container_access.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -122,7 +123,7 @@
dispatch::clear
<
- typename tag<Geometry>::type,
+ typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
Geometry
>::apply(geometry);
}
Modified: trunk/boost/geometry/algorithms/convex_hull.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/convex_hull.hpp (original)
+++ trunk/boost/geometry/algorithms/convex_hull.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -12,7 +12,6 @@
#include <boost/geometry/core/cs.hpp>
-#include <boost/geometry/core/is_multi.hpp>
#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
@@ -95,7 +94,6 @@
template
<
typename Tag1,
- bool IsMulti,
typename Geometry,
typename Output,
typename Strategy
@@ -109,7 +107,6 @@
<
typename GeometryTag,
order_selector Order,
- bool IsMulti,
typename GeometryIn, typename Strategy
>
struct convex_hull_inserter
@@ -137,7 +134,6 @@
dispatch::convex_hull
<
typename tag<Geometry1>::type,
- is_multi<Geometry1>::type::value,
Geometry1,
Geometry2,
Strategy
@@ -192,7 +188,6 @@
<
typename tag<Geometry>::type,
geometry::point_order<Geometry>::value,
- is_multi<Geometry>::type::value,
Geometry, Strategy
>::apply(geometry, out, strategy);
}
Modified: trunk/boost/geometry/algorithms/detail/disjoint.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/disjoint.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/disjoint.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -19,7 +19,6 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
-#include <boost/geometry/core/is_multi.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
Modified: trunk/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -14,7 +14,6 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
-#include <boost/geometry/core/is_multi.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -102,7 +101,6 @@
template
<
typename GeometryTag,
- bool IsMulti,
typename Geometry,
typename Turns,
typename TurnPolicy,
@@ -122,7 +120,7 @@
>
struct self_get_turn_points
<
- ring_tag, false, Ring,
+ ring_tag, Ring,
Turns,
TurnPolicy,
InterruptPolicy
@@ -131,7 +129,7 @@
<
Ring,
Turns,
- TurnPolicy,
+ TurnPolicy,
InterruptPolicy
>
{};
@@ -146,8 +144,8 @@
>
struct self_get_turn_points
<
- polygon_tag, false, Polygon,
- Turns,
+ polygon_tag, Polygon,
+ Turns,
TurnPolicy,
InterruptPolicy
>
@@ -155,7 +153,7 @@
<
Polygon,
Turns,
- TurnPolicy,
+ TurnPolicy,
InterruptPolicy
>
{};
@@ -198,7 +196,7 @@
typedef detail::overlay::get_turn_info
<
- typename point_type<Geometry>::type,
+ typename point_type<Geometry>::type,
typename point_type<Geometry>::type,
typename boost::range_value<Turns>::type,
detail::overlay::assign_null_policy
@@ -207,10 +205,9 @@
dispatch::self_get_turn_points
<
typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
Geometry,
- Turns,
- TurnPolicy,
+ Turns,
+ TurnPolicy,
InterruptPolicy
>::apply(geometry, turns, interrupt_policy);
}
Modified: trunk/boost/geometry/algorithms/disjoint.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/disjoint.hpp (original)
+++ trunk/boost/geometry/algorithms/disjoint.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -19,7 +19,6 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
-#include <boost/geometry/core/is_multi.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/algorithms/detail/disjoint.hpp>
@@ -136,7 +135,6 @@
<
typename GeometryTag1, typename GeometryTag2,
typename Geometry1, typename Geometry2,
- bool IsMulti1, bool IsMulti2,
std::size_t DimensionCount
>
struct disjoint
@@ -145,34 +143,34 @@
template <typename Point1, typename Point2, std::size_t DimensionCount>
-struct disjoint<point_tag, point_tag, Point1, Point2, false, false, DimensionCount>
+struct disjoint<point_tag, point_tag, Point1, Point2, DimensionCount>
: detail::disjoint::point_point<Point1, Point2, 0, DimensionCount>
{};
template <typename Box1, typename Box2, std::size_t DimensionCount>
-struct disjoint<box_tag, box_tag, Box1, Box2, false, false, DimensionCount>
+struct disjoint<box_tag, box_tag, Box1, Box2, DimensionCount>
: detail::disjoint::box_box<Box1, Box2, 0, DimensionCount>
{};
template <typename Point, typename Box, std::size_t DimensionCount>
-struct disjoint<point_tag, box_tag, Point, Box, false, false, DimensionCount>
+struct disjoint<point_tag, box_tag, Point, Box, DimensionCount>
: detail::disjoint::point_box<Point, Box, 0, DimensionCount>
{};
template <typename Linestring1, typename Linestring2>
-struct disjoint<linestring_tag, linestring_tag, Linestring1, Linestring2, false, false, 2>
+struct disjoint<linestring_tag, linestring_tag, Linestring1, Linestring2, 2>
: detail::disjoint::disjoint_linear<Linestring1, Linestring2>
{};
template <typename Linestring1, typename Linestring2>
-struct disjoint<segment_tag, segment_tag, Linestring1, Linestring2, false, false, 2>
+struct disjoint<segment_tag, segment_tag, Linestring1, Linestring2, 2>
: detail::disjoint::disjoint_segment<Linestring1, Linestring2>
{};
template <typename Linestring, typename Segment>
-struct disjoint<linestring_tag, segment_tag, Linestring, Segment, false, false, 2>
+struct disjoint<linestring_tag, segment_tag, Linestring, Segment, 2>
: detail::disjoint::disjoint_linear<Linestring, Segment>
{};
@@ -180,19 +178,17 @@
template
<
typename GeometryTag1, typename GeometryTag2,
- typename G1, typename G2,
- bool IsMulti1, bool IsMulti2,
+ typename Geometry1, typename Geometry2,
std::size_t DimensionCount
>
struct disjoint_reversed
{
- static inline bool apply(G1 const& g1, G2 const& g2)
+ static inline bool apply(Geometry1 const& g1, Geometry2 const& g2)
{
return disjoint
<
GeometryTag2, GeometryTag1,
- G2, G1,
- IsMulti2, IsMulti1,
+ Geometry2, Geometry1,
DimensionCount
>::apply(g2, g1);
}
@@ -232,8 +228,6 @@
typename tag<Geometry2>::type,
Geometry1,
Geometry2,
- is_multi<Geometry1>::type::value,
- is_multi<Geometry2>::type::value,
dimension<Geometry1>::type::value
>,
dispatch::disjoint
@@ -242,8 +236,6 @@
typename tag<Geometry2>::type,
Geometry1,
Geometry2,
- is_multi<Geometry1>::type::value,
- is_multi<Geometry2>::type::value,
dimension<Geometry1>::type::value
>
>::type::apply(geometry1, geometry2);
Modified: trunk/boost/geometry/algorithms/distance.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/distance.hpp (original)
+++ trunk/boost/geometry/algorithms/distance.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -20,8 +20,8 @@
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/closure.hpp>
-#include <boost/geometry/core/is_multi.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -246,8 +246,7 @@
<
typename GeometryTag1, typename GeometryTag2,
typename Geometry1, typename Geometry2,
- typename StrategyTag, typename Strategy,
- bool IsMulti1, bool IsMulti2
+ typename StrategyTag, typename Strategy
>
struct distance
{
@@ -261,22 +260,22 @@
template <typename P1, typename P2, typename Strategy>
struct distance
-<
- point_tag, point_tag,
- P1, P2,
- strategy_tag_distance_point_point, Strategy,
- false, false
-> : detail::distance::point_to_point<P1, P2, Strategy>
+ <
+ point_tag, point_tag,
+ P1, P2,
+ strategy_tag_distance_point_point, Strategy
+ >
+ : detail::distance::point_to_point<P1, P2, Strategy>
{};
+
// Point-line version 1, where point-point strategy is specified
template <typename Point, typename Linestring, typename Strategy>
struct distance
<
point_tag, linestring_tag,
Point, Linestring,
- strategy_tag_distance_point_point, Strategy,
- false, false
+ strategy_tag_distance_point_point, Strategy
>
{
@@ -305,8 +304,7 @@
<
point_tag, linestring_tag,
Point, Linestring,
- strategy_tag_distance_point_segment, Strategy,
- false, false
+ strategy_tag_distance_point_segment, Strategy
>
{
static inline typename return_type<Strategy>::type apply(Point const& point,
@@ -327,8 +325,7 @@
<
point_tag, ring_tag,
Point, Ring,
- strategy_tag_distance_point_point, Strategy,
- false, false
+ strategy_tag_distance_point_point, Strategy
>
{
typedef typename return_type<Strategy>::type return_type;
@@ -363,8 +360,7 @@
<
point_tag, polygon_tag,
Point, Polygon,
- strategy_tag_distance_point_point, Strategy,
- false, false
+ strategy_tag_distance_point_point, Strategy
>
{
typedef typename return_type<Strategy>::type return_type;
@@ -400,8 +396,7 @@
<
point_tag, segment_tag,
Point, Segment,
- strategy_tag_distance_point_point, Strategy,
- false, false
+ strategy_tag_distance_point_point, Strategy
> : detail::distance::point_to_segment<Point, Segment, Strategy>
{};
@@ -411,8 +406,7 @@
<
point_tag, segment_tag,
Point, Segment,
- strategy_tag_distance_point_segment, Strategy,
- false, false
+ strategy_tag_distance_point_segment, Strategy
>
{
static inline typename return_type<Strategy>::type apply(Point const& point,
@@ -437,8 +431,7 @@
<
typename GeometryTag1, typename GeometryTag2,
typename G1, typename G2,
- typename StrategyTag, typename Strategy,
- bool IsMulti1, bool IsMulti2
+ typename StrategyTag, typename Strategy
>
struct distance_reversed
{
@@ -449,8 +442,7 @@
<
GeometryTag2, GeometryTag1,
G2, G1,
- StrategyTag, Strategy,
- IsMulti2, IsMulti1
+ StrategyTag, Strategy
>::apply(g2, g1, strategy);
}
};
@@ -507,25 +499,21 @@
typename geometry::reverse_dispatch<Geometry1, Geometry2>::type,
dispatch::distance_reversed
<
- typename tag<Geometry1>::type,
- typename tag<Geometry2>::type,
+ typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
+ typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type,
Geometry1,
Geometry2,
typename strategy::distance::services::tag<Strategy>::type,
- Strategy,
- is_multi<Geometry1>::value,
- is_multi<Geometry2>::value
+ Strategy
>,
dispatch::distance
<
- typename tag<Geometry1>::type,
- typename tag<Geometry2>::type,
+ typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
+ typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type,
Geometry1,
Geometry2,
typename strategy::distance::services::tag<Strategy>::type,
- Strategy,
- is_multi<Geometry1>::value,
- is_multi<Geometry2>::value
+ Strategy
>
>::type::apply(geometry1, geometry2, strategy);
}
Modified: trunk/boost/geometry/algorithms/equals.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/equals.hpp (original)
+++ trunk/boost/geometry/algorithms/equals.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -21,7 +21,6 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
-#include <boost/geometry/core/is_multi.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -155,7 +154,6 @@
template
<
typename Tag1, typename Tag2,
- bool IsMulti1, bool IsMulti2,
typename Geometry1,
typename Geometry2,
std::size_t DimensionCount
@@ -165,7 +163,7 @@
template <typename P1, typename P2, std::size_t DimensionCount>
-struct equals<point_tag, point_tag, false, false, P1, P2, DimensionCount>
+struct equals<point_tag, point_tag, P1, P2, DimensionCount>
: geometry::detail::not_
<
P1,
@@ -176,13 +174,13 @@
template <typename Box1, typename Box2, std::size_t DimensionCount>
-struct equals<box_tag, box_tag, false, false, Box1, Box2, DimensionCount>
+struct equals<box_tag, box_tag, Box1, Box2, DimensionCount>
: detail::equals::box_box<Box1, Box2, 0, DimensionCount>
{};
template <typename Ring1, typename Ring2>
-struct equals<ring_tag, ring_tag, false, false, Ring1, Ring2, 2>
+struct equals<ring_tag, ring_tag, Ring1, Ring2, 2>
: detail::equals::equals_by_collection
<
Ring1, Ring2,
@@ -192,7 +190,7 @@
template <typename Polygon1, typename Polygon2>
-struct equals<polygon_tag, polygon_tag, false, false, Polygon1, Polygon2, 2>
+struct equals<polygon_tag, polygon_tag, Polygon1, Polygon2, 2>
: detail::equals::equals_by_collection
<
Polygon1, Polygon2,
@@ -202,7 +200,7 @@
template <typename LineString1, typename LineString2>
-struct equals<linestring_tag, linestring_tag, false, false, LineString1, LineString2, 2>
+struct equals<linestring_tag, linestring_tag, LineString1, LineString2, 2>
: detail::equals::equals_by_collection
<
LineString1, LineString2,
@@ -212,7 +210,7 @@
template <typename Polygon, typename Ring>
-struct equals<polygon_tag, ring_tag, false, false, Polygon, Ring, 2>
+struct equals<polygon_tag, ring_tag, Polygon, Ring, 2>
: detail::equals::equals_by_collection
<
Polygon, Ring,
@@ -222,7 +220,7 @@
template <typename Ring, typename Box>
-struct equals<ring_tag, box_tag, false, false, Ring, Box, 2>
+struct equals<ring_tag, box_tag, Ring, Box, 2>
: detail::equals::equals_by_collection
<
Ring, Box,
@@ -232,7 +230,7 @@
template <typename Polygon, typename Box>
-struct equals<polygon_tag, box_tag, false, false, Polygon, Box, 2>
+struct equals<polygon_tag, box_tag, Polygon, Box, 2>
: detail::equals::equals_by_collection
<
Polygon, Box,
@@ -244,7 +242,6 @@
template
<
typename Tag1, typename Tag2,
- bool IsMulti1, bool IsMulti2,
typename Geometry1,
typename Geometry2,
std::size_t DimensionCount
@@ -256,7 +253,6 @@
return equals
<
Tag2, Tag1,
- IsMulti2, IsMulti1,
Geometry2, Geometry1,
DimensionCount
>::apply(g2, g1);
@@ -293,8 +289,6 @@
<
typename tag<Geometry1>::type,
typename tag<Geometry2>::type,
- is_multi<Geometry1>::type::value,
- is_multi<Geometry2>::type::value,
Geometry1,
Geometry2,
dimension<Geometry1>::type::value
@@ -303,8 +297,6 @@
<
typename tag<Geometry1>::type,
typename tag<Geometry2>::type,
- is_multi<Geometry1>::type::value,
- is_multi<Geometry2>::type::value,
Geometry1,
Geometry2,
dimension<Geometry1>::type::value
Modified: trunk/boost/geometry/algorithms/for_each.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/for_each.hpp (original)
+++ trunk/boost/geometry/algorithms/for_each.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -17,7 +17,7 @@
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
-#include <boost/geometry/core/is_multi.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -165,7 +165,6 @@
template
<
typename Tag,
- bool IsMulti,
typename Geometry,
typename Functor,
bool IsConst
@@ -174,25 +173,25 @@
template <typename Point, typename Functor, bool IsConst>
-struct for_each_point<point_tag, false, Point, Functor, IsConst>
+struct for_each_point<point_tag, Point, Functor, IsConst>
: detail::for_each::fe_point_per_point<Point, Functor, IsConst>
{};
template <typename Linestring, typename Functor, bool IsConst>
-struct for_each_point<linestring_tag, false, Linestring, Functor, IsConst>
+struct for_each_point<linestring_tag, Linestring, Functor, IsConst>
: detail::for_each::fe_range_per_point<Linestring, Functor, IsConst>
{};
template <typename Ring, typename Functor, bool IsConst>
-struct for_each_point<ring_tag, false, Ring, Functor, IsConst>
+struct for_each_point<ring_tag, Ring, Functor, IsConst>
: detail::for_each::fe_range_per_point<Ring, Functor, IsConst>
{};
template <typename Polygon, typename Functor, bool IsConst>
-struct for_each_point<polygon_tag, false, Polygon, Functor, IsConst>
+struct for_each_point<polygon_tag, Polygon, Functor, IsConst>
: detail::for_each::fe_polygon_per_point<Polygon, Functor, IsConst>
{};
@@ -200,7 +199,6 @@
template
<
typename Tag,
- bool IsMulti,
typename Geometry,
typename Functor,
bool IsConst
@@ -208,25 +206,25 @@
struct for_each_segment {};
template <typename Point, typename Functor, bool IsConst>
-struct for_each_segment<point_tag, false, Point, Functor, IsConst>
+struct for_each_segment<point_tag, Point, Functor, IsConst>
: detail::for_each::fe_point_per_segment<Point, Functor, IsConst>
{};
template <typename Linestring, typename Functor, bool IsConst>
-struct for_each_segment<linestring_tag, false, Linestring, Functor, IsConst>
+struct for_each_segment<linestring_tag, Linestring, Functor, IsConst>
: detail::for_each::fe_range_per_segment<Linestring, Functor, IsConst>
{};
template <typename Ring, typename Functor, bool IsConst>
-struct for_each_segment<ring_tag, false, Ring, Functor, IsConst>
+struct for_each_segment<ring_tag, Ring, Functor, IsConst>
: detail::for_each::fe_range_per_segment<Ring, Functor, IsConst>
{};
template <typename Polygon, typename Functor, bool IsConst>
-struct for_each_segment<polygon_tag, false, Polygon, Functor, IsConst>
+struct for_each_segment<polygon_tag, Polygon, Functor, IsConst>
: detail::for_each::fe_polygon_per_segment<Polygon, Functor, IsConst>
{};
@@ -249,8 +247,7 @@
return dispatch::for_each_point
<
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
+ typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
Geometry,
Functor,
true
@@ -272,8 +269,7 @@
return dispatch::for_each_point
<
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
+ typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
Geometry,
Functor,
false
@@ -296,8 +292,7 @@
return dispatch::for_each_segment
<
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
+ typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
Geometry,
Functor,
true
@@ -319,8 +314,7 @@
return dispatch::for_each_segment
<
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
+ typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
Geometry,
Functor,
false
Copied: trunk/boost/geometry/algorithms/num_geometries.hpp (from r68727, /trunk/boost/geometry/core/num_geometries.hpp)
==============================================================================
--- /trunk/boost/geometry/core/num_geometries.hpp (original)
+++ trunk/boost/geometry/algorithms/num_geometries.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -6,14 +6,16 @@
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_GEOMETRY_NUM_GEOMETRIES_HPP
-#define BOOST_GEOMETRY_NUM_GEOMETRIES_HPP
+#ifndef BOOST_GEOMETRY_ALGORITHMS_NUM_GEOMETRIES_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_NUM_GEOMETRIES_HPP
#include <cstddef>
+#include <boost/mpl/assert.hpp>
+
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
-#include <boost/geometry/core/is_multi.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -23,13 +25,24 @@
#ifndef DOXYGEN_NO_DISPATCH
-namespace core_dispatch
+namespace dispatch
{
-template <typename Tag, bool IsMulti, typename Geometry>
+template <typename Tag, typename Geometry>
struct num_geometries
{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<Geometry>)
+ );
+};
+
+
+template <typename Geometry>
+struct num_geometries<single_tag, Geometry>
+{
static inline std::size_t apply(Geometry const&)
{
return 1;
@@ -38,7 +51,7 @@
-} // namespace core_dispatch
+} // namespace dispatch
#endif
@@ -57,10 +70,14 @@
{
concept::check<Geometry const>();
- return core_dispatch::num_geometries
+ return dispatch::num_geometries
<
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
+ typename tag_cast
+ <
+ typename tag<Geometry>::type,
+ single_tag,
+ multi_tag
+ >::type,
Geometry
>::apply(geometry);
}
@@ -69,4 +86,4 @@
}} // namespace boost::geometry
-#endif // BOOST_GEOMETRY_NUM_GEOMETRIES_HPP
+#endif // BOOST_GEOMETRY_ALGORITHMS_NUM_GEOMETRIES_HPP
Added: trunk/boost/geometry/algorithms/num_interior_rings.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/algorithms/num_interior_rings.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -0,0 +1,82 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, 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_NUM_INTERIOR_RINGS_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_NUM_INTERIOR_RINGS_HPP
+
+#include <cstddef>
+
+#include <boost/range.hpp>
+
+#include <boost/geometry/core/tag.hpp>
+#include <boost/geometry/core/tags.hpp>
+
+#include <boost/geometry/core/interior_rings.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+template <typename Tag, typename Geometry>
+struct num_interior_rings
+{
+ static inline std::size_t apply(Geometry const& )
+ {
+ return 0;
+ }
+};
+
+
+
+template <typename Polygon>
+struct num_interior_rings<polygon_tag, Polygon>
+{
+ static inline std::size_t apply(Polygon const& polygon)
+ {
+ return boost::size(geometry::interior_rings(polygon));
+ }
+
+};
+
+
+} // namespace dispatch
+#endif
+
+
+/*!
+\brief \brief_calc{number of interior rings}
+\ingroup num_interior_rings
+\details \details_calc{num_interior_rings, number of interior rings}.
+\tparam Geometry \tparam_geometry
+\param geometry \param_geometry
+\return \return_calc{number of interior rings}
+
+\qbk{[include ref/algorithms/num_interior_rings.qbk]}
+
+\note Defined by OGC as "numInteriorRing". To be consistent with "numPoints"
+ letter "s" is appended
+*/
+template <typename Geometry>
+inline std::size_t num_interior_rings(Geometry const& geometry)
+{
+ return dispatch::num_interior_rings
+ <
+ typename tag<Geometry>::type,
+ Geometry
+ >::apply(geometry);
+}
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_NUM_INTERIOR_RINGS_HPP
Modified: trunk/boost/geometry/algorithms/num_points.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/num_points.hpp (original)
+++ trunk/boost/geometry/algorithms/num_points.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -20,6 +20,7 @@
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/algorithms/disjoint.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -93,7 +94,7 @@
namespace dispatch
{
-template <typename GeometryTag, bool Linear, typename Geometry>
+template <typename GeometryTag, typename Geometry>
struct num_points
{
BOOST_MPL_ASSERT_MSG
@@ -103,36 +104,35 @@
);
};
-template <typename GeometryTag, typename Geometry>
-struct num_points<GeometryTag, true, Geometry>
- : detail::num_points::range_count<Geometry>
-{
-};
-
template <typename Geometry>
-struct num_points<point_tag, false, Geometry>
+struct num_points<point_tag, Geometry>
: detail::num_points::other_count<Geometry, 1>
-{
-};
+{};
template <typename Geometry>
-struct num_points<box_tag, false, Geometry>
+struct num_points<box_tag, Geometry>
: detail::num_points::other_count<Geometry, 4>
-{
-};
+{};
template <typename Geometry>
-struct num_points<segment_tag, false, Geometry>
+struct num_points<segment_tag, Geometry>
: detail::num_points::other_count<Geometry, 2>
-{
-};
+{};
+template <typename Geometry>
+struct num_points<linestring_tag, Geometry>
+ : detail::num_points::range_count<Geometry>
+{};
template <typename Geometry>
-struct num_points<polygon_tag, false, Geometry>
+struct num_points<ring_tag, Geometry>
+ : detail::num_points::range_count<Geometry>
+{};
+
+template <typename Geometry>
+struct num_points<polygon_tag, Geometry>
: detail::num_points::polygon_count<Geometry>
-{
-};
+{};
} // namespace dispatch
#endif
@@ -156,8 +156,7 @@
return dispatch::num_points
<
- typename tag<Geometry>::type,
- is_linear<Geometry>::value,
+ typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
Geometry
>::apply(geometry, add_for_open);
}
Modified: trunk/boost/geometry/algorithms/simplify.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/simplify.hpp (original)
+++ trunk/boost/geometry/algorithms/simplify.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -26,6 +26,7 @@
#include <boost/geometry/strategies/concepts/simplify_concept.hpp>
#include <boost/geometry/algorithms/clear.hpp>
+#include <boost/geometry/algorithms/num_interior_rings.hpp>
namespace boost { namespace geometry
Modified: trunk/boost/geometry/algorithms/transform.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/transform.hpp (original)
+++ trunk/boost/geometry/algorithms/transform.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -15,8 +15,9 @@
#include <boost/range.hpp>
#include <boost/typeof/typeof.hpp>
-#include <boost/geometry/algorithms/clear.hpp>
#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/clear.hpp>
+#include <boost/geometry/algorithms/num_interior_rings.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
Modified: trunk/boost/geometry/core/interior_rings.hpp
==============================================================================
--- trunk/boost/geometry/core/interior_rings.hpp (original)
+++ trunk/boost/geometry/core/interior_rings.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -68,7 +68,7 @@
template <typename Polygon>
struct interior_rings<polygon_tag, Polygon>
{
- static
+ static inline
typename geometry::interior_return_type<Polygon>::type
apply(Polygon& polygon)
{
@@ -80,35 +80,6 @@
};
-template <typename Tag, typename Geometry>
-struct num_interior_rings
-{};
-
-
-template <typename Ring>
-struct num_interior_rings<ring_tag, Ring>
-{
- static inline std::size_t apply(Ring const& )
- {
- return 0;
- }
-};
-
-
-template <typename Polygon>
-struct num_interior_rings<polygon_tag, Polygon>
-{
- static inline std::size_t apply(Polygon const& polygon)
- {
- return boost::size(interior_rings
- <
- polygon_tag, Polygon const
- >::apply(polygon));
- }
-
-};
-
-
} // namespace core_dispatch
#endif
@@ -156,29 +127,6 @@
}
-/*!
-\brief \brief_calc{number of interior rings}
-\ingroup num_interior_rings
-\details \details_calc{num_interior_rings, number of interior rings}.
-\tparam Geometry \tparam_geometry
-\param geometry \param_geometry
-\return \return_calc{number of interior rings}
-
-\qbk{[include ref/algorithms/num_interior_rings.qbk]}
-
-\note Defined by OGC as "numInteriorRing". To be consistent with "numPoints"
- letter "s" is appended
-*/
-template <typename Geometry>
-inline std::size_t num_interior_rings(Geometry const& geometry)
-{
- return core_dispatch::num_interior_rings
- <
- typename tag<Geometry>::type,
- Geometry
- >::apply(geometry);
-}
-
}} // namespace boost::geometry
Modified: trunk/boost/geometry/core/is_multi.hpp
==============================================================================
--- trunk/boost/geometry/core/is_multi.hpp (original)
+++ trunk/boost/geometry/core/is_multi.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -1,50 +1 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// 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_CORE_IS_MULTI_HPP
-#define BOOST_GEOMETRY_CORE_IS_MULTI_HPP
-
-
-#include <boost/type_traits.hpp>
-
-
-#include <boost/geometry/core/tag.hpp>
-#include <boost/geometry/core/tags.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace core_dispatch
-{
-
-template <typename GeometryTag>
-struct is_multi : boost::false_type {};
-
-
-} // namespace core_dispatch
-#endif
-
-
-
-
-/*!
- \brief Meta-function defining "true" for multi geometries (multi_point, etc)
- \ingroup core
-*/
-template <typename Geometry>
-struct is_multi : core_dispatch::is_multi<typename tag<Geometry>::type>
-{};
-
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_CORE_IS_MULTI_HPP
+// obsolete
Deleted: trunk/boost/geometry/core/num_geometries.hpp
==============================================================================
--- trunk/boost/geometry/core/num_geometries.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
+++ (empty file)
@@ -1,72 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 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_NUM_GEOMETRIES_HPP
-#define BOOST_GEOMETRY_NUM_GEOMETRIES_HPP
-
-#include <cstddef>
-
-#include <boost/geometry/core/tag.hpp>
-#include <boost/geometry/core/tags.hpp>
-#include <boost/geometry/core/is_multi.hpp>
-
-#include <boost/geometry/geometries/concepts/check.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace core_dispatch
-{
-
-
-template <typename Tag, bool IsMulti, typename Geometry>
-struct num_geometries
-{
- static inline std::size_t apply(Geometry const&)
- {
- return 1;
- }
-};
-
-
-
-} // namespace core_dispatch
-#endif
-
-
-/*!
-\brief \brief_calc{number of geometries}
-\ingroup num_geometries
-\details \details_calc{num_geometries, number of geometries}.
-\tparam Geometry \tparam_geometry
-\param geometry \param_geometry
-\return \return_calc{number of geometries}
-
-\qbk{[include ref/algorithms/num_geometries.qbk]}
-*/
-template <typename Geometry>
-inline std::size_t num_geometries(Geometry const& geometry)
-{
- concept::check<Geometry const>();
-
- return core_dispatch::num_geometries
- <
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
- Geometry
- >::apply(geometry);
-}
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_NUM_GEOMETRIES_HPP
Modified: trunk/boost/geometry/core/tag.hpp
==============================================================================
--- trunk/boost/geometry/core/tag.hpp (original)
+++ trunk/boost/geometry/core/tag.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -23,15 +23,15 @@
{
/*!
- \brief Traits class to attach a tag to a geometry
- \details All geometries should implement a traits::tag<G>::type metafunction to indicate their
- own geometry type.
- \ingroup traits
- \par Geometries:
- - all geometries
- \par Specializations should provide:
- - typedef XXX_tag type; (point_tag, box_tag, ...)
- \tparam Geometry geometry
+\brief Traits class to attach a tag to a geometry
+\details All geometries should implement a traits::tag<G>::type metafunction to indicate their
+ own geometry type.
+\ingroup traits
+\par Geometries:
+ - all geometries
+\par Specializations should provide:
+ - typedef XXX_tag type; (point_tag, box_tag, ...)
+\tparam Geometry geometry
*/
template <typename Geometry, typename Enable = void>
struct tag
@@ -43,12 +43,11 @@
/*!
- \brief Meta-function to get the tag of any geometry type
- \details All geometries tell their geometry type (point, linestring, polygon, etc) by implementing
- a tag traits class. This meta-function uses that traits class to retrieve the tag.
- If the input type is not a geometry at all, a geometry_not_recognized_tag will be returned.
- \tparam Geometry geometry
- \ingroup core
+\brief Meta-function to get the tag of any geometry type
+\details All geometries tell their geometry type (point, linestring, polygon, etc) by implementing
+ a tag traits class. This meta-function uses that traits class to retrieve the tag.
+\tparam Geometry geometry
+\ingroup core
*/
template <typename Geometry>
struct tag
Added: trunk/boost/geometry/core/tag_cast.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/core/tag_cast.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -0,0 +1,56 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, 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_CORE_TAG_CAST_HPP
+#define BOOST_GEOMETRY_CORE_TAG_CAST_HPP
+
+
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits.hpp>
+
+namespace boost { namespace geometry
+{
+
+/// Generic tag_cast utility
+template
+<
+ typename Tag,
+ typename BaseTag,
+ typename BaseTag2 = void,
+ typename BaseTag3 = void,
+ typename BaseTag4 = void,
+ typename BaseTag5 = void,
+ typename BaseTag6 = void,
+ typename BaseTag7 = void
+>
+struct tag_cast
+{
+ typedef typename boost::mpl::if_
+ <
+ typename boost::is_base_of<BaseTag, Tag>::type,
+ BaseTag,
+ // Try next one in line:
+ typename tag_cast
+ <
+ Tag, BaseTag2, BaseTag3, BaseTag4,
+ BaseTag5, BaseTag6, BaseTag7, void
+ >::type
+ >::type type;
+};
+
+// Specialization for last one
+template <typename Tag>
+struct tag_cast<Tag, void, void, void, void, void, void, void>
+{
+ // If not found, take specified tag, so do not cast
+ typedef Tag type;
+};
+
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_CORE_TAG_CAST_HPP
Modified: trunk/boost/geometry/core/tags.hpp
==============================================================================
--- trunk/boost/geometry/core/tags.hpp (original)
+++ trunk/boost/geometry/core/tags.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -26,6 +26,15 @@
struct spherical_tag {};
+// Tags defining tag hierarchy
+
+/// For single-geometries (point, linestring, polygon, box, ring, segment)
+struct single_tag {};
+
+
+/// For multiple-geometries (multi_point, multi_linestring, multi_polygon)
+struct multi_tag {};
+
// Tags defining geometry types
@@ -33,22 +42,24 @@
struct geometry_not_recognized_tag {};
/// OGC Point identifying tag
-struct point_tag {};
+struct point_tag : single_tag {};
/// OGC Linestring identifying tag
-struct linestring_tag {};
+struct linestring_tag : single_tag {};
/// OGC Polygon identifying tag
-struct polygon_tag {};
+struct polygon_tag : single_tag {};
/// Convenience (linear) ring identifying tag
-struct ring_tag {};
+struct ring_tag : single_tag {};
/// Convenience 2D or 3D box (mbr) identifying tag
-struct box_tag {};
+struct box_tag : single_tag {};
/// Convenience segment (2-points) identifying tag
-struct segment_tag {};
+struct segment_tag : single_tag {};
+
+
}} // namespace boost::geometry
Modified: trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp
==============================================================================
--- trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp (original)
+++ trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -17,6 +17,7 @@
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>
+#include <boost/geometry/algorithms/num_interior_rings.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/ranges/box_range.hpp>
#include <boost/geometry/ranges/segment_range.hpp>
Modified: trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object_multi.hpp
==============================================================================
--- trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object_multi.hpp (original)
+++ trunk/boost/geometry/extensions/gis/io/shapelib/shp_create_object_multi.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -15,6 +15,7 @@
#include <boost/geometry/multi/core/tags.hpp>
#include <boost/geometry/multi/core/point_type.hpp>
+#include <boost/geometry/multi/algorithms/num_interior_rings.hpp>
#include <boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp>
Modified: trunk/boost/geometry/extensions/io/svg/svg_mapper.hpp
==============================================================================
--- trunk/boost/geometry/extensions/io/svg/svg_mapper.hpp (original)
+++ trunk/boost/geometry/extensions/io/svg/svg_mapper.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -21,6 +21,10 @@
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
+
+#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
+
#include <boost/geometry/algorithms/envelope.hpp>
#include <boost/geometry/algorithms/transform.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
@@ -35,7 +39,6 @@
#include <boost/geometry/geometries/point_xy.hpp>
-#include <boost/geometry/multi/core/is_multi.hpp>
#include <boost/geometry/multi/core/tags.hpp>
#include <boost/geometry/multi/algorithms/envelope.hpp>
#include <boost/geometry/multi/algorithms/num_points.hpp>
@@ -51,7 +54,7 @@
namespace dispatch
{
-template <typename GeometryTag, bool IsMulti, typename Geometry>
+template <typename GeometryTag, typename Geometry>
struct svg_map
{
BOOST_MPL_ASSERT_MSG
@@ -63,7 +66,7 @@
template <typename Point>
-struct svg_map<point_tag, false, Point>
+struct svg_map<point_tag, Point>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
@@ -77,7 +80,7 @@
};
template <typename Box>
-struct svg_map<box_tag, false, Box>
+struct svg_map<box_tag, Box>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
@@ -107,7 +110,7 @@
};
template <typename Segment>
-struct svg_map<segment_tag, false, Segment>
+struct svg_map<segment_tag, Segment>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
@@ -126,19 +129,19 @@
template <typename Ring>
-struct svg_map<ring_tag, false, Ring>
+struct svg_map<ring_tag, Ring>
: svg_map_range<Ring, model::ring<model::d2::point_xy<int> > >
{};
template <typename Linestring>
-struct svg_map<linestring_tag, false, Linestring>
+struct svg_map<linestring_tag, Linestring>
: svg_map_range<Linestring, model::linestring<model::d2::point_xy<int> > >
{};
template <typename Polygon>
-struct svg_map<polygon_tag, false, Polygon>
+struct svg_map<polygon_tag, Polygon>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
@@ -152,9 +155,14 @@
};
-template <typename Tag, typename Multi>
-struct svg_map<Tag, true, Multi>
+template <typename Multi>
+struct svg_map<multi_tag, Multi>
{
+ typedef typename single_tag_of
+ <
+ typename geometry::tag<Multi>::type
+ >::type stag;
+
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
std::string const& style, int size,
@@ -167,8 +175,7 @@
{
svg_map
<
- typename single_tag<Tag>::type,
- false,
+ stag,
typename boost::range_value<Multi>::type
>::apply(stream, style, size, *it, strategy);
}
@@ -187,8 +194,11 @@
{
dispatch::svg_map
<
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
+ typename tag_cast
+ <
+ typename tag<Geometry>::type,
+ multi_tag
+ >::type,
typename boost::remove_const<Geometry>::type
>::apply(stream, style, size, geometry, strategy);
}
Modified: trunk/boost/geometry/geometry.hpp
==============================================================================
--- trunk/boost/geometry/geometry.hpp (original)
+++ trunk/boost/geometry/geometry.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -21,7 +21,6 @@
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
-#include <boost/geometry/core/num_geometries.hpp>
#include <boost/geometry/core/radian_access.hpp>
#include <boost/geometry/core/topological_dimension.hpp>
@@ -50,6 +49,8 @@
#include <boost/geometry/algorithms/intersects.hpp>
#include <boost/geometry/algorithms/length.hpp>
#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/algorithms/num_geometries.hpp>
+#include <boost/geometry/algorithms/num_inteior_rings.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/algorithms/perimeter.hpp>
#include <boost/geometry/algorithms/reverse.hpp>
Modified: trunk/boost/geometry/multi/algorithms/clear.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/clear.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/clear.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -22,21 +22,11 @@
{
template <typename Geometry>
-struct clear<multi_point_tag, Geometry>
+struct clear<multi_tag, Geometry>
: detail::clear::collection_clear<Geometry>
{};
-template <typename Geometry>
-struct clear<multi_linestring_tag, Geometry>
- : detail::clear::collection_clear<Geometry>
-{};
-
-template <typename Geometry>
-struct clear<multi_polygon_tag, Geometry>
- : detail::clear::collection_clear<Geometry>
-{};
-
} // namespace dispatch
#endif
Modified: trunk/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -31,8 +31,8 @@
>
struct self_get_turn_points
<
- multi_polygon_tag, true, MultiPolygon,
- Turns,
+ multi_polygon_tag, MultiPolygon,
+ Turns,
TurnPolicy, InterruptPolicy
>
: detail::self_get_turn_points::get_turns
Modified: trunk/boost/geometry/multi/algorithms/distance.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/distance.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/distance.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -14,7 +14,6 @@
#include <boost/range.hpp>
#include <boost/geometry/multi/core/tags.hpp>
-#include <boost/geometry/multi/core/is_multi.hpp>
#include <boost/geometry/multi/core/geometry_id.hpp>
#include <boost/geometry/multi/core/point_type.hpp>
@@ -103,15 +102,19 @@
namespace dispatch
{
-template <typename GeometryTag1, typename GeometryTag2,
- typename G1, typename G2, typename Strategy>
-struct distance<GeometryTag1, GeometryTag2, G1, G2, strategy_tag_distance_point_point, Strategy, false, true>
+template
+<
+ typename SingleGeometryTag,
+ typename G1,
+ typename G2,
+ typename Strategy
+>
+struct distance<SingleGeometryTag, multi_tag, G1, G2, strategy_tag_distance_point_point, Strategy>
: detail::distance::distance_single_to_multi<G1, G2, Strategy>
{};
-template <typename GeometryTag1, typename GeometryTag2,
- typename G1, typename G2, typename Strategy>
-struct distance<GeometryTag1, GeometryTag2, G1, G2, strategy_tag_distance_point_point, Strategy, true, true>
+template <typename G1, typename G2, typename Strategy>
+struct distance<multi_tag, multi_tag, G1, G2, strategy_tag_distance_point_point, Strategy>
: detail::distance::distance_multi_to_multi<G1, G2, Strategy>
{};
Modified: trunk/boost/geometry/multi/algorithms/equals.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/equals.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/equals.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -9,7 +9,6 @@
#define BOOST_GEOMETRY_MULTI_ALGORITHMS_EQUALS_HPP
-#include <boost/geometry/multi/core/is_multi.hpp>
#include <boost/geometry/multi/core/tags.hpp>
#include <boost/geometry/multi/core/geometry_id.hpp>
@@ -28,7 +27,6 @@
struct equals
<
multi_polygon_tag, multi_polygon_tag,
- true, true,
MultiPolygon1, MultiPolygon2,
2
>
@@ -44,7 +42,6 @@
struct equals
<
polygon_tag, multi_polygon_tag,
- false, true,
Polygon, MultiPolygon,
2
>
Modified: trunk/boost/geometry/multi/algorithms/for_each.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/for_each.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/for_each.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -13,7 +13,6 @@
#include <boost/typeof/typeof.hpp>
#include <boost/geometry/multi/core/tags.hpp>
-#include <boost/geometry/multi/core/is_multi.hpp>
#include <boost/geometry/multi/core/point_type.hpp>
@@ -63,12 +62,11 @@
template
<
- typename MultiTag,
typename MultiGeometry,
typename Functor,
bool IsConst
>
-struct for_each_point<MultiTag, true, MultiGeometry, Functor, IsConst>
+struct for_each_point<multi_tag, MultiGeometry, Functor, IsConst>
: detail::for_each::for_each_multi
<
MultiGeometry,
@@ -77,8 +75,10 @@
// Specify the dispatch of the single-version as policy
for_each_point
<
- typename single_tag<MultiTag>::type,
- false,
+ typename single_tag_of
+ <
+ typename tag<MultiGeometry>::type
+ >::type,
typename boost::range_value<MultiGeometry>::type,
Functor,
IsConst
@@ -89,12 +89,11 @@
template
<
- typename MultiTag,
typename MultiGeometry,
typename Functor,
bool IsConst
>
-struct for_each_segment<MultiTag, true, MultiGeometry, Functor, IsConst>
+struct for_each_segment<multi_tag, MultiGeometry, Functor, IsConst>
: detail::for_each::for_each_multi
<
MultiGeometry,
@@ -103,8 +102,10 @@
// Specify the dispatch of the single-version as policy
for_each_segment
<
- typename single_tag<MultiTag>::type,
- false,
+ typename single_tag_of
+ <
+ typename tag<MultiGeometry>::type
+ >::type,
typename boost::range_value<MultiGeometry>::type,
Functor,
IsConst
Copied: trunk/boost/geometry/multi/algorithms/num_geometries.hpp (from r68727, /trunk/boost/geometry/multi/core/num_geometries.hpp)
==============================================================================
--- /trunk/boost/geometry/multi/core/num_geometries.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/num_geometries.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -6,17 +6,15 @@
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_GEOMETRY_MULTI_CORE_NUM_GEOMETRIES_HPP
-#define BOOST_GEOMETRY_MULTI_CORE_NUM_GEOMETRIES_HPP
+#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_GEOMETRIES_HPP
+#define BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_GEOMETRIES_HPP
#include <cstddef>
#include <boost/range.hpp>
-
-#include <boost/geometry/core/num_geometries.hpp>
-#include <boost/geometry/multi/core/tags.hpp>
+#include <boost/geometry/algorithms/num_geometries.hpp>
namespace boost { namespace geometry
@@ -24,11 +22,11 @@
#ifndef DOXYGEN_NO_DISPATCH
-namespace core_dispatch
+namespace dispatch
{
-template <typename Tag, typename MultiGeometry>
-struct num_geometries<Tag, true, MultiGeometry>
+template <typename MultiGeometry>
+struct num_geometries<multi_tag, MultiGeometry>
{
static inline std::size_t apply(MultiGeometry const& multi_geometry)
{
@@ -37,11 +35,11 @@
};
-} // namespace core_dispatch
+} // namespace dispatch
#endif
}} // namespace boost::geometry
-#endif // BOOST_GEOMETRY_MULTI_CORE_NUM_GEOMETRIES_HPP
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_GEOMETRIES_HPP
Added: trunk/boost/geometry/multi/algorithms/num_interior_rings.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/multi/algorithms/num_interior_rings.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -0,0 +1,55 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, 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_MULTI_ALGORITHMS_NUM_INTERIOR_RINGS_HPP
+#define BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_INTERIOR_RINGS_HPP
+
+#include <cstddef>
+
+#include <boost/range.hpp>
+
+#include <boost/geometry/core/tag.hpp>
+#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/multi/core/tags.hpp>
+
+#include <boost/geometry/algorithms/num_interior_rings.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+template <typename MultiPolygon>
+struct num_interior_rings<multi_polygon_tag, MultiPolygon>
+{
+ static inline std::size_t apply(MultiPolygon const& multi_polygon)
+ {
+ std::size_t n = 0;
+ for (typename boost::range_iterator<MultiPolygon const>::type
+ it = boost::begin(multi_polygon);
+ it != boost::end(multi_polygon);
+ ++it)
+ {
+ n += geometry::num_interior_rings(*it);
+ }
+ return n;
+ }
+
+};
+
+} // namespace dispatch
+#endif
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_INTERIOR_RINGS_HPP
Modified: trunk/boost/geometry/multi/algorithms/num_points.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/num_points.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/num_points.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -44,7 +44,6 @@
n += dispatch::num_points
<
typename tag<geometry_type>::type,
- geometry::is_linear<geometry_type>::value,
geometry_type
>::apply(*it, add_for_open);
}
@@ -63,15 +62,7 @@
template <typename Geometry>
-struct num_points<multi_point_tag, false, Geometry>
- : detail::num_points::multi_count<Geometry> {};
-
-template <typename Geometry>
-struct num_points<multi_linestring_tag, false, Geometry>
- : detail::num_points::multi_count<Geometry> {};
-
-template <typename Geometry>
-struct num_points<multi_polygon_tag, false, Geometry>
+struct num_points<multi_tag, Geometry>
: detail::num_points::multi_count<Geometry> {};
Modified: trunk/boost/geometry/multi/algorithms/simplify.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/simplify.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/simplify.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -12,7 +12,6 @@
#include <boost/range.hpp>
#include <boost/geometry/multi/core/tags.hpp>
-#include <boost/geometry/multi/core/is_multi.hpp>
#include <boost/geometry/multi/iterators/range_type.hpp>
Modified: trunk/boost/geometry/multi/core/interior_rings.hpp
==============================================================================
--- trunk/boost/geometry/multi/core/interior_rings.hpp (original)
+++ trunk/boost/geometry/multi/core/interior_rings.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -22,8 +22,6 @@
{
-
-
#ifndef DOXYGEN_NO_DISPATCH
namespace core_dispatch
{
@@ -40,26 +38,6 @@
};
-
-template <typename MultiPolygon>
-struct num_interior_rings<multi_polygon_tag, MultiPolygon>
-{
- static inline std::size_t apply(MultiPolygon const& multi_polygon)
- {
- std::size_t n = 0;
- for (typename boost::range_iterator<MultiPolygon const>::type
- it = boost::begin(multi_polygon);
- it != boost::end(multi_polygon);
- ++it)
- {
- n += geometry::num_interior_rings(*it);
- }
- return n;
- }
-
-};
-
-
} // namespace core_dispatch
#endif
Modified: trunk/boost/geometry/multi/core/is_multi.hpp
==============================================================================
--- trunk/boost/geometry/multi/core/is_multi.hpp (original)
+++ trunk/boost/geometry/multi/core/is_multi.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -1,48 +1 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// 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_MULTI_CORE_IS_MULTI_HPP
-#define BOOST_GEOMETRY_MULTI_CORE_IS_MULTI_HPP
-
-
-#include <boost/type_traits.hpp>
-
-
-#include <boost/geometry/core/is_multi.hpp>
-#include <boost/geometry/multi/core/tags.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace core_dispatch
-{
-
-template <>
-struct is_multi<multi_point_tag> : boost::true_type {};
-
-
-template <>
-struct is_multi<multi_linestring_tag> : boost::true_type {};
-
-
-template <>
-struct is_multi<multi_polygon_tag> : boost::true_type {};
-
-
-} // namespace core_dispatch
-#endif
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_MULTI_CORE_IS_MULTI_HPP
+// obsolete
Deleted: trunk/boost/geometry/multi/core/num_geometries.hpp
==============================================================================
--- trunk/boost/geometry/multi/core/num_geometries.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
+++ (empty file)
@@ -1,47 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 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_MULTI_CORE_NUM_GEOMETRIES_HPP
-#define BOOST_GEOMETRY_MULTI_CORE_NUM_GEOMETRIES_HPP
-
-
-#include <cstddef>
-
-#include <boost/range.hpp>
-
-
-#include <boost/geometry/core/num_geometries.hpp>
-#include <boost/geometry/multi/core/tags.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace core_dispatch
-{
-
-template <typename Tag, typename MultiGeometry>
-struct num_geometries<Tag, true, MultiGeometry>
-{
- static inline std::size_t apply(MultiGeometry const& multi_geometry)
- {
- return boost::size(multi_geometry);
- }
-};
-
-
-} // namespace core_dispatch
-#endif
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_MULTI_CORE_NUM_GEOMETRIES_HPP
Modified: trunk/boost/geometry/multi/core/tags.hpp
==============================================================================
--- trunk/boost/geometry/multi/core/tags.hpp (original)
+++ trunk/boost/geometry/multi/core/tags.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -16,44 +16,44 @@
{
/// OGC Multi point identifying tag
-struct multi_point_tag {};
+struct multi_point_tag : multi_tag {};
/// OGC Multi linestring identifying tag
-struct multi_linestring_tag {};
+struct multi_linestring_tag : multi_tag {};
/// OGC Multi polygon identifying tag
-struct multi_polygon_tag {};
+struct multi_polygon_tag : multi_tag{};
/// OGC Geometry Collection identifying tag
-struct geometry_collection_tag {};
+struct geometry_collection_tag : multi_tag {};
/*!
- \brief Meta-function to get for a tag of a multi-geometry
- the tag of the corresponding single-geometry
+\brief Meta-function to get for a tag of a multi-geometry
+ the tag of the corresponding single-geometry
*/
template <typename Tag>
-struct single_tag
+struct single_tag_of
{};
#ifndef DOXYGEN_NO_DETAIL
template <>
-struct single_tag<multi_point_tag>
+struct single_tag_of<multi_point_tag>
{
typedef point_tag type;
};
template <>
-struct single_tag<multi_linestring_tag>
+struct single_tag_of<multi_linestring_tag>
{
typedef linestring_tag type;
};
template <>
-struct single_tag<multi_polygon_tag>
+struct single_tag_of<multi_polygon_tag>
{
typedef polygon_tag type;
};
Modified: trunk/boost/geometry/multi/iterators/range_type.hpp
==============================================================================
--- trunk/boost/geometry/multi/iterators/range_type.hpp (original)
+++ trunk/boost/geometry/multi/iterators/range_type.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -11,8 +11,6 @@
#include <boost/range.hpp>
-#include <boost/geometry/multi/core/is_multi.hpp>
-
#include <boost/geometry/iterators/range_type.hpp>
Modified: trunk/boost/geometry/multi/multi.hpp
==============================================================================
--- trunk/boost/geometry/multi/multi.hpp (original)
+++ trunk/boost/geometry/multi/multi.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -14,9 +14,7 @@
#include <boost/geometry/multi/core/closure.hpp>
#include <boost/geometry/multi/core/geometry_id.hpp>
#include <boost/geometry/multi/core/is_areal.hpp>
-#include <boost/geometry/multi/core/is_multi.hpp>
#include <boost/geometry/multi/core/interior_rings.hpp>
-#include <boost/geometry/multi/core/num_geometries.hpp>
#include <boost/geometry/multi/core/point_order.hpp>
#include <boost/geometry/multi/core/point_type.hpp>
#include <boost/geometry/multi/core/ring_type.hpp>
@@ -36,6 +34,8 @@
#include <boost/geometry/multi/algorithms/for_each.hpp>
#include <boost/geometry/multi/algorithms/intersection.hpp>
#include <boost/geometry/multi/algorithms/length.hpp>
+#include <boost/geometry/multi/algorithms/num_geometries.hpp>
+#include <boost/geometry/multi/algorithms/num_interior_rings.hpp>
#include <boost/geometry/multi/algorithms/num_points.hpp>
#include <boost/geometry/multi/algorithms/perimeter.hpp>
#include <boost/geometry/multi/algorithms/reverse.hpp>
Modified: trunk/boost/geometry/multi/util/for_each_range.hpp
==============================================================================
--- trunk/boost/geometry/multi/util/for_each_range.hpp (original)
+++ trunk/boost/geometry/multi/util/for_each_range.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -52,21 +52,21 @@
{
-template <typename Geometry, typename Actor, bool IsConst>
-struct for_each_range<multi_linestring_tag, true, Geometry, Actor, IsConst>
- : detail::for_each::fe_range_multi<Geometry, Actor, IsConst>
+template <typename MultiPoint, typename Actor, bool IsConst>
+struct for_each_range<multi_point_tag, MultiPoint, Actor, IsConst>
+ : detail::for_each::fe_range_range<MultiPoint, Actor, IsConst>
{};
-
template <typename Geometry, typename Actor, bool IsConst>
-struct for_each_range<multi_polygon_tag, true, Geometry, Actor, IsConst>
- : detail::for_each::fe_range_multi<Geometry, Actor, IsConst>
+struct for_each_range<multi_linestring_tag, Geometry, Actor, IsConst>
+ :
+ detail::for_each::fe_range_multi<Geometry, Actor, IsConst>
{};
-
-template <typename MultiPoint, typename Actor, bool IsConst>
-struct for_each_range<multi_point_tag, true, MultiPoint, Actor, IsConst>
- : detail::for_each::fe_range_range<MultiPoint, Actor, IsConst>
+template <typename Geometry, typename Actor, bool IsConst>
+struct for_each_range<multi_polygon_tag, Geometry, Actor, IsConst>
+ :
+ detail::for_each::fe_range_multi<Geometry, Actor, IsConst>
{};
Modified: trunk/boost/geometry/multi/util/write_dsv.hpp
==============================================================================
--- trunk/boost/geometry/multi/util/write_dsv.hpp (original)
+++ trunk/boost/geometry/multi/util/write_dsv.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -57,8 +57,8 @@
{
-template <typename Tag, typename Geometry>
-struct dsv<Tag, true, Geometry>
+template <typename Geometry>
+struct dsv<multi_tag, Geometry>
: detail::dsv::dsv_multi<Geometry>
{};
Modified: trunk/boost/geometry/util/as_range.hpp
==============================================================================
--- trunk/boost/geometry/util/as_range.hpp (original)
+++ trunk/boost/geometry/util/as_range.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -13,7 +13,6 @@
#include <boost/type_traits.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
-#include <boost/geometry/core/is_multi.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
Modified: trunk/boost/geometry/util/for_each_range.hpp
==============================================================================
--- trunk/boost/geometry/util/for_each_range.hpp (original)
+++ trunk/boost/geometry/util/for_each_range.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -14,7 +14,7 @@
#include <boost/geometry/core/tag.hpp>
-#include <boost/geometry/core/is_multi.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/util/add_const_if_c.hpp>
@@ -67,7 +67,6 @@
template
<
typename Tag,
- bool IsMulti,
typename Geometry,
typename Actor,
bool IsConst
@@ -76,19 +75,19 @@
template <typename Linestring, typename Actor, bool IsConst>
-struct for_each_range<linestring_tag, false, Linestring, Actor, IsConst>
+struct for_each_range<linestring_tag, Linestring, Actor, IsConst>
: detail::for_each::fe_range_range<Linestring, Actor, IsConst>
{};
template <typename Ring, typename Actor, bool IsConst>
-struct for_each_range<ring_tag, false, Ring, Actor, IsConst>
+struct for_each_range<ring_tag, Ring, Actor, IsConst>
: detail::for_each::fe_range_range<Ring, Actor, IsConst>
{};
template <typename Polygon, typename Actor, bool IsConst>
-struct for_each_range<polygon_tag, false, Polygon, Actor, IsConst>
+struct for_each_range<polygon_tag, Polygon, Actor, IsConst>
: detail::for_each::fe_range_polygon<Polygon, Actor, IsConst>
{};
@@ -103,7 +102,6 @@
dispatch::for_each_range
<
typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
Geometry,
Actor,
true
Modified: trunk/boost/geometry/util/write_dsv.hpp
==============================================================================
--- trunk/boost/geometry/util/write_dsv.hpp (original)
+++ trunk/boost/geometry/util/write_dsv.hpp 2011-02-12 10:26:36 EST (Sat, 12 Feb 2011)
@@ -22,7 +22,7 @@
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/core/ring_type.hpp>
-#include <boost/geometry/core/is_multi.hpp>
+#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
@@ -269,41 +269,41 @@
namespace dispatch
{
-template <typename Tag, bool IsMulti, typename Geometry>
+template <typename Tag, typename Geometry>
struct dsv {};
template <typename Point>
-struct dsv<point_tag, false, Point>
+struct dsv<point_tag, Point>
: detail::dsv::dsv_point<Point>
{};
template <typename Linestring>
-struct dsv<linestring_tag, false, Linestring>
+struct dsv<linestring_tag, Linestring>
: detail::dsv::dsv_range<Linestring>
{};
template <typename Box>
-struct dsv<box_tag, false, Box>
+struct dsv<box_tag, Box>
: detail::dsv::dsv_indexed<Box>
{};
template <typename Segment>
-struct dsv<segment_tag, false, Segment>
+struct dsv<segment_tag, Segment>
: detail::dsv::dsv_indexed<Segment>
{};
template <typename Ring>
-struct dsv<ring_tag, false, Ring>
+struct dsv<ring_tag, Ring>
: detail::dsv::dsv_range<Ring>
{};
template <typename Polygon>
-struct dsv<polygon_tag, false, Polygon>
+struct dsv<polygon_tag, Polygon>
: detail::dsv::dsv_poly<Polygon>
{};
@@ -336,8 +336,11 @@
{
dispatch::dsv
<
- typename tag<Geometry>::type,
- is_multi<Geometry>::type::value,
+ typename tag_cast
+ <
+ typename tag<Geometry>::type,
+ multi_tag
+ >::type,
Geometry
>::apply(os, m.m_geometry, m.m_settings);
os.flush();
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