mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-10 11:32:15 +00:00
[multi][core] Move functionalities of multi/core into core
This commit is contained in:
@@ -14,10 +14,9 @@
|
||||
#ifndef BOOST_GEOMETRY_CORE_CLOSURE_HPP
|
||||
#define BOOST_GEOMETRY_CORE_CLOSURE_HPP
|
||||
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/size_t.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
@@ -139,7 +138,7 @@ struct closure<ring_tag, Ring>
|
||||
= geometry::traits::closure<Ring>::value;
|
||||
};
|
||||
|
||||
// Specialization for polygon: the closure is the closure of its rings
|
||||
// Specialization for Polygon: the closure is the closure of its rings
|
||||
template <typename Polygon>
|
||||
struct closure<polygon_tag, Polygon>
|
||||
{
|
||||
@@ -150,6 +149,24 @@ struct closure<polygon_tag, Polygon>
|
||||
>::value ;
|
||||
};
|
||||
|
||||
template <typename MultiPoint>
|
||||
struct closure<multi_point_tag, MultiPoint>
|
||||
: public core_detail::closure::closed {};
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct closure<multi_linestring_tag, MultiLinestring>
|
||||
: public core_detail::closure::closed {};
|
||||
|
||||
// Specialization for MultiPolygon: the closure is the closure of Polygon's rings
|
||||
template <typename MultiPolygon>
|
||||
struct closure<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
static const closure_selector value = core_dispatch::closure
|
||||
<
|
||||
polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::value ;
|
||||
};
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif // DOXYGEN_NO_DISPATCH
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
@@ -45,29 +43,40 @@ struct geometry_id
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<point_tag> : boost::mpl::int_<1> {};
|
||||
struct geometry_id<point_tag> : boost::mpl::int_<1> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<linestring_tag> : boost::mpl::int_<2> {};
|
||||
struct geometry_id<linestring_tag> : boost::mpl::int_<2> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<polygon_tag> : boost::mpl::int_<3> {};
|
||||
struct geometry_id<polygon_tag> : boost::mpl::int_<3> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<segment_tag> : boost::mpl::int_<92> {};
|
||||
struct geometry_id<multi_point_tag> : boost::mpl::int_<4> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<ring_tag> : boost::mpl::int_<93> {};
|
||||
struct geometry_id<multi_linestring_tag> : boost::mpl::int_<5> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<box_tag> : boost::mpl::int_<94> {};
|
||||
struct geometry_id<multi_polygon_tag> : boost::mpl::int_<6> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<segment_tag> : boost::mpl::int_<92> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<ring_tag> : boost::mpl::int_<93> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<box_tag> : boost::mpl::int_<94> {};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
@@ -85,6 +85,17 @@ struct interior_rings<polygon_tag, Polygon>
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct interior_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename core_dispatch::interior_type
|
||||
<
|
||||
polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
#define BOOST_GEOMETRY_CORE_IS_AREAL_HPP
|
||||
|
||||
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
@@ -36,7 +35,7 @@ template <typename GeometryTag> struct is_areal : boost::false_type {};
|
||||
template <> struct is_areal<ring_tag> : boost::true_type {};
|
||||
template <> struct is_areal<box_tag> : boost::true_type {};
|
||||
template <> struct is_areal<polygon_tag> : boost::true_type {};
|
||||
|
||||
template <> struct is_areal<multi_polygon_tag> : boost::true_type {};
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
@@ -135,6 +135,26 @@ struct point_order<polygon_tag, Polygon>
|
||||
>::value ;
|
||||
};
|
||||
|
||||
template <typename MultiPoint>
|
||||
struct point_order<multi_point_tag, MultiPoint>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct point_order<multi_linestring_tag, MultiLinestring>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
|
||||
// Specialization for multi_polygon: the order is the order of its polygons
|
||||
template <typename MultiPolygon>
|
||||
struct point_order<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
static const order_selector value = core_dispatch::point_order
|
||||
<
|
||||
polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::value ;
|
||||
};
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif // DOXYGEN_NO_DISPATCH
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
@@ -102,6 +102,38 @@ struct point_type<polygon_tag, Polygon>
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiPoint>
|
||||
struct point_type<multi_point_tag, MultiPoint>
|
||||
{
|
||||
typedef typename boost::range_value
|
||||
<
|
||||
MultiPoint
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct point_type<multi_linestring_tag, MultiLinestring>
|
||||
{
|
||||
typedef typename point_type
|
||||
<
|
||||
linestring_tag,
|
||||
typename boost::range_value<MultiLinestring>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct point_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename point_type
|
||||
<
|
||||
polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif // DOXYGEN_NO_DISPATCH
|
||||
|
||||
|
||||
@@ -18,8 +18,10 @@
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
@@ -102,6 +104,38 @@ struct ring_return_type<polygon_tag, Polygon>
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct ring_return_type<multi_linestring_tag, MultiLinestring>
|
||||
{
|
||||
typedef typename ring_return_type
|
||||
<
|
||||
linestring_tag,
|
||||
typename mpl::if_
|
||||
<
|
||||
boost::is_const<MultiLinestring>,
|
||||
typename boost::range_value<MultiLinestring>::type const,
|
||||
typename boost::range_value<MultiLinestring>::type
|
||||
>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct ring_return_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename ring_return_type
|
||||
<
|
||||
polygon_tag,
|
||||
typename mpl::if_
|
||||
<
|
||||
boost::is_const<MultiPolygon>,
|
||||
typename boost::range_value<MultiPolygon>::type const,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename GeometryTag, typename Geometry>
|
||||
struct ring_type
|
||||
{};
|
||||
@@ -124,8 +158,25 @@ struct ring_type<polygon_tag, Polygon>
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct ring_type<multi_linestring_tag, MultiLinestring>
|
||||
{
|
||||
typedef typename boost::remove_reference
|
||||
<
|
||||
typename ring_return_type<multi_linestring_tag, MultiLinestring>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct ring_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename boost::remove_reference
|
||||
<
|
||||
typename ring_return_type<multi_polygon_tag, MultiPolygon>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
@@ -88,6 +88,49 @@ struct box_tag : single_tag, areal_tag {};
|
||||
struct segment_tag : single_tag, linear_tag {};
|
||||
|
||||
|
||||
/// OGC Multi point identifying tag
|
||||
struct multi_point_tag : multi_tag, pointlike_tag {};
|
||||
|
||||
/// OGC Multi linestring identifying tag
|
||||
struct multi_linestring_tag : multi_tag, linear_tag {};
|
||||
|
||||
/// OGC Multi polygon identifying tag
|
||||
struct multi_polygon_tag : multi_tag, polygonal_tag {};
|
||||
|
||||
/// OGC Geometry Collection identifying 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
|
||||
*/
|
||||
template <typename Tag>
|
||||
struct single_tag_of
|
||||
{};
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
|
||||
template <>
|
||||
struct single_tag_of<multi_point_tag>
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct single_tag_of<multi_linestring_tag>
|
||||
{
|
||||
typedef linestring_tag type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct single_tag_of<multi_polygon_tag>
|
||||
{
|
||||
typedef polygon_tag type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
@@ -49,10 +49,12 @@ struct top_dim<segment_tag> : boost::mpl::int_<1> {};
|
||||
|
||||
|
||||
// ring: topological dimension of two, but some people say: 1 !!
|
||||
// NOTE: This is not OGC LinearRing!
|
||||
template <>
|
||||
struct top_dim<ring_tag> : boost::mpl::int_<2> {};
|
||||
|
||||
|
||||
// TODO: This is wrong! Boxes may have various topological dimensions
|
||||
template <>
|
||||
struct top_dim<box_tag> : boost::mpl::int_<2> {};
|
||||
|
||||
@@ -61,6 +63,17 @@ template <>
|
||||
struct top_dim<polygon_tag> : boost::mpl::int_<2> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct top_dim<multi_point_tag> : boost::mpl::int_<0> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct top_dim<multi_linestring_tag> : boost::mpl::int_<1> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct top_dim<multi_polygon_tag> : boost::mpl::int_<2> {};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
@@ -14,45 +14,6 @@
|
||||
#ifndef BOOST_GEOMETRY_MULTI_CORE_CLOSURE_HPP
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_CLOSURE_HPP
|
||||
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/closure.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
template <typename Multi>
|
||||
struct closure<multi_point_tag, Multi> : public core_detail::closure::closed {};
|
||||
|
||||
template <typename Multi>
|
||||
struct closure<multi_linestring_tag, Multi> : public core_detail::closure::closed {};
|
||||
|
||||
// Specialization for polygon: the closure is the closure of its rings
|
||||
template <typename MultiPolygon>
|
||||
struct closure<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
static const closure_selector value = core_dispatch::closure
|
||||
<
|
||||
polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::value ;
|
||||
};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif // DOXYGEN_NO_DISPATCH
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_CLOSURE_HPP
|
||||
|
||||
@@ -15,42 +15,6 @@
|
||||
#ifndef BOOST_GEOMETRY_MULTI_CORE_GEOMETRY_ID_HPP
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_GEOMETRY_ID_HPP
|
||||
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/core/geometry_id.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
template <>
|
||||
struct geometry_id<multi_point_tag> : boost::mpl::int_<4> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<multi_linestring_tag> : boost::mpl::int_<5> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct geometry_id<multi_polygon_tag> : boost::mpl::int_<6> {};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_GEOMETRY_ID_HPP
|
||||
|
||||
@@ -16,40 +16,7 @@
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_INTERIOR_RINGS_HPP
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct interior_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename core_dispatch::interior_type
|
||||
<
|
||||
polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_INTERIOR_RINGS_HPP
|
||||
|
||||
@@ -16,28 +16,7 @@
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_IS_AREAL_HPP
|
||||
|
||||
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/core/is_areal.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
template <> struct is_areal<multi_polygon_tag> : boost::true_type {};
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_IS_AREAL_HPP
|
||||
|
||||
@@ -15,43 +15,7 @@
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_POINT_ORDER_HPP
|
||||
|
||||
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
template <typename Multi>
|
||||
struct point_order<multi_point_tag, Multi>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
template <typename Multi>
|
||||
struct point_order<multi_linestring_tag, Multi>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
|
||||
// Specialization for multi_polygon: the order is the order of its polygons
|
||||
template <typename MultiPolygon>
|
||||
struct point_order<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
static const order_selector value = core_dispatch::point_order
|
||||
<
|
||||
polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::value ;
|
||||
};
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif // DOXYGEN_NO_DISPATCH
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_POINT_ORDER_HPP
|
||||
|
||||
@@ -16,49 +16,7 @@
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_POINT_TYPE_HPP
|
||||
|
||||
|
||||
#include <boost/range/metafunctions.hpp>
|
||||
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
template <typename MultiPoint>
|
||||
struct point_type<multi_point_tag, MultiPoint>
|
||||
{
|
||||
typedef typename boost::range_value<MultiPoint>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct point_type<multi_linestring_tag, MultiLinestring>
|
||||
{
|
||||
typedef typename point_type<linestring_tag,
|
||||
typename boost::range_value<MultiLinestring>::type>::type type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct point_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename point_type<polygon_tag,
|
||||
typename boost::range_value<MultiPolygon>::type>::type type;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_POINT_TYPE_HPP
|
||||
|
||||
@@ -19,75 +19,7 @@
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_RING_TYPE_HPP
|
||||
|
||||
|
||||
#include <boost/range/metafunctions.hpp>
|
||||
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct ring_return_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename ring_return_type
|
||||
<
|
||||
polygon_tag,
|
||||
typename mpl::if_
|
||||
<
|
||||
boost::is_const<MultiPolygon>,
|
||||
typename boost::range_value<MultiPolygon>::type const,
|
||||
typename boost::range_value<MultiPolygon>::type
|
||||
>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct ring_return_type<multi_linestring_tag, MultiLinestring>
|
||||
{
|
||||
typedef typename ring_return_type
|
||||
<
|
||||
linestring_tag,
|
||||
typename mpl::if_
|
||||
<
|
||||
boost::is_const<MultiLinestring>,
|
||||
typename boost::range_value<MultiLinestring>::type const,
|
||||
typename boost::range_value<MultiLinestring>::type
|
||||
>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename MultiPolygon>
|
||||
struct ring_type<multi_polygon_tag, MultiPolygon>
|
||||
{
|
||||
typedef typename boost::remove_reference
|
||||
<
|
||||
typename ring_return_type<multi_polygon_tag, MultiPolygon>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename MultiLinestring>
|
||||
struct ring_type<multi_linestring_tag, MultiLinestring>
|
||||
{
|
||||
typedef typename boost::remove_reference
|
||||
<
|
||||
typename ring_return_type<multi_linestring_tag, MultiLinestring>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_RING_TYPE_HPP
|
||||
|
||||
@@ -15,57 +15,8 @@
|
||||
#ifndef BOOST_GEOMETRY_MULTI_CORE_TAGS_HPP
|
||||
#define BOOST_GEOMETRY_MULTI_CORE_TAGS_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
/// OGC Multi point identifying tag
|
||||
struct multi_point_tag : multi_tag, pointlike_tag {};
|
||||
|
||||
/// OGC Multi linestring identifying tag
|
||||
struct multi_linestring_tag : multi_tag, linear_tag {};
|
||||
|
||||
/// OGC Multi polygon identifying tag
|
||||
struct multi_polygon_tag : multi_tag, polygonal_tag {};
|
||||
|
||||
/// OGC Geometry Collection identifying 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
|
||||
*/
|
||||
template <typename Tag>
|
||||
struct single_tag_of
|
||||
{};
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
|
||||
template <>
|
||||
struct single_tag_of<multi_point_tag>
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct single_tag_of<multi_linestring_tag>
|
||||
{
|
||||
typedef linestring_tag type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct single_tag_of<multi_polygon_tag>
|
||||
{
|
||||
typedef polygon_tag type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_MULTI_CORE_TAGS_HPP
|
||||
|
||||
@@ -16,37 +16,7 @@
|
||||
#define BOOST_GEOMETRY_MULTI_TOPOLOGICAL_DIMENSION_HPP
|
||||
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/core/topological_dimension.hpp>
|
||||
#include <boost/geometry/multi/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
|
||||
template <>
|
||||
struct top_dim<multi_point_tag> : boost::mpl::int_<0> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct top_dim<multi_linestring_tag> : boost::mpl::int_<1> {};
|
||||
|
||||
|
||||
template <>
|
||||
struct top_dim<multi_polygon_tag> : boost::mpl::int_<2> {};
|
||||
|
||||
|
||||
} // namespace core_dispatch
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user