summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp')
-rw-r--r--boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp61
1 files changed, 33 insertions, 28 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp b/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp
index ccb5e668ae..6dbd6d682c 100644
--- a/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp
+++ b/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp
@@ -83,6 +83,8 @@ struct get_turn_info_linear_linear
case 'm' :
{
+ using handler = touch_interior<TurnInfo, verify_policy_ll>;
+
if ( get_turn_info_for_endpoint<false, true>
::apply(range_p, range_q,
tp_model, inters, method_touch_interior, out,
@@ -92,15 +94,10 @@ struct get_turn_info_linear_linear
}
else
{
- typedef touch_interior
- <
- TurnInfo
- > policy;
-
// If Q (1) arrives (1)
if ( inters.d_info().arrival[1] == 1)
{
- policy::template apply<0>(range_p, range_q, tp,
+ handler::template apply<0>(range_p, range_q, tp,
inters.i_info(), inters.d_info(),
inters.sides(),
umbrella_strategy);
@@ -108,12 +105,12 @@ struct get_turn_info_linear_linear
else
{
// Swap p/q
- policy::template apply<1>(range_q, range_p, tp,
+ handler::template apply<1>(range_q, range_p, tp,
inters.i_info(), inters.d_info(),
inters.swapped_sides(),
umbrella_strategy);
}
-
+
if ( tp.operations[0].operation == operation_blocked )
{
tp.operations[1].is_collinear = true;
@@ -126,7 +123,7 @@ struct get_turn_info_linear_linear
replace_method_and_operations_tm(tp.method,
tp.operations[0].operation,
tp.operations[1].operation);
-
+
*out++ = tp;
}
}
@@ -142,6 +139,8 @@ struct get_turn_info_linear_linear
break;
case 't' :
{
+ using handler = touch<TurnInfo, verify_policy_ll>;
+
// Both touch (both arrive there)
if ( get_turn_info_for_endpoint<false, true>
::apply(range_p, range_q,
@@ -150,12 +149,12 @@ struct get_turn_info_linear_linear
{
// do nothing
}
- else
+ else
{
- touch<TurnInfo>::apply(range_p, range_q, tp,
- inters.i_info(), inters.d_info(),
- inters.sides(),
- umbrella_strategy);
+ handler::apply(range_p, range_q, tp,
+ inters.i_info(), inters.d_info(),
+ inters.sides(),
+ umbrella_strategy);
// workarounds for touch<> not taking spikes into account starts here
// those was discovered empirically
@@ -170,7 +169,7 @@ struct get_turn_info_linear_linear
if ( inters.is_spike_p() && inters.is_spike_q() )
{
tp.operations[0].operation = operation_union;
- tp.operations[1].operation = operation_union;
+ tp.operations[1].operation = operation_union;
}
else
{
@@ -189,7 +188,7 @@ struct get_turn_info_linear_linear
}
else
{
- tp.operations[0].operation = operation_union;
+ tp.operations[0].operation = operation_union;
}
}
else
@@ -208,7 +207,7 @@ struct get_turn_info_linear_linear
}
else
{
- tp.operations[1].operation = operation_union;
+ tp.operations[1].operation = operation_union;
}
}
else
@@ -224,7 +223,7 @@ struct get_turn_info_linear_linear
&& inters.is_spike_p() )
{
tp.operations[0].operation = operation_union;
- tp.operations[1].operation = operation_union;
+ tp.operations[1].operation = operation_union;
}
}
else if ( tp.operations[0].operation == operation_none
@@ -275,6 +274,8 @@ struct get_turn_info_linear_linear
break;
case 'e':
{
+ using handler = equal<TurnInfo, verify_policy_ll>;
+
if ( get_turn_info_for_endpoint<true, true>
::apply(range_p, range_q,
tp_model, inters, method_equal, out,
@@ -291,7 +292,7 @@ struct get_turn_info_linear_linear
{
// Both equal
// or collinear-and-ending at intersection point
- equal<TurnInfo>::apply(range_p, range_q, tp,
+ handler::apply(range_p, range_q, tp,
inters.i_info(), inters.d_info(), inters.sides(),
umbrella_strategy);
@@ -351,7 +352,9 @@ struct get_turn_info_linear_linear
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_ll>;
+
+ handler::apply(range_p, range_q, tp,
inters.i_info(), inters.d_info(), inters.sides(),
umbrella_strategy);
@@ -364,8 +367,10 @@ struct get_turn_info_linear_linear
}
else
{
- collinear<TurnInfo>::apply(range_p, range_q,
- tp, inters.i_info(), inters.d_info(), inters.sides());
+ using handler = collinear<TurnInfo, verify_policy_ll>;
+ handler::apply(range_p, range_q, tp,
+ inters.i_info(), inters.d_info(),
+ inters.sides());
//method_replace = method_touch_interior;
//spike_op = operation_continue;
@@ -374,7 +379,7 @@ struct get_turn_info_linear_linear
// transform turn
turn_transformer_ec transformer(method_replace);
transformer(tp);
-
+
// conditionally handle spikes
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|| ! append_collinear_spikes(tp, inters,
@@ -519,7 +524,7 @@ struct get_turn_info_linear_linear
return true;
}
-
+
return false;
}
@@ -562,9 +567,9 @@ struct get_turn_info_linear_linear
{
tp.operations[0].is_collinear = true;
tp.operations[1].is_collinear = false;
-
+
BOOST_GEOMETRY_ASSERT(inters.i_info().count > 1);
-
+
base_turn_handler::assign_point(tp, method_touch_interior,
inters.i_info(), 1);
}
@@ -593,7 +598,7 @@ struct get_turn_info_linear_linear
{
tp.operations[0].is_collinear = false;
tp.operations[1].is_collinear = true;
-
+
BOOST_GEOMETRY_ASSERT(inters.i_info().count > 0);
base_turn_handler::assign_point(tp, method_touch_interior, inters.i_info(), 0);
@@ -608,7 +613,7 @@ struct get_turn_info_linear_linear
res = true;
}
-
+
return res;
}