mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-09 23:24:02 +00:00
Remove deprecated rescaling code
This commit is contained in:
parent
69588ff2bf
commit
38051ad095
@ -64,13 +64,12 @@ int main(void)
|
||||
#endif
|
||||
|
||||
// Calculate intersection points (turn points)
|
||||
using segment_ratio = bg::detail::segment_ratio_type<point_2d, bg::detail::no_rescale_policy>::type;
|
||||
using segment_ratio = bg::detail::segment_ratio_type<point_2d>::type;
|
||||
using turn_info = bg::detail::overlay::turn_info<point_2d, segment_ratio>;
|
||||
std::vector<turn_info> turns;
|
||||
bg::detail::get_turns::no_interrupt_policy policy;
|
||||
bg::detail::no_rescale_policy rescale_policy;
|
||||
bg::strategies::relate::services::default_strategy<bg::model::linestring<point_2d>, bg::model::polygon<point_2d>>::type strategy;
|
||||
bg::get_turns<false, false, bg::detail::overlay::assign_null_policy>(ls, p, strategy, rescale_policy, turns, policy);
|
||||
bg::get_turns<false, false, bg::detail::overlay::assign_null_policy>(ls, p, strategy, turns, policy);
|
||||
|
||||
std::cout << "Intersection of linestring/polygon" << std::endl;
|
||||
for (turn_info const& turn : turns)
|
||||
|
@ -102,11 +102,10 @@ int main()
|
||||
|
||||
// This works because outputs to a normal struct point, no point*
|
||||
typedef boost::geometry::model::linestring<point_2d> linestring_2d;
|
||||
boost::geometry::detail::no_rescale_policy rescale_policy;
|
||||
std::vector<linestring_2d> clipped;
|
||||
boost::geometry::strategy::intersection::liang_barsky<box_2d, point_2d> strategy;
|
||||
boost::geometry::detail::intersection::clip_range_with_box<linestring_2d>(cb,
|
||||
myline, rescale_policy, std::back_inserter(clipped), strategy);
|
||||
myline, std::back_inserter(clipped), strategy);
|
||||
|
||||
|
||||
std::cout << boost::geometry::length(clipped.front()) << std::endl;
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2012-2020 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2022-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2022.
|
||||
// Modifications copyright (c) 2017-2022 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -95,7 +96,6 @@ struct buffer_range
|
||||
typename SegmentStrategy,
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline
|
||||
@ -112,7 +112,6 @@ struct buffer_range
|
||||
SegmentStrategy const& segment_strategy,
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
RobustPolicy const& ,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
geometry::strategy::buffer::join_selector const join
|
||||
@ -204,7 +203,6 @@ struct buffer_range
|
||||
typename SegmentStrategy,
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline geometry::strategy::buffer::result_code iterate(Collection& collection,
|
||||
@ -214,7 +212,6 @@ struct buffer_range
|
||||
SegmentStrategy const& segment_strategy,
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies,
|
||||
bool linear,
|
||||
output_point_type& first_p1,
|
||||
@ -291,7 +288,7 @@ struct buffer_range
|
||||
*it, generated_side.front(), generated_side.back(),
|
||||
side,
|
||||
distance_strategy, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
}
|
||||
|
||||
collection.add_side_piece(*prev, *it, generated_side, first, distance_strategy.empty(side));
|
||||
@ -340,7 +337,6 @@ struct buffer_multi
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline void apply(Multi const& multi,
|
||||
@ -350,7 +346,6 @@ struct buffer_multi
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
for (auto it = boost::begin(multi); it != boost::end(multi); ++it)
|
||||
@ -358,7 +353,7 @@ struct buffer_multi
|
||||
Policy::apply(*it, collection,
|
||||
distance_strategy, segment_strategy,
|
||||
join_strategy, end_strategy, point_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -425,7 +420,6 @@ struct buffer_inserter<point_tag, Point, RingOutput>
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline void apply(Point const& point, Collection& collection,
|
||||
@ -434,7 +428,6 @@ struct buffer_inserter<point_tag, Point, RingOutput>
|
||||
JoinStrategy const& ,
|
||||
EndStrategy const& ,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& ,
|
||||
Strategies const& )
|
||||
{
|
||||
detail::buffer::buffer_point
|
||||
@ -463,7 +456,6 @@ struct buffer_inserter_ring
|
||||
typename SegmentStrategy,
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline geometry::strategy::buffer::result_code iterate(Collection& collection,
|
||||
@ -473,7 +465,6 @@ struct buffer_inserter_ring
|
||||
SegmentStrategy const& segment_strategy,
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
output_point_type first_p1, first_p2, last_p1, last_p2;
|
||||
@ -484,7 +475,7 @@ struct buffer_inserter_ring
|
||||
= buffer_range::iterate(collection, begin, end,
|
||||
side,
|
||||
distance_strategy, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies,
|
||||
strategies,
|
||||
false, first_p1, first_p2, last_p1, last_p2);
|
||||
|
||||
// Generate closing join
|
||||
@ -496,7 +487,7 @@ struct buffer_inserter_ring
|
||||
*(begin + 1), first_p1, first_p2,
|
||||
side,
|
||||
distance_strategy, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
}
|
||||
|
||||
// Buffer is closed automatically by last closing corner
|
||||
@ -511,7 +502,6 @@ struct buffer_inserter_ring
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline geometry::strategy::buffer::result_code apply(RingInput const& ring,
|
||||
@ -521,7 +511,6 @@ struct buffer_inserter_ring
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
// Use helper geometry to support non-mutable input Rings
|
||||
@ -551,14 +540,14 @@ struct buffer_inserter_ring
|
||||
code = iterate(collection, boost::rbegin(view), boost::rend(view),
|
||||
geometry::strategy::buffer::buffer_side_right,
|
||||
distance, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
}
|
||||
else
|
||||
{
|
||||
code = iterate(collection, boost::begin(view), boost::end(view),
|
||||
geometry::strategy::buffer::buffer_side_left,
|
||||
distance, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
}
|
||||
}
|
||||
|
||||
@ -591,7 +580,6 @@ struct buffer_inserter<ring_tag, RingInput, RingOutput>
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline geometry::strategy::buffer::result_code apply(RingInput const& ring,
|
||||
@ -601,7 +589,6 @@ struct buffer_inserter<ring_tag, RingInput, RingOutput>
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
collection.start_new_ring(distance.negative());
|
||||
@ -609,7 +596,7 @@ struct buffer_inserter<ring_tag, RingInput, RingOutput>
|
||||
= buffer_inserter_ring<RingInput, RingOutput>::apply(ring,
|
||||
collection, distance,
|
||||
segment_strategy, join_strategy, end_strategy, point_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
collection.finish_ring(code, ring, false, false);
|
||||
return code;
|
||||
}
|
||||
@ -633,7 +620,6 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||
typename SegmentStrategy,
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline geometry::strategy::buffer::result_code iterate(Collection& collection,
|
||||
@ -643,7 +629,6 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||
SegmentStrategy const& segment_strategy,
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies,
|
||||
output_point_type& first_p1)
|
||||
{
|
||||
@ -680,7 +665,7 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||
= detail::buffer::buffer_range<output_ring_type>::iterate(collection,
|
||||
begin, end, side,
|
||||
distance_strategy, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies,
|
||||
strategies,
|
||||
true, first_p1, first_p2, last_p1, last_p2);
|
||||
|
||||
if (result == geometry::strategy::buffer::result_normal)
|
||||
@ -701,7 +686,6 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline geometry::strategy::buffer::result_code apply(Linestring const& linestring,
|
||||
@ -711,7 +695,6 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
// Use helper geometry to support non-mutable input Linestrings
|
||||
@ -728,7 +711,7 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||
boost::begin(simplified), boost::end(simplified),
|
||||
geometry::strategy::buffer::buffer_side_left,
|
||||
distance, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies,
|
||||
strategies,
|
||||
first_p1);
|
||||
|
||||
if (code == geometry::strategy::buffer::result_normal)
|
||||
@ -737,7 +720,7 @@ struct buffer_inserter<linestring_tag, Linestring, Polygon>
|
||||
boost::rbegin(simplified), boost::rend(simplified),
|
||||
geometry::strategy::buffer::buffer_side_right,
|
||||
distance, segment_strategy, join_strategy, end_strategy,
|
||||
robust_policy, strategies,
|
||||
strategies,
|
||||
first_p1);
|
||||
}
|
||||
collection.finish_ring(code);
|
||||
@ -779,7 +762,6 @@ private:
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline
|
||||
@ -790,7 +772,6 @@ private:
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies,
|
||||
bool is_interior)
|
||||
{
|
||||
@ -806,7 +787,7 @@ private:
|
||||
geometry::strategy::buffer::result_code const code
|
||||
= policy::apply(*it, collection, distance, segment_strategy,
|
||||
join_strategy, end_strategy, point_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
|
||||
collection.finish_ring(code, *it, is_interior, false);
|
||||
}
|
||||
@ -821,7 +802,6 @@ private:
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline
|
||||
@ -832,13 +812,12 @@ private:
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
iterate(boost::begin(interior_rings), boost::end(interior_rings),
|
||||
collection, distance, segment_strategy,
|
||||
join_strategy, end_strategy, point_strategy,
|
||||
robust_policy, strategies, true);
|
||||
strategies, true);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -850,7 +829,6 @@ public:
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Strategies
|
||||
>
|
||||
static inline void apply(PolygonInput const& polygon,
|
||||
@ -860,7 +838,6 @@ public:
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategies const& strategies)
|
||||
{
|
||||
{
|
||||
@ -870,7 +847,7 @@ public:
|
||||
= policy::apply(exterior_ring(polygon), collection,
|
||||
distance, segment_strategy,
|
||||
join_strategy, end_strategy, point_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
|
||||
collection.finish_ring(code, exterior_ring(polygon), false,
|
||||
geometry::num_interior_rings(polygon) > 0u);
|
||||
@ -879,7 +856,7 @@ public:
|
||||
apply_interior_rings(interior_rings(polygon),
|
||||
collection, distance, segment_strategy,
|
||||
join_strategy, end_strategy, point_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
}
|
||||
};
|
||||
|
||||
@ -925,7 +902,6 @@ template
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename Strategies,
|
||||
typename RobustPolicy,
|
||||
typename VisitPiecesPolicy
|
||||
>
|
||||
inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator out,
|
||||
@ -935,7 +911,6 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
Strategies const& strategies,
|
||||
RobustPolicy const& robust_policy,
|
||||
VisitPiecesPolicy& visit_pieces_policy
|
||||
)
|
||||
{
|
||||
@ -945,10 +920,9 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
|
||||
<
|
||||
typename geometry::ring_type<GeometryOutput>::type,
|
||||
Strategies,
|
||||
DistanceStrategy,
|
||||
RobustPolicy
|
||||
DistanceStrategy
|
||||
>;
|
||||
collection_type collection(strategies, distance_strategy, robust_policy);
|
||||
collection_type collection(strategies, distance_strategy);
|
||||
collection_type const& const_collection = collection;
|
||||
|
||||
static constexpr bool areal = util::is_areal<GeometryInput>::value;
|
||||
@ -965,7 +939,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
|
||||
>::apply(geometry_input, collection,
|
||||
distance_strategy, segment_strategy, join_strategy,
|
||||
end_strategy, point_strategy,
|
||||
robust_policy, strategies);
|
||||
strategies);
|
||||
|
||||
collection.get_turns();
|
||||
if BOOST_GEOMETRY_CONSTEXPR (areal)
|
||||
@ -1035,8 +1009,7 @@ template
|
||||
typename JoinStrategy,
|
||||
typename EndStrategy,
|
||||
typename PointStrategy,
|
||||
typename Strategies,
|
||||
typename RobustPolicy
|
||||
typename Strategies
|
||||
>
|
||||
inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator out,
|
||||
DistanceStrategy const& distance_strategy,
|
||||
@ -1044,14 +1017,13 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
|
||||
JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy,
|
||||
PointStrategy const& point_strategy,
|
||||
Strategies const& strategies,
|
||||
RobustPolicy const& robust_policy)
|
||||
Strategies const& strategies)
|
||||
{
|
||||
detail::buffer::visit_pieces_default_policy visitor;
|
||||
buffer_inserter<GeometryOutput>(geometry_input, out,
|
||||
distance_strategy, segment_strategy, join_strategy,
|
||||
end_strategy, point_strategy,
|
||||
strategies, robust_policy, visitor);
|
||||
strategies, visitor);
|
||||
}
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -47,7 +48,6 @@ public :
|
||||
typename Turns,
|
||||
typename Geometry,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename Visitor
|
||||
>
|
||||
static inline void apply(std::size_t size_at_start,
|
||||
@ -59,7 +59,6 @@ public :
|
||||
Geometry const& ,
|
||||
Geometry const& ,
|
||||
Strategy const& ,
|
||||
RobustPolicy const& ,
|
||||
state_type& state,
|
||||
Visitor& /*visitor*/
|
||||
)
|
||||
@ -131,11 +130,11 @@ struct buffer_turn_operation
|
||||
: public detail::overlay::traversal_turn_operation<Point, SegmentRatio>
|
||||
{
|
||||
signed_size_type piece_index;
|
||||
signed_size_type index_in_robust_ring;
|
||||
signed_size_type index_in_ring;
|
||||
|
||||
inline buffer_turn_operation()
|
||||
: piece_index(-1)
|
||||
, index_in_robust_ring(-1)
|
||||
, index_in_ring(-1)
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2016-2022.
|
||||
// Modifications copyright (c) 2016-2022 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2016-2024.
|
||||
// Modifications copyright (c) 2016-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -100,7 +101,7 @@ namespace detail { namespace buffer
|
||||
* form together the offsetted ring (marked with o below)
|
||||
* The 8 pieces are part of the piece collection and use for inside-checks
|
||||
* The inner parts form (using 1 or 2 points per piece, often co-located)
|
||||
* form together the robust_polygons (marked with r below)
|
||||
* form together the polygons (marked with r below)
|
||||
* The remaining piece-segments are helper-segments (marked with h)
|
||||
*
|
||||
* ooooooooooooooooo
|
||||
@ -119,8 +120,7 @@ template
|
||||
<
|
||||
typename Ring,
|
||||
typename Strategy,
|
||||
typename DistanceStrategy,
|
||||
typename RobustPolicy
|
||||
typename DistanceStrategy
|
||||
>
|
||||
struct buffered_piece_collection
|
||||
{
|
||||
@ -135,13 +135,13 @@ struct buffered_piece_collection
|
||||
typedef buffer_turn_info
|
||||
<
|
||||
point_type,
|
||||
typename segment_ratio_type<point_type, RobustPolicy>::type
|
||||
typename segment_ratio_type<point_type>::type
|
||||
> buffer_turn_info_type;
|
||||
|
||||
typedef buffer_turn_operation
|
||||
<
|
||||
point_type,
|
||||
typename segment_ratio_type<point_type, RobustPolicy>::type
|
||||
typename segment_ratio_type<point_type>::type
|
||||
> buffer_turn_operation_type;
|
||||
|
||||
typedef std::vector<buffer_turn_info_type> turn_vector_type;
|
||||
@ -158,7 +158,7 @@ struct buffered_piece_collection
|
||||
|
||||
// The next two members (1, 2) form together a complete clockwise ring
|
||||
// for each piece (with one dupped point)
|
||||
// The complete clockwise ring is also included as a robust ring (3)
|
||||
// The complete clockwise ring is also included as a ring (3)
|
||||
|
||||
// 1: half, part of offsetted_rings
|
||||
|
||||
@ -228,7 +228,7 @@ struct buffered_piece_collection
|
||||
geometry::sectionalize
|
||||
<
|
||||
false, dimensions
|
||||
>(m_ring, detail::no_rescale_policy(), m_sections, strategy);
|
||||
>(m_ring, m_sections, strategy);
|
||||
}
|
||||
|
||||
clockwise_ring_type m_ring;
|
||||
@ -258,14 +258,8 @@ struct buffered_piece_collection
|
||||
segment_identifier current_segment_id;
|
||||
|
||||
// Monotonic sections (used for offsetted rings around points)
|
||||
// are still using a robust type, to be comparable with turn calculations,
|
||||
// which is using rescaling.
|
||||
typedef geometry::model::box
|
||||
<
|
||||
typename geometry::robust_point_type<point_type, RobustPolicy>::type
|
||||
> robust_box_type;
|
||||
typedef geometry::sections <robust_box_type, 2> robust_sections_type;
|
||||
robust_sections_type monotonic_sections;
|
||||
typedef geometry::sections<box_type, 2> sections_type;
|
||||
sections_type monotonic_sections;
|
||||
|
||||
// Define the clusters, mapping cluster_id -> turns
|
||||
typedef std::map
|
||||
@ -278,17 +272,14 @@ struct buffered_piece_collection
|
||||
|
||||
Strategy m_strategy;
|
||||
DistanceStrategy m_distance_strategy;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
|
||||
buffered_piece_collection(Strategy const& strategy,
|
||||
DistanceStrategy const& distance_strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
DistanceStrategy const& distance_strategy)
|
||||
: m_first_piece_index(-1)
|
||||
, m_deflate(false)
|
||||
, m_has_deflated(false)
|
||||
, m_strategy(strategy)
|
||||
, m_distance_strategy(distance_strategy)
|
||||
, m_robust_policy(robust_policy)
|
||||
{}
|
||||
|
||||
inline void check_linear_endpoints(buffer_turn_info_type& turn) const
|
||||
@ -434,16 +425,15 @@ struct buffered_piece_collection
|
||||
piece_vector_type,
|
||||
buffered_ring_collection<buffered_ring<Ring> >,
|
||||
turn_vector_type,
|
||||
Strategy,
|
||||
RobustPolicy
|
||||
Strategy
|
||||
> visitor(m_pieces, offsetted_rings, m_turns,
|
||||
m_strategy, m_robust_policy);
|
||||
m_strategy);
|
||||
|
||||
detail::sectionalize::enlarge_sections(monotonic_sections, m_strategy);
|
||||
|
||||
geometry::partition
|
||||
<
|
||||
robust_box_type
|
||||
box_type
|
||||
>::apply(monotonic_sections, visitor,
|
||||
detail::section::get_section_box<Strategy>(m_strategy),
|
||||
detail::section::overlaps_section_box<Strategy>(m_strategy));
|
||||
@ -593,8 +583,7 @@ struct buffered_piece_collection
|
||||
if (! boost::empty(input_ring))
|
||||
{
|
||||
// Assign the ring to the original_ring collection
|
||||
// For rescaling, it is recalculated. Without rescaling, it
|
||||
// is just assigning (note that this Ring type is the
|
||||
// (note that this Ring type is the
|
||||
// GeometryOut type, which might differ from the input ring type)
|
||||
clockwise_ring_type clockwise_ring;
|
||||
|
||||
@ -706,7 +695,6 @@ struct buffered_piece_collection
|
||||
sectionalizer::apply(monotonic_sections,
|
||||
boost::begin(ring) + pc.first_seg_id.segment_index,
|
||||
boost::begin(ring) + pc.beyond_last_segment_index,
|
||||
m_robust_policy,
|
||||
m_strategy,
|
||||
ring_id, 10);
|
||||
}
|
||||
@ -885,7 +873,7 @@ struct buffered_piece_collection
|
||||
<
|
||||
false, false, overlay_buffer,
|
||||
ring_collection_t, ring_collection_t
|
||||
>(m_turns, m_clusters, m_robust_policy))
|
||||
>(m_turns, m_clusters))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -938,7 +926,6 @@ struct buffered_piece_collection
|
||||
{
|
||||
enrich_intersection_points<false, false, overlay_buffer>(m_turns,
|
||||
m_clusters, offsetted_rings, offsetted_rings,
|
||||
m_robust_policy,
|
||||
m_strategy);
|
||||
}
|
||||
|
||||
@ -965,8 +952,8 @@ struct buffered_piece_collection
|
||||
{
|
||||
signed_size_type count_in_original = 0;
|
||||
|
||||
// Check of the robust point of this outputted ring is in
|
||||
// any of the robust original rings
|
||||
// Check of the point of this outputted ring is in
|
||||
// any of the original rings
|
||||
// This can go quadratic if the input has many rings, and there
|
||||
// are many untouched deflated rings around
|
||||
for (auto const& original : original_rings)
|
||||
@ -1054,7 +1041,7 @@ struct buffered_piece_collection
|
||||
traversed_rings.clear();
|
||||
buffer_overlay_visitor visitor;
|
||||
traverser::apply(offsetted_rings, offsetted_rings,
|
||||
m_strategy, m_robust_policy,
|
||||
m_strategy,
|
||||
m_turns, traversed_rings,
|
||||
turn_info_per_ring,
|
||||
m_clusters, visitor);
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -117,8 +118,7 @@ template
|
||||
typename Pieces,
|
||||
typename Rings,
|
||||
typename Turns,
|
||||
typename Strategy,
|
||||
typename RobustPolicy
|
||||
typename Strategy
|
||||
>
|
||||
class piece_turn_visitor
|
||||
{
|
||||
@ -126,7 +126,6 @@ class piece_turn_visitor
|
||||
Rings const& m_rings;
|
||||
Turns& m_turns;
|
||||
Strategy const& m_strategy;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
|
||||
template <typename Piece>
|
||||
inline bool is_adjacent(Piece const& piece1, Piece const& piece2) const
|
||||
@ -161,8 +160,7 @@ class piece_turn_visitor
|
||||
&& it_begin + 1 != it_beyond
|
||||
&& detail::section::preceding<Dimension>(dir, *(it_begin + 1),
|
||||
this_bounding_box,
|
||||
other_bounding_box,
|
||||
m_robust_policy);
|
||||
other_bounding_box);
|
||||
++it_begin, index++)
|
||||
{}
|
||||
}
|
||||
@ -177,7 +175,7 @@ class piece_turn_visitor
|
||||
&& it_beyond - 2 != it_begin)
|
||||
{
|
||||
if (detail::section::exceeding<Dimension>(dir, *(it_beyond - 2),
|
||||
this_bounding_box, other_bounding_box, m_robust_policy))
|
||||
this_bounding_box, other_bounding_box))
|
||||
{
|
||||
--it_beyond;
|
||||
}
|
||||
@ -271,7 +269,6 @@ class piece_turn_visitor
|
||||
turn_policy::apply(unique_sub_range1, unique_sub_range2,
|
||||
the_model,
|
||||
m_strategy,
|
||||
m_robust_policy,
|
||||
std::back_inserter(m_turns));
|
||||
}
|
||||
}
|
||||
@ -282,13 +279,11 @@ public:
|
||||
piece_turn_visitor(Pieces const& pieces,
|
||||
Rings const& ring_collection,
|
||||
Turns& turns,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
Strategy const& strategy)
|
||||
: m_pieces(pieces)
|
||||
, m_rings(ring_collection)
|
||||
, m_turns(turns)
|
||||
, m_strategy(strategy)
|
||||
, m_robust_policy(robust_policy)
|
||||
{}
|
||||
|
||||
template <typename Section>
|
||||
|
@ -4,8 +4,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2017-2022.
|
||||
// Modifications copyright (c) 2017-2022 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -78,11 +79,6 @@ struct buffer_all<Input, Output, TagIn, multi_polygon_tag>
|
||||
typedef typename boost::range_value<Output>::type polygon_type;
|
||||
|
||||
typedef typename point_type<Input>::type point_type;
|
||||
typedef typename rescale_policy_type
|
||||
<
|
||||
point_type,
|
||||
typename geometry::cs_tag<point_type>::type
|
||||
>::type rescale_policy_type;
|
||||
|
||||
if (geometry::is_empty(geometry_in))
|
||||
{
|
||||
@ -94,10 +90,6 @@ struct buffer_all<Input, Output, TagIn, multi_polygon_tag>
|
||||
geometry::envelope(geometry_in, box);
|
||||
geometry::buffer(box, box, distance_strategy.max_distance(join_strategy, end_strategy));
|
||||
|
||||
rescale_policy_type rescale_policy
|
||||
= boost::geometry::get_rescale_policy<rescale_policy_type>(
|
||||
box, strategies);
|
||||
|
||||
detail::buffer::buffer_inserter<polygon_type>(geometry_in,
|
||||
range::back_inserter(geometry_out),
|
||||
distance_strategy,
|
||||
@ -105,8 +97,7 @@ struct buffer_all<Input, Output, TagIn, multi_polygon_tag>
|
||||
join_strategy,
|
||||
end_strategy,
|
||||
point_strategy,
|
||||
strategies,
|
||||
rescale_policy);
|
||||
strategies);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -5,11 +5,11 @@
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@ -36,7 +36,6 @@
|
||||
#include <boost/geometry/geometries/helper_geometry.hpp>
|
||||
|
||||
#include <boost/geometry/policies/disjoint_interrupt_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/dispatch/disjoint.hpp>
|
||||
|
||||
@ -128,7 +127,7 @@ struct disjoint_linear
|
||||
Geometry1, Geometry2, assign_disjoint_policy
|
||||
>
|
||||
>::apply(0, geometry1, 1, geometry2,
|
||||
strategy, detail::no_rescale_policy(), turns, interrupt_policy);
|
||||
strategy, turns, interrupt_policy);
|
||||
|
||||
return !interrupt_policy.has_intersections;
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -26,9 +27,6 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
|
||||
|
||||
#include <boost/geometry/policies/disjoint_interrupt_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS
|
||||
# include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
|
||||
@ -67,17 +65,16 @@ namespace detail { namespace overlay
|
||||
{
|
||||
|
||||
|
||||
template <typename Geometry, typename Strategy, typename RobustPolicy>
|
||||
template <typename Geometry, typename Strategy>
|
||||
inline bool has_self_intersections(Geometry const& geometry,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
bool throw_on_self_intersection = true)
|
||||
{
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef turn_info
|
||||
<
|
||||
point_type,
|
||||
typename segment_ratio_type<point_type, RobustPolicy>::type
|
||||
typename segment_ratio_type<point_type>::type
|
||||
> turn_info;
|
||||
std::deque<turn_info> turns;
|
||||
detail::disjoint::disjoint_interrupt_policy policy;
|
||||
@ -86,7 +83,7 @@ inline bool has_self_intersections(Geometry const& geometry,
|
||||
<
|
||||
false,
|
||||
detail::overlay::assign_null_policy
|
||||
>(geometry, strategy, robust_policy, turns, policy, 0, false);
|
||||
>(geometry, strategy, turns, policy, 0, false);
|
||||
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS
|
||||
bool first = true;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2020-2021, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2020-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
@ -40,12 +41,10 @@ struct intersection_areal_areal_
|
||||
<
|
||||
typename Areal1,
|
||||
typename Areal2,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Areal1 const& areal1,
|
||||
Areal2 const& areal2,
|
||||
RobustPolicy const& robust_policy,
|
||||
GeometryOut& geometry_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -54,7 +53,7 @@ struct intersection_areal_areal_
|
||||
Areal1, Areal2,
|
||||
typename boost::range_value<GeometryOut>::type,
|
||||
overlay_intersection
|
||||
>::apply(areal1, areal2, robust_policy,
|
||||
>::apply(areal1, areal2,
|
||||
geometry::range::back_inserter(geometry_out),
|
||||
strategy);
|
||||
}
|
||||
@ -69,12 +68,10 @@ struct intersection_areal_areal_<TupledOut, tupled_output_tag>
|
||||
<
|
||||
typename Areal1,
|
||||
typename Areal2,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Areal1 const& areal1,
|
||||
Areal2 const& areal2,
|
||||
RobustPolicy const& robust_policy,
|
||||
TupledOut& geometry_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -110,11 +107,8 @@ struct intersection_areal_areal_<TupledOut, tupled_output_tag>
|
||||
areal::index, TupledOut
|
||||
>::type areal_out_type;
|
||||
|
||||
// NOTE: The same robust_policy is used in each call of
|
||||
// intersection_insert. Is that correct?
|
||||
|
||||
// A * A -> A
|
||||
call_intersection(areal1, areal2, robust_policy,
|
||||
call_intersection(areal1, areal2,
|
||||
areal::get(geometry_out),
|
||||
strategy);
|
||||
|
||||
@ -124,7 +118,6 @@ struct intersection_areal_areal_<TupledOut, tupled_output_tag>
|
||||
// L * L -> (L, P)
|
||||
call_intersection(geometry::detail::boundary_view<Areal1 const>(areal1),
|
||||
geometry::detail::boundary_view<Areal2 const>(areal2),
|
||||
robust_policy,
|
||||
! is_areal_empty
|
||||
? temp_out
|
||||
: geometry_out,
|
||||
@ -144,14 +137,12 @@ struct intersection_areal_areal_<TupledOut, tupled_output_tag>
|
||||
// L - L -> L
|
||||
call_difference(linear::get(temp_out),
|
||||
areal_out_boundary,
|
||||
robust_policy,
|
||||
linear::get(geometry_out),
|
||||
strategy);
|
||||
|
||||
// P - L -> P
|
||||
call_difference(pointlike::get(temp_out),
|
||||
areal_out_boundary,
|
||||
robust_policy,
|
||||
pointlike::get(geometry_out),
|
||||
strategy);
|
||||
}
|
||||
@ -164,13 +155,11 @@ private:
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename GeometryOut,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void call_intersection(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
GeometryOut& geometry_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -185,7 +174,6 @@ private:
|
||||
overlay_intersection
|
||||
>::apply(geometry1,
|
||||
geometry2,
|
||||
robust_policy,
|
||||
geometry::detail::output_geometry_back_inserter(geometry_out),
|
||||
strategy);
|
||||
}
|
||||
@ -194,13 +182,11 @@ private:
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename GeometryOut,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void call_difference(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
GeometryOut& geometry_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -212,7 +198,6 @@ private:
|
||||
overlay_difference
|
||||
>::apply(geometry1,
|
||||
geometry2,
|
||||
robust_policy,
|
||||
geometry::range::back_inserter(geometry_out),
|
||||
strategy);
|
||||
}
|
||||
@ -225,20 +210,18 @@ struct intersection_areal_areal
|
||||
<
|
||||
typename Areal1,
|
||||
typename Areal2,
|
||||
typename RobustPolicy,
|
||||
typename GeometryOut,
|
||||
typename Strategy
|
||||
>
|
||||
static inline bool apply(Areal1 const& areal1,
|
||||
Areal2 const& areal2,
|
||||
RobustPolicy const& robust_policy,
|
||||
GeometryOut& geometry_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
intersection_areal_areal_
|
||||
<
|
||||
GeometryOut
|
||||
>::apply(areal1, areal2, robust_policy, geometry_out, strategy);
|
||||
>::apply(areal1, areal2, geometry_out, strategy);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2015.
|
||||
// Modifications copyright (c) 2015, Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -31,13 +31,11 @@ struct intersection_box_box
|
||||
template
|
||||
<
|
||||
typename Box1, typename Box2,
|
||||
typename RobustPolicy,
|
||||
typename BoxOut,
|
||||
typename Strategy
|
||||
>
|
||||
static inline bool apply(Box1 const& box1,
|
||||
Box2 const& box2,
|
||||
RobustPolicy const& robust_policy,
|
||||
BoxOut& box_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -62,7 +60,7 @@ struct intersection_box_box
|
||||
set<max_corner, Dimension>(box_out, max1 > max2 ? max2 : max1);
|
||||
|
||||
return intersection_box_box<Dimension + 1, DimensionCount>
|
||||
::apply(box1, box2, robust_policy, box_out, strategy);
|
||||
::apply(box1, box2, box_out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -72,12 +70,10 @@ struct intersection_box_box<DimensionCount, DimensionCount>
|
||||
template
|
||||
<
|
||||
typename Box1, typename Box2,
|
||||
typename RobustPolicy,
|
||||
typename BoxOut,
|
||||
typename Strategy
|
||||
>
|
||||
static inline bool apply(Box1 const&, Box2 const&,
|
||||
RobustPolicy const&, BoxOut&, Strategy const&)
|
||||
static inline bool apply(Box1 const&, Box2 const&, BoxOut&, Strategy const&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2022, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2022-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
@ -216,22 +217,12 @@ private:
|
||||
template <typename Out, typename Strategy, std::enable_if_t<! util::is_pointlike<Out>::value, int> = 0>
|
||||
static void merge_two(Out const& g1, Out const& g2, Out& out, Strategy const& strategy)
|
||||
{
|
||||
using rescale_policy_type = typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Out, Out, typename Strategy::cs_tag
|
||||
>::type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
g1, g2, strategy);
|
||||
|
||||
geometry::dispatch::intersection_insert
|
||||
<
|
||||
Out, Out, typename boost::range_value<Out>::type,
|
||||
overlay_union
|
||||
>::apply(g1,
|
||||
g2,
|
||||
robust_policy,
|
||||
geometry::range::back_inserter(out),
|
||||
strategy);
|
||||
}
|
||||
@ -244,7 +235,6 @@ private:
|
||||
Out, Out, typename boost::range_value<Out>::type
|
||||
>::apply(g1,
|
||||
g2,
|
||||
0, // dummy robust policy
|
||||
geometry::range::back_inserter(out),
|
||||
strategy);
|
||||
}
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014-2022.
|
||||
// Modifications copyright (c) 2014-2022, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -17,7 +18,6 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/intersection_insert.hpp>
|
||||
#include <boost/geometry/algorithms/detail/tupled_output.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_variant.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/relate/services.hpp>
|
||||
@ -43,10 +43,9 @@ template
|
||||
>
|
||||
struct intersection
|
||||
{
|
||||
template <typename RobustPolicy, typename GeometryOut, typename Strategy>
|
||||
template <typename GeometryOut, typename Strategy>
|
||||
static inline bool apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
GeometryOut& geometry_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -59,7 +58,7 @@ struct intersection
|
||||
<
|
||||
Geometry1, Geometry2, SingleOut,
|
||||
overlay_intersection
|
||||
>::apply(geometry1, geometry2, robust_policy,
|
||||
>::apply(geometry1, geometry2,
|
||||
geometry::detail::output_geometry_back_inserter(geometry_out),
|
||||
strategy);
|
||||
|
||||
@ -83,11 +82,10 @@ struct intersection
|
||||
>
|
||||
: intersection<Geometry2, Geometry1, Tag2, Tag1, false>
|
||||
{
|
||||
template <typename RobustPolicy, typename GeometryOut, typename Strategy>
|
||||
template <typename GeometryOut, typename Strategy>
|
||||
static inline bool apply(
|
||||
Geometry1 const& g1,
|
||||
Geometry2 const& g2,
|
||||
RobustPolicy const& robust_policy,
|
||||
GeometryOut& out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -96,7 +94,7 @@ struct intersection
|
||||
Geometry2, Geometry1,
|
||||
Tag2, Tag1,
|
||||
false
|
||||
>::apply(g2, g1, robust_policy, out, strategy);
|
||||
>::apply(g2, g1, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -121,22 +119,11 @@ struct intersection
|
||||
static bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
GeometryOut & geometry_out, Strategy const& strategy)
|
||||
{
|
||||
typedef typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename Strategy::cs_tag
|
||||
>::type rescale_policy_type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
geometry1, geometry2, strategy);
|
||||
|
||||
return dispatch::intersection
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2
|
||||
>::apply(geometry1, geometry2, robust_policy, geometry_out,
|
||||
>::apply(geometry1, geometry2, geometry_out,
|
||||
strategy);
|
||||
}
|
||||
};
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014-2022.
|
||||
// Modifications copyright (c) 2014-2022, Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -53,12 +53,10 @@ struct intersection_multi_linestring_multi_linestring_point
|
||||
template
|
||||
<
|
||||
typename MultiLinestring1, typename MultiLinestring2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(MultiLinestring1 const& ml1,
|
||||
MultiLinestring2 const& ml2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -69,7 +67,7 @@ struct intersection_multi_linestring_multi_linestring_point
|
||||
for (auto it2 = boost::begin(ml2); it2 != boost::end(ml2); ++it2)
|
||||
{
|
||||
out = intersection_linestring_linestring_point<PointOut>
|
||||
::apply(*it1, *it2, robust_policy, out, strategy);
|
||||
::apply(*it1, *it2, out, strategy);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,19 +82,17 @@ struct intersection_linestring_multi_linestring_point
|
||||
template
|
||||
<
|
||||
typename Linestring, typename MultiLinestring,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Linestring const& linestring,
|
||||
MultiLinestring const& ml,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
for (auto it = boost::begin(ml); it != boost::end(ml); ++it)
|
||||
{
|
||||
out = intersection_linestring_linestring_point<PointOut>
|
||||
::apply(linestring, *it, robust_policy, out, strategy);
|
||||
::apply(linestring, *it, out, strategy);
|
||||
}
|
||||
|
||||
return out;
|
||||
@ -118,11 +114,9 @@ struct intersection_of_multi_linestring_with_areal
|
||||
template
|
||||
<
|
||||
typename MultiLinestring, typename Areal,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(MultiLinestring const& ml, Areal const& areal,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -131,7 +125,7 @@ struct intersection_of_multi_linestring_with_areal
|
||||
out = intersection_of_linestring_with_areal
|
||||
<
|
||||
ReverseAreal, LineStringOut, OverlayType, FollowIsolatedPoints
|
||||
>::apply(*it, areal, robust_policy, out, strategy);
|
||||
>::apply(*it, areal, out, strategy);
|
||||
}
|
||||
|
||||
return out;
|
||||
@ -152,18 +146,16 @@ struct intersection_of_areal_with_multi_linestring
|
||||
template
|
||||
<
|
||||
typename Areal, typename MultiLinestring,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Areal const& areal, MultiLinestring const& ml,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return intersection_of_multi_linestring_with_areal
|
||||
<
|
||||
ReverseAreal, LineStringOut, OverlayType, FollowIsolatedPoints
|
||||
>::apply(ml, areal, robust_policy, out, strategy);
|
||||
>::apply(ml, areal, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -175,12 +167,10 @@ struct clip_multi_linestring
|
||||
template
|
||||
<
|
||||
typename MultiLinestring, typename Box,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(MultiLinestring const& multi_linestring,
|
||||
Box const& box,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out, Strategy const& )
|
||||
{
|
||||
typedef typename point_type<LinestringOut>::type point_type;
|
||||
@ -188,7 +178,7 @@ struct clip_multi_linestring
|
||||
for (auto it = boost::begin(multi_linestring); it != boost::end(multi_linestring); ++it)
|
||||
{
|
||||
out = detail::intersection::clip_range_with_box
|
||||
<LinestringOut>(box, *it, robust_policy, out, lb_strategy);
|
||||
<LinestringOut>(box, *it, out, lb_strategy);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
@ -4,9 +4,9 @@
|
||||
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020, Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
|
||||
#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
|
||||
#include <boost/geometry/policies/disjoint_interrupt_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/relate/services.hpp>
|
||||
|
||||
@ -69,7 +68,7 @@ struct self_intersects
|
||||
detail::self_get_turn_points::get_turns
|
||||
<
|
||||
false, turn_policy
|
||||
>::apply(geometry, strategy, detail::no_rescale_policy(), turns, policy, 0, true);
|
||||
>::apply(geometry, strategy, turns, policy, 0, true);
|
||||
return policy.has_intersections;
|
||||
}
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
@ -31,7 +31,6 @@
|
||||
#include <boost/geometry/util/range.hpp>
|
||||
|
||||
#include <boost/geometry/policies/predicate_based_interrupt_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/segment_ratio.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/intersects.hpp>
|
||||
@ -218,7 +217,6 @@ inline bool has_self_intersections(Linear const& linear, Strategy const& strateg
|
||||
false, turn_policy
|
||||
>::apply(linear,
|
||||
strategy,
|
||||
detail::no_rescale_policy(),
|
||||
turns,
|
||||
interrupt_policy, 0, true);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -26,8 +26,6 @@
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
#include <boost/geometry/policies/predicate_based_interrupt_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
@ -48,21 +46,11 @@ class has_valid_self_turns
|
||||
private:
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
|
||||
typedef typename geometry::rescale_policy_type
|
||||
<
|
||||
point_type,
|
||||
CSTag
|
||||
>::type rescale_policy_type;
|
||||
|
||||
public:
|
||||
typedef detail::overlay::turn_info
|
||||
<
|
||||
point_type,
|
||||
typename segment_ratio_type
|
||||
<
|
||||
point_type,
|
||||
rescale_policy_type
|
||||
>::type
|
||||
typename segment_ratio_type<point_type>::type
|
||||
> turn_type;
|
||||
|
||||
// returns true if all turns are valid
|
||||
@ -74,9 +62,6 @@ public:
|
||||
{
|
||||
boost::ignore_unused(visitor);
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(geometry, strategy);
|
||||
|
||||
detail::overlay::stateless_predicate_based_interrupt_policy
|
||||
<
|
||||
is_acceptable_turn<Geometry>
|
||||
@ -86,7 +71,7 @@ public:
|
||||
detail::self_get_turn_points::self_turns
|
||||
<
|
||||
false, detail::overlay::assign_null_policy
|
||||
>(geometry, strategy, robust_policy, turns, interrupt_policy,
|
||||
>(geometry, strategy, turns, interrupt_policy,
|
||||
0, true);
|
||||
|
||||
if (interrupt_policy.has_intersections)
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014-2020.
|
||||
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -42,50 +43,22 @@ namespace detail { namespace overlay
|
||||
{
|
||||
|
||||
// TODO: move this / rename this
|
||||
template <typename Point1, typename Point2, typename Strategy, typename RobustPolicy>
|
||||
template <typename Point1, typename Point2, typename Strategy>
|
||||
inline bool points_equal_or_close(Point1 const& point1,
|
||||
Point2 const& point2,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
Strategy const& strategy)
|
||||
{
|
||||
if (detail::equals::equals_point_point(point1, point2, strategy))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if BOOST_GEOMETRY_CONSTEXPR (! RobustPolicy::enabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else // else prevents unreachable code warning
|
||||
{
|
||||
// Try using specified robust policy
|
||||
using robust_point_type = typename geometry::robust_point_type
|
||||
<
|
||||
Point1,
|
||||
RobustPolicy
|
||||
>::type;
|
||||
|
||||
robust_point_type point1_rob, point2_rob;
|
||||
geometry::recalculate(point1_rob, point1, robust_policy);
|
||||
geometry::recalculate(point2_rob, point2, robust_policy);
|
||||
|
||||
// Only if this is the case the same strategy can be used.
|
||||
BOOST_STATIC_ASSERT((std::is_same
|
||||
<
|
||||
typename geometry::cs_tag<Point1>::type,
|
||||
typename geometry::cs_tag<robust_point_type>::type
|
||||
>::value));
|
||||
|
||||
return detail::equals::equals_point_point(point1_rob, point2_rob, strategy);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template <typename Range, typename Point, typename Strategy, typename RobustPolicy>
|
||||
template <typename Range, typename Point, typename Strategy>
|
||||
inline void append_no_dups_or_spikes(Range& range, Point const& point,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
Strategy const& strategy)
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
|
||||
std::cout << " add: ("
|
||||
@ -96,8 +69,7 @@ inline void append_no_dups_or_spikes(Range& range, Point const& point,
|
||||
// for geometries >= 3 points.
|
||||
// So we have to check the first potential duplicate differently
|
||||
if ( boost::size(range) == 1
|
||||
&& points_equal_or_close(*(boost::begin(range)), point, strategy,
|
||||
robust_policy) )
|
||||
&& points_equal_or_close(*(boost::begin(range)), point, strategy) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -122,8 +94,8 @@ inline void append_no_dups_or_spikes(Range& range, Point const& point,
|
||||
&& point_is_spike_or_equal(point,
|
||||
*(boost::end(range) - 3),
|
||||
*(boost::end(range) - 2),
|
||||
strategy.side(), // TODO: Pass strategy?
|
||||
robust_policy))
|
||||
strategy.side() // TODO: Pass strategy?
|
||||
))
|
||||
{
|
||||
// Use the Concept/traits, so resize and append again
|
||||
traits::resize<Range>::apply(range, boost::size(range) - 2);
|
||||
@ -131,10 +103,9 @@ inline void append_no_dups_or_spikes(Range& range, Point const& point,
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Range, typename Point, typename Strategy, typename RobustPolicy>
|
||||
template <typename Range, typename Point, typename Strategy>
|
||||
inline void append_no_collinear(Range& range, Point const& point,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
Strategy const& strategy)
|
||||
{
|
||||
// Stricter version, not allowing any point in a linear row
|
||||
// (spike, continuation or same point)
|
||||
@ -144,8 +115,7 @@ inline void append_no_collinear(Range& range, Point const& point,
|
||||
// So we have to check the first potential duplicate differently
|
||||
if ( boost::size(range) == 1
|
||||
&& points_equal_or_close(*(boost::begin(range)), point,
|
||||
strategy,
|
||||
robust_policy) )
|
||||
strategy) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -161,8 +131,8 @@ inline void append_no_collinear(Range& range, Point const& point,
|
||||
&& point_is_collinear(point,
|
||||
*(boost::end(range) - 3),
|
||||
*(boost::end(range) - 2),
|
||||
strategy.side(), // TODO: Pass strategy?
|
||||
robust_policy))
|
||||
strategy.side() // TODO: Pass strategy?
|
||||
))
|
||||
{
|
||||
// Use the Concept/traits, so resize and append again
|
||||
traits::resize<Range>::apply(range, boost::size(range) - 2);
|
||||
@ -171,9 +141,8 @@ inline void append_no_collinear(Range& range, Point const& point,
|
||||
}
|
||||
|
||||
// Should only be called internally, from traverse.
|
||||
template <typename Ring, typename Strategy, typename RobustPolicy>
|
||||
inline void remove_spikes_at_closure(Ring& ring, Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
template <typename Ring, typename Strategy>
|
||||
inline void remove_spikes_at_closure(Ring& ring, Strategy const& strategy)
|
||||
{
|
||||
// It assumes a closed ring (whatever the closure value)
|
||||
constexpr std::size_t min_size
|
||||
@ -199,8 +168,8 @@ inline void remove_spikes_at_closure(Ring& ring, Strategy const& strategy,
|
||||
// Check if closing point is a spike (this is so if the second point is
|
||||
// considered as collinear w.r.t. the last segment)
|
||||
if (point_is_collinear(*second, *penultimate, *first,
|
||||
strategy.side(), // TODO: Pass strategy?
|
||||
robust_policy))
|
||||
strategy.side() // TODO: Pass strategy?
|
||||
))
|
||||
{
|
||||
// Remove first point and last point
|
||||
range::erase(ring, first);
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -106,7 +107,6 @@ public :
|
||||
typename Operation,
|
||||
typename Rings, typename Ring, typename Turns,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename Visitor
|
||||
>
|
||||
static inline void apply(std::size_t size_at_start,
|
||||
@ -119,7 +119,6 @@ public :
|
||||
Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
state_type& state,
|
||||
Visitor& visitor)
|
||||
{
|
||||
@ -131,8 +130,8 @@ public :
|
||||
if (! state.m_checked)
|
||||
{
|
||||
state.m_checked = true;
|
||||
has_self_intersections(geometry1, strategy, robust_policy);
|
||||
has_self_intersections(geometry2, strategy, robust_policy);
|
||||
has_self_intersections(geometry1, strategy);
|
||||
has_self_intersections(geometry2, strategy);
|
||||
}
|
||||
|
||||
// Make bad output clean
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2015-2020.
|
||||
// Modifications copyright (c) 2015-2020 Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -180,13 +180,11 @@ template
|
||||
typename OutputLinestring,
|
||||
typename OutputIterator,
|
||||
typename Range,
|
||||
typename RobustPolicy,
|
||||
typename Box,
|
||||
typename Strategy
|
||||
>
|
||||
OutputIterator clip_range_with_box(Box const& b, Range const& range,
|
||||
RobustPolicy const&,
|
||||
OutputIterator out, Strategy const& strategy)
|
||||
OutputIterator out, Strategy const& strategy)
|
||||
{
|
||||
if (boost::begin(range) == boost::end(range))
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -62,14 +63,12 @@ struct copy_segments_ring
|
||||
typename Ring,
|
||||
typename SegmentIdentifier,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename RangeOut
|
||||
>
|
||||
static inline void apply(Ring const& ring,
|
||||
SegmentIdentifier const& seg_id,
|
||||
signed_size_type to_index,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
RangeOut& current_output)
|
||||
{
|
||||
using view_type = detail::closed_clockwise_view
|
||||
@ -108,7 +107,7 @@ struct copy_segments_ring
|
||||
|
||||
for (signed_size_type i = 0; i < count; ++i, ++it)
|
||||
{
|
||||
detail::overlay::append_no_dups_or_spikes(current_output, *it, strategy, robust_policy);
|
||||
detail::overlay::append_no_dups_or_spikes(current_output, *it, strategy);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -118,24 +117,21 @@ class copy_segments_linestring
|
||||
{
|
||||
private:
|
||||
// remove spikes
|
||||
template <typename RangeOut, typename Point, typename Strategy, typename RobustPolicy>
|
||||
template <typename RangeOut, typename Point, typename Strategy>
|
||||
static inline void append_to_output(RangeOut& current_output,
|
||||
Point const& point,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
std::true_type const&)
|
||||
{
|
||||
detail::overlay::append_no_dups_or_spikes(current_output, point,
|
||||
strategy,
|
||||
robust_policy);
|
||||
strategy);
|
||||
}
|
||||
|
||||
// keep spikes
|
||||
template <typename RangeOut, typename Point, typename Strategy, typename RobustPolicy>
|
||||
template <typename RangeOut, typename Point, typename Strategy>
|
||||
static inline void append_to_output(RangeOut& current_output,
|
||||
Point const& point,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const&,
|
||||
std::false_type const&)
|
||||
{
|
||||
detail::overlay::append_no_duplicates(current_output, point, strategy);
|
||||
@ -147,14 +143,12 @@ public:
|
||||
typename LineString,
|
||||
typename SegmentIdentifier,
|
||||
typename SideStrategy,
|
||||
typename RobustPolicy,
|
||||
typename RangeOut
|
||||
>
|
||||
static inline void apply(LineString const& ls,
|
||||
SegmentIdentifier const& seg_id,
|
||||
signed_size_type to_index,
|
||||
SideStrategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
RangeOut& current_output)
|
||||
{
|
||||
signed_size_type const from_index = seg_id.segment_index + 1;
|
||||
@ -171,7 +165,7 @@ public:
|
||||
auto it = boost::begin(ls) + from_index;
|
||||
for (signed_size_type i = 0; i < count; ++i, ++it)
|
||||
{
|
||||
append_to_output(current_output, *it, strategy, robust_policy,
|
||||
append_to_output(current_output, *it, strategy,
|
||||
std::integral_constant<bool, RemoveSpikes>());
|
||||
}
|
||||
}
|
||||
@ -185,14 +179,12 @@ struct copy_segments_polygon
|
||||
typename Polygon,
|
||||
typename SegmentIdentifier,
|
||||
typename SideStrategy,
|
||||
typename RobustPolicy,
|
||||
typename RangeOut
|
||||
>
|
||||
static inline void apply(Polygon const& polygon,
|
||||
SegmentIdentifier const& seg_id,
|
||||
signed_size_type to_index,
|
||||
SideStrategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
RangeOut& current_output)
|
||||
{
|
||||
// Call ring-version with the right ring
|
||||
@ -203,7 +195,6 @@ struct copy_segments_polygon
|
||||
: range::at(geometry::interior_rings(polygon), seg_id.ring_index),
|
||||
seg_id, to_index,
|
||||
strategy,
|
||||
robust_policy,
|
||||
current_output
|
||||
);
|
||||
}
|
||||
@ -218,14 +209,12 @@ struct copy_segments_box
|
||||
typename Box,
|
||||
typename SegmentIdentifier,
|
||||
typename SideStrategy,
|
||||
typename RobustPolicy,
|
||||
typename RangeOut
|
||||
>
|
||||
static inline void apply(Box const& box,
|
||||
SegmentIdentifier const& seg_id,
|
||||
signed_size_type to_index,
|
||||
SideStrategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
RangeOut& current_output)
|
||||
{
|
||||
signed_size_type index = seg_id.segment_index + 1;
|
||||
@ -245,7 +234,7 @@ struct copy_segments_box
|
||||
for (signed_size_type i = 0; i < count; i++, index++)
|
||||
{
|
||||
detail::overlay::append_no_dups_or_spikes(current_output,
|
||||
bp[index % 5], strategy, robust_policy);
|
||||
bp[index % 5], strategy);
|
||||
|
||||
}
|
||||
}
|
||||
@ -260,14 +249,12 @@ struct copy_segments_multi
|
||||
typename MultiGeometry,
|
||||
typename SegmentIdentifier,
|
||||
typename SideStrategy,
|
||||
typename RobustPolicy,
|
||||
typename RangeOut
|
||||
>
|
||||
static inline void apply(MultiGeometry const& multi_geometry,
|
||||
SegmentIdentifier const& seg_id,
|
||||
signed_size_type to_index,
|
||||
SideStrategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
RangeOut& current_output)
|
||||
{
|
||||
|
||||
@ -281,7 +268,6 @@ struct copy_segments_multi
|
||||
Policy::apply(range::at(multi_geometry, seg_id.multi_index),
|
||||
seg_id, to_index,
|
||||
strategy,
|
||||
robust_policy,
|
||||
current_output);
|
||||
}
|
||||
};
|
||||
@ -351,14 +337,12 @@ template
|
||||
typename Geometry,
|
||||
typename SegmentIdentifier,
|
||||
typename SideStrategy,
|
||||
typename RobustPolicy,
|
||||
typename RangeOut
|
||||
>
|
||||
inline void copy_segments(Geometry const& geometry,
|
||||
SegmentIdentifier const& seg_id,
|
||||
signed_size_type to_index,
|
||||
SideStrategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
RangeOut& range_out)
|
||||
{
|
||||
concepts::check<Geometry const>();
|
||||
@ -367,7 +351,7 @@ inline void copy_segments(Geometry const& geometry,
|
||||
<
|
||||
typename tag<Geometry>::type,
|
||||
Reverse
|
||||
>::apply(geometry, seg_id, to_index, strategy, robust_policy, range_out);
|
||||
>::apply(geometry, seg_id, to_index, strategy, range_out);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -41,7 +42,6 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/is_self_turn.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/overlay_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_type.hpp>
|
||||
#include <boost/geometry/util/constexpr.hpp>
|
||||
#include <boost/geometry/views/enumerate_view.hpp>
|
||||
|
||||
@ -81,14 +81,12 @@ template
|
||||
typename Operations,
|
||||
typename Turns,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
inline void enrich_sort(Operations& operations,
|
||||
Turns const& turns,
|
||||
Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
std::sort(std::begin(operations),
|
||||
@ -98,10 +96,9 @@ inline void enrich_sort(Operations& operations,
|
||||
Turns,
|
||||
typename boost::range_value<Operations>::type,
|
||||
Geometry1, Geometry2,
|
||||
RobustPolicy,
|
||||
Strategy,
|
||||
Reverse1, Reverse2
|
||||
>(turns, geometry1, geometry2, robust_policy, strategy));
|
||||
>(turns, geometry1, geometry2, strategy));
|
||||
}
|
||||
|
||||
|
||||
@ -379,7 +376,6 @@ inline void calculate_remaining_distance(Turns& turns)
|
||||
\param clusters container containing clusters
|
||||
\param geometry1 \param_geometry
|
||||
\param geometry2 \param_geometry
|
||||
\param robust_policy policy to handle robustness issues
|
||||
\param strategy point in geometry strategy
|
||||
*/
|
||||
template
|
||||
@ -389,13 +385,11 @@ template
|
||||
typename Turns,
|
||||
typename Clusters,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename IntersectionStrategy
|
||||
>
|
||||
inline void enrich_intersection_points(Turns& turns,
|
||||
Clusters& clusters,
|
||||
Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
IntersectionStrategy const& strategy)
|
||||
{
|
||||
constexpr detail::overlay::operation_type target_operation
|
||||
@ -431,7 +425,7 @@ inline void enrich_intersection_points(Turns& turns,
|
||||
has_colocations = detail::overlay::handle_colocations
|
||||
<
|
||||
Reverse1, Reverse2, OverlayType, Geometry1, Geometry2
|
||||
>(turns, clusters, robust_policy);
|
||||
>(turns, clusters);
|
||||
// Gather cluster properties (using even clusters with
|
||||
// discarded turns - for open turns)
|
||||
detail::overlay::gather_cluster_properties
|
||||
@ -510,7 +504,7 @@ inline void enrich_intersection_points(Turns& turns,
|
||||
detail::overlay::enrich_sort<Reverse1, Reverse2>(
|
||||
pair.second, turns,
|
||||
geometry1, geometry2,
|
||||
robust_policy, strategy);
|
||||
strategy);
|
||||
}
|
||||
|
||||
if (has_colocations)
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014-2022.
|
||||
// Modifications copyright (c) 2014-2022 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -220,8 +221,7 @@ struct action_selector<overlay_intersection, RemoveSpikes>
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation,
|
||||
typename Strategy,
|
||||
typename RobustPolicy
|
||||
typename Strategy
|
||||
>
|
||||
static inline void enter(LineStringOut& current_piece,
|
||||
LineString const& ,
|
||||
@ -229,7 +229,6 @@ struct action_selector<overlay_intersection, RemoveSpikes>
|
||||
signed_size_type , Point const& point,
|
||||
Operation const& operation,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator& )
|
||||
{
|
||||
// On enter, append the intersection point and remember starting point
|
||||
@ -245,8 +244,7 @@ struct action_selector<overlay_intersection, RemoveSpikes>
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation,
|
||||
typename Strategy,
|
||||
typename RobustPolicy
|
||||
typename Strategy
|
||||
>
|
||||
static inline void leave(LineStringOut& current_piece,
|
||||
LineString const& linestring,
|
||||
@ -254,7 +252,6 @@ struct action_selector<overlay_intersection, RemoveSpikes>
|
||||
signed_size_type index, Point const& point,
|
||||
Operation const& ,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator& out)
|
||||
{
|
||||
// On leave, copy all segments from starting point, append the intersection point
|
||||
@ -262,7 +259,7 @@ struct action_selector<overlay_intersection, RemoveSpikes>
|
||||
detail::copy_segments::copy_segments_linestring
|
||||
<
|
||||
false, RemoveSpikes
|
||||
>::apply(linestring, segment_id, index, strategy, robust_policy, current_piece);
|
||||
>::apply(linestring, segment_id, index, strategy, current_piece);
|
||||
detail::overlay::append_no_duplicates(current_piece, point, strategy);
|
||||
if (::boost::size(current_piece) > 1)
|
||||
{
|
||||
@ -309,8 +306,7 @@ struct action_selector<overlay_difference, RemoveSpikes>
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation,
|
||||
typename Strategy,
|
||||
typename RobustPolicy
|
||||
typename Strategy
|
||||
>
|
||||
static inline void enter(LineStringOut& current_piece,
|
||||
LineString const& linestring,
|
||||
@ -318,11 +314,10 @@ struct action_selector<overlay_difference, RemoveSpikes>
|
||||
signed_size_type index, Point const& point,
|
||||
Operation const& operation,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator& out)
|
||||
{
|
||||
normal_action::leave(current_piece, linestring, segment_id, index,
|
||||
point, operation, strategy, robust_policy, out);
|
||||
point, operation, strategy, out);
|
||||
}
|
||||
|
||||
template
|
||||
@ -332,8 +327,7 @@ struct action_selector<overlay_difference, RemoveSpikes>
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation,
|
||||
typename Strategy,
|
||||
typename RobustPolicy
|
||||
typename Strategy
|
||||
>
|
||||
static inline void leave(LineStringOut& current_piece,
|
||||
LineString const& linestring,
|
||||
@ -341,11 +335,10 @@ struct action_selector<overlay_difference, RemoveSpikes>
|
||||
signed_size_type index, Point const& point,
|
||||
Operation const& operation,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator& out)
|
||||
{
|
||||
normal_action::enter(current_piece, linestring, segment_id, index,
|
||||
point, operation, strategy, robust_policy, out);
|
||||
point, operation, strategy, out);
|
||||
}
|
||||
|
||||
template
|
||||
@ -412,13 +405,11 @@ public :
|
||||
<
|
||||
typename Turns,
|
||||
typename OutputIterator,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(LineString const& linestring, Polygon const& polygon,
|
||||
detail::overlay::operation_type , // TODO: this parameter might be redundant
|
||||
Turns& turns,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -464,7 +455,7 @@ public :
|
||||
entered = true;
|
||||
action::enter(current_piece, linestring, current_segment_id,
|
||||
op.seg_id.segment_index, turn.point, op,
|
||||
strategy, robust_policy,
|
||||
strategy,
|
||||
linear::get(out));
|
||||
}
|
||||
else if (following::is_leaving(turn, op, entered, first, linestring, polygon, strategy))
|
||||
@ -474,7 +465,7 @@ public :
|
||||
entered = false;
|
||||
action::leave(current_piece, linestring, current_segment_id,
|
||||
op.seg_id.segment_index, turn.point, op,
|
||||
strategy, robust_policy,
|
||||
strategy,
|
||||
linear::get(out));
|
||||
}
|
||||
else if (BOOST_GEOMETRY_CONDITION(FollowIsolatedPoints)
|
||||
@ -499,7 +490,7 @@ public :
|
||||
>::apply(linestring,
|
||||
current_segment_id,
|
||||
static_cast<signed_size_type>(boost::size(linestring) - 1),
|
||||
strategy, robust_policy,
|
||||
strategy,
|
||||
current_piece);
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -212,9 +212,6 @@ protected:
|
||||
OutputIterator oit,
|
||||
SideStrategy const& strategy)
|
||||
{
|
||||
// We don't rescale linear/linear
|
||||
detail::no_rescale_policy robust_policy;
|
||||
|
||||
if ( is_entering(*it, *op_it) )
|
||||
{
|
||||
detail::turns::debug_turn(*it, *op_it, "-> Entering");
|
||||
@ -226,7 +223,7 @@ protected:
|
||||
linestring,
|
||||
current_segment_id,
|
||||
op_it->seg_id.segment_index,
|
||||
it->point, *op_it, strategy, robust_policy,
|
||||
it->point, *op_it, strategy,
|
||||
linear::get(oit));
|
||||
}
|
||||
++enter_count;
|
||||
@ -243,7 +240,7 @@ protected:
|
||||
linestring,
|
||||
current_segment_id,
|
||||
op_it->seg_id.segment_index,
|
||||
it->point, *op_it, strategy, robust_policy,
|
||||
it->point, *op_it, strategy,
|
||||
linear::get(oit));
|
||||
}
|
||||
}
|
||||
@ -284,9 +281,6 @@ protected:
|
||||
{
|
||||
if ( action::is_entered(entered) )
|
||||
{
|
||||
// We don't rescale linear/linear
|
||||
detail::no_rescale_policy robust_policy;
|
||||
|
||||
detail::copy_segments::copy_segments_linestring
|
||||
<
|
||||
false, false // do not reverse; do not remove spikes
|
||||
@ -294,7 +288,6 @@ protected:
|
||||
current_segment_id,
|
||||
static_cast<signed_size_type>(boost::size(linestring) - 1),
|
||||
strategy,
|
||||
robust_policy,
|
||||
current_piece);
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
// Copyright (c) 2021 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2024.
|
||||
// Modifications copyright (c) 2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// 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)
|
||||
@ -17,14 +21,9 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/approximately_equals.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/cluster_info.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_ring.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
|
||||
#define BOOST_GEOMETRY_USE_RESCALING_IN_GET_CLUSTERS
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
@ -32,7 +31,7 @@ namespace boost { namespace geometry
|
||||
namespace detail { namespace overlay
|
||||
{
|
||||
|
||||
template <typename Tag = no_rescale_policy_tag, bool Integral = false>
|
||||
template <bool Integral = false>
|
||||
struct sweep_equal_policy
|
||||
{
|
||||
|
||||
@ -58,7 +57,7 @@ public:
|
||||
};
|
||||
|
||||
template <>
|
||||
struct sweep_equal_policy<no_rescale_policy_tag, true>
|
||||
struct sweep_equal_policy<true>
|
||||
{
|
||||
template <typename P>
|
||||
static inline bool equals(P const& p1, P const& p2)
|
||||
@ -74,26 +73,6 @@ struct sweep_equal_policy<no_rescale_policy_tag, true>
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef BOOST_GEOMETRY_USE_RESCALING_IN_GET_CLUSTERS
|
||||
template <>
|
||||
struct sweep_equal_policy<rescale_policy_tag, true>
|
||||
{
|
||||
template <typename P>
|
||||
static inline bool equals(P const& p1, P const& p2)
|
||||
{
|
||||
// Neighbouring cells in the "integer grid" are considered as equal
|
||||
return math::abs(geometry::get<0>(p1) - geometry::get<0>(p2)) <= 1
|
||||
&& math::abs(geometry::get<1>(p1) - geometry::get<1>(p2)) <= 1;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static inline bool exceeds(T value)
|
||||
{
|
||||
return value > 1;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename Point>
|
||||
struct turn_with_point
|
||||
{
|
||||
@ -112,29 +91,16 @@ struct cluster_with_point
|
||||
template
|
||||
<
|
||||
typename Turns,
|
||||
typename Clusters,
|
||||
typename RobustPolicy
|
||||
typename Clusters
|
||||
>
|
||||
inline void get_clusters(Turns& turns, Clusters& clusters,
|
||||
RobustPolicy const& robust_policy)
|
||||
inline void get_clusters(Turns& turns, Clusters& clusters)
|
||||
{
|
||||
using turn_type = typename boost::range_value<Turns>::type;
|
||||
using cluster_type = typename Clusters::mapped_type;
|
||||
|
||||
#ifdef BOOST_GEOMETRY_USE_RESCALING_IN_GET_CLUSTERS
|
||||
// For now still use robust points for rescaled, otherwise points do not match
|
||||
using point_type = typename geometry::robust_point_type
|
||||
<
|
||||
typename turn_type::point_type,
|
||||
RobustPolicy
|
||||
>::type;
|
||||
#else
|
||||
using point_type = typename turn_type::point_type;
|
||||
#endif
|
||||
|
||||
sweep_equal_policy
|
||||
<
|
||||
typename rescale_policy_type<RobustPolicy>::type,
|
||||
std::is_integral<typename coordinate_type<point_type>::type>::value
|
||||
> equal_policy;
|
||||
|
||||
@ -144,13 +110,7 @@ inline void get_clusters(Turns& turns, Clusters& clusters,
|
||||
{
|
||||
if (! turn.discarded)
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_USE_RESCALING_IN_GET_CLUSTERS
|
||||
point_type pnt;
|
||||
geometry::recalculate(pnt, turn.point, robust_policy);
|
||||
points.push_back({turn_index, pnt});
|
||||
#else
|
||||
points.push_back({turn_index, turn.point});
|
||||
#endif
|
||||
}
|
||||
turn_index++;
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -22,7 +22,6 @@
|
||||
|
||||
#include <boost/geometry/algorithms/convert.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
|
||||
#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/segment.hpp>
|
||||
|
||||
@ -48,23 +47,14 @@ struct get_turn_without_info
|
||||
typename UniqueSubRange1,
|
||||
typename UniqueSubRange2,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator
|
||||
>
|
||||
static inline OutputIterator apply(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo const& ,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator out)
|
||||
{
|
||||
// Make sure this is only called with no rescaling
|
||||
BOOST_STATIC_ASSERT((std::is_same
|
||||
<
|
||||
no_rescale_policy_tag,
|
||||
typename rescale_policy_type<RobustPolicy>::type
|
||||
>::value));
|
||||
|
||||
typedef typename TurnInfo::point_type turn_point_type;
|
||||
|
||||
typedef policies::relate::segments_intersection_points
|
||||
@ -96,13 +86,11 @@ template
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename Strategy
|
||||
>
|
||||
inline void get_intersection_points(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -139,7 +127,6 @@ inline void get_intersection_points(Geometry1 const& geometry1,
|
||||
>::apply(0, geometry1,
|
||||
1, geometry2,
|
||||
strategy,
|
||||
robust_policy,
|
||||
turns, interrupt_policy);
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2023 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2015-2022.
|
||||
// Modifications copyright (c) 2015-2022 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -138,8 +139,8 @@ struct base_turn_handler
|
||||
BOOST_GEOMETRY_ASSERT(index < info.count);
|
||||
|
||||
geometry::convert(info.intersections[index], ti.point);
|
||||
ti.operations[0].fraction = info.fractions[index].robust_ra;
|
||||
ti.operations[1].fraction = info.fractions[index].robust_rb;
|
||||
ti.operations[0].fraction = info.fractions[index].ra;
|
||||
ti.operations[1].fraction = info.fractions[index].rb;
|
||||
}
|
||||
|
||||
template <typename TurnInfo, typename IntersectionInfo, typename DirInfo>
|
||||
@ -170,8 +171,8 @@ struct base_turn_handler
|
||||
}
|
||||
else
|
||||
{
|
||||
ti.operations[i].fraction = i == 0 ? info.fractions[index].robust_ra
|
||||
: info.fractions[index].robust_rb;
|
||||
ti.operations[i].fraction = i == 0 ? info.fractions[index].ra
|
||||
: info.fractions[index].rb;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -179,7 +180,7 @@ struct base_turn_handler
|
||||
template <typename IntersectionInfo>
|
||||
static inline unsigned int non_opposite_to_index(IntersectionInfo const& info)
|
||||
{
|
||||
return info.fractions[0].robust_rb < info.fractions[1].robust_rb
|
||||
return info.fractions[0].rb < info.fractions[1].rb
|
||||
? 1 : 0;
|
||||
}
|
||||
|
||||
@ -1394,7 +1395,6 @@ struct get_turn_info
|
||||
typename UniqueSubRange2,
|
||||
typename TurnInfo,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator
|
||||
>
|
||||
static inline OutputIterator apply(
|
||||
@ -1402,18 +1402,16 @@ struct get_turn_info
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo const& tp_model,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out)
|
||||
{
|
||||
typedef intersection_info
|
||||
<
|
||||
UniqueSubRange1, UniqueSubRange2,
|
||||
typename TurnInfo::point_type,
|
||||
UmbrellaStrategy,
|
||||
RobustPolicy
|
||||
UmbrellaStrategy
|
||||
> inters_info;
|
||||
|
||||
inters_info inters(range_p, range_q, umbrella_strategy, robust_policy);
|
||||
inters_info inters(range_p, range_q, umbrella_strategy);
|
||||
|
||||
char const method = inters.d_info().how;
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -19,7 +19,6 @@
|
||||
#include <boost/geometry/algorithms/detail/equals/point_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
|
||||
namespace boost { namespace geometry {
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -16,10 +16,8 @@
|
||||
|
||||
#include <boost/geometry/algorithms/detail/direction_code.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
#include <boost/geometry/policies/relate/intersection_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
|
||||
#include <boost/geometry/strategies/intersection_result.hpp>
|
||||
|
||||
namespace boost { namespace geometry {
|
||||
@ -85,246 +83,17 @@ struct side_calculator
|
||||
// Used side-strategy, owned by the calculator
|
||||
side_strategy_type m_side_strategy;
|
||||
|
||||
// Used ranges - owned by get_turns or (for robust points) by intersection_info_base
|
||||
// Used ranges - owned by get_turns or (for points) by intersection_info_base
|
||||
UniqueSubRange1 const& m_range_p;
|
||||
UniqueSubRange2 const& m_range_q;
|
||||
};
|
||||
|
||||
template<typename Point, typename UniqueSubRange, typename RobustPolicy>
|
||||
struct robust_subrange_adapter
|
||||
{
|
||||
typedef Point point_type;
|
||||
|
||||
robust_subrange_adapter(UniqueSubRange const& unique_sub_range,
|
||||
Point const& robust_point_i, Point const& robust_point_j,
|
||||
RobustPolicy const& robust_policy)
|
||||
|
||||
: m_unique_sub_range(unique_sub_range)
|
||||
, m_robust_policy(robust_policy)
|
||||
, m_robust_point_i(robust_point_i)
|
||||
, m_robust_point_j(robust_point_j)
|
||||
, m_k_retrieved(false)
|
||||
{}
|
||||
|
||||
std::size_t size() const { return m_unique_sub_range.size(); }
|
||||
|
||||
//! Get precalculated point
|
||||
Point const& at(std::size_t index) const
|
||||
{
|
||||
BOOST_GEOMETRY_ASSERT(index < size());
|
||||
switch (index)
|
||||
{
|
||||
case 0 : return m_robust_point_i;
|
||||
case 1 : return m_robust_point_j;
|
||||
case 2 : return get_point_k();
|
||||
default : return m_robust_point_i;
|
||||
}
|
||||
}
|
||||
|
||||
private :
|
||||
Point const& get_point_k() const
|
||||
{
|
||||
if (! m_k_retrieved)
|
||||
{
|
||||
geometry::recalculate(m_robust_point_k, m_unique_sub_range.at(2), m_robust_policy);
|
||||
m_k_retrieved = true;
|
||||
}
|
||||
return m_robust_point_k;
|
||||
}
|
||||
|
||||
UniqueSubRange const& m_unique_sub_range;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
|
||||
Point const& m_robust_point_i;
|
||||
Point const& m_robust_point_j;
|
||||
mutable Point m_robust_point_k;
|
||||
|
||||
mutable bool m_k_retrieved;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename RobustPolicy
|
||||
typename TurnPoint, typename UmbrellaStrategy
|
||||
>
|
||||
struct robust_point_calculator
|
||||
{
|
||||
typedef typename geometry::robust_point_type
|
||||
<
|
||||
typename UniqueSubRange1::point_type, RobustPolicy
|
||||
>::type robust_point1_type;
|
||||
typedef typename geometry::robust_point_type
|
||||
<
|
||||
typename UniqueSubRange2::point_type, RobustPolicy
|
||||
>::type robust_point2_type;
|
||||
|
||||
inline robust_point_calculator(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
RobustPolicy const& robust_policy)
|
||||
: m_robust_policy(robust_policy)
|
||||
, m_range_p(range_p)
|
||||
, m_range_q(range_q)
|
||||
, m_pk_retrieved(false)
|
||||
, m_qk_retrieved(false)
|
||||
{
|
||||
// Calculate pi,pj and qi,qj which are almost always necessary
|
||||
// But don't calculate pk/qk yet, which is retrieved (taking
|
||||
// more time) and not always necessary.
|
||||
geometry::recalculate(m_rpi, range_p.at(0), robust_policy);
|
||||
geometry::recalculate(m_rpj, range_p.at(1), robust_policy);
|
||||
geometry::recalculate(m_rqi, range_q.at(0), robust_policy);
|
||||
geometry::recalculate(m_rqj, range_q.at(1), robust_policy);
|
||||
}
|
||||
|
||||
inline robust_point1_type const& get_rpk() const
|
||||
{
|
||||
if (! m_pk_retrieved)
|
||||
{
|
||||
geometry::recalculate(m_rpk, m_range_p.at(2), m_robust_policy);
|
||||
m_pk_retrieved = true;
|
||||
}
|
||||
return m_rpk;
|
||||
}
|
||||
inline robust_point2_type const& get_rqk() const
|
||||
{
|
||||
if (! m_qk_retrieved)
|
||||
{
|
||||
geometry::recalculate(m_rqk, m_range_q.at(2), m_robust_policy);
|
||||
m_qk_retrieved = true;
|
||||
}
|
||||
return m_rqk;
|
||||
}
|
||||
|
||||
robust_point1_type m_rpi, m_rpj;
|
||||
robust_point2_type m_rqi, m_rqj;
|
||||
|
||||
private :
|
||||
RobustPolicy const& m_robust_policy;
|
||||
UniqueSubRange1 const& m_range_p;
|
||||
UniqueSubRange2 const& m_range_q;
|
||||
|
||||
// On retrieval
|
||||
mutable robust_point1_type m_rpk;
|
||||
mutable robust_point2_type m_rqk;
|
||||
mutable bool m_pk_retrieved;
|
||||
mutable bool m_qk_retrieved;
|
||||
};
|
||||
|
||||
// Default version (empty - specialized below)
|
||||
template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename TurnPoint, typename UmbrellaStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Tag = typename rescale_policy_type<RobustPolicy>::type
|
||||
>
|
||||
class intersection_info_base {};
|
||||
|
||||
// Version with rescaling, having robust points
|
||||
template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename TurnPoint, typename UmbrellaStrategy,
|
||||
typename RobustPolicy
|
||||
>
|
||||
class intersection_info_base<UniqueSubRange1, UniqueSubRange2,
|
||||
TurnPoint, UmbrellaStrategy, RobustPolicy, rescale_policy_tag>
|
||||
{
|
||||
typedef robust_point_calculator
|
||||
<
|
||||
UniqueSubRange1, UniqueSubRange2,
|
||||
RobustPolicy
|
||||
>
|
||||
robust_calc_type;
|
||||
|
||||
public:
|
||||
typedef segment_intersection_points
|
||||
<
|
||||
TurnPoint,
|
||||
geometry::segment_ratio<boost::long_long_type>
|
||||
> intersection_point_type;
|
||||
typedef policies::relate::segments_intersection_policy
|
||||
<
|
||||
intersection_point_type
|
||||
> intersection_policy_type;
|
||||
|
||||
typedef typename intersection_policy_type::return_type result_type;
|
||||
|
||||
typedef typename robust_calc_type::robust_point1_type robust_point1_type;
|
||||
typedef typename robust_calc_type::robust_point2_type robust_point2_type;
|
||||
|
||||
typedef robust_subrange_adapter<robust_point1_type, UniqueSubRange1, RobustPolicy> robust_subrange1;
|
||||
typedef robust_subrange_adapter<robust_point2_type, UniqueSubRange2, RobustPolicy> robust_subrange2;
|
||||
|
||||
typedef side_calculator
|
||||
<
|
||||
robust_subrange1, robust_subrange2, UmbrellaStrategy
|
||||
> side_calculator_type;
|
||||
|
||||
typedef side_calculator
|
||||
<
|
||||
robust_subrange2, robust_subrange1, UmbrellaStrategy
|
||||
> robust_swapped_side_calculator_type;
|
||||
|
||||
intersection_info_base(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
: m_range_p(range_p)
|
||||
, m_range_q(range_q)
|
||||
, m_robust_calc(range_p, range_q, robust_policy)
|
||||
, m_robust_range_p(range_p, m_robust_calc.m_rpi, m_robust_calc.m_rpj, robust_policy)
|
||||
, m_robust_range_q(range_q, m_robust_calc.m_rqi, m_robust_calc.m_rqj, robust_policy)
|
||||
, m_side_calc(m_robust_range_p, m_robust_range_q, umbrella_strategy)
|
||||
, m_swapped_side_calc(m_robust_range_q, m_robust_range_p, umbrella_strategy)
|
||||
, m_result(umbrella_strategy.relate().apply(range_p, range_q,
|
||||
intersection_policy_type(),
|
||||
m_robust_range_p, m_robust_range_q))
|
||||
{}
|
||||
|
||||
inline bool p_is_last_segment() const { return m_range_p.is_last_segment(); }
|
||||
inline bool q_is_last_segment() const { return m_range_q.is_last_segment(); }
|
||||
|
||||
inline robust_point1_type const& rpi() const { return m_robust_calc.m_rpi; }
|
||||
inline robust_point1_type const& rpj() const { return m_robust_calc.m_rpj; }
|
||||
inline robust_point1_type const& rpk() const { return m_robust_calc.get_rpk(); }
|
||||
|
||||
inline robust_point2_type const& rqi() const { return m_robust_calc.m_rqi; }
|
||||
inline robust_point2_type const& rqj() const { return m_robust_calc.m_rqj; }
|
||||
inline robust_point2_type const& rqk() const { return m_robust_calc.get_rqk(); }
|
||||
|
||||
inline side_calculator_type const& sides() const { return m_side_calc; }
|
||||
inline robust_swapped_side_calculator_type const& swapped_sides() const
|
||||
{
|
||||
return m_swapped_side_calc;
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
// Owned by get_turns
|
||||
UniqueSubRange1 const& m_range_p;
|
||||
UniqueSubRange2 const& m_range_q;
|
||||
|
||||
// Owned by this class
|
||||
robust_calc_type m_robust_calc;
|
||||
robust_subrange1 m_robust_range_p;
|
||||
robust_subrange2 m_robust_range_q;
|
||||
side_calculator_type m_side_calc;
|
||||
robust_swapped_side_calculator_type m_swapped_side_calc;
|
||||
|
||||
protected :
|
||||
result_type m_result;
|
||||
};
|
||||
|
||||
// Version without rescaling
|
||||
template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename TurnPoint, typename UmbrellaStrategy,
|
||||
typename RobustPolicy
|
||||
>
|
||||
class intersection_info_base<UniqueSubRange1, UniqueSubRange2,
|
||||
TurnPoint, UmbrellaStrategy, RobustPolicy, no_rescale_policy_tag>
|
||||
class intersection_info_base
|
||||
{
|
||||
public:
|
||||
|
||||
@ -348,8 +117,7 @@ public:
|
||||
|
||||
intersection_info_base(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
no_rescale_policy const& )
|
||||
UmbrellaStrategy const& umbrella_strategy)
|
||||
: m_range_p(range_p)
|
||||
, m_range_q(range_q)
|
||||
, m_side_calc(range_p, range_q, umbrella_strategy)
|
||||
@ -393,15 +161,14 @@ template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename TurnPoint,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy
|
||||
typename UmbrellaStrategy
|
||||
>
|
||||
class intersection_info
|
||||
: public intersection_info_base<UniqueSubRange1, UniqueSubRange2,
|
||||
TurnPoint, UmbrellaStrategy, RobustPolicy>
|
||||
TurnPoint, UmbrellaStrategy>
|
||||
{
|
||||
typedef intersection_info_base<UniqueSubRange1, UniqueSubRange2,
|
||||
TurnPoint, UmbrellaStrategy, RobustPolicy> base;
|
||||
TurnPoint, UmbrellaStrategy> base;
|
||||
|
||||
public:
|
||||
|
||||
@ -415,11 +182,9 @@ public:
|
||||
|
||||
intersection_info(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
: base(range_p, range_q, umbrella_strategy, robust_policy)
|
||||
UmbrellaStrategy const& umbrella_strategy)
|
||||
: base(range_p, range_q, umbrella_strategy)
|
||||
, m_umbrella_strategy(umbrella_strategy)
|
||||
, m_robust_policy(robust_policy)
|
||||
{}
|
||||
|
||||
inline result_type const& result() const { return base::m_result; }
|
||||
@ -530,7 +295,6 @@ private:
|
||||
}
|
||||
|
||||
UmbrellaStrategy const& m_umbrella_strategy;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
};
|
||||
|
||||
}} // namespace detail::overlay
|
||||
|
@ -3,9 +3,9 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2013-2020.
|
||||
// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -45,7 +45,6 @@ struct get_turn_info_linear_areal
|
||||
typename UniqueSubRange2,
|
||||
typename TurnInfo,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator
|
||||
>
|
||||
static inline OutputIterator apply(
|
||||
@ -53,18 +52,16 @@ struct get_turn_info_linear_areal
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo const& tp_model,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out)
|
||||
{
|
||||
typedef intersection_info
|
||||
<
|
||||
UniqueSubRange1, UniqueSubRange2,
|
||||
typename TurnInfo::point_type,
|
||||
UmbrellaStrategy,
|
||||
RobustPolicy
|
||||
UmbrellaStrategy
|
||||
> inters_info;
|
||||
|
||||
inters_info inters(range_p, range_q, umbrella_strategy, robust_policy);
|
||||
inters_info inters(range_p, range_q, umbrella_strategy);
|
||||
|
||||
char const method = inters.d_info().how;
|
||||
|
||||
@ -388,9 +385,6 @@ struct get_turn_info_linear_areal
|
||||
break;
|
||||
default :
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
|
||||
std::cout << "TURN: Unknown method: " << method << std::endl;
|
||||
#endif
|
||||
#if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW)
|
||||
BOOST_THROW_EXCEPTION(turn_info_exception(method));
|
||||
#endif
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2013, 2014, 2015, 2017, 2018.
|
||||
// Modifications copyright (c) 2013-2018 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -39,7 +40,6 @@ struct get_turn_info_linear_linear
|
||||
typename UniqueSubRange2,
|
||||
typename TurnInfo,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator
|
||||
>
|
||||
static inline OutputIterator apply(
|
||||
@ -47,18 +47,16 @@ struct get_turn_info_linear_linear
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo const& tp_model,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out)
|
||||
{
|
||||
typedef intersection_info
|
||||
<
|
||||
UniqueSubRange1, UniqueSubRange2,
|
||||
typename TurnInfo::point_type,
|
||||
UmbrellaStrategy,
|
||||
RobustPolicy
|
||||
UmbrellaStrategy
|
||||
> inters_info;
|
||||
|
||||
inters_info inters(range_p, range_q, umbrella_strategy, robust_policy);
|
||||
inters_info inters(range_p, range_q, umbrella_strategy);
|
||||
|
||||
char const method = inters.d_info().how;
|
||||
|
||||
@ -457,9 +455,6 @@ struct get_turn_info_linear_linear
|
||||
break;
|
||||
default :
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
|
||||
std::cout << "TURN: Unknown method: " << method << std::endl;
|
||||
#endif
|
||||
#if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW)
|
||||
BOOST_THROW_EXCEPTION(turn_info_exception(method));
|
||||
#endif
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2014-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -33,7 +34,6 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/segment_identifier.hpp>
|
||||
#include <boost/geometry/algorithms/detail/partition.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/algorithms/detail/sections/range_by_section.hpp>
|
||||
#include <boost/geometry/algorithms/detail/sections/section_box_policies.hpp>
|
||||
#include <boost/geometry/algorithms/detail/sections/section_functions.hpp>
|
||||
@ -103,8 +103,7 @@ template
|
||||
typename Section,
|
||||
typename Point,
|
||||
typename CircularIterator,
|
||||
typename Strategy,
|
||||
typename RobustPolicy
|
||||
typename Strategy
|
||||
>
|
||||
struct unique_sub_range_from_section
|
||||
{
|
||||
@ -113,8 +112,7 @@ struct unique_sub_range_from_section
|
||||
unique_sub_range_from_section(Section const& section, signed_size_type index,
|
||||
CircularIterator circular_iterator,
|
||||
Point const& previous, Point const& current,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
Strategy const& strategy)
|
||||
: m_section(section)
|
||||
, m_index(index)
|
||||
, m_previous_point(previous)
|
||||
@ -122,7 +120,6 @@ struct unique_sub_range_from_section
|
||||
, m_circular_iterator(circular_iterator)
|
||||
, m_next_point_retrieved(false)
|
||||
, m_strategy(strategy)
|
||||
, m_robust_policy(robust_policy)
|
||||
{}
|
||||
|
||||
inline bool is_first_segment() const
|
||||
@ -165,13 +162,6 @@ private :
|
||||
|
||||
inline void advance_to_non_duplicate_next(Point const& current, CircularIterator& circular_iterator) const
|
||||
{
|
||||
using box_point_type = typename geometry::point_type<typename Section::box_type>::type;
|
||||
using robust_point_type = typename robust_point_type<box_point_type, RobustPolicy>::type;
|
||||
robust_point_type current_robust_point;
|
||||
robust_point_type next_robust_point;
|
||||
geometry::recalculate(current_robust_point, current, m_robust_policy);
|
||||
geometry::recalculate(next_robust_point, *circular_iterator, m_robust_policy);
|
||||
|
||||
// To see where the next segments bend to, in case of touch/intersections
|
||||
// on end points, we need (in case of degenerate/duplicate points) an extra
|
||||
// iterator which moves to the REAL next point, so non duplicate.
|
||||
@ -182,12 +172,10 @@ private :
|
||||
// So advance to the "non duplicate next"
|
||||
// (the check is defensive, to avoid endless loops)
|
||||
std::size_t check = 0;
|
||||
while (! detail::disjoint::disjoint_point_point(
|
||||
current_robust_point, next_robust_point, m_strategy)
|
||||
while (! detail::disjoint::disjoint_point_point(current, *circular_iterator, m_strategy)
|
||||
&& check++ < m_section.range_count)
|
||||
{
|
||||
circular_iterator++;
|
||||
geometry::recalculate(next_robust_point, *circular_iterator, m_robust_policy);
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +186,6 @@ private :
|
||||
mutable CircularIterator m_circular_iterator;
|
||||
mutable bool m_next_point_retrieved;
|
||||
Strategy m_strategy;
|
||||
RobustPolicy m_robust_policy;
|
||||
};
|
||||
|
||||
template
|
||||
@ -252,13 +239,12 @@ class get_turns_in_sections
|
||||
|
||||
public :
|
||||
// Returns true if terminated, false if interrupted
|
||||
template <typename Strategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename Strategy, typename Turns, typename InterruptPolicy>
|
||||
static inline bool apply(
|
||||
int source_id1, Geometry1 const& geometry1, Section1 const& sec1,
|
||||
int source_id2, Geometry2 const& geometry2, Section2 const& sec2,
|
||||
bool skip_larger, bool skip_adjacent,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy)
|
||||
{
|
||||
@ -294,7 +280,7 @@ public :
|
||||
range1_iterator prev1, it1, end1;
|
||||
|
||||
get_start_point_iterator(sec1, view1, prev1, it1, end1,
|
||||
index1, ndi1, dir1, sec2.bounding_box, robust_policy);
|
||||
index1, ndi1, dir1, sec2.bounding_box);
|
||||
|
||||
// We need a circular iterator because it might run through the closing point.
|
||||
// One circle is actually enough but this one is just convenient.
|
||||
@ -305,17 +291,17 @@ public :
|
||||
// section 2: [--------------]
|
||||
// section 1: |----|---|---|---|---|
|
||||
for (prev1 = it1++, next1++;
|
||||
it1 != end1 && ! detail::section::exceeding<0>(dir1, *prev1, sec1.bounding_box, sec2.bounding_box, robust_policy);
|
||||
it1 != end1 && ! detail::section::exceeding<0>(dir1, *prev1, sec1.bounding_box, sec2.bounding_box);
|
||||
++prev1, ++it1, ++index1, ++next1, ++ndi1)
|
||||
{
|
||||
unique_sub_range_from_section
|
||||
<
|
||||
areal1, Section1, point1_type, circular1_iterator,
|
||||
Strategy, RobustPolicy
|
||||
Strategy
|
||||
> unique_sub_range1(sec1, index1,
|
||||
circular1_iterator(begin_range_1, end_range_1, next1, true),
|
||||
*prev1, *it1,
|
||||
strategy, robust_policy);
|
||||
strategy);
|
||||
|
||||
signed_size_type index2 = sec2.begin_index;
|
||||
signed_size_type ndi2 = sec2.non_duplicate_index;
|
||||
@ -323,12 +309,12 @@ public :
|
||||
range2_iterator prev2, it2, end2;
|
||||
|
||||
get_start_point_iterator(sec2, view2, prev2, it2, end2,
|
||||
index2, ndi2, dir2, sec1.bounding_box, robust_policy);
|
||||
index2, ndi2, dir2, sec1.bounding_box);
|
||||
circular2_iterator next2(begin_range_2, end_range_2, it2, true);
|
||||
next2++;
|
||||
|
||||
for (prev2 = it2++, next2++;
|
||||
it2 != end2 && ! detail::section::exceeding<0>(dir2, *prev2, sec2.bounding_box, sec1.bounding_box, robust_policy);
|
||||
it2 != end2 && ! detail::section::exceeding<0>(dir2, *prev2, sec2.bounding_box, sec1.bounding_box);
|
||||
++prev2, ++it2, ++index2, ++next2, ++ndi2)
|
||||
{
|
||||
bool skip = false;
|
||||
@ -364,11 +350,11 @@ public :
|
||||
unique_sub_range_from_section
|
||||
<
|
||||
areal2, Section2, point2_type, circular2_iterator,
|
||||
Strategy, RobustPolicy
|
||||
Strategy
|
||||
> unique_sub_range2(sec2, index2,
|
||||
circular2_iterator(begin_range_2, end_range_2, next2),
|
||||
*prev2, *it2,
|
||||
strategy, robust_policy);
|
||||
strategy);
|
||||
|
||||
typedef typename boost::range_value<Turns>::type turn_info;
|
||||
|
||||
@ -383,7 +369,7 @@ public :
|
||||
std::size_t const size_before = boost::size(turns);
|
||||
|
||||
TurnPolicy::apply(unique_sub_range1, unique_sub_range2,
|
||||
ti, strategy, robust_policy,
|
||||
ti, strategy,
|
||||
std::back_inserter(turns));
|
||||
|
||||
if (InterruptPolicy::enabled)
|
||||
@ -410,14 +396,14 @@ private :
|
||||
// because of the logistics of "index" (the section-iterator automatically
|
||||
// skips to the begin-point, we loose the index or have to recalculate it)
|
||||
// So we mimic it here
|
||||
template <typename Range, typename Section, typename Box, typename RobustPolicy>
|
||||
template <typename Range, typename Section, typename Box>
|
||||
static inline void get_start_point_iterator(Section const& section,
|
||||
Range const& range,
|
||||
typename boost::range_iterator<Range const>::type& it,
|
||||
typename boost::range_iterator<Range const>::type& prev,
|
||||
typename boost::range_iterator<Range const>::type& end,
|
||||
signed_size_type& index, signed_size_type& ndi,
|
||||
int dir, Box const& other_bounding_box, RobustPolicy const& robust_policy)
|
||||
int dir, Box const& other_bounding_box)
|
||||
{
|
||||
it = boost::begin(range) + section.begin_index;
|
||||
end = boost::begin(range) + section.end_index + 1;
|
||||
@ -425,7 +411,7 @@ private :
|
||||
// Mimic section-iterator:
|
||||
// Skip to point such that section interects other box
|
||||
prev = it++;
|
||||
for(; it != end && detail::section::preceding<0>(dir, *it, section.bounding_box, other_bounding_box, robust_policy);
|
||||
for(; it != end && detail::section::preceding<0>(dir, *it, section.bounding_box, other_bounding_box);
|
||||
prev = it++, index++, ndi++)
|
||||
{}
|
||||
// Go back one step because we want to start completely preceding
|
||||
@ -439,7 +425,6 @@ template
|
||||
bool Reverse1, bool Reverse2,
|
||||
typename TurnPolicy,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename InterruptPolicy
|
||||
>
|
||||
@ -450,20 +435,17 @@ struct section_visitor
|
||||
int m_source_id2;
|
||||
Geometry2 const& m_geometry2;
|
||||
Strategy const& m_strategy;
|
||||
RobustPolicy const& m_rescale_policy;
|
||||
Turns& m_turns;
|
||||
InterruptPolicy& m_interrupt_policy;
|
||||
|
||||
section_visitor(int id1, Geometry1 const& g1,
|
||||
int id2, Geometry2 const& g2,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& ip)
|
||||
: m_source_id1(id1), m_geometry1(g1)
|
||||
, m_source_id2(id2), m_geometry2(g2)
|
||||
, m_strategy(strategy)
|
||||
, m_rescale_policy(robust_policy)
|
||||
, m_turns(turns)
|
||||
, m_interrupt_policy(ip)
|
||||
{}
|
||||
@ -487,7 +469,6 @@ struct section_visitor
|
||||
m_source_id2, m_geometry2, sec2,
|
||||
false, false,
|
||||
m_strategy,
|
||||
m_rescale_policy,
|
||||
m_turns, m_interrupt_policy);
|
||||
}
|
||||
return true;
|
||||
@ -505,12 +486,11 @@ class get_turns_generic
|
||||
{
|
||||
|
||||
public:
|
||||
template <typename Strategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename Strategy, typename Turns, typename InterruptPolicy>
|
||||
static inline void apply(
|
||||
int source_id1, Geometry1 const& geometry1,
|
||||
int source_id2, Geometry2 const& geometry2,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy)
|
||||
{
|
||||
@ -518,21 +498,15 @@ public:
|
||||
typedef typename boost::range_value<Turns>::type ip_type;
|
||||
typedef typename ip_type::point_type point_type;
|
||||
|
||||
typedef model::box
|
||||
<
|
||||
typename geometry::robust_point_type
|
||||
<
|
||||
point_type, RobustPolicy
|
||||
>::type
|
||||
> box_type;
|
||||
typedef model::box<point_type> box_type;
|
||||
typedef geometry::sections<box_type, 2> sections_type;
|
||||
|
||||
sections_type sec1, sec2;
|
||||
typedef std::integer_sequence<std::size_t, 0, 1> dimensions;
|
||||
|
||||
geometry::sectionalize<Reverse1, dimensions>(geometry1, robust_policy,
|
||||
geometry::sectionalize<Reverse1, dimensions>(geometry1,
|
||||
sec1, strategy, 0);
|
||||
geometry::sectionalize<Reverse2, dimensions>(geometry2, robust_policy,
|
||||
geometry::sectionalize<Reverse2, dimensions>(geometry2,
|
||||
sec2, strategy, 1);
|
||||
|
||||
// ... and then partition them, intersecting overlapping sections in visitor method
|
||||
@ -541,10 +515,10 @@ public:
|
||||
Geometry1, Geometry2,
|
||||
Reverse1, Reverse2,
|
||||
TurnPolicy,
|
||||
Strategy, RobustPolicy,
|
||||
Strategy,
|
||||
Turns, InterruptPolicy
|
||||
> visitor(source_id1, geometry1, source_id2, geometry2,
|
||||
strategy, robust_policy, turns, interrupt_policy);
|
||||
strategy, turns, interrupt_policy);
|
||||
|
||||
geometry::partition
|
||||
<
|
||||
@ -643,12 +617,11 @@ struct get_turns_cs
|
||||
ever_circling_iterator<iterator_type> m_circular_iterator;
|
||||
};
|
||||
|
||||
template <typename IntersectionStrategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename IntersectionStrategy, typename Turns, typename InterruptPolicy>
|
||||
static inline void apply(
|
||||
int source_id1, Range const& range,
|
||||
int source_id2, Box const& box,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy,
|
||||
signed_size_type multi_index = -1,
|
||||
@ -683,7 +656,6 @@ struct get_turns_cs
|
||||
view_unique_sub_range,
|
||||
box_points,
|
||||
intersection_strategy,
|
||||
robust_policy,
|
||||
turns,
|
||||
interrupt_policy);
|
||||
// Future performance enhancement:
|
||||
@ -697,14 +669,12 @@ private:
|
||||
<
|
||||
typename IntersectionStrategy,
|
||||
typename Turns,
|
||||
typename InterruptPolicy,
|
||||
typename RobustPolicy
|
||||
typename InterruptPolicy
|
||||
>
|
||||
static inline void get_turns_with_box(segment_identifier const& seg_id, int source_id2,
|
||||
unique_sub_range_from_view_policy const& range_unique_sub_range,
|
||||
box_array const& box,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
// Output
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy)
|
||||
@ -721,25 +691,25 @@ private:
|
||||
unique_sub_range_from_box_policy box_unique_sub_range(box);
|
||||
ti.operations[1].seg_id = segment_identifier(source_id2, -1, -1, 0);
|
||||
TurnPolicy::apply(range_unique_sub_range, box_unique_sub_range,
|
||||
ti, intersection_strategy, robust_policy,
|
||||
ti, intersection_strategy,
|
||||
std::back_inserter(turns));
|
||||
|
||||
ti.operations[1].seg_id = segment_identifier(source_id2, -1, -1, 1);
|
||||
box_unique_sub_range.next();
|
||||
TurnPolicy::apply(range_unique_sub_range, box_unique_sub_range,
|
||||
ti, intersection_strategy, robust_policy,
|
||||
ti, intersection_strategy,
|
||||
std::back_inserter(turns));
|
||||
|
||||
ti.operations[1].seg_id = segment_identifier(source_id2, -1, -1, 2);
|
||||
box_unique_sub_range.next();
|
||||
TurnPolicy::apply(range_unique_sub_range, box_unique_sub_range,
|
||||
ti, intersection_strategy, robust_policy,
|
||||
ti, intersection_strategy,
|
||||
std::back_inserter(turns));
|
||||
|
||||
ti.operations[1].seg_id = segment_identifier(source_id2, -1, -1, 3);
|
||||
box_unique_sub_range.next();
|
||||
TurnPolicy::apply(range_unique_sub_range, box_unique_sub_range,
|
||||
ti, intersection_strategy, robust_policy,
|
||||
ti, intersection_strategy,
|
||||
std::back_inserter(turns));
|
||||
|
||||
if (InterruptPolicy::enabled)
|
||||
@ -760,12 +730,11 @@ template
|
||||
>
|
||||
struct get_turns_polygon_cs
|
||||
{
|
||||
template <typename IntersectionStrategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename IntersectionStrategy, typename Turns, typename InterruptPolicy>
|
||||
static inline void apply(
|
||||
int source_id1, Polygon const& polygon,
|
||||
int source_id2, Box const& box,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy,
|
||||
signed_size_type multi_index = -1)
|
||||
@ -783,7 +752,6 @@ struct get_turns_polygon_cs
|
||||
source_id1, geometry::exterior_ring(polygon),
|
||||
source_id2, box,
|
||||
intersection_strategy,
|
||||
robust_policy,
|
||||
turns,
|
||||
interrupt_policy,
|
||||
multi_index, -1);
|
||||
@ -797,7 +765,6 @@ struct get_turns_polygon_cs
|
||||
source_id1, *it,
|
||||
source_id2, box,
|
||||
intersection_strategy,
|
||||
robust_policy,
|
||||
turns, interrupt_policy,
|
||||
multi_index, i);
|
||||
}
|
||||
@ -814,12 +781,11 @@ template
|
||||
>
|
||||
struct get_turns_multi_polygon_cs
|
||||
{
|
||||
template <typename IntersectionStrategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename IntersectionStrategy, typename Turns, typename InterruptPolicy>
|
||||
static inline void apply(
|
||||
int source_id1, Multi const& multi,
|
||||
int source_id2, Box const& box,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy)
|
||||
{
|
||||
@ -833,7 +799,7 @@ struct get_turns_multi_polygon_cs
|
||||
Reverse, ReverseBox,
|
||||
TurnPolicy
|
||||
>::apply(source_id1, *it, source_id2, box,
|
||||
intersection_strategy, robust_policy,
|
||||
intersection_strategy,
|
||||
turns, interrupt_policy, i);
|
||||
}
|
||||
}
|
||||
@ -986,11 +952,10 @@ template
|
||||
>
|
||||
struct get_turns_reversed
|
||||
{
|
||||
template <typename Strategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename Strategy, typename Turns, typename InterruptPolicy>
|
||||
static inline void apply(int source_id1, Geometry1 const& g1,
|
||||
int source_id2, Geometry2 const& g2,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy)
|
||||
{
|
||||
@ -1001,7 +966,7 @@ struct get_turns_reversed
|
||||
Reverse2, Reverse1,
|
||||
TurnPolicy
|
||||
>::apply(source_id2, g2, source_id1, g1,
|
||||
strategy, robust_policy,
|
||||
strategy,
|
||||
turns, interrupt_policy);
|
||||
}
|
||||
};
|
||||
@ -1021,7 +986,6 @@ struct get_turns_reversed
|
||||
\param geometry1 \param_geometry
|
||||
\param geometry2 \param_geometry
|
||||
\param intersection_strategy segments intersection strategy
|
||||
\param robust_policy policy to handle robustness issues
|
||||
\param turns container which will contain turn points
|
||||
\param interrupt_policy policy determining if process is stopped
|
||||
when intersection is found
|
||||
@ -1033,14 +997,12 @@ template
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename InterruptPolicy
|
||||
>
|
||||
inline void get_turns(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy)
|
||||
{
|
||||
@ -1071,7 +1033,6 @@ inline void get_turns(Geometry1 const& geometry1,
|
||||
>::apply(0, geometry1,
|
||||
1, geometry2,
|
||||
strategy,
|
||||
robust_policy,
|
||||
turns, interrupt_policy);
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -315,16 +316,14 @@ template
|
||||
typename Geometry0,
|
||||
typename Geometry1,
|
||||
typename Turns,
|
||||
typename Clusters,
|
||||
typename RobustPolicy
|
||||
typename Clusters
|
||||
>
|
||||
inline bool handle_colocations(Turns& turns, Clusters& clusters,
|
||||
RobustPolicy const& robust_policy)
|
||||
inline bool handle_colocations(Turns& turns, Clusters& clusters)
|
||||
{
|
||||
static const detail::overlay::operation_type target_operation
|
||||
= detail::overlay::operation_from_overlay<OverlayType>::value;
|
||||
|
||||
get_clusters(turns, clusters, robust_policy);
|
||||
get_clusters(turns, clusters);
|
||||
|
||||
if (clusters.empty())
|
||||
{
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
@ -45,10 +45,6 @@
|
||||
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
|
||||
#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
|
||||
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/relate/services.hpp>
|
||||
@ -75,22 +71,13 @@ struct intersection_segment_segment_point
|
||||
template
|
||||
<
|
||||
typename Segment1, typename Segment2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Segment1 const& segment1,
|
||||
Segment2 const& segment2,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
// Make sure this is only called with no rescaling
|
||||
BOOST_STATIC_ASSERT((std::is_same
|
||||
<
|
||||
no_rescale_policy_tag,
|
||||
typename rescale_policy_type<RobustPolicy>::type
|
||||
>::value));
|
||||
|
||||
typedef typename point_type<PointOut>::type point_type;
|
||||
|
||||
// Get the intersection point (or two points)
|
||||
@ -123,28 +110,19 @@ struct intersection_linestring_linestring_point
|
||||
template
|
||||
<
|
||||
typename Linestring1, typename Linestring2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Linestring1 const& linestring1,
|
||||
Linestring2 const& linestring2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
// Make sure this is only called with no rescaling
|
||||
BOOST_STATIC_ASSERT((std::is_same
|
||||
<
|
||||
no_rescale_policy_tag,
|
||||
typename rescale_policy_type<RobustPolicy>::type
|
||||
>::value));
|
||||
|
||||
typedef detail::overlay::turn_info<PointOut> turn_info;
|
||||
std::deque<turn_info> turns;
|
||||
|
||||
geometry::get_intersection_points(linestring1, linestring2,
|
||||
robust_policy, turns, strategy);
|
||||
turns, strategy);
|
||||
|
||||
for (auto const& turn : turns)
|
||||
{
|
||||
@ -281,21 +259,12 @@ struct intersection_of_linestring_with_areal
|
||||
template
|
||||
<
|
||||
typename LineString, typename Areal,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(LineString const& linestring, Areal const& areal,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
// Make sure this is only called with no rescaling
|
||||
BOOST_STATIC_ASSERT((std::is_same
|
||||
<
|
||||
no_rescale_policy_tag,
|
||||
typename rescale_policy_type<RobustPolicy>::type
|
||||
>::value));
|
||||
|
||||
if (boost::size(linestring) == 0)
|
||||
{
|
||||
return out;
|
||||
@ -356,7 +325,7 @@ struct intersection_of_linestring_with_areal
|
||||
(OverlayType == overlay_intersection ? ReverseAreal : !ReverseAreal),
|
||||
turn_policy
|
||||
>::apply(0, linestring, 1, areal,
|
||||
strategy, robust_policy,
|
||||
strategy,
|
||||
turns, policy);
|
||||
|
||||
int inside_value = 0;
|
||||
@ -390,7 +359,7 @@ struct intersection_of_linestring_with_areal
|
||||
(
|
||||
linestring, areal,
|
||||
geometry::detail::overlay::operation_intersection,
|
||||
turns, robust_policy, out, strategy
|
||||
turns, out, strategy
|
||||
);
|
||||
}
|
||||
};
|
||||
@ -414,20 +383,18 @@ struct intersection_areal_areal_point
|
||||
template
|
||||
<
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
typedef detail::overlay::turn_info
|
||||
<
|
||||
PointOut,
|
||||
typename segment_ratio_type<PointOut, RobustPolicy>::type
|
||||
typename segment_ratio_type<PointOut>::type
|
||||
> turn_info;
|
||||
std::vector<turn_info> turns;
|
||||
|
||||
@ -436,7 +403,7 @@ struct intersection_areal_areal_point
|
||||
geometry::get_turns
|
||||
<
|
||||
false, false, detail::overlay::assign_null_policy
|
||||
>(geometry1, geometry2, strategy, robust_policy, turns, policy);
|
||||
>(geometry1, geometry2, strategy, turns, policy);
|
||||
|
||||
return intersection_output_turn_points(turns, out);
|
||||
}
|
||||
@ -448,23 +415,14 @@ struct intersection_linear_areal_point
|
||||
template
|
||||
<
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
// Make sure this is only called with no rescaling
|
||||
BOOST_STATIC_ASSERT((std::is_same
|
||||
<
|
||||
no_rescale_policy_tag,
|
||||
typename rescale_policy_type<RobustPolicy>::type
|
||||
>::value));
|
||||
|
||||
typedef geometry::segment_ratio<typename geometry::coordinate_type<PointOut>::type> ratio_type;
|
||||
|
||||
typedef detail::overlay::turn_info
|
||||
@ -497,7 +455,7 @@ struct intersection_linear_areal_point
|
||||
false,
|
||||
turn_policy
|
||||
>::apply(0, geometry1, 1, geometry2,
|
||||
strategy, robust_policy,
|
||||
strategy,
|
||||
turns, interrupt_policy);
|
||||
|
||||
return intersection_output_turn_points(turns, out);
|
||||
@ -510,20 +468,18 @@ struct intersection_areal_linear_point
|
||||
template
|
||||
<
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return intersection_linear_areal_point
|
||||
<
|
||||
PointOut
|
||||
>::apply(geometry2, geometry1, robust_policy, out, strategy);
|
||||
>::apply(geometry2, geometry1, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -670,16 +626,15 @@ struct intersection_insert
|
||||
linear_tag, areal_tag, linear_tag
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Linestring const& linestring,
|
||||
Box const& box,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out, Strategy const& )
|
||||
{
|
||||
typedef typename point_type<GeometryOut>::type point_type;
|
||||
strategy::intersection::liang_barsky<Box, point_type> lb_strategy;
|
||||
return detail::intersection::clip_range_with_box
|
||||
<GeometryOut>(box, linestring, robust_policy, out, lb_strategy);
|
||||
<GeometryOut>(box, linestring, out, lb_strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -750,10 +705,9 @@ struct intersection_insert
|
||||
linear_tag, areal_tag, linear_tag
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Segment const& segment,
|
||||
Box const& box,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out, Strategy const& )
|
||||
{
|
||||
geometry::segment_view<Segment> range(segment);
|
||||
@ -761,7 +715,7 @@ struct intersection_insert
|
||||
typedef typename point_type<GeometryOut>::type point_type;
|
||||
strategy::intersection::liang_barsky<Box, point_type> lb_strategy;
|
||||
return detail::intersection::clip_range_with_box
|
||||
<GeometryOut>(box, range, robust_policy, out, lb_strategy);
|
||||
<GeometryOut>(box, range, out, lb_strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -842,10 +796,9 @@ template
|
||||
>
|
||||
struct intersection_insert_reversed
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Geometry1 const& g1,
|
||||
Geometry2 const& g2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -854,7 +807,7 @@ struct intersection_insert_reversed
|
||||
Geometry2, Geometry1, GeometryOut,
|
||||
OverlayType,
|
||||
Reverse2, Reverse1
|
||||
>::apply(g2, g1, robust_policy, out, strategy);
|
||||
>::apply(g2, g1, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -879,11 +832,10 @@ struct intersection_insert
|
||||
{
|
||||
template
|
||||
<
|
||||
typename RobustPolicy, typename OutputIterator, typename Strategy
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -896,7 +848,7 @@ struct intersection_insert
|
||||
detail::boundary_view<Geometry2 const>,
|
||||
LinestringOut,
|
||||
overlay_intersection
|
||||
>::apply(view1, view2, robust_policy, oit, strategy);
|
||||
>::apply(view1, view2, oit, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -951,18 +903,17 @@ struct intersection_insert
|
||||
// iterators in OutputIterators tuple/pair.
|
||||
template
|
||||
<
|
||||
typename RobustPolicy, typename OutputIterators, typename Strategy
|
||||
typename OutputIterators, typename Strategy
|
||||
>
|
||||
static inline OutputIterators apply(Linear1 const& linear1,
|
||||
Linear2 const& linear2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterators oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return detail::overlay::linear_linear_linestring
|
||||
<
|
||||
Linear1, Linear2, TupledOut, OverlayType
|
||||
>::apply(linear1, linear2, robust_policy, oit, strategy);
|
||||
>::apply(linear1, linear2, oit, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1065,11 +1016,10 @@ struct intersection_insert
|
||||
// of iterators in OutputIterators tuple/pair.
|
||||
template
|
||||
<
|
||||
typename RobustPolicy, typename OutputIterators, typename Strategy
|
||||
typename OutputIterators, typename Strategy
|
||||
>
|
||||
static inline OutputIterators apply(PointLike1 const& pointlike1,
|
||||
PointLike2 const& pointlike2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterators oits,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -1088,7 +1038,7 @@ struct intersection_insert
|
||||
out_point_index, TupledOut
|
||||
>::type,
|
||||
OverlayType
|
||||
>::apply(pointlike1, pointlike2, robust_policy,
|
||||
>::apply(pointlike1, pointlike2,
|
||||
bgt::get<out_point_index>(oits),
|
||||
strategy);
|
||||
|
||||
@ -1156,10 +1106,9 @@ struct intersection_insert
|
||||
linear_tag, pointlike_tag, pointlike_tag
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Linestring const& linestring,
|
||||
MultiPoint const& multipoint,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -1167,7 +1116,7 @@ struct intersection_insert
|
||||
<
|
||||
MultiPoint, Linestring, PointOut, overlay_intersection,
|
||||
multi_point_tag, linear_tag
|
||||
>::apply(multipoint, linestring, robust_policy, out, strategy);
|
||||
>::apply(multipoint, linestring, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1212,17 +1161,16 @@ struct intersection_insert
|
||||
linear_tag, pointlike_tag, detail::tupled_output_tag
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterators, typename Strategy>
|
||||
template <typename OutputIterators, typename Strategy>
|
||||
static inline OutputIterators apply(Linestring const& linestring,
|
||||
MultiPoint const& multipoint,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterators out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return intersection_insert
|
||||
<
|
||||
MultiPoint, Linestring, TupledOut, overlay_intersection
|
||||
>::apply(multipoint, linestring, robust_policy, out, strategy);
|
||||
>::apply(multipoint, linestring, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1284,10 +1232,9 @@ struct intersection_insert
|
||||
areal_tag, pointlike_tag, pointlike_tag
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Areal const& areal,
|
||||
MultiPoint const& multipoint,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -1295,7 +1242,7 @@ struct intersection_insert
|
||||
<
|
||||
MultiPoint, Areal, PointOut, overlay_intersection,
|
||||
multi_point_tag, ArealTag
|
||||
>::apply(multipoint, areal, robust_policy, out, strategy);
|
||||
>::apply(multipoint, areal, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1341,17 +1288,16 @@ struct intersection_insert
|
||||
areal_tag, pointlike_tag, detail::tupled_output_tag
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterators, typename Strategy>
|
||||
template <typename OutputIterators, typename Strategy>
|
||||
static inline OutputIterators apply(Areal const& areal,
|
||||
MultiPoint const& multipoint,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterators out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return intersection_insert
|
||||
<
|
||||
MultiPoint, Areal, TupledOut, overlay_intersection
|
||||
>::apply(multipoint, areal, robust_policy, out, strategy);
|
||||
>::apply(multipoint, areal, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1420,13 +1366,11 @@ template
|
||||
bool ReverseSecond,
|
||||
overlay_type OverlayType,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
inline OutputIterator insert(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -1449,7 +1393,7 @@ inline OutputIterator insert(Geometry1 const& geometry1,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry2>::value, ReverseSecond>::value
|
||||
>
|
||||
>::apply(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>::apply(geometry1, geometry2, out, strategy);
|
||||
}
|
||||
|
||||
|
||||
@ -1488,21 +1432,10 @@ inline OutputIterator intersection_insert(Geometry1 const& geometry1,
|
||||
concepts::check<Geometry1 const>();
|
||||
concepts::check<Geometry2 const>();
|
||||
|
||||
typedef typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename Strategy::cs_tag
|
||||
>::type rescale_policy_type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
geometry1, geometry2, strategy);
|
||||
|
||||
return detail::intersection::insert
|
||||
<
|
||||
GeometryOut, false, overlay_intersection
|
||||
>(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>(geometry1, geometry2, out, strategy);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -65,7 +65,6 @@ template
|
||||
typename Turns,
|
||||
typename Indexed,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename Strategy,
|
||||
bool Reverse1, bool Reverse2
|
||||
>
|
||||
@ -74,12 +73,10 @@ struct less_by_segment_ratio
|
||||
inline less_by_segment_ratio(Turns const& turns
|
||||
, Geometry1 const& geometry1
|
||||
, Geometry2 const& geometry2
|
||||
, RobustPolicy const& robust_policy
|
||||
, Strategy const& strategy)
|
||||
: m_turns(turns)
|
||||
, m_geometry1(geometry1)
|
||||
, m_geometry2(geometry2)
|
||||
, m_robust_policy(robust_policy)
|
||||
, m_strategy(strategy)
|
||||
{
|
||||
}
|
||||
@ -89,7 +86,6 @@ private :
|
||||
Turns const& m_turns;
|
||||
Geometry1 const& m_geometry1;
|
||||
Geometry2 const& m_geometry2;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
Strategy const& m_strategy;
|
||||
|
||||
typedef typename geometry::point_type<Geometry1>::type point_type;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2022, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -145,14 +146,12 @@ protected:
|
||||
typename Turns,
|
||||
typename LinearGeometry1,
|
||||
typename LinearGeometry2,
|
||||
typename Strategy,
|
||||
typename RobustPolicy
|
||||
typename Strategy
|
||||
>
|
||||
static inline void compute_turns(Turns& turns,
|
||||
LinearGeometry1 const& linear1,
|
||||
LinearGeometry2 const& linear2,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
Strategy const& strategy)
|
||||
{
|
||||
turns.clear();
|
||||
|
||||
@ -168,7 +167,7 @@ protected:
|
||||
LinearGeometry2,
|
||||
assign_policy
|
||||
>
|
||||
>::apply(turns, linear1, linear2, interrupt_policy, strategy, robust_policy);
|
||||
>::apply(turns, linear1, linear2, interrupt_policy, strategy);
|
||||
}
|
||||
|
||||
|
||||
@ -221,11 +220,10 @@ protected:
|
||||
public:
|
||||
template
|
||||
<
|
||||
typename RobustPolicy, typename OutputIterator, typename Strategy
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Linear1 const& linear1,
|
||||
Linear2 const& linear2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -239,12 +237,12 @@ public:
|
||||
Linear2,
|
||||
assign_policy
|
||||
>
|
||||
>::template turn_info_type<Strategy, RobustPolicy>::type turn_info;
|
||||
>::template turn_info_type<Strategy>::type turn_info;
|
||||
|
||||
typedef std::vector<turn_info> turns_container;
|
||||
|
||||
turns_container turns;
|
||||
compute_turns(turns, linear1, linear2, strategy, robust_policy);
|
||||
compute_turns(turns, linear1, linear2, strategy);
|
||||
|
||||
if ( turns.empty() )
|
||||
{
|
||||
@ -289,11 +287,10 @@ struct linear_linear_linestring
|
||||
{
|
||||
template
|
||||
<
|
||||
typename RobustPolicy, typename OutputIterator, typename Strategy
|
||||
typename OutputIterator, typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Linear1 const& linear1,
|
||||
Linear2 const& linear2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -310,7 +307,7 @@ struct linear_linear_linestring
|
||||
Linear2, Linear1, LinestringOut, overlay_difference,
|
||||
EnableFilterContinueTurns, EnableRemoveDuplicateTurns,
|
||||
EnableDegenerateTurns, EnableFollowIsolatedPoints
|
||||
>::apply(linear2, linear1, robust_policy, oit, strategy);
|
||||
>::apply(linear2, linear1, oit, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland
|
||||
|
||||
// This file was modified by Oracle on 2015-2020.
|
||||
// Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -35,8 +36,6 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/is_empty.hpp>
|
||||
#include <boost/geometry/algorithms/reverse.hpp>
|
||||
|
||||
@ -46,8 +45,6 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/select_rings.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/do_reverse.hpp>
|
||||
|
||||
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
|
||||
@ -232,10 +229,9 @@ template
|
||||
>
|
||||
struct overlay
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy, typename Visitor>
|
||||
template <typename OutputIterator, typename Strategy, typename Visitor>
|
||||
static inline OutputIterator apply(
|
||||
Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy,
|
||||
Visitor& visitor)
|
||||
@ -260,7 +256,7 @@ struct overlay
|
||||
typedef detail::overlay::traversal_turn_info
|
||||
<
|
||||
point_type,
|
||||
typename segment_ratio_type<point_type, RobustPolicy>::type
|
||||
typename segment_ratio_type<point_type>::type
|
||||
> turn_info;
|
||||
typedef std::deque<turn_info> turn_container_type;
|
||||
|
||||
@ -284,7 +280,7 @@ std::cout << "get turns" << std::endl;
|
||||
<
|
||||
Reverse1, Reverse2,
|
||||
assign_policy_only_start_turns
|
||||
>(geometry1, geometry2, strategy, robust_policy, turns, policy);
|
||||
>(geometry1, geometry2, strategy, turns, policy);
|
||||
|
||||
visitor.visit_turns(1, turns);
|
||||
|
||||
@ -296,12 +292,12 @@ std::cout << "get turns" << std::endl;
|
||||
if (needs_self_turns<Geometry1>::apply(geometry1))
|
||||
{
|
||||
self_get_turn_points::self_turns<Reverse1, assign_policy_only_start_turns>(geometry1,
|
||||
strategy, robust_policy, turns, policy, 0);
|
||||
strategy, turns, policy, 0);
|
||||
}
|
||||
if (needs_self_turns<Geometry2>::apply(geometry2))
|
||||
{
|
||||
self_get_turn_points::self_turns<Reverse2, assign_policy_only_start_turns>(geometry2,
|
||||
strategy, robust_policy, turns, policy, 1);
|
||||
strategy, turns, policy, 1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -315,7 +311,7 @@ std::cout << "enrich" << std::endl;
|
||||
std::map<ring_identifier, ring_turn_info> turn_info_per_ring;
|
||||
|
||||
geometry::enrich_intersection_points<Reverse1, Reverse2, OverlayType>(
|
||||
turns, clusters, geometry1, geometry2, robust_policy, strategy);
|
||||
turns, clusters, geometry1, geometry2, strategy);
|
||||
|
||||
visitor.visit_turns(2, turns);
|
||||
|
||||
@ -332,7 +328,6 @@ std::cout << "traverse" << std::endl;
|
||||
(
|
||||
geometry1, geometry2,
|
||||
strategy,
|
||||
robust_policy,
|
||||
turns, rings,
|
||||
turn_info_per_ring,
|
||||
clusters,
|
||||
@ -390,15 +385,14 @@ std::cout << "traverse" << std::endl;
|
||||
);
|
||||
}
|
||||
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(
|
||||
Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
overlay_null_visitor visitor;
|
||||
return apply(geometry1, geometry2, robust_policy, out, strategy, visitor);
|
||||
return apply(geometry1, geometry2, out, strategy, visitor);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2020, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2020-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
@ -211,10 +211,9 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(MultiPoint const& multipoint,
|
||||
MultiPolygon const& multipolygon,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -233,7 +232,7 @@ public:
|
||||
return multipoint_multipoint_point
|
||||
<
|
||||
MultiPoint, point_vector_type, PointOut, OverlayType
|
||||
>::apply(multipoint, common_points, robust_policy, oit, strategy);
|
||||
>::apply(multipoint, common_points, oit, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2015-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2015-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -65,10 +65,9 @@ template
|
||||
>
|
||||
struct point_single_point
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Point const& point,
|
||||
Geometry const& geometry,
|
||||
RobustPolicy const&,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -91,10 +90,9 @@ template
|
||||
>
|
||||
struct multipoint_single_point
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(MultiPoint const& multipoint,
|
||||
Geometry const& geometry,
|
||||
RobustPolicy const&,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -269,10 +267,9 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(MultiPoint const& multipoint,
|
||||
Linear const& linear,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -291,7 +288,7 @@ public:
|
||||
return multipoint_multipoint_point
|
||||
<
|
||||
MultiPoint, point_vector_type, PointOut, OverlayType
|
||||
>::apply(multipoint, common_points, robust_policy, oit, strategy);
|
||||
>::apply(multipoint, common_points, oit, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2014-2023, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
@ -149,10 +149,9 @@ template
|
||||
>
|
||||
struct point_point_point
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Point1 const& point1,
|
||||
Point2 const& point2,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -183,10 +182,9 @@ template
|
||||
>
|
||||
struct multipoint_point_point
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(MultiPoint const& multipoint,
|
||||
Point const& point,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -217,10 +215,9 @@ template
|
||||
>
|
||||
struct point_multipoint_point
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Point const& point,
|
||||
MultiPoint const& multipoint,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -252,10 +249,9 @@ template
|
||||
>
|
||||
struct multipoint_multipoint_point
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(MultiPoint1 const& multipoint1,
|
||||
MultiPoint2 const& multipoint2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -268,7 +264,7 @@ struct multipoint_multipoint_point
|
||||
return multipoint_multipoint_point
|
||||
<
|
||||
MultiPoint2, MultiPoint1, PointOut, OverlayType
|
||||
>::apply(multipoint2, multipoint1, robust_policy, oit, strategy);
|
||||
>::apply(multipoint2, multipoint1, oit, strategy);
|
||||
}
|
||||
}
|
||||
|
||||
@ -414,10 +410,9 @@ template
|
||||
>
|
||||
struct union_pointlike_pointlike_point
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(PointLike1 const& pointlike1,
|
||||
PointLike2 const& pointlike2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator oit,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -428,7 +423,7 @@ struct union_pointlike_pointlike_point
|
||||
PointLike2, PointLike1, PointOut, overlay_difference,
|
||||
typename tag<PointLike2>::type,
|
||||
typename tag<PointLike1>::type
|
||||
>::apply(pointlike2, pointlike1, robust_policy, oit, strategy);
|
||||
>::apply(pointlike2, pointlike1, oit, strategy);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -36,7 +37,6 @@
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
@ -65,14 +65,12 @@ template
|
||||
typename Turns,
|
||||
typename TurnPolicy,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename InterruptPolicy
|
||||
>
|
||||
struct self_section_visitor
|
||||
{
|
||||
Geometry const& m_geometry;
|
||||
Strategy const& m_strategy;
|
||||
RobustPolicy const& m_rescale_policy;
|
||||
Turns& m_turns;
|
||||
InterruptPolicy& m_interrupt_policy;
|
||||
int m_source_index;
|
||||
@ -80,14 +78,12 @@ struct self_section_visitor
|
||||
|
||||
inline self_section_visitor(Geometry const& g,
|
||||
Strategy const& s,
|
||||
RobustPolicy const& rp,
|
||||
Turns& turns,
|
||||
InterruptPolicy& ip,
|
||||
int source_index,
|
||||
bool skip_adjacent)
|
||||
: m_geometry(g)
|
||||
, m_strategy(s)
|
||||
, m_rescale_policy(rp)
|
||||
, m_turns(turns)
|
||||
, m_interrupt_policy(ip)
|
||||
, m_source_index(source_index)
|
||||
@ -114,7 +110,6 @@ struct self_section_visitor
|
||||
m_source_index, m_geometry, sec2,
|
||||
false, m_skip_adjacent,
|
||||
m_strategy,
|
||||
m_rescale_policy,
|
||||
m_turns, m_interrupt_policy);
|
||||
}
|
||||
|
||||
@ -128,23 +123,15 @@ struct self_section_visitor
|
||||
template <bool Reverse, typename TurnPolicy>
|
||||
struct get_turns
|
||||
{
|
||||
template <typename Geometry, typename Strategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename Geometry, typename Strategy, typename Turns, typename InterruptPolicy>
|
||||
static inline bool apply(
|
||||
Geometry const& geometry,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy,
|
||||
int source_index, bool skip_adjacent)
|
||||
{
|
||||
typedef model::box
|
||||
<
|
||||
typename geometry::robust_point_type
|
||||
<
|
||||
typename geometry::point_type<Geometry>::type,
|
||||
RobustPolicy
|
||||
>::type
|
||||
> box_type;
|
||||
typedef model::box<typename geometry::point_type<Geometry>::type> box_type;
|
||||
|
||||
// sectionalize in two dimensions to detect
|
||||
// all potential spikes correctly
|
||||
@ -153,14 +140,14 @@ struct get_turns
|
||||
typedef std::integer_sequence<std::size_t, 0, 1> dimensions;
|
||||
|
||||
sections_type sec;
|
||||
geometry::sectionalize<Reverse, dimensions>(geometry, robust_policy,
|
||||
geometry::sectionalize<Reverse, dimensions>(geometry,
|
||||
sec, strategy);
|
||||
|
||||
self_section_visitor
|
||||
<
|
||||
Reverse, Geometry,
|
||||
Turns, TurnPolicy, Strategy, RobustPolicy, InterruptPolicy
|
||||
> visitor(geometry, strategy, robust_policy, turns, interrupt_policy,
|
||||
Turns, TurnPolicy, Strategy, InterruptPolicy
|
||||
> visitor(geometry, strategy, turns, interrupt_policy,
|
||||
source_index, skip_adjacent);
|
||||
|
||||
// false if interrupted
|
||||
@ -223,11 +210,10 @@ struct self_get_turn_points
|
||||
TurnPolicy
|
||||
>
|
||||
{
|
||||
template <typename Strategy, typename RobustPolicy, typename Turns, typename InterruptPolicy>
|
||||
template <typename Strategy, typename Turns, typename InterruptPolicy>
|
||||
static inline bool apply(
|
||||
Box const& ,
|
||||
Strategy const& ,
|
||||
RobustPolicy const& ,
|
||||
Turns& ,
|
||||
InterruptPolicy& ,
|
||||
int /*source_index*/,
|
||||
@ -287,13 +273,11 @@ struct self_get_turn_points
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename InterruptPolicy
|
||||
>
|
||||
static inline void apply(Geometry const& geometry,
|
||||
Strategies const& strategies,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy,
|
||||
int source_index,
|
||||
@ -307,7 +291,7 @@ struct self_get_turn_points
|
||||
typename tag<Geometry>::type,
|
||||
Geometry,
|
||||
turn_policy
|
||||
>::apply(geometry, strategies, robust_policy, turns, interrupt_policy,
|
||||
>::apply(geometry, strategies, turns, interrupt_policy,
|
||||
source_index, skip_adjacent);
|
||||
}
|
||||
};
|
||||
@ -318,13 +302,11 @@ struct self_get_turn_points<Reverse, AssignPolicy, Strategy, false>
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename InterruptPolicy
|
||||
>
|
||||
static inline void apply(Geometry const& geometry,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy,
|
||||
int source_index,
|
||||
@ -339,7 +321,6 @@ struct self_get_turn_points<Reverse, AssignPolicy, Strategy, false>
|
||||
decltype(strategy_converter<Strategy>::get(strategy))
|
||||
>::apply(geometry,
|
||||
strategy_converter<Strategy>::get(strategy),
|
||||
robust_policy,
|
||||
turns,
|
||||
interrupt_policy,
|
||||
source_index,
|
||||
@ -363,13 +344,11 @@ template
|
||||
typename AssignPolicy,
|
||||
typename Geometry,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename InterruptPolicy
|
||||
>
|
||||
inline void self_turns(Geometry const& geometry,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy,
|
||||
int source_index = 0,
|
||||
@ -380,7 +359,7 @@ inline void self_turns(Geometry const& geometry,
|
||||
resolve_strategy::self_get_turn_points
|
||||
<
|
||||
Reverse, AssignPolicy, Strategy
|
||||
>::apply(geometry, strategy, robust_policy, turns, interrupt_policy,
|
||||
>::apply(geometry, strategy, turns, interrupt_policy,
|
||||
source_index, skip_adjacent);
|
||||
}
|
||||
|
||||
@ -395,7 +374,6 @@ inline void self_turns(Geometry const& geometry,
|
||||
(e.g. vector of "intersection/turn point"'s)
|
||||
\param geometry geometry
|
||||
\param strategy strategy to be used
|
||||
\param robust_policy policy to handle robustness issues
|
||||
\param turns container which will contain intersection points
|
||||
\param interrupt_policy policy determining if process is stopped
|
||||
when intersection is found
|
||||
@ -407,13 +385,11 @@ template
|
||||
typename AssignPolicy,
|
||||
typename Geometry,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename InterruptPolicy
|
||||
>
|
||||
inline void self_turns(Geometry const& geometry,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns,
|
||||
InterruptPolicy& interrupt_policy,
|
||||
int source_index = 0,
|
||||
@ -429,7 +405,7 @@ inline void self_turns(Geometry const& geometry,
|
||||
resolve_strategy::self_get_turn_points
|
||||
<
|
||||
reverse, AssignPolicy, Strategy
|
||||
>::apply(geometry, strategy, robust_policy, turns, interrupt_policy,
|
||||
>::apply(geometry, strategy, turns, interrupt_policy,
|
||||
source_index, skip_adjacent);
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2023-2024 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -83,7 +84,6 @@ template
|
||||
typename Geometry2,
|
||||
typename Turns,
|
||||
typename Clusters,
|
||||
typename RobustPolicy,
|
||||
typename Strategy,
|
||||
typename Visitor
|
||||
>
|
||||
@ -107,13 +107,12 @@ private :
|
||||
public :
|
||||
inline traversal(Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
Turns& turns, Clusters const& clusters,
|
||||
RobustPolicy const& robust_policy, Strategy const& strategy,
|
||||
Strategy const& strategy,
|
||||
Visitor& visitor)
|
||||
: m_geometry1(geometry1)
|
||||
, m_geometry2(geometry2)
|
||||
, m_turns(turns)
|
||||
, m_clusters(clusters)
|
||||
, m_robust_policy(robust_policy)
|
||||
, m_strategy(strategy)
|
||||
, m_visitor(visitor)
|
||||
{
|
||||
@ -1071,7 +1070,6 @@ private :
|
||||
Geometry2 const& m_geometry2;
|
||||
Turns& m_turns;
|
||||
Clusters const& m_clusters;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
Strategy m_strategy;
|
||||
Visitor& m_visitor;
|
||||
};
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2020.
|
||||
// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -45,7 +46,6 @@ template
|
||||
typename TurnInfoMap,
|
||||
typename Clusters,
|
||||
typename Strategy,
|
||||
typename RobustPolicy,
|
||||
typename Visitor,
|
||||
typename Backtrack
|
||||
>
|
||||
@ -55,7 +55,6 @@ struct traversal_ring_creator
|
||||
<
|
||||
Reverse1, Reverse2, OverlayType,
|
||||
Geometry1, Geometry2, Turns, Clusters,
|
||||
RobustPolicy,
|
||||
Strategy,
|
||||
Visitor
|
||||
> traversal_type;
|
||||
@ -70,16 +69,15 @@ struct traversal_ring_creator
|
||||
Turns& turns, TurnInfoMap& turn_info_map,
|
||||
Clusters const& clusters,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy, Visitor& visitor)
|
||||
Visitor& visitor)
|
||||
: m_trav(geometry1, geometry2, turns, clusters,
|
||||
robust_policy, strategy, visitor)
|
||||
strategy, visitor)
|
||||
, m_geometry1(geometry1)
|
||||
, m_geometry2(geometry2)
|
||||
, m_turns(turns)
|
||||
, m_turn_info_map(turn_info_map)
|
||||
, m_clusters(clusters)
|
||||
, m_strategy(strategy)
|
||||
, m_robust_policy(robust_policy)
|
||||
, m_visitor(visitor)
|
||||
{
|
||||
}
|
||||
@ -113,13 +111,13 @@ struct traversal_ring_creator
|
||||
{
|
||||
geometry::copy_segments<Reverse1>(m_geometry1,
|
||||
previous_op.seg_id, to_vertex_index,
|
||||
m_strategy, m_robust_policy, current_ring);
|
||||
m_strategy, current_ring);
|
||||
}
|
||||
else
|
||||
{
|
||||
geometry::copy_segments<Reverse2>(m_geometry2,
|
||||
previous_op.seg_id, to_vertex_index,
|
||||
m_strategy, m_robust_policy, current_ring);
|
||||
m_strategy, current_ring);
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,7 +160,7 @@ struct traversal_ring_creator
|
||||
turn_type& current_turn = m_turns[turn_index];
|
||||
turn_operation_type& op = current_turn.operations[op_index];
|
||||
detail::overlay::append_no_collinear(current_ring, current_turn.point,
|
||||
m_strategy, m_robust_policy);
|
||||
m_strategy);
|
||||
|
||||
// Register the visit
|
||||
m_trav.set_visited(current_turn, op);
|
||||
@ -179,7 +177,7 @@ struct traversal_ring_creator
|
||||
turn_operation_type& start_op = m_turns[start_turn_index].operations[start_op_index];
|
||||
|
||||
detail::overlay::append_no_collinear(ring, start_turn.point,
|
||||
m_strategy, m_robust_policy);
|
||||
m_strategy);
|
||||
|
||||
signed_size_type current_turn_index = start_turn_index;
|
||||
int current_op_index = start_op_index;
|
||||
@ -274,7 +272,7 @@ struct traversal_ring_creator
|
||||
|
||||
if (traverse_error == traverse_error_none)
|
||||
{
|
||||
remove_spikes_at_closure(ring, m_strategy, m_robust_policy);
|
||||
remove_spikes_at_closure(ring, m_strategy);
|
||||
fix_closure(ring, m_strategy);
|
||||
|
||||
std::size_t const min_num_points
|
||||
@ -298,7 +296,7 @@ struct traversal_ring_creator
|
||||
m_turns[turn_index].operations[op_index],
|
||||
traverse_error,
|
||||
m_geometry1, m_geometry2,
|
||||
m_strategy, m_robust_policy,
|
||||
m_strategy,
|
||||
state, m_visitor);
|
||||
}
|
||||
}
|
||||
@ -409,7 +407,6 @@ private:
|
||||
TurnInfoMap& m_turn_info_map; // contains turn-info information per ring
|
||||
Clusters const& m_clusters;
|
||||
Strategy const& m_strategy;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
Visitor& m_visitor;
|
||||
};
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
// Copyright (c) 2015-2016 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2018-2020.
|
||||
// Modifications copyright (c) 2018-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2018-2024.
|
||||
// Modifications copyright (c) 2018-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -83,7 +84,6 @@ template
|
||||
typename Geometry2,
|
||||
typename Turns,
|
||||
typename Clusters,
|
||||
typename RobustPolicy,
|
||||
typename Visitor
|
||||
>
|
||||
struct traversal_switch_detector
|
||||
@ -138,12 +138,11 @@ struct traversal_switch_detector
|
||||
inline traversal_switch_detector(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
Turns& turns, Clusters const& clusters,
|
||||
RobustPolicy const& robust_policy, Visitor& visitor)
|
||||
Visitor& visitor)
|
||||
: m_geometry1(geometry1)
|
||||
, m_geometry2(geometry2)
|
||||
, m_turns(turns)
|
||||
, m_clusters(clusters)
|
||||
, m_robust_policy(robust_policy)
|
||||
, m_visitor(visitor)
|
||||
{
|
||||
}
|
||||
@ -736,7 +735,6 @@ private:
|
||||
Clusters const& m_clusters;
|
||||
merge_map m_turns_per_ring;
|
||||
region_connection_map m_connected_regions;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
Visitor& m_visitor;
|
||||
};
|
||||
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2024.
|
||||
// Modifications copyright (c) 2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// 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)
|
||||
@ -58,7 +62,6 @@ public :
|
||||
template
|
||||
<
|
||||
typename IntersectionStrategy,
|
||||
typename RobustPolicy,
|
||||
typename Turns,
|
||||
typename Rings,
|
||||
typename TurnInfoMap,
|
||||
@ -68,7 +71,6 @@ public :
|
||||
static inline void apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
Turns& turns, Rings& rings,
|
||||
TurnInfoMap& turn_info_map,
|
||||
Clusters& clusters,
|
||||
@ -79,9 +81,9 @@ public :
|
||||
Reverse1, Reverse2, OverlayType,
|
||||
Geometry1, Geometry2,
|
||||
Turns, Clusters,
|
||||
RobustPolicy, Visitor
|
||||
Visitor
|
||||
> switch_detector(geometry1, geometry2, turns, clusters,
|
||||
robust_policy, visitor);
|
||||
visitor);
|
||||
|
||||
switch_detector.iterate();
|
||||
reset_visits(turns);
|
||||
@ -92,10 +94,10 @@ public :
|
||||
Geometry1, Geometry2,
|
||||
Turns, TurnInfoMap, Clusters,
|
||||
IntersectionStrategy,
|
||||
RobustPolicy, Visitor,
|
||||
Visitor,
|
||||
Backtrack
|
||||
> trav(geometry1, geometry2, turns, turn_info_map, clusters,
|
||||
intersection_strategy, robust_policy, visitor);
|
||||
intersection_strategy, visitor);
|
||||
|
||||
std::size_t finalized_ring_size = boost::size(rings);
|
||||
|
||||
|
@ -5,8 +5,9 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2015, 2017, 2019.
|
||||
// Modifications copyright (c) 2015-2019 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -18,9 +19,7 @@
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_POINT_IS_EQUAL_OR_SPIKE_HPP
|
||||
|
||||
#include <boost/geometry/algorithms/detail/direction_code.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
#include <boost/geometry/strategies/side.hpp>
|
||||
#include <boost/geometry/util/constexpr.hpp>
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
@ -70,86 +69,19 @@ template
|
||||
typename Point1,
|
||||
typename Point2,
|
||||
typename Point3,
|
||||
typename SideStrategy,
|
||||
typename RobustPolicy
|
||||
>
|
||||
inline bool point_is_spike_or_equal(Point1 const& last_point,
|
||||
Point2 const& segment_a,
|
||||
Point3 const& segment_b,
|
||||
SideStrategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
{
|
||||
if (point_is_spike_or_equal(last_point, segment_a, segment_b, strategy))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if BOOST_GEOMETRY_CONSTEXPR (! RobustPolicy::enabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else // else prevents unreachable code warning
|
||||
{
|
||||
// Try using specified robust policy
|
||||
using robust_point_type = typename geometry::robust_point_type
|
||||
<
|
||||
Point1,
|
||||
RobustPolicy
|
||||
>::type;
|
||||
|
||||
robust_point_type last_point_rob, segment_a_rob, segment_b_rob;
|
||||
geometry::recalculate(last_point_rob, last_point, robust_policy);
|
||||
geometry::recalculate(segment_a_rob, segment_a, robust_policy);
|
||||
geometry::recalculate(segment_b_rob, segment_b, robust_policy);
|
||||
|
||||
return point_is_spike_or_equal(last_point_rob, segment_a_rob, segment_b_rob,
|
||||
strategy);
|
||||
}
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename Point1,
|
||||
typename Point2,
|
||||
typename Point3,
|
||||
typename SideStrategy,
|
||||
typename RobustPolicy
|
||||
typename SideStrategy
|
||||
>
|
||||
inline bool point_is_collinear(Point1 const& last_point,
|
||||
Point2 const& segment_a,
|
||||
Point3 const& segment_b,
|
||||
SideStrategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
SideStrategy const& strategy)
|
||||
{
|
||||
int const side = strategy.apply(segment_a, segment_b, last_point);
|
||||
if (side == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// This part (or whole method, because it is then trivial)
|
||||
// will be removed after rescaling
|
||||
if BOOST_GEOMETRY_CONSTEXPR (! RobustPolicy::enabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else // else prevents unreachable code warning
|
||||
{
|
||||
// Redo, using specified robust policy
|
||||
using robust_point_type = typename geometry::robust_point_type
|
||||
<
|
||||
Point1,
|
||||
RobustPolicy
|
||||
>::type;
|
||||
|
||||
robust_point_type last_point_rob, segment_a_rob, segment_b_rob;
|
||||
geometry::recalculate(last_point_rob, last_point, robust_policy);
|
||||
geometry::recalculate(segment_a_rob, segment_a, robust_policy);
|
||||
geometry::recalculate(segment_b_rob, segment_b, robust_policy);
|
||||
|
||||
int const side_rob = strategy.apply(segment_a_rob, segment_b_rob, last_point_rob);
|
||||
return side_rob == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,230 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2013 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RECALCULATE_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RECALCULATE_HPP
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/concept/requires.hpp>
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/size.hpp>
|
||||
|
||||
#include <boost/geometry/arithmetic/arithmetic.hpp>
|
||||
#include <boost/geometry/algorithms/append.hpp>
|
||||
#include <boost/geometry/algorithms/clear.hpp>
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace recalculate
|
||||
{
|
||||
|
||||
template <std::size_t Dimension>
|
||||
struct recalculate_point
|
||||
{
|
||||
template <typename Point1, typename Point2, typename Strategy>
|
||||
static inline void apply(Point1& point1, Point2 const& point2, Strategy const& strategy)
|
||||
{
|
||||
std::size_t const dim = Dimension - 1;
|
||||
geometry::set<dim>(point1, strategy.template apply<dim>(geometry::get<dim>(point2)));
|
||||
recalculate_point<dim>::apply(point1, point2, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct recalculate_point<0>
|
||||
{
|
||||
template <typename Point1, typename Point2, typename Strategy>
|
||||
static inline void apply(Point1&, Point2 const&, Strategy const&)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <std::size_t Dimension>
|
||||
struct recalculate_indexed
|
||||
{
|
||||
template <typename Geometry1, typename Geometry2, typename Strategy>
|
||||
static inline void apply(Geometry1& geometry1, Geometry2 const& geometry2, Strategy const& strategy)
|
||||
{
|
||||
// Do it for both indices in one dimension
|
||||
static std::size_t const dim = Dimension - 1;
|
||||
geometry::set<0, dim>(geometry1, strategy.template apply<dim>(geometry::get<0, dim>(geometry2)));
|
||||
geometry::set<1, dim>(geometry1, strategy.template apply<dim>(geometry::get<1, dim>(geometry2)));
|
||||
recalculate_indexed<dim>::apply(geometry1, geometry2, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct recalculate_indexed<0>
|
||||
{
|
||||
|
||||
template <typename Geometry1, typename Geometry2, typename Strategy>
|
||||
static inline void apply(Geometry1& , Geometry2 const& , Strategy const& )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct range_to_range
|
||||
{
|
||||
template
|
||||
<
|
||||
typename Range1,
|
||||
typename Range2,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Range1& destination, Range2 const& source,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
typedef typename geometry::point_type<Range2>::type point_type;
|
||||
typedef recalculate_point<geometry::dimension<point_type>::value> per_point;
|
||||
geometry::clear(destination);
|
||||
|
||||
for (auto const& source_point : source)
|
||||
{
|
||||
point_type p;
|
||||
per_point::apply(p, source_point, strategy);
|
||||
geometry::append(destination, p);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct polygon_to_polygon
|
||||
{
|
||||
private:
|
||||
template
|
||||
<
|
||||
typename IteratorIn,
|
||||
typename IteratorOut,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void iterate(IteratorIn begin, IteratorIn end,
|
||||
IteratorOut it_out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
for (IteratorIn it_in = begin; it_in != end; ++it_in, ++it_out)
|
||||
{
|
||||
range_to_range::apply(*it_out, *it_in, strategy);
|
||||
}
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename InteriorRingsOut,
|
||||
typename InteriorRingsIn,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply_interior_rings(
|
||||
InteriorRingsOut& interior_rings_out,
|
||||
InteriorRingsIn const& interior_rings_in,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
traits::resize<InteriorRingsOut>::apply(interior_rings_out,
|
||||
boost::size(interior_rings_in));
|
||||
|
||||
iterate(
|
||||
boost::begin(interior_rings_in), boost::end(interior_rings_in),
|
||||
boost::begin(interior_rings_out),
|
||||
strategy);
|
||||
}
|
||||
|
||||
public:
|
||||
template
|
||||
<
|
||||
typename Polygon1,
|
||||
typename Polygon2,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Polygon1& destination, Polygon2 const& source,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
range_to_range::apply(geometry::exterior_ring(destination),
|
||||
geometry::exterior_ring(source), strategy);
|
||||
|
||||
apply_interior_rings(geometry::interior_rings(destination),
|
||||
geometry::interior_rings(source), strategy);
|
||||
}
|
||||
};
|
||||
|
||||
}} // namespace detail::recalculate
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename Tag1 = typename geometry::tag<Geometry1>::type,
|
||||
typename Tag2 = typename geometry::tag<Geometry2>::type
|
||||
>
|
||||
struct recalculate : not_implemented<Tag1, Tag2>
|
||||
{};
|
||||
|
||||
template <typename Point1, typename Point2>
|
||||
struct recalculate<Point1, Point2, point_tag, point_tag>
|
||||
: detail::recalculate::recalculate_point<geometry::dimension<Point1>::value>
|
||||
{};
|
||||
|
||||
template <typename Box1, typename Box2>
|
||||
struct recalculate<Box1, Box2, box_tag, box_tag>
|
||||
: detail::recalculate::recalculate_indexed<geometry::dimension<Box1>::value>
|
||||
{};
|
||||
|
||||
template <typename Segment1, typename Segment2>
|
||||
struct recalculate<Segment1, Segment2, segment_tag, segment_tag>
|
||||
: detail::recalculate::recalculate_indexed<geometry::dimension<Segment1>::value>
|
||||
{};
|
||||
|
||||
template <typename Polygon1, typename Polygon2>
|
||||
struct recalculate<Polygon1, Polygon2, polygon_tag, polygon_tag>
|
||||
: detail::recalculate::polygon_to_polygon
|
||||
{};
|
||||
|
||||
} // namespace dispatch
|
||||
#endif // DOXYGEN_NO_DISPATCH
|
||||
|
||||
|
||||
|
||||
template <typename Geometry1, typename Geometry2, typename Strategy>
|
||||
inline void recalculate(Geometry1& geometry1, Geometry2 const& geometry2, Strategy const& strategy)
|
||||
{
|
||||
concepts::check<Geometry1>();
|
||||
concepts::check<Geometry2 const>();
|
||||
|
||||
// static assert dimensions (/types) are the same
|
||||
|
||||
dispatch::recalculate<Geometry1, Geometry2>::apply(geometry1, geometry2, strategy);
|
||||
}
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_RECALCULATE_HPP
|
@ -2,11 +2,11 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013-2022.
|
||||
// Modifications copyright (c) 2013-2022 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -22,9 +22,6 @@
|
||||
|
||||
#include <boost/geometry/geometries/helper_geometry.hpp>
|
||||
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/cartesian/point_in_point.hpp>
|
||||
#include <boost/geometry/strategies/spherical/point_in_point.hpp>
|
||||
#include <boost/geometry/strategies/distance.hpp>
|
||||
@ -60,24 +57,13 @@ struct get_turns
|
||||
typename geometry::point_type<Geometry1>::type
|
||||
>::type;
|
||||
|
||||
template <typename Strategy>
|
||||
struct robust_policy_type
|
||||
: geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename Strategy::cs_tag
|
||||
>
|
||||
{};
|
||||
|
||||
template
|
||||
<
|
||||
typename Strategy,
|
||||
typename RobustPolicy = typename robust_policy_type<Strategy>::type
|
||||
typename Strategy
|
||||
>
|
||||
struct turn_info_type
|
||||
{
|
||||
using ratio_type = typename segment_ratio_type<turn_point_type, RobustPolicy>::type;
|
||||
using ratio_type = typename segment_ratio_type<turn_point_type>::type;
|
||||
using type = overlay::turn_info
|
||||
<
|
||||
turn_point_type,
|
||||
@ -95,23 +81,6 @@ struct get_turns
|
||||
Geometry2 const& geometry2,
|
||||
InterruptPolicy & interrupt_policy,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
typedef typename robust_policy_type<Strategy>::type robust_policy_t;
|
||||
|
||||
robust_policy_t robust_policy
|
||||
= geometry::get_rescale_policy<robust_policy_t>(
|
||||
geometry1, geometry2, strategy);
|
||||
|
||||
apply(turns, geometry1, geometry2, interrupt_policy, strategy, robust_policy);
|
||||
}
|
||||
|
||||
template <typename Turns, typename InterruptPolicy, typename Strategy, typename RobustPolicy>
|
||||
static inline void apply(Turns & turns,
|
||||
Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
InterruptPolicy & interrupt_policy,
|
||||
Strategy const& strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
{
|
||||
static const bool reverse1 = detail::overlay::do_reverse
|
||||
<
|
||||
@ -133,7 +102,7 @@ struct get_turns
|
||||
reverse2,
|
||||
GetTurnPolicy
|
||||
>::apply(0, geometry1, 1, geometry2,
|
||||
strategy, robust_policy,
|
||||
strategy,
|
||||
turns, interrupt_policy);
|
||||
}
|
||||
};
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2015-2021.
|
||||
// Modifications copyright (c) 2015-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -15,8 +16,6 @@
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
|
||||
// For spherical/geographic longitudes covered_by point/box
|
||||
#include <boost/geometry/strategies/cartesian/point_in_box.hpp>
|
||||
@ -121,41 +120,28 @@ template
|
||||
<
|
||||
std::size_t Dimension,
|
||||
typename Point,
|
||||
typename Box,
|
||||
typename RobustPolicy
|
||||
typename Box
|
||||
>
|
||||
inline bool preceding(int dir,
|
||||
Point const& point,
|
||||
Box const& point_box,
|
||||
Box const& other_box,
|
||||
RobustPolicy const& robust_policy)
|
||||
Box const& other_box)
|
||||
{
|
||||
using box_point_type = typename geometry::point_type<Box>::type;
|
||||
typename geometry::robust_point_type<box_point_type, RobustPolicy>::type robust_point;
|
||||
geometry::recalculate(robust_point, point, robust_policy);
|
||||
|
||||
// After recalculate() to prevent warning: 'robust_point' may be used uninitialized
|
||||
assert_coordinate_type_equal(robust_point, point_box);
|
||||
|
||||
return preceding_check<Dimension, Box>::apply(dir, robust_point,
|
||||
point_box,
|
||||
other_box);
|
||||
return preceding_check<Dimension, Box>::apply(dir, point, point_box, other_box);
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
std::size_t Dimension,
|
||||
typename Point,
|
||||
typename Box,
|
||||
typename RobustPolicy
|
||||
typename Box
|
||||
>
|
||||
inline bool exceeding(int dir,
|
||||
Point const& point,
|
||||
Box const& point_box,
|
||||
Box const& other_box,
|
||||
RobustPolicy const& robust_policy)
|
||||
Box const& other_box)
|
||||
{
|
||||
return preceding<Dimension>(-dir, point, point_box, other_box, robust_policy);
|
||||
return preceding<Dimension>(-dir, point, point_box, other_box);
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,11 +5,11 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2013-2021.
|
||||
// Modifications copyright (c) 2013-2021 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@ -38,7 +38,6 @@
|
||||
#include <boost/geometry/algorithms/envelope.hpp>
|
||||
#include <boost/geometry/algorithms/expand.hpp>
|
||||
#include <boost/geometry/algorithms/detail/expand_by_epsilon.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
|
||||
#include <boost/geometry/algorithms/detail/signed_size_type.hpp>
|
||||
|
||||
@ -52,8 +51,6 @@
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/segment.hpp>
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
#include <boost/geometry/util/normalize_spheroidal_coordinates.hpp>
|
||||
#include <boost/geometry/util/sequence.hpp>
|
||||
@ -386,19 +383,15 @@ struct sectionalize_part
|
||||
template
|
||||
<
|
||||
typename Iterator,
|
||||
typename RobustPolicy,
|
||||
typename Sections,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Sections& sections,
|
||||
Iterator begin, Iterator end,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategy const& strategy,
|
||||
ring_identifier ring_id,
|
||||
std::size_t max_count)
|
||||
{
|
||||
boost::ignore_unused(robust_policy);
|
||||
|
||||
using section_type = typename boost::range_value<Sections>::type;
|
||||
using box_type = typename section_type::box_type;
|
||||
using point_type = typename geometry::point_type<box_type>::type;
|
||||
@ -409,12 +402,6 @@ struct sectionalize_part
|
||||
== util::sequence_size<DimensionVector>::value
|
||||
);
|
||||
|
||||
using robust_point_type = typename geometry::robust_point_type
|
||||
<
|
||||
point_type,
|
||||
RobustPolicy
|
||||
>::type;
|
||||
|
||||
std::size_t const count = std::distance(begin, end);
|
||||
if (count == 0)
|
||||
{
|
||||
@ -429,23 +416,20 @@ struct sectionalize_part
|
||||
std::size_t last_non_duplicate_index = sections.size();
|
||||
|
||||
Iterator it = begin;
|
||||
robust_point_type previous_robust_point;
|
||||
geometry::recalculate(previous_robust_point, *it, robust_policy);
|
||||
point_type previous_point;
|
||||
geometry::detail::conversion::convert_point_to_point(*it, previous_point);
|
||||
|
||||
for(Iterator previous = it++;
|
||||
it != end;
|
||||
++previous, ++it, index++)
|
||||
for (Iterator previous = it++; it != end; ++previous, ++it, index++)
|
||||
{
|
||||
robust_point_type current_robust_point;
|
||||
geometry::recalculate(current_robust_point, *it, robust_policy);
|
||||
model::referring_segment<robust_point_type> robust_segment(
|
||||
previous_robust_point, current_robust_point);
|
||||
point_type current_point;
|
||||
geometry::detail::conversion::convert_point_to_point(*it, current_point);
|
||||
model::referring_segment<point_type> segment(previous_point, current_point);
|
||||
|
||||
int direction_classes[dimension_count] = {0};
|
||||
get_direction_loop
|
||||
<
|
||||
point_type, DimensionVector, 0, dimension_count
|
||||
>::apply(robust_segment, direction_classes);
|
||||
>::apply(segment, direction_classes);
|
||||
|
||||
// if "dir" == 0 for all point-dimensions, it is duplicate.
|
||||
// Those sections might be omitted, if wished, lateron
|
||||
@ -459,7 +443,7 @@ struct sectionalize_part
|
||||
if (check_duplicate_loop
|
||||
<
|
||||
0, geometry::dimension<point_type>::type::value
|
||||
>::apply(robust_segment)
|
||||
>::apply(segment)
|
||||
)
|
||||
{
|
||||
duplicate = true;
|
||||
@ -513,15 +497,15 @@ struct sectionalize_part
|
||||
|
||||
// In cartesian this is envelope of previous point expanded with current point
|
||||
// in non-cartesian this is envelope of a segment
|
||||
box_first_in_section<typename cs_tag<robust_point_type>::type>
|
||||
::apply(section.bounding_box, previous_robust_point, current_robust_point, strategy);
|
||||
box_first_in_section<typename cs_tag<point_type>::type>
|
||||
::apply(section.bounding_box, previous_point, current_point, strategy);
|
||||
}
|
||||
else
|
||||
{
|
||||
// In cartesian this is expand with current point
|
||||
// in non-cartesian this is expand with a segment
|
||||
box_next_in_section<typename cs_tag<robust_point_type>::type>
|
||||
::apply(section.bounding_box, previous_robust_point, current_robust_point, strategy);
|
||||
box_next_in_section<typename cs_tag<point_type>::type>
|
||||
::apply(section.bounding_box, previous_point, current_point, strategy);
|
||||
}
|
||||
|
||||
section.end_index = index + 1;
|
||||
@ -530,7 +514,7 @@ struct sectionalize_part
|
||||
{
|
||||
ndi++;
|
||||
}
|
||||
previous_robust_point = current_robust_point;
|
||||
previous_point = current_point;
|
||||
}
|
||||
|
||||
// Add last section if applicable
|
||||
@ -564,12 +548,10 @@ struct sectionalize_range
|
||||
template
|
||||
<
|
||||
typename Range,
|
||||
typename RobustPolicy,
|
||||
typename Sections,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Range const& range,
|
||||
RobustPolicy const& robust_policy,
|
||||
Sections& sections,
|
||||
Strategy const& strategy,
|
||||
ring_identifier ring_id,
|
||||
@ -597,7 +579,7 @@ struct sectionalize_range
|
||||
|
||||
sectionalize_part<DimensionVector>::apply(sections,
|
||||
boost::begin(view), boost::end(view),
|
||||
robust_policy, strategy,
|
||||
strategy,
|
||||
ring_id, max_count);
|
||||
}
|
||||
};
|
||||
@ -612,12 +594,10 @@ struct sectionalize_polygon
|
||||
template
|
||||
<
|
||||
typename Polygon,
|
||||
typename RobustPolicy,
|
||||
typename Sections,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Polygon const& poly,
|
||||
RobustPolicy const& robust_policy,
|
||||
Sections& sections,
|
||||
Strategy const& strategy,
|
||||
ring_identifier ring_id,
|
||||
@ -629,7 +609,7 @@ struct sectionalize_polygon
|
||||
>;
|
||||
|
||||
ring_id.ring_index = -1;
|
||||
sectionalizer::apply(exterior_ring(poly), robust_policy, sections,
|
||||
sectionalizer::apply(exterior_ring(poly), sections,
|
||||
strategy, ring_id, max_count);
|
||||
|
||||
ring_id.ring_index++;
|
||||
@ -637,7 +617,7 @@ struct sectionalize_polygon
|
||||
for (auto it = boost::begin(rings); it != boost::end(rings);
|
||||
++it, ++ring_id.ring_index)
|
||||
{
|
||||
sectionalizer::apply(*it, robust_policy, sections,
|
||||
sectionalizer::apply(*it, sections,
|
||||
strategy, ring_id, max_count);
|
||||
}
|
||||
}
|
||||
@ -649,12 +629,10 @@ struct sectionalize_box
|
||||
template
|
||||
<
|
||||
typename Box,
|
||||
typename RobustPolicy,
|
||||
typename Sections,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(Box const& box,
|
||||
RobustPolicy const& robust_policy,
|
||||
Sections& sections,
|
||||
Strategy const& strategy,
|
||||
ring_identifier const& ring_id, std::size_t max_count)
|
||||
@ -686,7 +664,7 @@ struct sectionalize_box
|
||||
sectionalize_range
|
||||
<
|
||||
closed, false, DimensionVector
|
||||
>::apply(points, robust_policy, sections,
|
||||
>::apply(points, sections,
|
||||
strategy, ring_id, max_count);
|
||||
}
|
||||
};
|
||||
@ -697,12 +675,10 @@ struct sectionalize_multi
|
||||
template
|
||||
<
|
||||
typename MultiGeometry,
|
||||
typename RobustPolicy,
|
||||
typename Sections,
|
||||
typename Strategy
|
||||
>
|
||||
static inline void apply(MultiGeometry const& multi,
|
||||
RobustPolicy const& robust_policy,
|
||||
Sections& sections,
|
||||
Strategy const& strategy,
|
||||
ring_identifier ring_id,
|
||||
@ -711,7 +687,7 @@ struct sectionalize_multi
|
||||
ring_id.multi_index = 0;
|
||||
for (auto it = boost::begin(multi); it != boost::end(multi); ++it, ++ring_id.multi_index)
|
||||
{
|
||||
Policy::apply(*it, robust_policy, sections,
|
||||
Policy::apply(*it, sections,
|
||||
strategy,
|
||||
ring_id, max_count);
|
||||
}
|
||||
@ -869,7 +845,6 @@ struct sectionalize<multi_linestring_tag, MultiLinestring, Reverse, DimensionVec
|
||||
\tparam Geometry type of geometry to check
|
||||
\tparam Sections type of sections to create
|
||||
\param geometry geometry to create sections from
|
||||
\param robust_policy policy to handle robustness issues
|
||||
\param sections structure with sections
|
||||
\param strategy strategy for envelope calculation
|
||||
\param expand_strategy strategy for partitions
|
||||
@ -884,11 +859,9 @@ template
|
||||
typename DimensionVector,
|
||||
typename Geometry,
|
||||
typename Sections,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
inline void sectionalize(Geometry const& geometry,
|
||||
RobustPolicy const& robust_policy,
|
||||
Sections& sections,
|
||||
Strategy const& strategy,
|
||||
int source_index = 0,
|
||||
@ -907,7 +880,7 @@ inline void sectionalize(Geometry const& geometry,
|
||||
Geometry,
|
||||
Reverse,
|
||||
DimensionVector
|
||||
>::apply(geometry, robust_policy, sections,
|
||||
>::apply(geometry, sections,
|
||||
strategy,
|
||||
ring_id, max_count);
|
||||
|
||||
@ -920,11 +893,9 @@ template
|
||||
bool Reverse,
|
||||
typename DimensionVector,
|
||||
typename Geometry,
|
||||
typename Sections,
|
||||
typename RobustPolicy
|
||||
typename Sections
|
||||
>
|
||||
inline void sectionalize(Geometry const& geometry,
|
||||
RobustPolicy const& robust_policy,
|
||||
Sections& sections,
|
||||
int source_index = 0,
|
||||
std::size_t max_count = 10)
|
||||
@ -939,7 +910,7 @@ inline void sectionalize(Geometry const& geometry,
|
||||
boost::geometry::sectionalize
|
||||
<
|
||||
Reverse, DimensionVector
|
||||
>(geometry, robust_policy, sections,
|
||||
>(geometry, sections,
|
||||
strategy_type(),
|
||||
source_index, max_count);
|
||||
}
|
||||
|
@ -5,9 +5,9 @@
|
||||
// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013-2022 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2013-2022.
|
||||
// Modifications copyright (c) 2013-2022, Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2013-2024.
|
||||
// Modifications copyright (c) 2013-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -39,8 +39,6 @@
|
||||
|
||||
#include <boost/geometry/geometries/helper_geometry.hpp>
|
||||
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/relate/cartesian.hpp>
|
||||
#include <boost/geometry/strategies/relate/geographic.hpp>
|
||||
#include <boost/geometry/strategies/relate/spherical.hpp>
|
||||
@ -255,7 +253,7 @@ struct areal_areal
|
||||
detail::overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
|
||||
detail::overlay::do_reverse<geometry::point_order<Geometry2>::value>::value,
|
||||
detail::overlay::assign_null_policy
|
||||
>(geometry1, geometry2, strategy, detail::no_rescale_policy(), turns, policy);
|
||||
>(geometry1, geometry2, strategy, turns, policy);
|
||||
|
||||
return policy.result()
|
||||
&& ! geometry::detail::touches::rings_containing(geometry1, geometry2, strategy)
|
||||
@ -526,7 +524,7 @@ struct self_touches
|
||||
detail::self_get_turn_points::get_turns
|
||||
<
|
||||
false, policy_type
|
||||
>::apply(geometry, strategy, detail::no_rescale_policy(),
|
||||
>::apply(geometry, strategy,
|
||||
turns, policy, 0, true);
|
||||
|
||||
return policy.result();
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2023.
|
||||
// Modifications copyright (c) 2017-2023, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -22,7 +22,6 @@
|
||||
#include <boost/geometry/algorithms/detail/visit.hpp>
|
||||
#include <boost/geometry/core/geometry_types.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_variant.hpp> // For backward compatibility
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/relate/cartesian.hpp>
|
||||
@ -62,12 +61,10 @@ struct call_intersection_insert
|
||||
template
|
||||
<
|
||||
typename OutputIterator,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -78,7 +75,7 @@ struct call_intersection_insert
|
||||
overlay_difference,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry2>::value, true>::value
|
||||
>::apply(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>::apply(geometry1, geometry2, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -86,10 +83,9 @@ struct call_intersection_insert
|
||||
template <typename Geometry1, typename Geometry2, typename SingleOut, typename OutTag>
|
||||
struct call_intersection_insert<Geometry1, Geometry2, SingleOut, OutTag, true>
|
||||
{
|
||||
template <typename OutputIterator, typename RobustPolicy, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& ,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator out,
|
||||
Strategy const& )
|
||||
{
|
||||
@ -149,12 +145,10 @@ struct call_intersection_insert
|
||||
template
|
||||
<
|
||||
typename OutputIterator,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -162,7 +156,7 @@ struct call_intersection_insert
|
||||
<
|
||||
Geometry1, Geometry2,
|
||||
typename base_t::access::type
|
||||
>::apply(geometry1, geometry2, robust_policy,
|
||||
>::apply(geometry1, geometry2,
|
||||
base_t::access::get(out), strategy);
|
||||
|
||||
return out;
|
||||
@ -188,12 +182,10 @@ struct call_intersection_insert
|
||||
template
|
||||
<
|
||||
typename OutputIterator,
|
||||
typename RobustPolicy,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& ,
|
||||
RobustPolicy const& ,
|
||||
OutputIterator out,
|
||||
Strategy const& )
|
||||
{
|
||||
@ -244,21 +236,10 @@ inline OutputIterator difference_insert(Geometry1 const& geometry1,
|
||||
//concepts::check<GeometryOut>();
|
||||
geometry::detail::output_geometry_concept_check<GeometryOut>::apply();
|
||||
|
||||
typedef typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename Strategy::cs_tag
|
||||
>::type rescale_policy_type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
geometry1, geometry2, strategy);
|
||||
|
||||
return geometry::detail::difference::call_intersection_insert
|
||||
<
|
||||
Geometry1, Geometry2, GeometryOut
|
||||
>::apply(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>::apply(geometry1, geometry2, out, strategy);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2015-2023.
|
||||
// Modifications copyright (c) 2015-2023 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
@ -22,7 +22,6 @@
|
||||
#include <boost/geometry/algorithms/union.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_variant.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/relate/cartesian.hpp>
|
||||
@ -45,13 +44,11 @@ struct compute_difference
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -69,7 +66,7 @@ struct compute_difference
|
||||
<
|
||||
geometry::point_order<Geometry2>::value, true
|
||||
>::value
|
||||
>::apply(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>::apply(geometry1, geometry2, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -80,25 +77,23 @@ struct sym_difference_generic
|
||||
{
|
||||
template
|
||||
<
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
out = compute_difference
|
||||
<
|
||||
GeometryOut
|
||||
>::apply(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>::apply(geometry1, geometry2, out, strategy);
|
||||
|
||||
return compute_difference
|
||||
<
|
||||
GeometryOut
|
||||
>::apply(geometry2, geometry1, robust_policy, out, strategy);
|
||||
>::apply(geometry2, geometry1, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -108,13 +103,11 @@ struct sym_difference_areal_areal
|
||||
{
|
||||
template
|
||||
<
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Areal1 const& areal1,
|
||||
Areal2 const& areal2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -131,19 +124,19 @@ struct sym_difference_areal_areal
|
||||
compute_difference
|
||||
<
|
||||
GeometryOut
|
||||
>::apply(areal1, areal2, robust_policy, oit12, strategy);
|
||||
>::apply(areal1, areal2, oit12, strategy);
|
||||
|
||||
compute_difference
|
||||
<
|
||||
GeometryOut
|
||||
>::apply(areal2, areal1, robust_policy, oit21, strategy);
|
||||
>::apply(areal2, areal1, oit21, strategy);
|
||||
|
||||
return geometry::dispatch::union_insert
|
||||
<
|
||||
helper_geometry_type,
|
||||
helper_geometry_type,
|
||||
GeometryOut
|
||||
>::apply(diff12, diff21, robust_policy, out, strategy);
|
||||
>::apply(diff12, diff21, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -160,13 +153,11 @@ struct sym_difference_same_inputs_tupled_output
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -178,7 +169,7 @@ struct sym_difference_same_inputs_tupled_output
|
||||
access::get(out) = Algorithm
|
||||
<
|
||||
typename access::type, Geometry1, Geometry2
|
||||
>::apply(geometry1, geometry2, robust_policy, access::get(out), strategy);
|
||||
>::apply(geometry1, geometry2, access::get(out), strategy);
|
||||
|
||||
return out;
|
||||
}
|
||||
@ -199,20 +190,18 @@ struct sym_difference_different_inputs_tupled_output
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return sym_difference_different_inputs_tupled_output
|
||||
<
|
||||
GeometryOut, SingleTag2, SingleTag1
|
||||
>::apply(geometry2, geometry1, robust_policy, out, strategy);
|
||||
>::apply(geometry2, geometry1, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -231,13 +220,11 @@ struct sym_difference_different_inputs_tupled_output
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator,
|
||||
typename Strategy
|
||||
>
|
||||
static inline OutputIterator apply(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -253,7 +240,7 @@ struct sym_difference_different_inputs_tupled_output
|
||||
access1::get(out) = compute_difference
|
||||
<
|
||||
typename access1::type
|
||||
>::apply(geometry1, geometry2, robust_policy, access1::get(out), strategy);
|
||||
>::apply(geometry1, geometry2, access1::get(out), strategy);
|
||||
|
||||
access2::get(out) = geometry::detail::convert_to_output
|
||||
<
|
||||
@ -452,21 +439,10 @@ inline OutputIterator sym_difference_insert(Geometry1 const& geometry1,
|
||||
//concepts::check<GeometryOut>();
|
||||
geometry::detail::output_geometry_concept_check<GeometryOut>::apply();
|
||||
|
||||
typedef typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename Strategy::cs_tag
|
||||
>::type rescale_policy_type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
geometry1, geometry2, strategy);
|
||||
|
||||
return dispatch::sym_difference_insert
|
||||
<
|
||||
Geometry1, Geometry2, GeometryOut
|
||||
>::apply(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>::apply(geometry1, geometry2, out, strategy);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014-2023.
|
||||
// Modifications copyright (c) 2014-2023 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
@ -27,7 +27,6 @@
|
||||
#include <boost/geometry/core/reverse_dispatch.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_variant.hpp>
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/relate/cartesian.hpp>
|
||||
@ -76,17 +75,16 @@ struct union_insert
|
||||
true
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Geometry1 const& g1,
|
||||
Geometry2 const& g2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return union_insert
|
||||
<
|
||||
Geometry2, Geometry1, GeometryOut
|
||||
>::apply(g2, g1, robust_policy, out, strategy);
|
||||
>::apply(g2, g1, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -181,17 +179,16 @@ struct union_insert
|
||||
SingleTupledOut, single_tag, single_tag
|
||||
>;
|
||||
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Geometry1 const& g1,
|
||||
Geometry2 const& g2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
access::get(out) = union_insert
|
||||
<
|
||||
Geometry2, Geometry1, typename access::type
|
||||
>::apply(g2, g1, robust_policy, access::get(out), strategy);
|
||||
>::apply(g2, g1, access::get(out), strategy);
|
||||
|
||||
return out;
|
||||
}
|
||||
@ -217,10 +214,9 @@ struct union_insert_tupled_different
|
||||
SingleTupledOut, SingleTag2, SingleTag2
|
||||
>;
|
||||
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Geometry1 const& g1,
|
||||
Geometry2 const& g2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
@ -231,7 +227,7 @@ struct union_insert_tupled_different
|
||||
overlay_difference,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry1>::value>::value,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Geometry2>::value, true>::value
|
||||
>::apply(g1, g2, robust_policy, access1::get(out), strategy);
|
||||
>::apply(g1, g2, access1::get(out), strategy);
|
||||
|
||||
access2::get(out) = geometry::detail::convert_to_output
|
||||
<
|
||||
@ -254,17 +250,16 @@ struct union_insert_tupled_different
|
||||
Geometry1, Geometry2, SingleTupledOut, SingleTag1, SingleTag2, false
|
||||
>
|
||||
{
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Geometry1 const& g1,
|
||||
Geometry2 const& g2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return union_insert_tupled_different
|
||||
<
|
||||
Geometry2, Geometry1, SingleTupledOut, SingleTag2, SingleTag1, true
|
||||
>::apply(g2, g1, robust_policy, out, strategy);
|
||||
>::apply(g2, g1, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -303,17 +298,16 @@ struct union_insert
|
||||
Geometry1, Geometry2, SingleTupledOut, single_tag2
|
||||
>;
|
||||
|
||||
template <typename RobustPolicy, typename OutputIterator, typename Strategy>
|
||||
template <typename OutputIterator, typename Strategy>
|
||||
static inline OutputIterator apply(Geometry1 const& g1,
|
||||
Geometry2 const& g2,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return union_insert_tupled_different
|
||||
<
|
||||
Geometry1, Geometry2, SingleTupledOut, single_tag1, single_tag2
|
||||
>::apply(g1, g2, robust_policy, out, strategy);
|
||||
>::apply(g1, g2, out, strategy);
|
||||
}
|
||||
};
|
||||
|
||||
@ -359,20 +353,10 @@ inline OutputIterator union_insert(Geometry1 const& geometry1,
|
||||
Geometry1, Geometry2
|
||||
>::type strategy;
|
||||
|
||||
using rescale_policy_type = typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2
|
||||
>::type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
geometry1, geometry2, strategy);
|
||||
|
||||
return dispatch::union_insert
|
||||
<
|
||||
Geometry1, Geometry2, GeometryOut
|
||||
>::apply(geometry1, geometry2, robust_policy, out, strategy);
|
||||
>::apply(geometry1, geometry2, out, strategy);
|
||||
}
|
||||
|
||||
|
||||
@ -401,21 +385,10 @@ struct union_
|
||||
GeometryOut
|
||||
>::type;
|
||||
|
||||
using rescale_policy_type = typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename Strategy::cs_tag
|
||||
>::type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
geometry1, geometry2, strategy);
|
||||
|
||||
dispatch::union_insert
|
||||
<
|
||||
Geometry1, Geometry2, single_out
|
||||
>::apply(geometry1, geometry2, robust_policy,
|
||||
>::apply(geometry1, geometry2,
|
||||
geometry::detail::output_geometry_back_inserter(geometry_out),
|
||||
strategy);
|
||||
}
|
||||
@ -594,15 +567,6 @@ private:
|
||||
template <typename Multi1, typename Multi2, typename Strategy>
|
||||
static inline void subtract_greater_topodim(Multi1 const& multi1, Multi2 const& multi2, Multi1& multi_out, Strategy const& strategy)
|
||||
{
|
||||
using rescale_policy_type = typename geometry::rescale_overlay_policy_type
|
||||
<
|
||||
Multi1, Multi2
|
||||
>::type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= geometry::get_rescale_policy<rescale_policy_type>(
|
||||
multi1, multi2, strategy);
|
||||
|
||||
geometry::dispatch::intersection_insert
|
||||
<
|
||||
Multi1, Multi2,
|
||||
@ -610,7 +574,7 @@ private:
|
||||
overlay_difference,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Multi1>::value>::value,
|
||||
geometry::detail::overlay::do_reverse<geometry::point_order<Multi2>::value, true>::value
|
||||
>::apply(multi1, multi2, robust_policy, range::back_inserter(multi_out), strategy);
|
||||
>::apply(multi1, multi2, range::back_inserter(multi_out), strategy);
|
||||
}
|
||||
*/
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// Copyright (c) 2019-2021 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Copyright (c) 2018-2023 Oracle and/or its affiliates.
|
||||
// Copyright (c) 2018-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -14,25 +14,5 @@
|
||||
#define BOOST_GEOMETRY_CORE_CONFIG_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
// If no define is specified, it uses BOOST_GEOMETRY_NO_ROBUSTNESS, which means: no rescaling.
|
||||
// (Rescaling was an earlier approach to fix robustness issues.)
|
||||
// However, if BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE is specified, it flips the default.
|
||||
#if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS) && !defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if defined(BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE)
|
||||
#define BOOST_GEOMETRY_USE_RESCALING
|
||||
#else
|
||||
#define BOOST_GEOMETRY_NO_ROBUSTNESS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) && ! defined(BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE)
|
||||
BOOST_PRAGMA_MESSAGE("Rescaling is deprecated and its functionality will be removed in Boost 1.84")
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) && defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
|
||||
#error "Define either BOOST_GEOMETRY_NO_ROBUSTNESS (default) or BOOST_GEOMETRY_USE_RESCALING"
|
||||
#endif
|
||||
|
||||
#endif // BOOST_GEOMETRY_CORE_CONFIG_HPP
|
||||
|
@ -4,8 +4,9 @@
|
||||
//
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// This file was modified by Oracle on 2019-2021.
|
||||
// Modifications copyright (c) 2019-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2019-2024.
|
||||
// Modifications copyright (c) 2019-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -57,7 +58,7 @@ inline typename default_content_result<Box>::type intersection_content(Box const
|
||||
bool const ok = geometry::detail::intersection::intersection_box_box
|
||||
<
|
||||
0, geometry::dimension<Box>::value
|
||||
>::apply(box1, box2, 0, box_intersection, 0);
|
||||
>::apply(box1, box2, box_intersection, 0);
|
||||
if ( ok )
|
||||
{
|
||||
return index::detail::content(box_intersection);
|
||||
|
@ -1,416 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2014-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2014-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2015-2020.
|
||||
// Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// 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_POLICIES_ROBUSTNESS_GET_RESCALE_POLICY_HPP
|
||||
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_GET_RESCALE_POLICY_HPP
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
#include <boost/geometry/core/config.hpp>
|
||||
#include <boost/geometry/core/coordinate_promotion.hpp>
|
||||
#include <boost/geometry/core/tag_cast.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/envelope.hpp>
|
||||
#include <boost/geometry/algorithms/expand.hpp>
|
||||
#include <boost/geometry/algorithms/is_empty.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/algorithms/detail/get_max_size.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/rescale_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_type.hpp>
|
||||
#include <boost/geometry/util/numeric_cast.hpp>
|
||||
#include <boost/geometry/util/type_traits.hpp>
|
||||
|
||||
// TEMP
|
||||
#include <boost/geometry/strategies/envelope/cartesian.hpp>
|
||||
#include <boost/geometry/strategies/envelope/geographic.hpp>
|
||||
#include <boost/geometry/strategies/envelope/spherical.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace get_rescale_policy
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Box,
|
||||
typename Point,
|
||||
typename RobustPoint,
|
||||
typename Factor
|
||||
>
|
||||
inline void scale_box_to_integer_range(Box const& box,
|
||||
Point& min_point,
|
||||
RobustPoint& min_robust_point,
|
||||
Factor& factor)
|
||||
{
|
||||
// Scale box to integer-range
|
||||
typedef typename promote_floating_point
|
||||
<
|
||||
typename geometry::coordinate_type<Point>::type
|
||||
>::type num_type;
|
||||
num_type const diff = util::numeric_cast<num_type>(detail::get_max_size(box));
|
||||
num_type const range = 10000000.0; // Define a large range to get precise integer coordinates
|
||||
num_type const half = 0.5;
|
||||
if (math::equals(diff, num_type())
|
||||
|| diff >= range
|
||||
|| ! boost::math::isfinite(diff))
|
||||
{
|
||||
factor = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
factor = util::numeric_cast<num_type>(
|
||||
util::numeric_cast<boost::long_long_type>(half + range / diff));
|
||||
BOOST_GEOMETRY_ASSERT(factor >= 1);
|
||||
}
|
||||
|
||||
// Assign input/output minimal points
|
||||
detail::assign_point_from_index<0>(box, min_point);
|
||||
num_type const two = 2;
|
||||
boost::long_long_type const min_coordinate
|
||||
= util::numeric_cast<boost::long_long_type>(-range / two);
|
||||
assign_values(min_robust_point, min_coordinate, min_coordinate);
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename Point, typename RobustPoint, typename Geometry,
|
||||
typename Factor, typename Strategy
|
||||
>
|
||||
static inline void init_rescale_policy(Geometry const& geometry,
|
||||
Point& min_point,
|
||||
RobustPoint& min_robust_point,
|
||||
Factor& factor,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
if (geometry::is_empty(geometry))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get bounding box
|
||||
model::box<Point> env = geometry::return_envelope
|
||||
<
|
||||
model::box<Point>
|
||||
>(geometry, strategy);
|
||||
|
||||
scale_box_to_integer_range(env, min_point, min_robust_point, factor);
|
||||
}
|
||||
|
||||
// NOTE: Actually it should take 2 separate strategies, one for each geometry
|
||||
// in case one of them was e.g. a Box
|
||||
template
|
||||
<
|
||||
typename Point, typename RobustPoint, typename Geometry1, typename Geometry2,
|
||||
typename Factor, typename Strategy1, typename Strategy2
|
||||
>
|
||||
static inline void init_rescale_policy(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
Point& min_point,
|
||||
RobustPoint& min_robust_point,
|
||||
Factor& factor,
|
||||
Strategy1 const& strategy1,
|
||||
Strategy2 const& strategy2)
|
||||
{
|
||||
// Get bounding boxes (when at least one of the geometries is not empty)
|
||||
bool const is_empty1 = geometry::is_empty(geometry1);
|
||||
bool const is_empty2 = geometry::is_empty(geometry2);
|
||||
if (is_empty1 && is_empty2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
model::box<Point> env;
|
||||
if (is_empty1)
|
||||
{
|
||||
geometry::envelope(geometry2, env, strategy2);
|
||||
}
|
||||
else if (is_empty2)
|
||||
{
|
||||
geometry::envelope(geometry1, env, strategy1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The following approach (envelope + expand) may not give the
|
||||
// optimal MBR when then two geometries are in the spherical
|
||||
// equatorial or geographic coordinate systems.
|
||||
// TODO: implement envelope for two (or possibly more geometries)
|
||||
geometry::envelope(geometry1, env, strategy1);
|
||||
model::box<Point> env2 = geometry::return_envelope
|
||||
<
|
||||
model::box<Point>
|
||||
>(geometry2, strategy2);
|
||||
geometry::expand(env, env2, strategy1);
|
||||
}
|
||||
|
||||
scale_box_to_integer_range(env, min_point, min_robust_point, factor);
|
||||
}
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool IsFloatingPoint
|
||||
>
|
||||
struct rescale_policy_type
|
||||
{
|
||||
typedef no_rescale_policy type;
|
||||
};
|
||||
|
||||
// We rescale only all FP types
|
||||
template
|
||||
<
|
||||
typename Point
|
||||
>
|
||||
struct rescale_policy_type<Point, true>
|
||||
{
|
||||
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
|
||||
typedef model::point
|
||||
<
|
||||
typename detail::robust_type<coordinate_type>::type,
|
||||
geometry::dimension<Point>::value,
|
||||
typename geometry::coordinate_system<Point>::type
|
||||
> robust_point_type;
|
||||
typedef typename promote_floating_point<coordinate_type>::type factor_type;
|
||||
typedef detail::robust_policy<Point, robust_point_type, factor_type> type;
|
||||
};
|
||||
|
||||
template <typename Policy>
|
||||
struct get_rescale_policy
|
||||
{
|
||||
template <typename Geometry, typename Strategy>
|
||||
static inline Policy apply(Geometry const& geometry,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef typename geometry::coordinate_type<Geometry>::type coordinate_type;
|
||||
typedef typename promote_floating_point<coordinate_type>::type factor_type;
|
||||
typedef model::point
|
||||
<
|
||||
typename detail::robust_type<coordinate_type>::type,
|
||||
geometry::dimension<point_type>::value,
|
||||
typename geometry::coordinate_system<point_type>::type
|
||||
> robust_point_type;
|
||||
|
||||
point_type min_point;
|
||||
robust_point_type min_robust_point;
|
||||
factor_type factor;
|
||||
init_rescale_policy(geometry, min_point, min_robust_point,
|
||||
factor, strategy);
|
||||
|
||||
return Policy(min_point, min_robust_point, factor);
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2, typename Strategy1, typename Strategy2>
|
||||
static inline Policy apply(Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
Strategy1 const& strategy1,
|
||||
Strategy2 const& strategy2)
|
||||
{
|
||||
typedef typename point_type<Geometry1>::type point_type;
|
||||
typedef typename geometry::coordinate_type<Geometry1>::type coordinate_type;
|
||||
typedef typename promote_floating_point<coordinate_type>::type factor_type;
|
||||
typedef model::point
|
||||
<
|
||||
typename detail::robust_type<coordinate_type>::type,
|
||||
geometry::dimension<point_type>::value,
|
||||
typename geometry::coordinate_system<point_type>::type
|
||||
> robust_point_type;
|
||||
|
||||
point_type min_point;
|
||||
robust_point_type min_robust_point;
|
||||
factor_type factor;
|
||||
init_rescale_policy(geometry1, geometry2, min_point, min_robust_point,
|
||||
factor, strategy1, strategy2);
|
||||
|
||||
return Policy(min_point, min_robust_point, factor);
|
||||
}
|
||||
};
|
||||
|
||||
// Specialization for no-rescaling
|
||||
template <>
|
||||
struct get_rescale_policy<no_rescale_policy>
|
||||
{
|
||||
template <typename Geometry, typename EnvelopeStrategy>
|
||||
static inline no_rescale_policy apply(Geometry const& , EnvelopeStrategy const&)
|
||||
{
|
||||
return no_rescale_policy();
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2, typename EnvelopeStrategy1, typename EnvelopeStrategy2>
|
||||
static inline no_rescale_policy apply(Geometry1 const& , Geometry2 const& ,
|
||||
EnvelopeStrategy1 const& , EnvelopeStrategy2 const& )
|
||||
{
|
||||
return no_rescale_policy();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}} // namespace detail::get_rescale_policy
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
typename CSTag = typename geometry::cs_tag<Point>::type
|
||||
>
|
||||
struct rescale_policy_type
|
||||
: public detail::get_rescale_policy::rescale_policy_type
|
||||
<
|
||||
Point,
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
std::is_floating_point
|
||||
<
|
||||
typename geometry::coordinate_type<Point>::type
|
||||
>::type::value
|
||||
&&
|
||||
std::is_same
|
||||
<
|
||||
CSTag,
|
||||
geometry::cartesian_tag
|
||||
>::value
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
>
|
||||
{
|
||||
BOOST_GEOMETRY_STATIC_ASSERT(
|
||||
(util::is_point<Point>::value),
|
||||
"Point type expected.",
|
||||
Point);
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename CSTag = typename geometry::cs_tag<Geometry1>::type,
|
||||
typename Tag1 = typename tag_cast
|
||||
<
|
||||
typename tag<Geometry1>::type,
|
||||
box_tag,
|
||||
pointlike_tag,
|
||||
linear_tag,
|
||||
areal_tag
|
||||
>::type,
|
||||
typename Tag2 = typename tag_cast
|
||||
<
|
||||
typename tag<Geometry2>::type,
|
||||
box_tag,
|
||||
pointlike_tag,
|
||||
linear_tag,
|
||||
areal_tag
|
||||
>::type
|
||||
>
|
||||
struct rescale_overlay_policy_type
|
||||
// Default: no rescaling
|
||||
: public detail::get_rescale_policy::rescale_policy_type
|
||||
<
|
||||
typename geometry::point_type<Geometry1>::type,
|
||||
false
|
||||
>
|
||||
{};
|
||||
|
||||
// Areal/areal: get rescale policy based on coordinate type
|
||||
template
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename CSTag
|
||||
>
|
||||
struct rescale_overlay_policy_type<Geometry1, Geometry2, CSTag, areal_tag, areal_tag>
|
||||
: public rescale_policy_type
|
||||
<
|
||||
typename geometry::point_type<Geometry1>::type,
|
||||
CSTag
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
template <typename Policy, typename Geometry>
|
||||
inline Policy get_rescale_policy(Geometry const& geometry)
|
||||
{
|
||||
typename geometry::strategies::envelope::services::default_strategy
|
||||
<
|
||||
Geometry,
|
||||
model::box<typename point_type<Geometry>::type>
|
||||
>::type strategy;
|
||||
|
||||
return detail::get_rescale_policy::get_rescale_policy<Policy>::apply(geometry, strategy);
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename Policy, typename Geometry, typename Strategy,
|
||||
std::enable_if_t<std::is_void<typename geometry::tag<Strategy>::type>::value, int> = 0
|
||||
>
|
||||
inline Policy get_rescale_policy(Geometry const& geometry, Strategy const& strategy)
|
||||
{
|
||||
return detail::get_rescale_policy::get_rescale_policy
|
||||
<
|
||||
Policy
|
||||
>::apply(geometry, strategy);
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename Policy, typename Geometry1, typename Geometry2,
|
||||
std::enable_if_t<! std::is_void<typename geometry::tag<Geometry2>::type>::value, int> = 0
|
||||
>
|
||||
inline Policy get_rescale_policy(Geometry1 const& geometry1, Geometry2 const& geometry2)
|
||||
{
|
||||
typename geometry::strategies::envelope::services::default_strategy
|
||||
<
|
||||
Geometry1,
|
||||
model::box<typename point_type<Geometry1>::type>
|
||||
>::type strategy1;
|
||||
typename geometry::strategies::envelope::services::default_strategy
|
||||
<
|
||||
Geometry2,
|
||||
model::box<typename point_type<Geometry2>::type>
|
||||
>::type strategy2;
|
||||
|
||||
return detail::get_rescale_policy::get_rescale_policy
|
||||
<
|
||||
Policy
|
||||
>::apply(geometry1, geometry2, strategy1, strategy2);
|
||||
}
|
||||
|
||||
template <typename Policy, typename Geometry1, typename Geometry2, typename Strategy>
|
||||
inline Policy get_rescale_policy(Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
return detail::get_rescale_policy::get_rescale_policy
|
||||
<
|
||||
Policy
|
||||
>::apply(geometry1, geometry2, strategy, strategy);
|
||||
}
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_GET_RESCALE_POLICY_HPP
|
@ -1,55 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2013 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// 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_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
|
||||
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/segment_ratio.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// Redudant later.
|
||||
struct no_rescale_policy
|
||||
{
|
||||
static bool const enabled = false;
|
||||
|
||||
// We don't rescale but return the reference of the input
|
||||
template <std::size_t Dimension, typename Value>
|
||||
inline Value const& apply(Value const& value) const
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
#endif
|
||||
|
||||
|
||||
// Implement meta-functions for this policy
|
||||
template <typename Point>
|
||||
struct robust_point_type<Point, detail::no_rescale_policy>
|
||||
{
|
||||
// The point itself
|
||||
typedef Point type;
|
||||
};
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_NO_RESCALE_POLICY_HPP
|
@ -1,85 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2014-2015 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2014-2015 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2015, 2023.
|
||||
// Modifications copyright (c) 2015-2023, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// 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_POLICIES_ROBUSTNESS_RESCALE_POLICY_HPP
|
||||
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_RESCALE_POLICY_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
|
||||
#include <boost/geometry/policies/robustness/segment_ratio.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename FpPoint, typename IntPoint, typename CalculationType>
|
||||
struct robust_policy
|
||||
{
|
||||
static bool const enabled = true;
|
||||
|
||||
typedef typename geometry::coordinate_type<IntPoint>::type output_ct;
|
||||
|
||||
robust_policy(FpPoint const& fp_min, IntPoint const& int_min, CalculationType const& the_factor)
|
||||
: m_fp_min(fp_min)
|
||||
, m_int_min(int_min)
|
||||
, m_multiplier(the_factor)
|
||||
{
|
||||
}
|
||||
|
||||
template <std::size_t Dimension, typename Value>
|
||||
inline output_ct apply(Value const& value) const
|
||||
{
|
||||
// a + (v-b)*f
|
||||
CalculationType const a = static_cast<CalculationType>(get<Dimension>(m_int_min));
|
||||
CalculationType const b = static_cast<CalculationType>(get<Dimension>(m_fp_min));
|
||||
CalculationType const result = a + (value - b) * m_multiplier;
|
||||
|
||||
return geometry::math::rounding_cast<output_ct>(result);
|
||||
}
|
||||
|
||||
FpPoint m_fp_min;
|
||||
IntPoint m_int_min;
|
||||
CalculationType m_multiplier;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
#endif
|
||||
|
||||
|
||||
// Implement meta-functions for this policy
|
||||
|
||||
// Define the IntPoint as a robust-point type
|
||||
template <typename Point, typename FpPoint, typename IntPoint, typename CalculationType>
|
||||
struct robust_point_type<Point, detail::robust_policy<FpPoint, IntPoint, CalculationType> >
|
||||
{
|
||||
typedef IntPoint type;
|
||||
};
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_RESCALE_POLICY_HPP
|
@ -1,43 +0,0 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2019-2019 Barend Gehrels, 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_POLICIES_ROBUSTNESS_RESCALE_POLICY_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_RESCALE_POLICY_TYPE_HPP
|
||||
|
||||
#include <boost/geometry/policies/robustness/no_rescale_policy.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
struct no_rescale_policy_tag {};
|
||||
struct rescale_policy_tag {};
|
||||
|
||||
template <typename RobustPolicy>
|
||||
struct rescale_policy_type
|
||||
{
|
||||
typedef rescale_policy_tag type;
|
||||
};
|
||||
|
||||
// Specialization
|
||||
template <>
|
||||
struct rescale_policy_type<no_rescale_policy>
|
||||
{
|
||||
typedef no_rescale_policy_tag type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
#endif
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_RESCALE_POLICY_TYPE_HPP
|
@ -1,30 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2013 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// 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_POLICIES_ROBUSTNESS_ROBUST_POINT_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_POINT_TYPE_HPP
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
// Meta-function to typedef a robust point type for a policy
|
||||
template <typename Point, typename Policy>
|
||||
struct robust_point_type
|
||||
{
|
||||
// By default, the point itself is the robust type
|
||||
typedef Point type;
|
||||
};
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_POINT_TYPE_HPP
|
@ -1,72 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2014 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// 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_POLICIES_ROBUSTNESS_ROBUST_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_TYPE_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
|
||||
namespace detail_dispatch
|
||||
{
|
||||
|
||||
template <typename CoordinateType, typename IsFloatingPoint>
|
||||
struct robust_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct robust_type<CoordinateType, std::false_type>
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct robust_type<CoordinateType, std::true_type>
|
||||
{
|
||||
typedef boost::long_long_type type;
|
||||
};
|
||||
|
||||
} // namespace detail_dispatch
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct robust_type
|
||||
{
|
||||
typedef typename detail_dispatch::robust_type
|
||||
<
|
||||
CoordinateType,
|
||||
typename std::is_floating_point<CoordinateType>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_ROBUST_TYPE_HPP
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2016-2021.
|
||||
// Modifications copyright (c) 2016-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2016-2024.
|
||||
// Modifications copyright (c) 2016-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -347,6 +348,11 @@ private :
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Point>
|
||||
struct segment_ratio_type
|
||||
{
|
||||
using type = segment_ratio<typename geometry::coordinate_type<Point>::type>;
|
||||
};
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
@ -1,54 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2013 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// 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_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace detail
|
||||
{
|
||||
|
||||
// Temporary meta-function to access segment-ratio for a policy
|
||||
template <typename Point, typename Policy>
|
||||
struct segment_ratio_type
|
||||
{
|
||||
// Type in segment ratio is either the coordinate type, or for
|
||||
// deprecated robust point types it is a long_long type
|
||||
typedef std::conditional_t
|
||||
<
|
||||
std::is_same
|
||||
<
|
||||
typename rescale_policy_type<Policy>::type,
|
||||
no_rescale_policy_tag
|
||||
>::value,
|
||||
typename geometry::coordinate_type<Point>::type,
|
||||
boost::long_long_type
|
||||
> coordinate_type;
|
||||
|
||||
// Define segment ratio based on the coordinate type
|
||||
typedef geometry::segment_ratio<coordinate_type> type;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::deatil
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_POLICIES_ROBUSTNESS_SEGMENT_RATIO_TYPE_HPP
|
@ -3,9 +3,9 @@
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2013-2023 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021, Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
#include <boost/geometry/algorithms/detail/assign_values.hpp>
|
||||
#include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/equals/point_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
#include <boost/geometry/util/numeric_cast.hpp>
|
||||
@ -52,15 +51,6 @@
|
||||
#include <boost/geometry/strategies/side_info.hpp>
|
||||
#include <boost/geometry/strategies/within.hpp>
|
||||
|
||||
#include <boost/geometry/policies/robustness/rescale_policy_tags.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
|
||||
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
|
||||
# include <boost/geometry/io/wkt/write.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
@ -157,12 +147,12 @@ struct cartesian_segments
|
||||
template <typename Point, typename Segment1, typename Segment2>
|
||||
void assign_a(Point& point, Segment1 const& a, Segment2 const& ) const
|
||||
{
|
||||
assign(point, a, dx_a, dy_a, robust_ra);
|
||||
assign(point, a, dx_a, dy_a, ra);
|
||||
}
|
||||
template <typename Point, typename Segment1, typename Segment2>
|
||||
void assign_b(Point& point, Segment1 const& , Segment2 const& b) const
|
||||
{
|
||||
assign(point, b, dx_b, dy_b, robust_rb);
|
||||
assign(point, b, dx_b, dy_b, rb);
|
||||
}
|
||||
|
||||
template <typename Point, typename Segment>
|
||||
@ -239,7 +229,7 @@ struct cartesian_segments
|
||||
<
|
||||
std::is_arithmetic<CoordinateType>::value
|
||||
>::apply(comparable_length_a(), comparable_length_b(),
|
||||
robust_ra.edge_value(), robust_rb.edge_value());
|
||||
ra.edge_value(), rb.edge_value());
|
||||
|
||||
if (use_a)
|
||||
{
|
||||
@ -254,8 +244,8 @@ struct cartesian_segments
|
||||
// Verify nearly collinear cases (the threshold is arbitrary
|
||||
// but influences performance). If the intersection is located
|
||||
// outside the segments, then it should be moved.
|
||||
if (robust_ra.possibly_collinear(1.0e-3)
|
||||
&& robust_rb.possibly_collinear(1.0e-3))
|
||||
if (ra.possibly_collinear(1.0e-3)
|
||||
&& rb.possibly_collinear(1.0e-3))
|
||||
{
|
||||
// The segments are nearly collinear and because of the calculation
|
||||
// method with very small denominator, the IP appears outside the
|
||||
@ -270,8 +260,8 @@ struct cartesian_segments
|
||||
|
||||
CoordinateType dx_a, dy_a;
|
||||
CoordinateType dx_b, dy_b;
|
||||
SegmentRatio robust_ra;
|
||||
SegmentRatio robust_rb;
|
||||
SegmentRatio ra;
|
||||
SegmentRatio rb;
|
||||
};
|
||||
|
||||
template <typename D, typename W, typename ResultType>
|
||||
@ -414,10 +404,10 @@ struct cartesian_segments
|
||||
typename geometry::coordinate_type<point2_type>::type
|
||||
>::type coordinate_type;
|
||||
|
||||
point1_type const& p1 = range_p.at(0);
|
||||
point1_type const& p2 = range_p.at(1);
|
||||
point2_type const& q1 = range_q.at(0);
|
||||
point2_type const& q2 = range_q.at(1);
|
||||
point1_type const& p1 = p.first;
|
||||
point1_type const& p2 = p.second;
|
||||
point2_type const& q1 = q.first;
|
||||
point2_type const& q2 = q.second;
|
||||
|
||||
bool const p_is_point = equals_point_point(p1, p2);
|
||||
bool const q_is_point = equals_point_point(q1, q2);
|
||||
@ -460,14 +450,6 @@ struct cartesian_segments
|
||||
|
||||
bool collinear = sides.collinear();
|
||||
|
||||
//TODO: remove this when rescaling is removed
|
||||
// Calculate the differences again
|
||||
// (for rescaled version, this is different from dx_p etc)
|
||||
coordinate_type const dx_p = get<0>(p2) - get<0>(p1);
|
||||
coordinate_type const dx_q = get<0>(q2) - get<0>(q1);
|
||||
coordinate_type const dy_p = get<1>(p2) - get<1>(p1);
|
||||
coordinate_type const dy_q = get<1>(q2) - get<1>(q1);
|
||||
|
||||
// r: ratio 0-1 where intersection divides A/B
|
||||
// (only calculated for non-collinear segments)
|
||||
if (! collinear)
|
||||
@ -475,18 +457,18 @@ struct cartesian_segments
|
||||
coordinate_type denominator_a, nominator_a;
|
||||
coordinate_type denominator_b, nominator_b;
|
||||
|
||||
cramers_rule(dx_p, dy_p, dx_q, dy_q,
|
||||
cramers_rule(sinfo.dx_a, sinfo.dy_a, sinfo.dx_b, sinfo.dy_b,
|
||||
get<0>(p1) - get<0>(q1),
|
||||
get<1>(p1) - get<1>(q1),
|
||||
nominator_a, denominator_a);
|
||||
|
||||
cramers_rule(dx_q, dy_q, dx_p, dy_p,
|
||||
cramers_rule(sinfo.dx_b, sinfo.dy_b, sinfo.dx_a, sinfo.dy_a,
|
||||
get<0>(q1) - get<0>(p1),
|
||||
get<1>(q1) - get<1>(p1),
|
||||
nominator_b, denominator_b);
|
||||
|
||||
math::detail::equals_factor_policy<coordinate_type>
|
||||
policy(dx_p, dy_p, dx_q, dy_q);
|
||||
policy(sinfo.dx_a, sinfo.dy_a, sinfo.dx_b, sinfo.dy_b);
|
||||
|
||||
coordinate_type const zero = 0;
|
||||
if (math::detail::equals_by_policy(denominator_a, zero, policy)
|
||||
@ -500,18 +482,18 @@ struct cartesian_segments
|
||||
}
|
||||
else
|
||||
{
|
||||
sinfo.robust_ra.assign(nominator_a, denominator_a);
|
||||
sinfo.robust_rb.assign(nominator_b, denominator_b);
|
||||
sinfo.ra.assign(nominator_a, denominator_a);
|
||||
sinfo.rb.assign(nominator_b, denominator_b);
|
||||
}
|
||||
}
|
||||
|
||||
if (collinear)
|
||||
{
|
||||
std::pair<bool, bool> const collinear_use_first
|
||||
= is_x_more_significant(geometry::math::abs(dx_p),
|
||||
geometry::math::abs(dy_p),
|
||||
geometry::math::abs(dx_q),
|
||||
geometry::math::abs(dy_q),
|
||||
= is_x_more_significant(geometry::math::abs(sinfo.dx_a),
|
||||
geometry::math::abs(sinfo.dy_a),
|
||||
geometry::math::abs(sinfo.dx_b),
|
||||
geometry::math::abs(sinfo.dy_b),
|
||||
p_is_point, q_is_point);
|
||||
|
||||
if (collinear_use_first.second)
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2016-2021, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2016-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -23,7 +24,6 @@
|
||||
#include <boost/geometry/algorithms/detail/assign_values.hpp>
|
||||
#include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/equals/point_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
|
||||
#include <boost/geometry/formulas/andoyer_inverse.hpp>
|
||||
#include <boost/geometry/formulas/sjoberg_intersection.hpp>
|
||||
@ -114,8 +114,8 @@ struct geographic_segments
|
||||
|
||||
CoordinateType lon;
|
||||
CoordinateType lat;
|
||||
SegmentRatio robust_ra;
|
||||
SegmentRatio robust_rb;
|
||||
SegmentRatio ra;
|
||||
SegmentRatio rb;
|
||||
intersection_point_flag ip_flag;
|
||||
};
|
||||
|
||||
@ -489,8 +489,8 @@ private:
|
||||
|
||||
sinfo.lon = lon;
|
||||
sinfo.lat = lat;
|
||||
sinfo.robust_ra.assign(dist_a1_i1, dist_a1_a2);
|
||||
sinfo.robust_rb.assign(dist_b1_i1, dist_b1_b2);
|
||||
sinfo.ra.assign(dist_a1_i1, dist_a1_a2);
|
||||
sinfo.rb.assign(dist_b1_i1, dist_b1_b2);
|
||||
sinfo.ip_flag = ip_flag;
|
||||
|
||||
return Policy::segments_crosses(sides, sinfo, a, b);
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2015-2021.
|
||||
// Modifications copyright (c) 2015-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -24,8 +25,8 @@ namespace boost { namespace geometry
|
||||
template <typename SegmentRatio>
|
||||
struct fraction_type
|
||||
{
|
||||
SegmentRatio robust_ra; // TODO this can be renamed now to "ra"
|
||||
SegmentRatio robust_rb;
|
||||
SegmentRatio ra;
|
||||
SegmentRatio rb;
|
||||
|
||||
bool initialized;
|
||||
inline fraction_type()
|
||||
@ -36,15 +37,15 @@ struct fraction_type
|
||||
inline void assign(Info const& info)
|
||||
{
|
||||
initialized = true;
|
||||
robust_ra = info.robust_ra;
|
||||
robust_rb = info.robust_rb;
|
||||
ra = info.ra;
|
||||
rb = info.rb;
|
||||
}
|
||||
|
||||
inline void assign(SegmentRatio const& a, SegmentRatio const& b)
|
||||
{
|
||||
initialized = true;
|
||||
robust_ra = a;
|
||||
robust_rb = b;
|
||||
ra = a;
|
||||
rb = b;
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2016-2020.
|
||||
// Modifications copyright (c) 2016-2020, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2016-2024.
|
||||
// Modifications copyright (c) 2016-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -17,7 +18,6 @@
|
||||
//#include <type_traits>
|
||||
|
||||
#include <boost/geometry/policies/relate/intersection_policy.hpp>
|
||||
#include <boost/geometry/policies/robustness/segment_ratio_type.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/intersection.hpp>
|
||||
#include <boost/geometry/strategies/intersection_result.hpp>
|
||||
@ -41,21 +41,15 @@ template
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
typename IntersectionPoint,
|
||||
typename RobustPolicy,
|
||||
typename CalculationType = void
|
||||
>
|
||||
struct intersection_strategies
|
||||
{
|
||||
private :
|
||||
// for development BOOST_STATIC_ASSERT((! std::is_same<RobustPolicy, void>::type::value));
|
||||
|
||||
typedef segment_intersection_points
|
||||
<
|
||||
IntersectionPoint,
|
||||
typename detail::segment_ratio_type
|
||||
<
|
||||
IntersectionPoint, RobustPolicy
|
||||
>::type
|
||||
typename segment_ratio_type<IntersectionPoint>::type
|
||||
> ip_type;
|
||||
|
||||
public:
|
||||
@ -69,14 +63,6 @@ public:
|
||||
Tag,
|
||||
CalculationType
|
||||
>::type segment_intersection_strategy_type;
|
||||
|
||||
typedef typename strategy::side::services::default_strategy
|
||||
<
|
||||
Tag,
|
||||
CalculationType
|
||||
>::type side_strategy_type;
|
||||
|
||||
typedef RobustPolicy rescale_policy_type;
|
||||
};
|
||||
|
||||
|
||||
|
@ -4,6 +4,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2024.
|
||||
// Modifications copyright (c) 2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
@ -17,7 +21,7 @@
|
||||
#include <cmath>
|
||||
#include <utility>
|
||||
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) || defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION)
|
||||
# include <iostream>
|
||||
#endif
|
||||
|
||||
@ -146,7 +150,7 @@ public :
|
||||
return sides[Which].first == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) || defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION)
|
||||
inline void debug() const
|
||||
{
|
||||
std::cout << sides[0].first << " "
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2016-2021, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2016-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -23,7 +24,6 @@
|
||||
#include <boost/geometry/algorithms/detail/assign_values.hpp>
|
||||
#include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/equals/point_point.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
|
||||
#include <boost/geometry/arithmetic/arithmetic.hpp>
|
||||
#include <boost/geometry/arithmetic/cross_product.hpp>
|
||||
@ -133,8 +133,8 @@ struct ecef_segments
|
||||
}
|
||||
|
||||
Vector3d intersection_point;
|
||||
SegmentRatio robust_ra;
|
||||
SegmentRatio robust_rb;
|
||||
SegmentRatio ra;
|
||||
SegmentRatio rb;
|
||||
intersection_point_flag ip_flag;
|
||||
|
||||
CalcPolicy const& calc_policy;
|
||||
@ -424,8 +424,8 @@ struct ecef_segments
|
||||
vec3d_t
|
||||
> sinfo(calc_policy);
|
||||
|
||||
sinfo.robust_ra.assign(dist_a1_i1, dist_a1_a2);
|
||||
sinfo.robust_rb.assign(dist_b1_i1, dist_b1_b2);
|
||||
sinfo.ra.assign(dist_a1_i1, dist_a1_a2);
|
||||
sinfo.rb.assign(dist_b1_i1, dist_b1_b2);
|
||||
sinfo.intersection_point = i1;
|
||||
sinfo.ip_flag = ip_flag;
|
||||
|
||||
|
@ -51,8 +51,8 @@ void test_all()
|
||||
test_one<multi_point_type, polygon>("simplex3", simplex, join, end_flat, 44.5619, 3.0);
|
||||
|
||||
test_one<multi_point_type, polygon>("three1", three, join, end_flat, 3.0 * expectation, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// For no-rescaling, fails in CCW mode
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// fails in CCW mode
|
||||
test_one<multi_point_type, polygon>("three2", three, join, end_flat, 36.7528, 2.0);
|
||||
#endif
|
||||
test_one<multi_point_type, polygon>("three19", three, join, end_flat, 33.6857, 1.9);
|
||||
@ -126,11 +126,7 @@ void test_many_points_per_circle()
|
||||
|
||||
using bg::strategy::buffer::point_circle;
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
double const tolerance = 1000.0;
|
||||
#else
|
||||
double const tolerance = 1.0;
|
||||
#endif
|
||||
|
||||
// Area should be somewhat larger (~>) than pi*distance^2
|
||||
// 6051788: area ~> 115058122875258
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
// Copyright (c) 2024 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2019-2024.
|
||||
// Modifications copyright (c) 2019-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// 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)
|
||||
@ -159,7 +163,6 @@ void test_buffer(std::string const& caseid, std::string const& wkt, std::vector<
|
||||
distance_strategy, buffer_side_strategy, join_strategy,
|
||||
end_strategy, point_strategy,
|
||||
strategy,
|
||||
bg::detail::no_rescale_policy(),
|
||||
visitor);
|
||||
|
||||
#if defined(TEST_WITH_SVG)
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2010-2019 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2016-2021.
|
||||
// Modifications copyright (c) 2016-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2016-2024.
|
||||
// Modifications copyright (c) 2016-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -272,15 +273,9 @@ void test_buffer(std::string const& caseid,
|
||||
#endif
|
||||
|
||||
typedef typename bg::point_type<Geometry>::type point_type;
|
||||
typedef typename bg::rescale_policy_type<point_type>::type
|
||||
rescale_policy_type;
|
||||
|
||||
// Enlarge the box to get a proper rescale policy
|
||||
bg::buffer(envelope, envelope, distance_strategy.max_distance(join_strategy, end_strategy));
|
||||
|
||||
rescale_policy_type rescale_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(envelope, strategy);
|
||||
|
||||
buffered.clear();
|
||||
bg::detail::buffer::buffer_inserter<GeometryOut>(geometry,
|
||||
std::back_inserter(buffered),
|
||||
@ -290,7 +285,6 @@ void test_buffer(std::string const& caseid,
|
||||
end_strategy,
|
||||
point_strategy,
|
||||
strategy,
|
||||
rescale_policy,
|
||||
visitor);
|
||||
|
||||
#if defined(TEST_WITH_CSV)
|
||||
@ -379,15 +373,12 @@ void test_buffer(std::string const& caseid,
|
||||
join_strategy,
|
||||
end_strategy,
|
||||
point_strategy,
|
||||
rescale_policy,
|
||||
ptv);
|
||||
ptv.map_input_output(geometry, buffered, distance_strategy.negative());
|
||||
// self_ips NYI here
|
||||
}
|
||||
#elif defined(TEST_WITH_SVG)
|
||||
rescale_policy_type rescale_policy_output
|
||||
= bg::get_rescale_policy<rescale_policy_type>(envelope_output);
|
||||
buffer_mapper.map_self_ips(mapper, buffered, strategy, rescale_policy_output);
|
||||
buffer_mapper.map_self_ips(mapper, buffered, strategy);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2020-2024.
|
||||
// Modifications copyright (c) 2020-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -39,7 +40,7 @@ void test_sectionalize(std::string const /*caseid*/, Geometry const& geometry, s
|
||||
typedef std::integer_sequence<std::size_t, 0> dim2;
|
||||
|
||||
sections s;
|
||||
bg::sectionalize<Reverse, dim2>(geometry, bg::detail::no_rescale_policy(), s);
|
||||
bg::sectionalize<Reverse, dim2>(geometry, s);
|
||||
|
||||
BOOST_CHECK_EQUAL(s.size(), section_count);
|
||||
|
||||
|
@ -5,8 +5,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2020-2024.
|
||||
// Modifications copyright (c) 2020-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -61,7 +62,6 @@ void test_sectionalize_part()
|
||||
Geometry geometry;
|
||||
geometry.push_back(bg::make<point_type>(1, 1));
|
||||
|
||||
bg::detail::no_rescale_policy rescale_policy;
|
||||
typename bg::strategies::relate::services::default_strategy
|
||||
<
|
||||
Geometry, Geometry
|
||||
@ -69,12 +69,12 @@ void test_sectionalize_part()
|
||||
|
||||
bg::ring_identifier ring_id;
|
||||
sectionalize_part::apply(sections, geometry.begin(), geometry.end(),
|
||||
rescale_policy, strategy, ring_id, 10);
|
||||
strategy, ring_id, 10);
|
||||
// There should not yet be anything generated, because it is only ONE point
|
||||
|
||||
geometry.push_back(bg::make<point_type>(2, 2));
|
||||
sectionalize_part::apply(sections, geometry.begin(), geometry.end(),
|
||||
rescale_policy, strategy, ring_id, 10);
|
||||
strategy, ring_id, 10);
|
||||
}
|
||||
|
||||
|
||||
@ -92,8 +92,7 @@ void test_sectionalize(std::string const& caseid, G const& g, std::size_t sectio
|
||||
using sections= bg::sections<box, dimension_count>;
|
||||
|
||||
sections s;
|
||||
bg::sectionalize<Reverse, DimensionVector>(g,
|
||||
bg::detail::no_rescale_policy(), s, 0, max_count);
|
||||
bg::sectionalize<Reverse, DimensionVector>(g, s, 0, max_count);
|
||||
|
||||
BOOST_CHECK_EQUAL(s.size(), section_count);
|
||||
|
||||
@ -340,8 +339,8 @@ void test_large_integers()
|
||||
bg::sections<bg::model::box<double_point_type>, 1> double_sections;
|
||||
|
||||
|
||||
bg::sectionalize<false, dimensions>(int_poly, bg::detail::no_rescale_policy(), int_sections);
|
||||
bg::sectionalize<false, dimensions>(double_poly, bg::detail::no_rescale_policy(), double_sections);
|
||||
bg::sectionalize<false, dimensions>(int_poly, int_sections);
|
||||
bg::sectionalize<false, dimensions>(double_poly, double_sections);
|
||||
|
||||
bool equally_sized = int_sections.size() == double_sections.size();
|
||||
BOOST_CHECK(equally_sized);
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
// Copyright (c) 2022 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2024.
|
||||
// Modifications copyright (c) 2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// 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)
|
||||
@ -30,7 +34,7 @@ void test_sectionalize_on_const(Geometry const& geometry, std::size_t expected_s
|
||||
using dim_type = std::integer_sequence<std::size_t, Dim>;
|
||||
|
||||
section_type sections;
|
||||
bg::sectionalize<false, dim_type>(geometry, bg::detail::no_rescale_policy(), sections);
|
||||
bg::sectionalize<false, dim_type>(geometry, sections);
|
||||
BOOST_CHECK_EQUAL(sections.size(), expected_section_count);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ void geometry_to_svg(Geometry const& geometry, const std::string& case_id)
|
||||
using turn_info = bg::detail::overlay::turn_info
|
||||
<
|
||||
point_type,
|
||||
typename bg::detail::segment_ratio_type<point_type, bg::detail::no_rescale_policy>::type
|
||||
typename bg::segment_ratio_type<point_type>::type
|
||||
>;
|
||||
using strategy_type = typename bg::strategies::relate::services::default_strategy
|
||||
<
|
||||
@ -66,20 +66,13 @@ void geometry_to_svg(Geometry const& geometry, const std::string& case_id)
|
||||
|
||||
strategy_type strategy;
|
||||
|
||||
#if defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
|
||||
bg::detail::no_rescale_policy rescale_policy;
|
||||
#else
|
||||
using rescale_policy_type = typename bg::rescale_policy_type<point_type>::type;
|
||||
rescale_policy_type rescale_policy = bg::get_rescale_policy<rescale_policy_type>(geometry, strategy);
|
||||
#endif
|
||||
|
||||
std::vector<turn_info> turns;
|
||||
|
||||
bg::detail::self_get_turn_points::no_interrupt_policy policy;
|
||||
bg::self_turns
|
||||
<
|
||||
bg::detail::overlay::assign_null_policy
|
||||
>(geometry, strategy, rescale_policy, turns, policy);
|
||||
>(geometry, strategy, turns, policy);
|
||||
|
||||
for (turn_info const& turn : turns)
|
||||
{
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2019-2021.
|
||||
// Modifications copyright (c) 2019-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2019-2024.
|
||||
// Modifications copyright (c) 2019-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -31,8 +32,6 @@
|
||||
#include <boost/geometry/io/wkt/read.hpp>
|
||||
#include <boost/geometry/io/wkt/write.hpp>
|
||||
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2021 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2021-2024.
|
||||
// Modifications copyright (c) 2021-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -41,11 +42,10 @@ void do_test(std::string const& case_id,
|
||||
std::size_t expected_cluster_count)
|
||||
{
|
||||
using coor_type = typename bg::coordinate_type<Point>::type;
|
||||
using policy_type = bg::detail::no_rescale_policy;
|
||||
using turn_info = bg::detail::overlay::turn_info
|
||||
<
|
||||
Point,
|
||||
typename bg::detail::segment_ratio_type<Point, policy_type>::type
|
||||
typename bg::segment_ratio_type<Point>::type
|
||||
>;
|
||||
|
||||
using cluster_type = std::map
|
||||
@ -61,7 +61,7 @@ void do_test(std::string const& case_id,
|
||||
}
|
||||
|
||||
cluster_type clusters;
|
||||
bg::detail::overlay::get_clusters(turns, clusters, policy_type());
|
||||
bg::detail::overlay::get_clusters(turns, clusters);
|
||||
BOOST_CHECK_MESSAGE(expected_cluster_count == clusters.size(),
|
||||
"Case: " << case_id
|
||||
<< " ctype: " << string_from_type<coor_type>::name()
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -77,24 +78,21 @@ void test_with_point(std::string const& caseid,
|
||||
P, P
|
||||
>::type strategy_type;
|
||||
|
||||
typedef typename bg::detail::no_rescale_policy rescale_policy_type;
|
||||
|
||||
typedef bg::detail::overlay::turn_info
|
||||
<
|
||||
P,
|
||||
typename bg::detail::segment_ratio_type<P, rescale_policy_type>::type
|
||||
typename bg::segment_ratio_type<P>::type
|
||||
> turn_info;
|
||||
typedef std::vector<turn_info> tp_vector;
|
||||
turn_info model;
|
||||
tp_vector info;
|
||||
strategy_type strategy;
|
||||
rescale_policy_type rescale_policy;
|
||||
sub_range_from_points<P> sub_range_p(pi, pj, pk);
|
||||
sub_range_from_points<P> sub_range_q(qi, qj, qk);
|
||||
bg::detail::overlay::get_turn_info
|
||||
<
|
||||
bg::detail::overlay::assign_null_policy
|
||||
>::apply(sub_range_p, sub_range_q, model, strategy, rescale_policy, std::back_inserter(info));
|
||||
>::apply(sub_range_p, sub_range_q, model, strategy, std::back_inserter(info));
|
||||
|
||||
if (info.size() == 0)
|
||||
{
|
||||
@ -224,7 +222,7 @@ void test_both(std::string const& caseid,
|
||||
method, expected_touch_only, ip_x, ip_y, expected, ip_x2, ip_y2);
|
||||
|
||||
std::string reversed(expected.rbegin(), expected.rend());
|
||||
|
||||
|
||||
if (ip_x2 >= 0 && ip_y2 >= 0)
|
||||
{
|
||||
std::swap(ip_x, ip_x2);
|
||||
|
@ -5,8 +5,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -28,7 +29,6 @@
|
||||
|
||||
#include <boost/geometry/algorithms/correct.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
|
||||
|
||||
@ -63,24 +63,18 @@ struct test_get_turns
|
||||
G1 const& g1, G2 const& g2, double /*precision*/)
|
||||
{
|
||||
typedef typename bg::point_type<G2>::type point_type;
|
||||
|
||||
|
||||
typedef typename bg::strategies::relate::services::default_strategy
|
||||
<
|
||||
G1, G2
|
||||
>::type strategy_type;
|
||||
|
||||
typedef typename bg::rescale_policy_type<point_type>::type
|
||||
rescale_policy_type;
|
||||
|
||||
strategy_type strategy;
|
||||
|
||||
rescale_policy_type rescale_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
typedef bg::detail::overlay::turn_info
|
||||
<
|
||||
point_type,
|
||||
typename bg::detail::segment_ratio_type<point_type, rescale_policy_type>::type
|
||||
typename bg::segment_ratio_type<point_type>::type
|
||||
> turn_info;
|
||||
std::vector<turn_info> turns;
|
||||
|
||||
@ -89,7 +83,7 @@ struct test_get_turns
|
||||
bg::get_turns
|
||||
<
|
||||
false, false, bg::detail::overlay::assign_null_policy
|
||||
>(g1, g2, strategy, rescale_policy, turns, policy);
|
||||
>(g1, g2, strategy, turns, policy);
|
||||
|
||||
BOOST_CHECK_MESSAGE(
|
||||
expected_count == boost::size(turns),
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
// Copyright (c) 2022 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2024.
|
||||
// Modifications copyright (c) 2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
// 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)
|
||||
@ -24,15 +28,14 @@ void test_get_turns_on_const(Ring1 const &ring1, Ring2 const &ring2,
|
||||
{
|
||||
namespace bg = boost::geometry;
|
||||
|
||||
using rescale_policy_type = bg::detail::no_rescale_policy;
|
||||
using strategy_type = typename bg::strategies::relate::services::default_strategy<Ring1, Ring2>::type;
|
||||
|
||||
using point_type = typename bg::point_type<Ring1>::type;
|
||||
using writable_point_type = typename bg::helper_geometry<point_type>::type;
|
||||
|
||||
using segment_ratio_type = typename bg::detail::segment_ratio_type
|
||||
using segment_ratio_type = typename bg::segment_ratio_type
|
||||
<
|
||||
writable_point_type, rescale_policy_type
|
||||
writable_point_type
|
||||
>::type;
|
||||
using turn_info = bg::detail::overlay::turn_info
|
||||
<
|
||||
@ -45,12 +48,12 @@ void test_get_turns_on_const(Ring1 const &ring1, Ring2 const &ring2,
|
||||
bg::get_turns
|
||||
<
|
||||
false, false, bg::detail::overlay::assign_null_policy
|
||||
>(ring1, ring2, strategy, rescale_policy_type(), turns, policy);
|
||||
>(ring1, ring2, strategy, turns, policy);
|
||||
|
||||
BOOST_CHECK_EQUAL(turns.size(), expectation.size());
|
||||
|
||||
const double tolerance = 0.001;
|
||||
for (std::size_t i = 0; i < turns.size() && i < expectation.size(); i++)
|
||||
for (std::size_t i = 0; i < turns.size() && i < expectation.size(); i++)
|
||||
{
|
||||
BOOST_CHECK_CLOSE(expectation[i].GetX(), bg::get<0>(turns[i].point), tolerance);
|
||||
BOOST_CHECK_CLOSE(expectation[i].GetY(), bg::get<1>(turns[i].point), tolerance);
|
||||
@ -58,11 +61,11 @@ void test_get_turns_on_const(Ring1 const &ring1, Ring2 const &ring2,
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << bg::wkt(ring1) << " " << bg::wkt(ring2) << std::endl;
|
||||
for (const auto& turn : turns)
|
||||
for (const auto& turn : turns)
|
||||
{
|
||||
std::cout << bg::wkt(turn.point) << std::endl;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
|
@ -5,9 +5,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -114,7 +114,7 @@ void test_all()
|
||||
expected("tuu+"));
|
||||
test_geometry<ls, poly>("LINESTRING(0 1,0 0,0 1)", "POLYGON((0 0,3 3,3 0,0 0))",
|
||||
expected("tuu+"));
|
||||
|
||||
|
||||
// SPIKE - NON-ENDPOINT - OPPOSITE
|
||||
|
||||
// opposite - eq eq
|
||||
@ -213,7 +213,7 @@ void test_all()
|
||||
test_geometry<ls, poly>("LINESTRING(0 6, 5 6)",
|
||||
"POLYGON((0 0,0 10,10 10,10 0,0 0),(4 4,6 4,6 6,4 6,4 4))",
|
||||
expected("miu+")("mcu+")("mxc="));
|
||||
|
||||
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
|
@ -1,7 +1,8 @@
|
||||
// Boost.Geometry
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2016, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2016-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -33,18 +34,18 @@ void test_all()
|
||||
expected("tcu+")("mic=")("mcc+")("txu="));
|
||||
test_geometry<ls, poly>("LINESTRING(10 0,5 0,5 5,10 5,10 10)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
|
||||
expected("tcc+")("miu=")("mcu+")("txc="));
|
||||
|
||||
|
||||
test_geometry<ls, poly>("LINESTRING(0 0,10 0,10 10.151081711048134)",
|
||||
"POLYGON((0 0,5 5,0 10,20 10,20 2,19 0,0 0)(10 3,15 3,15 7,10 7,10 3))",
|
||||
expected("tcu+")("mic=")("mcu+")("mic=")("mxu+"));
|
||||
|
||||
|
||||
test_geometry<ls, poly>("LINESTRING(11 1,10 0,0 0)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
|
||||
"tcc+", "txu=");
|
||||
test_geometry<ls, poly>("LINESTRING(0 0,10 0,11 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
|
||||
"tcu+", "tuc=");
|
||||
test_geometry<ls, poly>("LINESTRING(10 0,0 0,-1 1)", "POLYGON((0 0,0 10,10 10,10 0,0 0))",
|
||||
"tcc+", "tuu=");
|
||||
|
||||
|
||||
// true hole
|
||||
test_geometry<ls, poly>("LINESTRING(9 1,10 5,9 9)",
|
||||
"POLYGON((0 0,0 10,10 10,10 5,10 0,0 0)(2 2,10 5,2 8,2 2))",
|
||||
@ -70,7 +71,7 @@ void test_all()
|
||||
expected("mcu+")("mic=")("tcc+")("txu="));
|
||||
|
||||
// SPIKE - NON-ENDPOINT - NON-OPPOSITE
|
||||
|
||||
|
||||
// spike - neq eq
|
||||
test_geometry<ls, poly>("LINESTRING(2 2.0036594926050877,4 4,1 1.0022887548647630)",
|
||||
"POLYGON((0 0,4 4,6 3,6 0,0 0))",
|
||||
@ -119,9 +120,9 @@ void test_all()
|
||||
test_geometry<ls, poly>("LINESTRING(0 1,0 0,0 1)",
|
||||
"POLYGON((0 0,3 3,3 0,0 0))",
|
||||
expected("tuu+"));
|
||||
|
||||
|
||||
// SPIKE - NON-ENDPOINT - OPPOSITE
|
||||
|
||||
|
||||
// opposite - eq eq
|
||||
test_geometry<ls, poly>("LINESTRING(6 6,4 4,0 0,2 2.0036594926050877)",
|
||||
"POLYGON((-1 -1,0 0,4 4,6 3,-1 -1))",
|
||||
|
@ -5,8 +5,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -33,7 +34,7 @@ void test_all()
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "tii++", "txx==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "tix+=", "txi=+");
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++");
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tiu+=");
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txx==");
|
||||
@ -73,9 +74,9 @@ void test_all()
|
||||
test_geometry<ls, ls>("LINESTRING(3 5,2 1,1 0)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "tiu+=", "ecc==", "txi=+");
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "mii++", "txu==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+");
|
||||
test_geometry<ls, ls>("LINESTRING(-1 -1,1 0,10 0,20 -1)", "LINESTRING(0 0,10 0)", "mii++", "tux==");
|
||||
test_geometry<ls, ls>("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+=");
|
||||
test_geometry<ls, ls>("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+=");
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)",
|
||||
"LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)",
|
||||
@ -144,7 +145,7 @@ void test_all()
|
||||
expected("muu++"));
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 4,5 4,6 3)",
|
||||
expected("muu++"));
|
||||
|
||||
|
||||
// SPIKE - NON-ENDPOINT - OPPOSITE
|
||||
|
||||
// opposite - eq eq
|
||||
@ -210,7 +211,7 @@ void test_all()
|
||||
expected("muu++"));
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 4,5 4)",
|
||||
expected("muu++"));
|
||||
|
||||
|
||||
// 29.01.2015
|
||||
if ( BOOST_GEOMETRY_CONDITION((std::is_same<T, double>::value)) )
|
||||
{
|
||||
@ -373,7 +374,7 @@ void test_all()
|
||||
test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0,5 0))",
|
||||
"MULTILINESTRING((1 0,8 0,4 0))",
|
||||
expected("mii++")("mix+=")("mux==")("mui==")("mix+=")("mii+=")("mxu==")("mxi=+"));
|
||||
|
||||
|
||||
/*test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0,5 0))",
|
||||
"MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))",
|
||||
expected("mii")("ccc")("ccc")("txx"));*/
|
||||
|
@ -1,7 +1,8 @@
|
||||
// Boost.Geometry
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2016-2021, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2016-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -26,7 +27,7 @@ void test_all()
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "tii++", "txx==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "tix+=", "txi=+");
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++");
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tiu+=");
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txx==");
|
||||
@ -40,7 +41,7 @@ void test_all()
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 1,1 0)", "tux++");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(0 0,1 0)", "tii++", "tux==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(2 0,1 0)", "tix+=", "txi=+");
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,3 0,3 1)", "mii++", "ccc==", "muu==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,3 0,3 -1)", "mii++", "ccc==", "muu==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,1 0,1 1)", "miu+=", "mui=+");
|
||||
@ -49,17 +50,17 @@ void test_all()
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,4 0,4 -1)", "tii++", "ccc==", "tuu==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,2 0,2 1)", "tiu+=", "tui=+");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,2 0,2 -1)", "tiu+=", "tui=+");
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(1 0,2 1,3 5)", "tii++", "ecc==", "tux==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(3 5,2 1,1 0)", "tix+=", "ecc==", "tui=+");
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,2 1,3 5)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "txu==", "ecc==", "tii++");
|
||||
test_geometry<ls, ls>("LINESTRING(3 5,2 1,1 0)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "tiu+=", "ecc==", "txi=+");
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "mii++", "txu==");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+");
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+");
|
||||
test_geometry<ls, ls>("LINESTRING(-1 -1,1 0,10 0,20 -1)", "LINESTRING(0 0,10 0)", "mii++", "tux==");
|
||||
test_geometry<ls, ls>("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+=");
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+=");
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)",
|
||||
"LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)",
|
||||
expected("tii++")("ecc==")("muu==")("mii++")("muu==")("mii++")("mux=="));
|
||||
@ -82,23 +83,23 @@ void test_all()
|
||||
"LINESTRING(-1 0,1 0,2 1.0004570537241201524198894179384922,3 2)",
|
||||
"mxi=+", "tix+=", "ecc==");
|
||||
}
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(30 0,20 0,1 1,-1 -1)", "LINESTRING(0 -1,0 0,1 -1,20 0,25 0)", "mix+=", "tui=+", "muu++");
|
||||
test_geometry<ls, ls>("LINESTRING(0 -1,0 0,1 -1,20 0,25 0)", "LINESTRING(30 0,20 0,1 1,-1 -1)", "mxi=+", "tiu+=", "muu++");
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,30 0)", "LINESTRING(4 0,4 1,20 1,5 0,1 0)", "muu++", "mui=+", "mix+=");
|
||||
test_geometry<ls, ls>("LINESTRING(4 0,4 1,20 1,5 0,1 0)", "LINESTRING(0 0,30 0)", "muu++", "miu+=", "mxi=+");
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(30 0,0 0)", "LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)",
|
||||
expected("mui=+")("miu+=")("mui=+")("mix+="));
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", "LINESTRING(30 0,0 0)",
|
||||
expected("miu+=")("mui=+")("miu+=")("mxi=+"));
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)",
|
||||
expected("mii++")("iuu++")("muu=="));
|
||||
test_geometry<ls, ls>("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,5 0,4 1)",
|
||||
expected("mii++")("muu++")("muu=="));
|
||||
|
||||
|
||||
// non-collinear
|
||||
test_geometry<ls, ls>("LINESTRING(0 1,0 0)", "LINESTRING(0 0,1 0,2 0)", "txu++");
|
||||
test_geometry<ls, ls>("LINESTRING(0 1,0 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++");
|
||||
@ -134,9 +135,9 @@ void test_all()
|
||||
expected("muu++"));
|
||||
test_geometry<ls, ls>("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(-1 0,1 0,6 3)",
|
||||
expected("muu++"));
|
||||
|
||||
|
||||
// SPIKE - NON-ENDPOINT - OPPOSITE
|
||||
|
||||
|
||||
// opposite - eq eq
|
||||
test_geometry<ls, ls>("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -1,0 0,0 4,6 3)",
|
||||
expected("tiu+=")("txi=+")("tii=+")("mxu=="));
|
||||
@ -157,7 +158,7 @@ void test_all()
|
||||
// opposite - neq eq
|
||||
test_geometry<ls, ls>("LINESTRING(6 3,0 3,0 0)", "LINESTRING(0 0,0 2,0 3,0 1)",
|
||||
expected("txi=+")("tix+=")("tii+=")("mux=="));
|
||||
|
||||
|
||||
// SPIKE - ENDPOINT - NON-OPPOSITE
|
||||
|
||||
// spike - neq eq
|
||||
@ -200,7 +201,7 @@ void test_all()
|
||||
expected("muu++"));
|
||||
test_geometry<ls, ls>("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(1 0,-1 0)",
|
||||
expected("muu++"));
|
||||
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(3 0,0 0)",
|
||||
"LINESTRING(4 2,1 0,9 0)",
|
||||
@ -222,7 +223,7 @@ void test_all()
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,5 0)",
|
||||
"LINESTRING(2 0,0 0,-10 0)",
|
||||
expected("tiu+=")("mui=+"));
|
||||
|
||||
|
||||
if ( BOOST_GEOMETRY_CONDITION((std::is_same<T, double>::value)) )
|
||||
{
|
||||
test_geometry<ls, ls>("LINESTRING(0 -1, 10 -1, 20 1)",
|
||||
@ -237,7 +238,7 @@ void test_all()
|
||||
test_geometry<ls, ls>("LINESTRING(20 1, 10 -1, 0 0)",
|
||||
"LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392, 12 10)",
|
||||
expected("muu==")("ccc==")("mii++"));
|
||||
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 -1, 10 -1, 20 1)",
|
||||
"LINESTRING(12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)",
|
||||
expected("mii++")("ccc==")("mux=="));
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -404,15 +405,6 @@ void test_overlay(std::string const& caseid,
|
||||
|
||||
strategy_type strategy;
|
||||
|
||||
using rescale_policy_type = typename bg::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry,
|
||||
Geometry
|
||||
>::type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
#if defined(TEST_WITH_SVG)
|
||||
map_visitor<svg_mapper> visitor(mapper);
|
||||
#else
|
||||
@ -420,7 +412,7 @@ void test_overlay(std::string const& caseid,
|
||||
#endif
|
||||
|
||||
Geometry result;
|
||||
overlay::apply(g1, g2, robust_policy, std::back_inserter(result),
|
||||
overlay::apply(g1, g2, std::back_inserter(result),
|
||||
strategy, visitor);
|
||||
|
||||
std::string message;
|
||||
|
@ -5,8 +5,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -28,7 +29,6 @@
|
||||
#include <boost/geometry/algorithms/intersects.hpp>
|
||||
//#include <boost/geometry/algorithms/detail/overlay/self_intersection_points.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
@ -54,24 +54,21 @@ static void test_self_intersection_points(std::string const& case_id,
|
||||
double /*precision*/ = 0.001)
|
||||
{
|
||||
typedef typename bg::point_type<Geometry>::type point_type;
|
||||
//typedef typename bg::rescale_policy_type<point_type>::type rescale_policy_type;
|
||||
typedef typename bg::strategies::relate::services::default_strategy
|
||||
<
|
||||
Geometry, Geometry
|
||||
>::type strategy_type;
|
||||
typedef bg::detail::no_rescale_policy rescale_policy_type;
|
||||
typedef bg::detail::overlay::turn_info<point_type> turn_info;
|
||||
|
||||
std::vector<turn_info> turns;
|
||||
|
||||
strategy_type strategy;
|
||||
rescale_policy_type rescale_policy;
|
||||
|
||||
bg::detail::self_get_turn_points::no_interrupt_policy policy;
|
||||
bg::self_turns
|
||||
<
|
||||
bg::detail::overlay::assign_null_policy
|
||||
>(geometry, strategy, rescale_policy, turns, policy);
|
||||
>(geometry, strategy, turns, policy);
|
||||
|
||||
|
||||
typedef typename bg::coordinate_type<Geometry>::type ct;
|
||||
@ -91,12 +88,6 @@ static void test_self_intersection_points(std::string const& case_id,
|
||||
|
||||
BOOST_CHECK_EQUAL(expected_count, n);
|
||||
|
||||
typedef typename bg::rescale_policy_type<point_type>::type
|
||||
default_rescale_policy_type;
|
||||
|
||||
default_rescale_policy_type default_robust_policy
|
||||
= bg::get_rescale_policy<default_rescale_policy_type>(geometry, strategy);
|
||||
|
||||
if (expected_count > 0)
|
||||
{
|
||||
BOOST_CHECK_EQUAL(bg::intersects(geometry), true);
|
||||
@ -105,7 +96,7 @@ static void test_self_intersection_points(std::string const& case_id,
|
||||
{
|
||||
try
|
||||
{
|
||||
bg::detail::overlay::has_self_intersections(geometry, strategy, default_robust_policy);
|
||||
bg::detail::overlay::has_self_intersections(geometry, strategy);
|
||||
BOOST_CHECK_MESSAGE(false, "Case " << case_id << " there are no self-intersections detected!");
|
||||
}
|
||||
catch(...)
|
||||
@ -119,7 +110,7 @@ static void test_self_intersection_points(std::string const& case_id,
|
||||
{
|
||||
try
|
||||
{
|
||||
bg::detail::overlay::has_self_intersections(geometry, strategy, default_robust_policy);
|
||||
bg::detail::overlay::has_self_intersections(geometry, strategy);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
@ -4,8 +4,9 @@
|
||||
// Copyright (c) 2016 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -124,11 +125,10 @@ template
|
||||
bool Reverse1, bool Reverse2, bool ReverseOut,
|
||||
typename GeometryOut,
|
||||
typename Geometry1, typename Geometry2,
|
||||
typename RobustPolicy, typename Strategy
|
||||
typename Strategy
|
||||
>
|
||||
std::vector<std::size_t> apply_overlay(
|
||||
Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
using namespace boost::geometry;
|
||||
@ -137,7 +137,7 @@ std::vector<std::size_t> apply_overlay(
|
||||
typedef bg::detail::overlay::traversal_turn_info
|
||||
<
|
||||
point_type,
|
||||
typename bg::detail::segment_ratio_type<point_type, RobustPolicy>::type
|
||||
typename bg::segment_ratio_type<point_type>::type
|
||||
> turn_info;
|
||||
typedef std::deque<turn_info> turn_container_type;
|
||||
|
||||
@ -155,12 +155,12 @@ std::vector<std::size_t> apply_overlay(
|
||||
<
|
||||
Reverse1, Reverse2,
|
||||
detail::overlay::assign_null_policy
|
||||
>(geometry1, geometry2, strategy, robust_policy, turns, policy);
|
||||
>(geometry1, geometry2, strategy, turns, policy);
|
||||
|
||||
cluster_type clusters;
|
||||
|
||||
bg::enrich_intersection_points<Reverse1, Reverse2, OverlayType>(turns,
|
||||
clusters, geometry1, geometry2, robust_policy, strategy);
|
||||
clusters, geometry1, geometry2, strategy);
|
||||
|
||||
// Gather cluster properties, with test option
|
||||
return ::gather_cluster_properties<Reverse1, Reverse2, OverlayType>(
|
||||
@ -188,15 +188,6 @@ void test_sort_by_side(std::string const& case_id,
|
||||
|
||||
typedef typename boost::range_value<Geometry>::type geometry_out;
|
||||
|
||||
typedef typename bg::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry,
|
||||
Geometry
|
||||
>::type rescale_policy_type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
typedef typename bg::strategies::relate::services::default_strategy
|
||||
<
|
||||
Geometry, Geometry
|
||||
@ -207,7 +198,7 @@ void test_sort_by_side(std::string const& case_id,
|
||||
std::vector<std::size_t> result = ::apply_overlay
|
||||
<
|
||||
OverlayType, false, false, false, geometry_out
|
||||
>(g1, g2, robust_policy, strategy);
|
||||
>(g1, g2, strategy);
|
||||
|
||||
BOOST_CHECK_MESSAGE(result == expected_open_count,
|
||||
" caseid=" << case_id
|
||||
|
@ -4,8 +4,9 @@
|
||||
// Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2017-2021.
|
||||
// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2017-2024.
|
||||
// Modifications copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -49,12 +50,11 @@ std::string as_string(std::vector<T> const& v)
|
||||
template
|
||||
<
|
||||
typename Geometry, typename Point,
|
||||
typename RobustPolicy, typename Strategy
|
||||
typename Strategy
|
||||
>
|
||||
std::vector<std::size_t> apply_get_turns(std::string const& case_id,
|
||||
Geometry const& geometry1, Geometry const& geometry2,
|
||||
Point const& turn_point, Point const& origin_point,
|
||||
RobustPolicy const& robust_policy,
|
||||
Strategy const& strategy,
|
||||
std::size_t expected_open_count,
|
||||
std::size_t expected_max_rank,
|
||||
@ -69,7 +69,7 @@ std::vector<std::size_t> apply_get_turns(std::string const& case_id,
|
||||
typedef bg::detail::overlay::turn_info
|
||||
<
|
||||
point_type,
|
||||
typename bg::detail::segment_ratio_type<point_type, RobustPolicy>::type
|
||||
typename bg::segment_ratio_type<point_type>::type
|
||||
> turn_info;
|
||||
typedef std::deque<turn_info> turn_container_type;
|
||||
|
||||
@ -80,7 +80,7 @@ std::vector<std::size_t> apply_get_turns(std::string const& case_id,
|
||||
<
|
||||
false, false,
|
||||
detail::overlay::assign_null_policy
|
||||
>(geometry1, geometry2, strategy, robust_policy, turns, policy);
|
||||
>(geometry1, geometry2, strategy, turns, policy);
|
||||
|
||||
|
||||
// Define sorter, sorting counter-clockwise such that polygons are on the
|
||||
@ -241,15 +241,6 @@ void test_basic(std::string const& case_id,
|
||||
bg::correct(g1);
|
||||
bg::correct(g2);
|
||||
|
||||
typedef typename bg::rescale_overlay_policy_type
|
||||
<
|
||||
multi_polygon,
|
||||
multi_polygon
|
||||
>::type rescale_policy_type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
typedef typename bg::strategies::relate::services::default_strategy
|
||||
<
|
||||
multi_polygon, multi_polygon
|
||||
@ -258,7 +249,7 @@ void test_basic(std::string const& case_id,
|
||||
strategy_type strategy;
|
||||
|
||||
apply_get_turns(case_id, g1, g2, turn_point, origin_point,
|
||||
robust_policy, strategy,
|
||||
strategy,
|
||||
expected_open_count, expected_max_rank, expected_right_count);
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,9 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014, 2016-2020.
|
||||
// Modifications copyright (c) 2014-2020 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2016-2024.
|
||||
// Modifications copyright (c) 2014-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -51,7 +52,7 @@ inline expected_pusher expected(std::string const& ex)
|
||||
struct equal_turn
|
||||
{
|
||||
equal_turn(std::string const& s) : turn_ptr(&s) {}
|
||||
|
||||
|
||||
template <typename T>
|
||||
bool operator()(T const& t) const
|
||||
{
|
||||
@ -168,12 +169,11 @@ void check_geometry_range(Geometry1 const& g1,
|
||||
Expected const& expected,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
typedef bg::detail::no_rescale_policy robust_policy_type;
|
||||
typedef typename bg::point_type<Geometry2>::type point_type;
|
||||
|
||||
typedef typename bg::detail::segment_ratio_type
|
||||
typedef typename bg::segment_ratio_type
|
||||
<
|
||||
point_type, robust_policy_type
|
||||
point_type
|
||||
>::type segment_ratio_type;
|
||||
|
||||
typedef bg::detail::overlay::turn_info
|
||||
@ -193,8 +193,7 @@ void check_geometry_range(Geometry1 const& g1,
|
||||
|
||||
std::vector<turn_info> detected;
|
||||
interrupt_policy_t interrupt_policy;
|
||||
robust_policy_type robust_policy;
|
||||
|
||||
|
||||
// Don't switch the geometries
|
||||
typedef bg::detail::get_turns::get_turn_info_type
|
||||
<
|
||||
@ -206,7 +205,7 @@ void check_geometry_range(Geometry1 const& g1,
|
||||
typename bg::tag<Geometry1>::type, typename bg::tag<Geometry2>::type,
|
||||
Geometry1, Geometry2, false, false,
|
||||
turn_policy_t
|
||||
>::apply(0, g1, 1, g2, strategy, robust_policy, detected, interrupt_policy);
|
||||
>::apply(0, g1, 1, g2, strategy, detected, interrupt_policy);
|
||||
|
||||
bool ok = boost::size(expected) == detected.size();
|
||||
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2021-2024.
|
||||
// Modifications copyright (c) 2021-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -54,8 +55,6 @@
|
||||
# include <boost/geometry/io/svg/svg_mapper.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
#include <algorithms/overlay/overlay_cases.hpp>
|
||||
@ -145,24 +144,19 @@ struct test_traverse
|
||||
>::type strategy;
|
||||
|
||||
typedef typename bg::point_type<G2>::type point_type;
|
||||
typedef typename bg::rescale_policy_type<point_type>::type
|
||||
rescale_policy_type;
|
||||
|
||||
rescale_policy_type rescale_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
typedef bg::detail::overlay::traversal_turn_info
|
||||
<
|
||||
point_type,
|
||||
typename bg::detail::segment_ratio_type<point_type, rescale_policy_type>::type
|
||||
typename bg::detail::segment_ratio_type<point_type>::type
|
||||
> turn_info;
|
||||
std::vector<turn_info> turns;
|
||||
|
||||
std::map<bg::signed_size_type, bg::detail::overlay::cluster_info> clusters;
|
||||
|
||||
bg::detail::get_turns::no_interrupt_policy policy;
|
||||
bg::get_turns<Reverse1, Reverse2, bg::detail::overlay::assign_null_policy>(g1, g2, strategy, rescale_policy, turns, policy);
|
||||
bg::enrich_intersection_points<Reverse1, Reverse2, OverlayType>(turns, clusters, g1, g2, rescale_policy, strategy);
|
||||
bg::get_turns<Reverse1, Reverse2, bg::detail::overlay::assign_null_policy>(g1, g2, strategy, turns, policy);
|
||||
bg::enrich_intersection_points<Reverse1, Reverse2, OverlayType>(turns, clusters, g1, g2, strategy);
|
||||
|
||||
typedef bg::model::ring<typename bg::point_type<G2>::type> ring_type;
|
||||
typedef std::vector<ring_type> out_vector;
|
||||
@ -176,7 +170,7 @@ struct test_traverse
|
||||
Reverse1, Reverse2,
|
||||
G1, G2,
|
||||
OverlayType
|
||||
>::apply(g1, g2, strategy, rescale_policy, turns, v, visitor);
|
||||
>::apply(g1, g2, strategy, turns, v, visitor);
|
||||
|
||||
// Check number of resulting rings
|
||||
BOOST_CHECK_MESSAGE(expected_count == boost::size(v),
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2021-2024.
|
||||
// Modifications copyright (c) 2021-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -30,8 +31,6 @@
|
||||
# include <boost/geometry/io/svg/svg_mapper.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
|
||||
#include <algorithms/overlay/overlay_cases.hpp>
|
||||
|
||||
template <typename Geometry>
|
||||
@ -52,16 +51,10 @@ intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name,
|
||||
|
||||
typedef typename bg::point_type<Geometry1>::type point_type;
|
||||
|
||||
typedef typename bg::rescale_policy_type<point_type>::type
|
||||
rescale_policy_type;
|
||||
|
||||
rescale_policy_type rescale_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
typedef bg::detail::overlay::traversal_turn_info
|
||||
<
|
||||
point_type,
|
||||
typename bg::detail::segment_ratio_type<point_type, rescale_policy_type>::type
|
||||
typename bg::detail::segment_ratio_type<point_type>::type
|
||||
> turn_info;
|
||||
std::vector<turn_info> turns;
|
||||
|
||||
@ -71,14 +64,14 @@ intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name,
|
||||
rev<Geometry1>::value,
|
||||
rev<Geometry2>::value,
|
||||
bg::detail::overlay::assign_null_policy
|
||||
>(g1, g2, rescale_policy, turns, policy);
|
||||
>(g1, g2, turns, policy);
|
||||
|
||||
bg::enrich_intersection_points
|
||||
<
|
||||
rev<Geometry1>::value, rev<Geometry2>::value,
|
||||
bg::overlay_intersection
|
||||
>(turns, bg::detail::overlay::operation_intersection,
|
||||
g1, g2, rescale_policy, side_strategy_type());
|
||||
g1, g2, side_strategy_type());
|
||||
|
||||
typedef bg::model::ring<typename bg::point_type<Geometry1>::type> ring_type;
|
||||
typedef std::deque<ring_type> out_vector;
|
||||
@ -88,7 +81,7 @@ intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name,
|
||||
<
|
||||
rev<Geometry1>::value, rev<Geometry2>::value,
|
||||
Geometry1, Geometry2
|
||||
>::apply(g1, g2, op, rescale_policy, turns, v);
|
||||
>::apply(g1, g2, op, turns, v);
|
||||
|
||||
typename bg::coordinate_type<Geometry1>::type result = 0.0;
|
||||
for (ring_type& ring : v)
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2015-2022, Oracle and/or its affiliates.
|
||||
|
||||
// Copyright (c) 2015-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -81,8 +81,6 @@ struct check_turn_less
|
||||
Geometry1, Geometry2
|
||||
>::type strategy_type;
|
||||
|
||||
typedef bg::detail::no_rescale_policy robust_policy_type;
|
||||
|
||||
typedef bg::detail::relate::turns::get_turns
|
||||
<
|
||||
Geometry1,
|
||||
@ -95,7 +93,7 @@ struct check_turn_less
|
||||
|
||||
typedef typename get_turns_type::template turn_info_type
|
||||
<
|
||||
strategy_type, robust_policy_type
|
||||
strategy_type
|
||||
>::type turn_info;
|
||||
|
||||
typedef std::vector<turn_info> turns_container;
|
||||
@ -106,7 +104,7 @@ struct check_turn_less
|
||||
|
||||
get_turns_type::apply(turns, geometry1, geometry2,
|
||||
interrupt_policy,
|
||||
strategy_type(), robust_policy_type());
|
||||
strategy_type());
|
||||
|
||||
|
||||
typedef bg::detail::turns::less_seg_fraction_other_op<> turn_less_type;
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2015-2021.
|
||||
// Modifications copyright (c) 2015-2021 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2015-2024.
|
||||
// Modifications copyright (c) 2015-2024 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -145,17 +146,6 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
|
||||
std::cout << "*** case: " << caseid
|
||||
<< " area: " << area
|
||||
<< " points: " << n
|
||||
<< " polygons: " << boost::size(clip)
|
||||
<< " holes: " << holes
|
||||
<< std::endl;
|
||||
#endif
|
||||
|
||||
if (! expected_count.empty())
|
||||
{
|
||||
BOOST_CHECK_MESSAGE(expected_count.has(clip.size()),
|
||||
|
@ -5,6 +5,10 @@
|
||||
# Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
# Copyright (c) 2009-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
#
|
||||
# This file was modified by Oracle on 2024.
|
||||
# Modifications copyright (c) 2024 Oracle and/or its affiliates.
|
||||
# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
|
||||
# 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)
|
||||
@ -12,5 +16,4 @@
|
||||
test-suite boost-geometry-policies
|
||||
:
|
||||
[ run compare.cpp : : : : policies_compare ]
|
||||
[ run rescale_policy.cpp : : : : policies_rescale_policy ]
|
||||
;
|
||||
|
@ -1,132 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
// Unit Test
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <boost/geometry/algorithms/correct.hpp>
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/algorithms/length.hpp>
|
||||
#include <boost/geometry/algorithms/num_points.hpp>
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/iterators/point_iterator.hpp>
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
#include <geometry_test_common.hpp>
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename RescalePolicy,
|
||||
typename Geometry1,
|
||||
typename Geometry2
|
||||
>
|
||||
void test_one(std::string const& wkt1, std::string const& wkt2,
|
||||
std::string const& expected_coordinates)
|
||||
{
|
||||
Geometry1 geometry1;
|
||||
bg::read_wkt(wkt1, geometry1);
|
||||
|
||||
Geometry2 geometry2;
|
||||
bg::read_wkt(wkt2, geometry2);
|
||||
|
||||
RescalePolicy rescale_policy
|
||||
= bg::get_rescale_policy<RescalePolicy>(geometry1, geometry2);
|
||||
|
||||
typedef typename bg::point_type<Geometry1>::type point_type;
|
||||
typedef typename bg::robust_point_type
|
||||
<
|
||||
point_type, RescalePolicy
|
||||
>::type robust_point_type;
|
||||
|
||||
{
|
||||
robust_point_type robust_point;
|
||||
bg::recalculate(robust_point, *bg::points_begin(geometry1), rescale_policy);
|
||||
|
||||
std::ostringstream out;
|
||||
out << bg::get<0>(robust_point) << " " << bg::get<1>(robust_point);
|
||||
BOOST_CHECK_EQUAL(expected_coordinates, out.str());
|
||||
}
|
||||
|
||||
{
|
||||
// Assuming Geometry1 is a polygon:
|
||||
typedef bg::model::polygon<robust_point_type> polygon_type;
|
||||
polygon_type geometry_out;
|
||||
bg::recalculate(geometry_out, geometry1, rescale_policy);
|
||||
robust_point_type p = *bg::points_begin(geometry_out);
|
||||
|
||||
std::ostringstream out;
|
||||
out << bg::get<0>(p) << " " << bg::get<1>(p);
|
||||
BOOST_CHECK_EQUAL(expected_coordinates, out.str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static std::string simplex_normal[2] =
|
||||
{"POLYGON((0 1,2 5,5 3,0 1))",
|
||||
"POLYGON((3 0,0 3,4 5,3 0))"};
|
||||
|
||||
static std::string simplex_large[2] =
|
||||
{"POLYGON((0 1000,2000 5000,5000 3000,0 1000))",
|
||||
"POLYGON((3000 0,0 3000,4000 5000,3000 0))"};
|
||||
|
||||
|
||||
template <bool Rescale, typename P>
|
||||
void test_rescale(std::string const& expected_normal, std::string const& expected_large)
|
||||
{
|
||||
using polygon = bg::model::polygon<P>;
|
||||
|
||||
using rescale_policy_type = std::conditional_t
|
||||
<
|
||||
Rescale,
|
||||
typename bg::rescale_policy_type<P>::type,
|
||||
bg::detail::no_rescale_policy
|
||||
>;
|
||||
|
||||
test_one<rescale_policy_type, polygon, polygon>(
|
||||
simplex_normal[0], simplex_normal[1],
|
||||
expected_normal);
|
||||
test_one<rescale_policy_type, polygon, polygon>(
|
||||
simplex_large[0], simplex_large[1],
|
||||
expected_large);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void test_all(std::string const& expected_normal, std::string const& expected_large)
|
||||
{
|
||||
typedef bg::model::d2::point_xy<T> point_type;
|
||||
test_rescale<true, point_type>(expected_normal, expected_large);
|
||||
//test_rescale<false, point_type>();
|
||||
}
|
||||
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
test_all<double>("-5000000 -3000000", "-5000000 -3000000");
|
||||
test_all<long double>("-5000000 -3000000", "-5000000 -3000000");
|
||||
test_all<int>("0 1", "0 1000");
|
||||
test_all<long long>("0 1", "0 1000");
|
||||
// test_all<short int>(); // compiles but overflows
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -3,8 +3,9 @@
|
||||
|
||||
// Copyright (c) 2019-2021 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2021-2024.
|
||||
// Modifications copyright (c) 2021-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -80,18 +81,9 @@ bool test_overlay(std::string const& caseid,
|
||||
|
||||
strategy_type strategy;
|
||||
|
||||
typedef typename bg::rescale_overlay_policy_type
|
||||
<
|
||||
Geometry,
|
||||
Geometry
|
||||
>::type rescale_policy_type;
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(g1, g2);
|
||||
|
||||
Geometry result;
|
||||
bg::detail::overlay::overlay_null_visitor visitor;
|
||||
overlay::apply(g1, g2, robust_policy, std::back_inserter(result),
|
||||
overlay::apply(g1, g2, std::back_inserter(result),
|
||||
strategy, visitor);
|
||||
|
||||
auto const detected_area = bg::area(result);
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
// Copyright (c) 2013-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2021-2024.
|
||||
// Modifications copyright (c) 2021-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
@ -104,8 +105,6 @@ int main()
|
||||
multi_polygon, multi_polygon
|
||||
>::type strategy;
|
||||
|
||||
using rescale_policy_type = typename bg::rescale_policy_type<pt>::type;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@ -126,10 +125,7 @@ int main()
|
||||
bg::correct(p);
|
||||
mp.push_back(p);
|
||||
|
||||
rescale_policy_type robust_policy
|
||||
= bg::get_rescale_policy<rescale_policy_type>(mp, strategy);
|
||||
|
||||
bg::detail::overlay::has_self_intersections(mp, strategy, robust_policy);
|
||||
bg::detail::overlay::has_self_intersections(mp, strategy);
|
||||
|
||||
std::ostringstream out;
|
||||
out << "original " << poly_list.size();
|
||||
@ -174,12 +170,9 @@ int main()
|
||||
|
||||
#ifdef CHECK_SELF_INTERSECTIONS
|
||||
|
||||
rescale_policy_type robust_policy_i
|
||||
= bg::get_rescale_policy<rescale_policy_type>(mp_i, strategy);
|
||||
|
||||
try
|
||||
{
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_i, strategy, robust_policy_i);
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_i, strategy);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -189,7 +182,7 @@ int main()
|
||||
std::cout << boost::geometry::wkt(mp_i) << std::endl;
|
||||
try
|
||||
{
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_i, strategy, robust_policy_i);
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_i, strategy);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -197,12 +190,9 @@ int main()
|
||||
break;
|
||||
}
|
||||
|
||||
rescale_policy_type robust_policy_d
|
||||
= bg::get_rescale_policy<rescale_policy_type>(mp_d, strategy);
|
||||
|
||||
try
|
||||
{
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_d, strategy, robust_policy_d);
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_d, strategy);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -213,12 +203,9 @@ int main()
|
||||
break;
|
||||
}
|
||||
|
||||
rescale_policy_type robust_policy_e
|
||||
= bg::get_rescale_policy<rescale_policy_type>(mp_e, strategy);
|
||||
|
||||
try
|
||||
{
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_e, strategy, robust_policy_e);
|
||||
boost::geometry::detail::overlay::has_self_intersections(mp_e, strategy);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
@ -5,7 +5,8 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Copyright (c) 2017-2020, Oracle and/or its affiliates.
|
||||
// Copyright (c) 2017-2024, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
@ -151,8 +152,8 @@ static void test_segment_ratio(std::string const& case_id,
|
||||
|
||||
BOOST_CHECK_EQUAL(is.count, expected_count);
|
||||
|
||||
BOOST_CHECK_EQUAL(is.fractions[0].robust_ra, expected_a1);
|
||||
BOOST_CHECK_EQUAL(is.fractions[0].robust_rb, expected_b1);
|
||||
BOOST_CHECK_EQUAL(is.fractions[0].ra, expected_a1);
|
||||
BOOST_CHECK_EQUAL(is.fractions[0].rb, expected_b1);
|
||||
BOOST_CHECK_EQUAL(bg::get<0>(is.intersections[0]), exp_ax1);
|
||||
BOOST_CHECK_EQUAL(bg::get<1>(is.intersections[0]), exp_ay1);
|
||||
|
||||
@ -160,8 +161,8 @@ static void test_segment_ratio(std::string const& case_id,
|
||||
{
|
||||
BOOST_CHECK_EQUAL(bg::get<0>(is.intersections[1]), exp_ax2);
|
||||
BOOST_CHECK_EQUAL(bg::get<1>(is.intersections[1]), exp_ay2);
|
||||
BOOST_CHECK_EQUAL(is.fractions[1].robust_ra, expected_a2);
|
||||
BOOST_CHECK_EQUAL(is.fractions[1].robust_rb, expected_b2);
|
||||
BOOST_CHECK_EQUAL(is.fractions[1].ra, expected_a2);
|
||||
BOOST_CHECK_EQUAL(is.fractions[1].rb, expected_b2);
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user