mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-13 12:32:09 +00:00
Added Reverse to copy_segment_point.hpp,
and therefore, to enrich_intersection_points.hpp, handle_tangencies.hpp Protected point_order with MPL_ASSERT [SVN r67374]
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
#include <boost/geometry/iterators/range_type.hpp>
|
||||
#include <boost/geometry/views/closeable_view.hpp>
|
||||
#include <boost/geometry/views/reversible_view.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
@@ -29,9 +30,21 @@ namespace detail { namespace copy_segments
|
||||
{
|
||||
|
||||
|
||||
template <typename Range, typename SegmentIdentifier, typename PointOut>
|
||||
template <typename Range, bool Reverse, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point_range
|
||||
{
|
||||
typedef typename closeable_view
|
||||
<
|
||||
Range const,
|
||||
closure<Range>::value
|
||||
>::type cview_type;
|
||||
|
||||
typedef typename reversible_view
|
||||
<
|
||||
cview_type const,
|
||||
Reverse ? iterate_reverse : iterate_forward
|
||||
>::type rview_type;
|
||||
|
||||
static inline bool apply(Range const& range,
|
||||
SegmentIdentifier const& seg_id, bool second,
|
||||
PointOut& point)
|
||||
@@ -52,13 +65,17 @@ struct copy_segment_point_range
|
||||
return false;
|
||||
}
|
||||
|
||||
geometry::copy_coordinates(range[index], point);
|
||||
cview_type cview(range);
|
||||
rview_type view(cview);
|
||||
|
||||
|
||||
geometry::copy_coordinates(*(boost::begin(view) + index), point);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Polygon, typename SegmentIdentifier, typename PointOut>
|
||||
template <typename Polygon, bool Reverse, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point_polygon
|
||||
{
|
||||
static inline bool apply(Polygon const& polygon,
|
||||
@@ -69,6 +86,7 @@ struct copy_segment_point_polygon
|
||||
return copy_segment_point_range
|
||||
<
|
||||
typename geometry::ring_type<Polygon>::type,
|
||||
Reverse,
|
||||
SegmentIdentifier,
|
||||
PointOut
|
||||
>::apply
|
||||
@@ -126,6 +144,7 @@ template
|
||||
<
|
||||
typename Tag,
|
||||
typename GeometryIn,
|
||||
bool Reverse,
|
||||
typename SegmentIdentifier,
|
||||
typename PointOut
|
||||
>
|
||||
@@ -139,34 +158,34 @@ struct copy_segment_point
|
||||
};
|
||||
|
||||
|
||||
template <typename LineString, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<linestring_tag, LineString, SegmentIdentifier, PointOut>
|
||||
template <typename LineString, bool Reverse, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<linestring_tag, LineString, Reverse, SegmentIdentifier, PointOut>
|
||||
: detail::copy_segments::copy_segment_point_range
|
||||
<
|
||||
LineString, SegmentIdentifier, PointOut
|
||||
LineString, Reverse, SegmentIdentifier, PointOut
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
template <typename Ring, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<ring_tag, Ring, SegmentIdentifier, PointOut>
|
||||
template <typename Ring, bool Reverse, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<ring_tag, Ring, Reverse, SegmentIdentifier, PointOut>
|
||||
: detail::copy_segments::copy_segment_point_range
|
||||
<
|
||||
Ring, SegmentIdentifier, PointOut
|
||||
Ring, Reverse, SegmentIdentifier, PointOut
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename Polygon, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<polygon_tag, Polygon, SegmentIdentifier, PointOut>
|
||||
template <typename Polygon, bool Reverse, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<polygon_tag, Polygon, Reverse, SegmentIdentifier, PointOut>
|
||||
: detail::copy_segments::copy_segment_point_polygon
|
||||
<
|
||||
Polygon, SegmentIdentifier, PointOut
|
||||
Polygon, Reverse, SegmentIdentifier, PointOut
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
template <typename Box, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<box_tag, Box, SegmentIdentifier, PointOut>
|
||||
template <typename Box, bool Reverse, typename SegmentIdentifier, typename PointOut>
|
||||
struct copy_segment_point<box_tag, Box, Reverse, SegmentIdentifier, PointOut>
|
||||
: detail::copy_segments::copy_segment_point_box
|
||||
<
|
||||
Box, SegmentIdentifier, PointOut
|
||||
@@ -186,7 +205,7 @@ struct copy_segment_point<box_tag, Box, SegmentIdentifier, PointOut>
|
||||
\brief Helper function, copies a point from a segment
|
||||
\ingroup overlay
|
||||
*/
|
||||
template<typename Geometry, typename SegmentIdentifier, typename PointOut>
|
||||
template<bool Reverse, typename Geometry, typename SegmentIdentifier, typename PointOut>
|
||||
inline bool copy_segment_point(Geometry const& geometry,
|
||||
SegmentIdentifier const& seg_id, bool second,
|
||||
PointOut& point_out)
|
||||
@@ -197,6 +216,7 @@ inline bool copy_segment_point(Geometry const& geometry,
|
||||
<
|
||||
typename tag<Geometry>::type,
|
||||
Geometry,
|
||||
Reverse,
|
||||
SegmentIdentifier,
|
||||
PointOut
|
||||
>::apply(geometry, seg_id, second, point_out);
|
||||
@@ -210,8 +230,8 @@ inline bool copy_segment_point(Geometry const& geometry,
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename SegmentIdentifier,
|
||||
typename PointOut
|
||||
>
|
||||
@@ -228,6 +248,7 @@ inline bool copy_segment_point(Geometry1 const& geometry1, Geometry2 const& geom
|
||||
<
|
||||
typename tag<Geometry1>::type,
|
||||
Geometry1,
|
||||
Reverse1,
|
||||
SegmentIdentifier,
|
||||
PointOut
|
||||
>::apply(geometry1, seg_id, second, point_out);
|
||||
@@ -238,6 +259,7 @@ inline bool copy_segment_point(Geometry1 const& geometry1, Geometry2 const& geom
|
||||
<
|
||||
typename tag<Geometry2>::type,
|
||||
Geometry2,
|
||||
Reverse2,
|
||||
SegmentIdentifier,
|
||||
PointOut
|
||||
>::apply(geometry2, seg_id, second, point_out);
|
||||
@@ -254,8 +276,8 @@ inline bool copy_segment_point(Geometry1 const& geometry1, Geometry2 const& geom
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename SegmentIdentifier,
|
||||
typename PointOut
|
||||
>
|
||||
@@ -266,8 +288,8 @@ inline bool copy_segment_points(Geometry1 const& geometry1, Geometry2 const& geo
|
||||
concept::check<Geometry1 const>();
|
||||
concept::check<Geometry2 const>();
|
||||
|
||||
return copy_segment_point(geometry1, geometry2, seg_id, false, point1)
|
||||
&& copy_segment_point(geometry1, geometry2, seg_id, true, point2);
|
||||
return copy_segment_point<Reverse1, Reverse2>(geometry1, geometry2, seg_id, false, point1)
|
||||
&& copy_segment_point<Reverse1, Reverse2>(geometry1, geometry2, seg_id, true, point2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ template
|
||||
<
|
||||
typename TurnPoints,
|
||||
typename Indexed,
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename Geometry1, typename Geometry2,
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename Strategy
|
||||
>
|
||||
struct sort_on_segment_and_distance
|
||||
@@ -112,13 +112,13 @@ private :
|
||||
typedef typename geometry::point_type<Geometry1>::type point_type;
|
||||
point_type pi, pj, ri, rj, si, sj;
|
||||
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.seg_id,
|
||||
pi, pj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.other_id,
|
||||
ri, rj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
right.subject.other_id,
|
||||
si, sj);
|
||||
|
||||
@@ -196,10 +196,10 @@ inline void update_discarded(Turns& turn_points, Operations& operations)
|
||||
template
|
||||
<
|
||||
typename IndexType,
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename Container,
|
||||
typename TurnPoints,
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename Strategy
|
||||
>
|
||||
inline void enrich_sort(Container& operations,
|
||||
@@ -218,6 +218,7 @@ inline void enrich_sort(Container& operations,
|
||||
TurnPoints,
|
||||
IndexType,
|
||||
Geometry1, Geometry2,
|
||||
Reverse1, Reverse2,
|
||||
Strategy
|
||||
>(turn_points, geometry1, geometry2, strategy, clustered));
|
||||
|
||||
@@ -252,14 +253,14 @@ inline void enrich_sort(Container& operations,
|
||||
}
|
||||
else if (begin_cluster != boost::end(operations))
|
||||
{
|
||||
handle_cluster<IndexType>(begin_cluster, it, turn_points,
|
||||
handle_cluster<IndexType, Reverse1, Reverse2>(begin_cluster, it, turn_points,
|
||||
for_operation, geometry1, geometry2, strategy);
|
||||
begin_cluster = boost::end(operations);
|
||||
}
|
||||
}
|
||||
if (begin_cluster != boost::end(operations))
|
||||
{
|
||||
handle_cluster<IndexType>(begin_cluster, it, turn_points,
|
||||
handle_cluster<IndexType, Reverse1, Reverse2>(begin_cluster, it, turn_points,
|
||||
for_operation, geometry1, geometry2, strategy);
|
||||
}
|
||||
}
|
||||
@@ -429,9 +430,9 @@ inline void create_map(TurnPoints const& turn_points, MappedVector& mapped_vecto
|
||||
*/
|
||||
template
|
||||
<
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename TurnPoints,
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename Strategy
|
||||
>
|
||||
inline void enrich_intersection_points(TurnPoints& turn_points,
|
||||
@@ -486,7 +487,7 @@ inline void enrich_intersection_points(TurnPoints& turn_points,
|
||||
std::cout << "ENRICH-sort Ring "
|
||||
<< mit->first << std::endl;
|
||||
#endif
|
||||
detail::overlay::enrich_sort<indexed_turn_operation>(mit->second, turn_points, for_operation,
|
||||
detail::overlay::enrich_sort<indexed_turn_operation, Reverse1, Reverse2>(mit->second, turn_points, for_operation,
|
||||
geometry1, geometry2, strategy);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ template
|
||||
<
|
||||
typename TurnPoints,
|
||||
typename Indexed,
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename Geometry1, typename Geometry2,
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename Strategy
|
||||
>
|
||||
struct sort_in_cluster
|
||||
@@ -101,13 +101,13 @@ private :
|
||||
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
point_type pi, pj, ri, rj, si, sj;
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.seg_id,
|
||||
pi, pj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.other_id,
|
||||
ri, rj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
right.subject.other_id,
|
||||
si, sj);
|
||||
|
||||
@@ -121,8 +121,8 @@ private :
|
||||
int const side_si_r = m_strategy.apply(ri, rj, si);
|
||||
int const side_sj_r = m_strategy.apply(ri, rj, sj);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
std::cout << "Case: " << header << " for " << left.index << " / " << right.index << std::endl;
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH_MORE
|
||||
std::cout << " Segment p:" << geometry::wkt(pi) << " .. " << geometry::wkt(pj) << std::endl;
|
||||
std::cout << " Segment r:" << geometry::wkt(ri) << " .. " << geometry::wkt(rj) << std::endl;
|
||||
std::cout << " Segment s:" << geometry::wkt(si) << " .. " << geometry::wkt(sj) << std::endl;
|
||||
@@ -174,9 +174,9 @@ private :
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
//#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
std::cout << "ux/ux unhandled" << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
//debug_consider(0, left, right, header, false, "-> return ", ret);
|
||||
@@ -217,9 +217,9 @@ private :
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
//#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
std::cout << " iu/ux unhandled" << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
ret = order == 1;
|
||||
}
|
||||
|
||||
@@ -263,13 +263,13 @@ private :
|
||||
}
|
||||
|
||||
point_type pi, pj, ri, rj, si, sj;
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.seg_id,
|
||||
pi, pj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.other_id,
|
||||
ri, rj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
right.subject.other_id,
|
||||
si, sj);
|
||||
|
||||
@@ -301,9 +301,9 @@ private :
|
||||
debug_consider(0, left, right, header, false, "opp.", ret);
|
||||
return ret;
|
||||
}
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
//#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
|
||||
std::cout << " iu/iu coming from opposite unhandled" << std::endl;
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
// We need EXTRA information here: are p/r/s overlapping?
|
||||
@@ -369,13 +369,13 @@ private :
|
||||
debug_consider(0, left, right, header);
|
||||
|
||||
point_type pi, pj, ri, rj, si, sj;
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.seg_id,
|
||||
pi, pj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
left.subject.other_id,
|
||||
ri, rj);
|
||||
geometry::copy_segment_points(m_geometry1, m_geometry2,
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
right.subject.other_id,
|
||||
si, sj);
|
||||
|
||||
@@ -482,7 +482,8 @@ public :
|
||||
<< operation_char(m_turn_points[left.index].operations[1].operation)
|
||||
<< "/" << operation_char(m_turn_points[right.index].operations[0].operation)
|
||||
<< operation_char(m_turn_points[right.index].operations[1].operation)
|
||||
<< " " << " Take " << left.index << " < " << right.index;
|
||||
<< " " << " Take " << left.index << " < " << right.index
|
||||
<< std::cout;
|
||||
#endif
|
||||
|
||||
return default_order;
|
||||
@@ -586,6 +587,7 @@ inline void inspect_cluster(Iterator begin_cluster, Iterator end_cluster,
|
||||
template
|
||||
<
|
||||
typename IndexType,
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename Iterator,
|
||||
typename TurnPoints,
|
||||
typename Geometry1,
|
||||
@@ -610,6 +612,7 @@ inline void handle_cluster(Iterator begin_cluster, Iterator end_cluster,
|
||||
TurnPoints,
|
||||
IndexType,
|
||||
Geometry1, Geometry2,
|
||||
Reverse1, Reverse2,
|
||||
Strategy
|
||||
>(turn_points, geometry1, geometry2, strategy));
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ std::cout << "get turns" << std::endl;
|
||||
std::cout << "enrich" << std::endl;
|
||||
#endif
|
||||
typename Strategy::side_strategy_type side_strategy;
|
||||
geometry::enrich_intersection_points(turn_points,
|
||||
geometry::enrich_intersection_points<Reverse1, Reverse2>(turn_points,
|
||||
Direction == -1
|
||||
? boost::geometry::detail::overlay::operation_intersection
|
||||
: boost::geometry::detail::overlay::operation_union,
|
||||
|
||||
@@ -76,7 +76,7 @@ struct dissolve_ring_or_polygon
|
||||
typename cs_tag<Geometry>::type
|
||||
>::type side_strategy_type;
|
||||
|
||||
enrich_intersection_points(turns,
|
||||
enrich_intersection_points<false, false>(turns,
|
||||
detail::overlay::operation_union,
|
||||
geometry, geometry,
|
||||
side_strategy_type());
|
||||
@@ -89,7 +89,7 @@ struct dissolve_ring_or_polygon
|
||||
|
||||
clear_visit_info(turns);
|
||||
|
||||
enrich_intersection_points(turns,
|
||||
enrich_intersection_points<false, false>(turns,
|
||||
detail::overlay::operation_intersection,
|
||||
geometry, geometry,
|
||||
side_strategy_type());
|
||||
|
||||
@@ -352,8 +352,8 @@ inline OutputIterator inserter(Geometry1 const& geometry1,
|
||||
geometry::is_areal<Geometry2>::value,
|
||||
geometry::is_areal<GeometryOut>::value,
|
||||
Geometry1, Geometry2,
|
||||
overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry2>::value, Reverse2>::value,
|
||||
ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
@@ -370,8 +370,8 @@ inline OutputIterator inserter(Geometry1 const& geometry1,
|
||||
geometry::is_areal<Geometry2>::value,
|
||||
geometry::is_areal<GeometryOut>::value,
|
||||
Geometry1, Geometry2,
|
||||
overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry2>::value, Reverse2>::value,
|
||||
ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
|
||||
@@ -134,8 +134,8 @@ inline OutputIterator inserter(Geometry1 const& geometry1,
|
||||
geometry::is_areal<Geometry2>::value,
|
||||
geometry::is_areal<GeometryOut>::value,
|
||||
Geometry1, Geometry2,
|
||||
overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry2>::value, Reverse2>::value,
|
||||
ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
@@ -149,8 +149,8 @@ inline OutputIterator inserter(Geometry1 const& geometry1,
|
||||
geometry::is_areal<Geometry2>::value,
|
||||
geometry::is_areal<GeometryOut>::value,
|
||||
Geometry1, Geometry2,
|
||||
overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry1>::value, Reverse1>::value,
|
||||
overlay::do_reverse<geometry::point_order<Geometry2>::value, Reverse2>::value,
|
||||
ReverseOut,
|
||||
OutputIterator, GeometryOut,
|
||||
Strategy
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#define BOOST_GEOMETRY_CORE_POINT_ORDER_HPP
|
||||
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
@@ -43,6 +44,21 @@ struct point_order
|
||||
} // namespace traits
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace point_order
|
||||
{
|
||||
|
||||
struct clockwise
|
||||
{
|
||||
static const order_selector value = geometry::clockwise;
|
||||
};
|
||||
|
||||
|
||||
}} // namespace detail::point_order
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace core_dispatch
|
||||
{
|
||||
@@ -50,9 +66,29 @@ namespace core_dispatch
|
||||
template <typename Tag, typename Geometry>
|
||||
struct point_order
|
||||
{
|
||||
static const order_selector value = clockwise;
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
(
|
||||
false, NOT_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
|
||||
, (types<Geometry>)
|
||||
);
|
||||
};
|
||||
|
||||
template <typename Point>
|
||||
struct point_order<point_tag, Point>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
template <typename Segment>
|
||||
struct point_order<segment_tag, Segment>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
|
||||
template <typename Box>
|
||||
struct point_order<box_tag, Box>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
template <typename LineString>
|
||||
struct point_order<linestring_tag, LineString>
|
||||
: public detail::point_order::clockwise {};
|
||||
|
||||
|
||||
template <typename Ring>
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace dispatch
|
||||
template
|
||||
<
|
||||
typename MultiGeometry,
|
||||
bool Reverse,
|
||||
typename SegmentIdentifier,
|
||||
typename PointOut
|
||||
>
|
||||
@@ -69,6 +70,7 @@ struct copy_segment_point
|
||||
<
|
||||
multi_polygon_tag,
|
||||
MultiGeometry,
|
||||
Reverse,
|
||||
SegmentIdentifier,
|
||||
PointOut
|
||||
>
|
||||
@@ -80,6 +82,7 @@ struct copy_segment_point
|
||||
detail::copy_segments::copy_segment_point_polygon
|
||||
<
|
||||
typename boost::range_value<MultiGeometry>::type,
|
||||
Reverse,
|
||||
SegmentIdentifier,
|
||||
PointOut
|
||||
>
|
||||
|
||||
@@ -23,6 +23,15 @@ namespace boost { namespace geometry
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user