// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2017 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-2020.
+// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
case 's' : // starts from the middle
get_turn_info_for_endpoint<true, true>(range_p, range_q,
tp_model, inters, method_none, out,
- umbrella_strategy.get_point_in_point_strategy());
+ umbrella_strategy);
break;
case 'd' : // disjoint: never do anything
{
if ( get_turn_info_for_endpoint<false, true>(range_p, range_q,
tp_model, inters, method_touch_interior, out,
- umbrella_strategy.get_point_in_point_strategy()) )
+ umbrella_strategy) )
{
// do nothing
}
else
{
- typedef touch_interior<TurnInfo> handler;
+ using handler = touch_interior<TurnInfo, verify_policy_la>;
// If Q (1) arrives (1)
if ( inters.d_info().arrival[1] == 1 )
// Swap p/q
handler::template apply<1>(range_q, range_p,
tp, inters.i_info(), inters.d_info(),
- inters.get_swapped_sides(), umbrella_strategy);
+ inters.swapped_sides(), umbrella_strategy);
}
if ( tp.operations[1].operation == operation_blocked )
// this function assumes that 'u' must be set for a spike
calculate_spike_operation(tp.operations[0].operation,
inters,
- umbrella_strategy.get_point_in_point_strategy());
+ umbrella_strategy);
*out++ = tp;
}
// Both touch (both arrive there)
if ( get_turn_info_for_endpoint<false, true>(range_p, range_q,
tp_model, inters, method_touch, out,
- umbrella_strategy.get_point_in_point_strategy()) )
+ umbrella_strategy) )
{
// do nothing
}
else
{
- touch<TurnInfo>::apply(range_p, range_q, tp,
+ using handler = touch<TurnInfo, verify_policy_la>;
+ handler::apply(range_p, range_q, tp,
inters.i_info(), inters.d_info(), inters.sides(),
umbrella_strategy);
bool ignore_spike
= calculate_spike_operation(tp.operations[0].operation,
inters,
- umbrella_strategy.get_point_in_point_strategy());
+ umbrella_strategy);
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|| ignore_spike
{
if ( get_turn_info_for_endpoint<true, true>(range_p, range_q,
tp_model, inters, method_equal, out,
- umbrella_strategy.get_point_in_point_strategy()) )
+ umbrella_strategy) )
{
// do nothing
}
{
// Both equal
// or collinear-and-ending at intersection point
- equal<TurnInfo>::apply(range_p, range_q, tp,
+ using handler = equal<TurnInfo, verify_policy_la>;
+ handler::apply(range_p, range_q, tp,
inters.i_info(), inters.d_info(), inters.sides(),
umbrella_strategy);
if ( get_turn_info_for_endpoint<true, true>(
range_p, range_q,
tp_model, inters, method_collinear, out,
- umbrella_strategy.get_point_in_point_strategy()) )
+ umbrella_strategy) )
{
// do nothing
}
if ( inters.d_info().arrival[0] == 0 )
{
// Collinear, but similar thus handled as equal
- equal<TurnInfo>::apply(range_p, range_q, tp,
+ using handler = equal<TurnInfo, verify_policy_la>;
+ handler::apply(range_p, range_q, tp,
inters.i_info(), inters.d_info(), inters.sides(),
umbrella_strategy);
}
else
{
- collinear<TurnInfo>::apply(range_p, range_q, tp,
- inters.i_info(), inters.d_info(), inters.sides());
+ using handler = collinear<TurnInfo, verify_policy_la>;
+ handler::apply(range_p, range_q, tp, inters.i_info(),
+ inters.d_info(), inters.sides());
//method_replace = method_touch_interior;
//version = append_collinear;
if ( range_p.is_first_segment()
&& equals::equals_point_point(range_p.at(0), tp.point,
- umbrella_strategy.get_point_in_point_strategy()) )
+ umbrella_strategy) )
{
tp.operations[0].position = position_front;
}
else if ( range_p.is_last_segment()
&& equals::equals_point_point(range_p.at(1), tp.point,
- umbrella_strategy.get_point_in_point_strategy()) )
+ umbrella_strategy) )
{
tp.operations[0].position = position_back;
}
template <typename Operation,
typename IntersectionInfo,
- typename EqPPStrategy>
+ typename Strategy>
static inline bool calculate_spike_operation(Operation & op,
IntersectionInfo const& inters,
- EqPPStrategy const& strategy)
+ Strategy const& strategy)
{
bool is_p_spike = ( op == operation_union || op == operation_intersection )
&& inters.is_spike_p();
// spike on the edge point
// if it's already known that the spike is going out this musn't be checked
if ( ! going_out
- && detail::equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
+ && equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
{
int const pk_q2 = inters.sides().pk_wrt_q2();
going_in = pk_q1 < 0 && pk_q2 < 0; // Pk on the right of both
// spike on the edge point
// if it's already known that the spike is going in this musn't be checked
if ( ! going_in
- && detail::equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
+ && equals::equals_point_point(inters.rpj(), inters.rqj(), strategy) )
{
int const pk_q2 = inters.sides().pk_wrt_q2();
going_in = pk_q1 < 0 || pk_q2 < 0; // Pk on the right of one of them
typename TurnInfo,
typename IntersectionInfo,
typename OutputIterator,
- typename EqPPStrategy>
+ typename Strategy>
static inline bool get_turn_info_for_endpoint(
UniqueSubRange1 const& range_p,
UniqueSubRange2 const& range_q,
IntersectionInfo const& inters,
method_type /*method*/,
OutputIterator out,
- EqPPStrategy const& strategy)
+ Strategy const& strategy)
{
namespace ov = overlay;
typedef ov::get_turn_info_for_endpoint<EnableFirst, EnableLast> get_info_e;
return false;
}
- typename IntersectionInfo::side_strategy_type const& sides
- = inters.get_side_strategy();
-
linear_intersections intersections(range_p.at(0),
range_q.at(0),
inters.result(),
}
else
{
+ auto const sides = strategy.side();
+
// pi is the intersection point at qj or in the middle of q1
// so consider segments
// 1. pi at qj: qi-qj-pj and qi-qj-qk
}
else //if ( result.template get<0>().count == 1 )
{
+ auto const sides = strategy.side();
+
// pj is the intersection point at qj or in the middle of q1
// so consider segments
// 1. pj at qj: qi-qj-pi and qi-qj-qk
// don't ignore anything for now
return false;
}
-
- template <typename Point1, typename Point2, typename IntersectionStrategy>
- static inline bool equals_point_point(Point1 const& point1, Point2 const& point2,
- IntersectionStrategy const& strategy)
- {
- return detail::equals::equals_point_point(point1, point2,
- strategy.get_point_in_point_strategy());
- }
};
}} // namespace detail::overlay