mirror of
https://github.com/boostorg/geometry.git
synced 2026-01-30 07:52:09 +00:00
[get_turn_info] Review remark, get cs tag from umbrella strategy
This commit is contained in:
@@ -168,14 +168,14 @@ namespace detail
|
||||
// 0 (absolutely 0, not even an epsilon) means collinear. Like side,
|
||||
// a negative means that p is to the right of p1-p2. And a positive value
|
||||
// means that p is to the left of p1-p2.
|
||||
template <typename SegmentPoint, typename Point>
|
||||
template <typename cs_tag, typename SegmentPoint, typename Point>
|
||||
static distance_measure<typename select_coordinate_type<SegmentPoint, Point>::type>
|
||||
get_distance_measure(SegmentPoint const& p1, SegmentPoint const& p2, Point const& p)
|
||||
{
|
||||
return detail_dispatch::get_distance_measure
|
||||
<
|
||||
typename select_coordinate_type<SegmentPoint, Point>::type,
|
||||
typename geometry::cs_tag<SegmentPoint>::type
|
||||
cs_tag
|
||||
>::apply(p1, p2, p);
|
||||
|
||||
}
|
||||
|
||||
@@ -150,10 +150,12 @@ struct base_turn_handler
|
||||
std::size_t IndexQ,
|
||||
typename UniqueSubRange1,
|
||||
typename UniqueSubRange2,
|
||||
typename UmbrellaStrategy,
|
||||
typename TurnInfo
|
||||
>
|
||||
static inline void both_collinear(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
std::size_t index_p, std::size_t index_q,
|
||||
TurnInfo& ti)
|
||||
{
|
||||
@@ -167,20 +169,24 @@ struct base_turn_handler
|
||||
typedef detail::distance_measure
|
||||
<
|
||||
typename select_coordinate_type
|
||||
<
|
||||
typename UniqueSubRange1::point_type,
|
||||
typename UniqueSubRange2::point_type
|
||||
<
|
||||
typename UniqueSubRange1::point_type,
|
||||
typename UniqueSubRange2::point_type
|
||||
>::type
|
||||
> dm_type;
|
||||
|
||||
dm_type const dm = get_distance_measure(range_q.at(index_q - 1),
|
||||
dm_type const dm = get_distance_measure<typename UmbrellaStrategy::cs_tag>(range_q.at(index_q - 1),
|
||||
range_q.at(index_q), range_p.at(index_p));
|
||||
|
||||
if (! dm.is_zero())
|
||||
{
|
||||
// Not truely collinear, distinguish for union/intersection
|
||||
// If p goes left (positive), take that for a union
|
||||
ui_else_iu(dm.is_positive(), ti);
|
||||
|
||||
ti.operations[IndexP].operation = dm.is_positive()
|
||||
? operation_union : operation_intersection;
|
||||
ti.operations[IndexQ].operation = dm.is_positive()
|
||||
? operation_intersection : operation_union;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -205,14 +211,16 @@ struct touch_interior : public base_turn_handler
|
||||
typename UniqueSubRange2,
|
||||
typename IntersectionInfo,
|
||||
typename DirInfo,
|
||||
typename SidePolicy
|
||||
typename SidePolicy,
|
||||
typename UmbrellaStrategy
|
||||
>
|
||||
static inline void apply(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo& ti,
|
||||
IntersectionInfo const& intersection_info,
|
||||
DirInfo const& dir_info,
|
||||
SidePolicy const& side)
|
||||
SidePolicy const& side,
|
||||
UmbrellaStrategy const& umbrella_strategy)
|
||||
{
|
||||
assign_point(ti, method_touch_interior, intersection_info, 0);
|
||||
|
||||
@@ -312,7 +320,7 @@ struct touch_interior : public base_turn_handler
|
||||
// Q intersects on interior of P and continues collinearly
|
||||
if (side_qk_q == side_qi_p)
|
||||
{
|
||||
both_collinear<index_p, index_q>(range_p, range_q, 1, 2, ti);
|
||||
both_collinear<index_p, index_q>(range_p, range_q, umbrella_strategy, 1, 2, ti);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -361,14 +369,16 @@ struct touch : public base_turn_handler
|
||||
typename UniqueSubRange2,
|
||||
typename IntersectionInfo,
|
||||
typename DirInfo,
|
||||
typename SidePolicy
|
||||
typename SideCalculator,
|
||||
typename UmbrellaStrategy
|
||||
>
|
||||
static inline void apply(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo& ti,
|
||||
IntersectionInfo const& intersection_info,
|
||||
DirInfo const& dir_info,
|
||||
SidePolicy const& side)
|
||||
SideCalculator const& side,
|
||||
UmbrellaStrategy const& umbrella_strategy)
|
||||
{
|
||||
assign_point(ti, method_touch, intersection_info, 0);
|
||||
|
||||
@@ -404,7 +414,7 @@ struct touch : public base_turn_handler
|
||||
// (#BRL2)
|
||||
if (side_pk_q2 == 0 && ! block_q)
|
||||
{
|
||||
both_collinear<0, 1>(range_p, range_q, 2, 2, ti);
|
||||
both_collinear<0, 1>(range_p, range_q, umbrella_strategy, 2, 2, ti);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -547,14 +557,16 @@ struct equal : public base_turn_handler
|
||||
typename UniqueSubRange2,
|
||||
typename IntersectionInfo,
|
||||
typename DirInfo,
|
||||
typename SidePolicy
|
||||
typename SideCalculator,
|
||||
typename UmbrellaStrategy
|
||||
>
|
||||
static inline void apply(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo& ti,
|
||||
IntersectionInfo const& info,
|
||||
DirInfo const& ,
|
||||
SidePolicy const& side)
|
||||
SideCalculator const& side,
|
||||
UmbrellaStrategy const& umbrella_strategy)
|
||||
{
|
||||
// Copy the intersection point in TO direction
|
||||
assign_point(ti, method_equal, info, non_opposite_to_index(info));
|
||||
@@ -572,8 +584,7 @@ struct equal : public base_turn_handler
|
||||
// oppositely
|
||||
if (side_pk_q2 == 0 && side_pk_p == side_qk_p)
|
||||
{
|
||||
both_collinear<0, 1>(range_p, range_q, 2, 2, ti);
|
||||
|
||||
both_collinear<0, 1>(range_p, range_q, umbrella_strategy, 2, 2, ti);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -606,14 +617,16 @@ struct start : public base_turn_handler
|
||||
typename UniqueSubRange2,
|
||||
typename IntersectionInfo,
|
||||
typename DirInfo,
|
||||
typename SidePolicy
|
||||
typename SideCalculator,
|
||||
typename UmbrellaStrategy
|
||||
>
|
||||
static inline bool apply(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo& ti,
|
||||
IntersectionInfo const& info,
|
||||
DirInfo const& dir_info,
|
||||
SidePolicy const& side)
|
||||
SideCalculator const& side,
|
||||
UmbrellaStrategy const& umbrella_strategy)
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
// If rescaled, it is not necessary to handle start turns
|
||||
@@ -639,8 +652,9 @@ struct start : public base_turn_handler
|
||||
>::type
|
||||
> dm_type;
|
||||
|
||||
dm_type const dm_pi_q1 = get_distance_measure(range_q.at(0), range_q.at(1), range_p.at(0));
|
||||
dm_type const dm_qi_p1 = get_distance_measure(range_p.at(0), range_p.at(1), range_q.at(0));
|
||||
typedef typename UmbrellaStrategy::cs_tag cs_tag;
|
||||
dm_type const dm_pi_q1 = get_distance_measure<cs_tag>(range_q.at(0), range_q.at(1), range_p.at(0));
|
||||
dm_type const dm_qi_p1 = get_distance_measure<cs_tag>(range_p.at(0), range_p.at(1), range_q.at(0));
|
||||
|
||||
if (dir_info.how_a == -1 && dir_info.how_b == -1)
|
||||
{
|
||||
@@ -1108,7 +1122,7 @@ struct get_turn_info
|
||||
typename UniqueSubRange1,
|
||||
typename UniqueSubRange2,
|
||||
typename TurnInfo,
|
||||
typename IntersectionStrategy,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator
|
||||
>
|
||||
@@ -1116,7 +1130,7 @@ struct get_turn_info
|
||||
UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo const& tp_model,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out)
|
||||
{
|
||||
@@ -1124,12 +1138,11 @@ struct get_turn_info
|
||||
<
|
||||
UniqueSubRange1, UniqueSubRange2,
|
||||
typename TurnInfo::point_type,
|
||||
IntersectionStrategy,
|
||||
UmbrellaStrategy,
|
||||
RobustPolicy
|
||||
> inters_info;
|
||||
|
||||
inters_info inters(range_p, range_q,
|
||||
intersection_strategy, robust_policy);
|
||||
inters_info inters(range_p, range_q, umbrella_strategy, robust_policy);
|
||||
|
||||
char const method = inters.d_info().how;
|
||||
|
||||
@@ -1153,19 +1166,19 @@ struct get_turn_info
|
||||
typedef touch_interior
|
||||
<
|
||||
TurnInfo
|
||||
> policy;
|
||||
> handler;
|
||||
|
||||
// If Q (1) arrives (1)
|
||||
if ( inters.d_info().arrival[1] == 1 )
|
||||
{
|
||||
policy::template apply<0>(range_p, range_q, tp, inters.i_info(), inters.d_info(),
|
||||
inters.sides());
|
||||
handler::template apply<0>(range_p, range_q, tp, inters.i_info(), inters.d_info(),
|
||||
inters.sides(), umbrella_strategy);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Swap p/q
|
||||
policy::template apply<1>(range_q, range_p, tp, inters.i_info(), inters.d_info(),
|
||||
inters.get_swapped_sides());
|
||||
handler::template apply<1>(range_q, range_p, tp, inters.i_info(), inters.d_info(),
|
||||
inters.get_swapped_sides(), umbrella_strategy);
|
||||
}
|
||||
*out++ = tp;
|
||||
}
|
||||
@@ -1179,7 +1192,7 @@ struct get_turn_info
|
||||
case 't' :
|
||||
{
|
||||
// Both touch (both arrive there)
|
||||
touch<TurnInfo>::apply(range_p, range_q, tp, inters.i_info(), inters.d_info(), inters.sides());
|
||||
touch<TurnInfo>::apply(range_p, range_q, tp, inters.i_info(), inters.d_info(), inters.sides(), umbrella_strategy);
|
||||
*out++ = tp;
|
||||
}
|
||||
break;
|
||||
@@ -1187,7 +1200,7 @@ struct get_turn_info
|
||||
case 's' :
|
||||
{
|
||||
// "from" or "start" without rescaling, it is in some cases necessary to handle
|
||||
if (start<TurnInfo>::apply(range_p, range_q, tp, inters.i_info(), inters.d_info(), inters.sides()))
|
||||
if (start<TurnInfo>::apply(range_p, range_q, tp, inters.i_info(), inters.d_info(), inters.sides(), umbrella_strategy))
|
||||
{
|
||||
*out++ = tp;
|
||||
}
|
||||
@@ -1203,7 +1216,7 @@ struct get_turn_info
|
||||
{
|
||||
// Both equal
|
||||
// or collinear-and-ending at intersection point
|
||||
equal<TurnInfo>::apply(range_p, range_q, tp, inters.i_info(), inters.d_info(), inters.sides());
|
||||
equal<TurnInfo>::apply(range_p, range_q, tp, inters.i_info(), inters.d_info(), inters.sides(), umbrella_strategy);
|
||||
*out++ = tp;
|
||||
}
|
||||
else
|
||||
@@ -1226,7 +1239,7 @@ struct get_turn_info
|
||||
{
|
||||
// Collinear, but similar thus handled as equal
|
||||
equal<TurnInfo>::apply(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(), inters.sides());
|
||||
inters.i_info(), inters.d_info(), inters.sides(), umbrella_strategy);
|
||||
|
||||
// override assigned method
|
||||
tp.method = method_collinear;
|
||||
|
||||
@@ -217,7 +217,7 @@ private :
|
||||
template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename TurnPoint, typename IntersectionStrategy, typename RobustPolicy>
|
||||
typename TurnPoint, typename UmbrellaStrategy, typename RobustPolicy>
|
||||
class intersection_info_base
|
||||
: private robust_points<UniqueSubRange1, UniqueSubRange2, RobustPolicy>
|
||||
{
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
|
||||
typedef typename cs_tag<TurnPoint>::type cs_tag;
|
||||
|
||||
typedef typename IntersectionStrategy::side_strategy_type side_strategy_type;
|
||||
typedef typename UmbrellaStrategy::side_strategy_type side_strategy_type;
|
||||
typedef side_calculator<cs_tag, robust_subrange1, robust_subrange2,
|
||||
side_strategy_type> side_calculator_type;
|
||||
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
|
||||
intersection_info_base(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
: base(range_p, range_q, robust_policy)
|
||||
, m_range_p(range_p)
|
||||
@@ -252,7 +252,7 @@ public:
|
||||
, m_robust_range_p(range_p, base::m_rpi, base::m_rpj, robust_policy)
|
||||
, m_robust_range_q(range_q, base::m_rqi, base::m_rqj, robust_policy)
|
||||
, m_side_calc(m_robust_range_p, m_robust_range_q,
|
||||
intersection_strategy.get_side_strategy())
|
||||
umbrella_strategy.get_side_strategy())
|
||||
{}
|
||||
|
||||
inline typename UniqueSubRange1::point_type const& pi() const { return m_range_p.at(0); }
|
||||
@@ -289,10 +289,10 @@ private :
|
||||
template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename TurnPoint, typename IntersectionStrategy
|
||||
typename TurnPoint, typename UmbrellaStrategy
|
||||
>
|
||||
class intersection_info_base<UniqueSubRange1, UniqueSubRange2,
|
||||
TurnPoint, IntersectionStrategy, detail::no_rescale_policy>
|
||||
TurnPoint, UmbrellaStrategy, detail::no_rescale_policy>
|
||||
{
|
||||
public:
|
||||
typedef typename UniqueSubRange1::point_type point1_type;
|
||||
@@ -301,9 +301,9 @@ public:
|
||||
typedef typename UniqueSubRange1::point_type robust_point1_type;
|
||||
typedef typename UniqueSubRange2::point_type robust_point2_type;
|
||||
|
||||
typedef typename cs_tag<TurnPoint>::type cs_tag;
|
||||
typedef typename UmbrellaStrategy::cs_tag cs_tag;
|
||||
|
||||
typedef typename IntersectionStrategy::side_strategy_type side_strategy_type;
|
||||
typedef typename UmbrellaStrategy::side_strategy_type side_strategy_type;
|
||||
typedef side_calculator<cs_tag, UniqueSubRange1, UniqueSubRange2, side_strategy_type> side_calculator_type;
|
||||
|
||||
typedef side_calculator
|
||||
@@ -314,12 +314,12 @@ public:
|
||||
|
||||
intersection_info_base(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
no_rescale_policy const& /*robust_policy*/)
|
||||
: m_range_p(range_p)
|
||||
, m_range_q(range_q)
|
||||
, m_side_calc(range_p, range_q,
|
||||
intersection_strategy.get_side_strategy())
|
||||
umbrella_strategy.get_side_strategy())
|
||||
{}
|
||||
|
||||
inline point1_type const& rpi() const { return m_side_calc.get_pi(); }
|
||||
@@ -354,15 +354,15 @@ template
|
||||
<
|
||||
typename UniqueSubRange1, typename UniqueSubRange2,
|
||||
typename TurnPoint,
|
||||
typename IntersectionStrategy,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy
|
||||
>
|
||||
class intersection_info
|
||||
: public intersection_info_base<UniqueSubRange1, UniqueSubRange2,
|
||||
TurnPoint, IntersectionStrategy, RobustPolicy>
|
||||
TurnPoint, UmbrellaStrategy, RobustPolicy>
|
||||
{
|
||||
typedef intersection_info_base<UniqueSubRange1, UniqueSubRange2,
|
||||
TurnPoint, IntersectionStrategy, RobustPolicy> base;
|
||||
TurnPoint, UmbrellaStrategy, RobustPolicy> base;
|
||||
|
||||
public:
|
||||
typedef segment_intersection_points
|
||||
@@ -387,8 +387,8 @@ public:
|
||||
policies::relate::segments_direction
|
||||
> intersection_policy_type;
|
||||
|
||||
typedef IntersectionStrategy intersection_strategy_type;
|
||||
typedef typename IntersectionStrategy::side_strategy_type side_strategy_type;
|
||||
typedef UmbrellaStrategy intersection_strategy_type;
|
||||
typedef typename UmbrellaStrategy::side_strategy_type side_strategy_type;
|
||||
|
||||
typedef model::referring_segment<point1_type const> segment_type1;
|
||||
typedef model::referring_segment<point2_type const> segment_type2;
|
||||
@@ -400,18 +400,18 @@ public:
|
||||
|
||||
intersection_info(UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
IntersectionStrategy const& intersection_strategy,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy)
|
||||
: base(range_p, range_q,
|
||||
intersection_strategy, robust_policy)
|
||||
, m_result(intersection_strategy.apply(
|
||||
umbrella_strategy, robust_policy)
|
||||
, m_result(umbrella_strategy.apply(
|
||||
segment_type1(range_p.at(0), range_p.at(1)),
|
||||
segment_type2(range_q.at(0), range_q.at(1)),
|
||||
intersection_policy_type(),
|
||||
robust_policy,
|
||||
base::rpi(), base::rpj(),
|
||||
base::rqi(), base::rqj()))
|
||||
, m_intersection_strategy(intersection_strategy)
|
||||
, m_intersection_strategy(umbrella_strategy)
|
||||
, m_robust_policy(robust_policy)
|
||||
{}
|
||||
|
||||
@@ -523,7 +523,7 @@ private:
|
||||
}
|
||||
|
||||
result_type m_result;
|
||||
IntersectionStrategy const& m_intersection_strategy;
|
||||
UmbrellaStrategy const& m_intersection_strategy;
|
||||
RobustPolicy const& m_robust_policy;
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ struct get_turn_info_linear_areal
|
||||
typename UniqueSubRange1,
|
||||
typename UniqueSubRange2,
|
||||
typename TurnInfo,
|
||||
typename IntersectionStrategy,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator
|
||||
>
|
||||
@@ -52,7 +52,7 @@ struct get_turn_info_linear_areal
|
||||
UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo const& tp_model,
|
||||
IntersectionStrategy const& strategy,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out)
|
||||
{
|
||||
@@ -60,11 +60,11 @@ struct get_turn_info_linear_areal
|
||||
<
|
||||
UniqueSubRange1, UniqueSubRange2,
|
||||
typename TurnInfo::point_type,
|
||||
IntersectionStrategy,
|
||||
UmbrellaStrategy,
|
||||
RobustPolicy
|
||||
> inters_info;
|
||||
|
||||
inters_info inters(range_p, range_q, strategy, robust_policy);
|
||||
inters_info inters(range_p, range_q, umbrella_strategy, robust_policy);
|
||||
|
||||
char const method = inters.d_info().how;
|
||||
|
||||
@@ -79,7 +79,7 @@ struct get_turn_info_linear_areal
|
||||
case 's' : // starts from the middle
|
||||
get_turn_info_for_endpoint<true, true>(range_p, range_q,
|
||||
tp_model, inters, method_none, out,
|
||||
strategy.get_point_in_point_strategy());
|
||||
umbrella_strategy.get_point_in_point_strategy());
|
||||
break;
|
||||
|
||||
case 'd' : // disjoint: never do anything
|
||||
@@ -89,30 +89,27 @@ struct get_turn_info_linear_areal
|
||||
{
|
||||
if ( get_turn_info_for_endpoint<false, true>(range_p, range_q,
|
||||
tp_model, inters, method_touch_interior, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef touch_interior
|
||||
<
|
||||
TurnInfo
|
||||
> policy;
|
||||
typedef touch_interior<TurnInfo> handler;
|
||||
|
||||
// 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());
|
||||
inters.sides(), umbrella_strategy);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Swap p/q
|
||||
policy::template apply<1>(range_q, range_p,
|
||||
handler::template apply<1>(range_q, range_p,
|
||||
tp, inters.i_info(), inters.d_info(),
|
||||
inters.get_swapped_sides());
|
||||
inters.get_swapped_sides(), umbrella_strategy);
|
||||
}
|
||||
|
||||
if ( tp.operations[1].operation == operation_blocked )
|
||||
@@ -127,7 +124,7 @@ struct get_turn_info_linear_areal
|
||||
// this function assumes that 'u' must be set for a spike
|
||||
calculate_spike_operation(tp.operations[0].operation,
|
||||
inters,
|
||||
strategy.get_point_in_point_strategy());
|
||||
umbrella_strategy.get_point_in_point_strategy());
|
||||
|
||||
*out++ = tp;
|
||||
}
|
||||
@@ -147,14 +144,15 @@ struct get_turn_info_linear_areal
|
||||
// Both touch (both arrive there)
|
||||
if ( get_turn_info_for_endpoint<false, true>(range_p, range_q,
|
||||
tp_model, inters, method_touch, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
touch<TurnInfo>::apply(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(), inters.sides());
|
||||
inters.i_info(), inters.d_info(), inters.sides(),
|
||||
umbrella_strategy);
|
||||
|
||||
if ( tp.operations[1].operation == operation_blocked )
|
||||
{
|
||||
@@ -220,7 +218,7 @@ struct get_turn_info_linear_areal
|
||||
bool ignore_spike
|
||||
= calculate_spike_operation(tp.operations[0].operation,
|
||||
inters,
|
||||
strategy.get_point_in_point_strategy());
|
||||
umbrella_strategy.get_point_in_point_strategy());
|
||||
|
||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||
|| ignore_spike
|
||||
@@ -236,7 +234,7 @@ struct get_turn_info_linear_areal
|
||||
{
|
||||
if ( get_turn_info_for_endpoint<true, true>(range_p, range_q,
|
||||
tp_model, inters, method_equal, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@@ -249,7 +247,8 @@ struct get_turn_info_linear_areal
|
||||
// Both equal
|
||||
// or collinear-and-ending at intersection point
|
||||
equal<TurnInfo>::apply(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(), inters.sides());
|
||||
inters.i_info(), inters.d_info(), inters.sides(),
|
||||
umbrella_strategy);
|
||||
|
||||
turn_transformer_ec<false> transformer(method_touch);
|
||||
transformer(tp);
|
||||
@@ -280,7 +279,7 @@ struct get_turn_info_linear_areal
|
||||
if ( get_turn_info_for_endpoint<true, true>(
|
||||
range_p, range_q,
|
||||
tp_model, inters, method_collinear, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@@ -297,7 +296,8 @@ struct get_turn_info_linear_areal
|
||||
{
|
||||
// Collinear, but similar thus handled as equal
|
||||
equal<TurnInfo>::apply(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(), inters.sides());
|
||||
inters.i_info(), inters.d_info(), inters.sides(),
|
||||
umbrella_strategy);
|
||||
|
||||
method_replace = method_touch;
|
||||
version = append_equal;
|
||||
@@ -359,13 +359,13 @@ struct get_turn_info_linear_areal
|
||||
|
||||
if ( range_p.is_first_segment()
|
||||
&& equals::equals_point_point(range_p.at(0), tp.point,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
tp.operations[0].position = position_front;
|
||||
}
|
||||
else if ( range_p.is_last_segment()
|
||||
&& equals::equals_point_point(range_p.at(1), tp.point,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
tp.operations[0].position = position_back;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ struct get_turn_info_linear_linear
|
||||
typename UniqueSubRange1,
|
||||
typename UniqueSubRange2,
|
||||
typename TurnInfo,
|
||||
typename IntersectionStrategy,
|
||||
typename UmbrellaStrategy,
|
||||
typename RobustPolicy,
|
||||
typename OutputIterator
|
||||
>
|
||||
@@ -47,7 +47,7 @@ struct get_turn_info_linear_linear
|
||||
UniqueSubRange1 const& range_p,
|
||||
UniqueSubRange2 const& range_q,
|
||||
TurnInfo const& tp_model,
|
||||
IntersectionStrategy const& strategy,
|
||||
UmbrellaStrategy const& umbrella_strategy,
|
||||
RobustPolicy const& robust_policy,
|
||||
OutputIterator out)
|
||||
{
|
||||
@@ -55,11 +55,11 @@ struct get_turn_info_linear_linear
|
||||
<
|
||||
UniqueSubRange1, UniqueSubRange2,
|
||||
typename TurnInfo::point_type,
|
||||
IntersectionStrategy,
|
||||
UmbrellaStrategy,
|
||||
RobustPolicy
|
||||
> inters_info;
|
||||
|
||||
inters_info inters(range_p, range_q, strategy, robust_policy);
|
||||
inters_info inters(range_p, range_q, umbrella_strategy, robust_policy);
|
||||
|
||||
char const method = inters.d_info().how;
|
||||
|
||||
@@ -75,7 +75,7 @@ struct get_turn_info_linear_linear
|
||||
get_turn_info_for_endpoint<true, true>
|
||||
::apply(range_p, range_q,
|
||||
tp_model, inters, method_none, out,
|
||||
strategy.get_point_in_point_strategy());
|
||||
umbrella_strategy.get_point_in_point_strategy());
|
||||
break;
|
||||
|
||||
case 'd' : // disjoint: never do anything
|
||||
@@ -86,7 +86,7 @@ struct get_turn_info_linear_linear
|
||||
if ( get_turn_info_for_endpoint<false, true>
|
||||
::apply(range_p, range_q,
|
||||
tp_model, inters, method_touch_interior, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@@ -102,14 +102,16 @@ struct get_turn_info_linear_linear
|
||||
{
|
||||
policy::template apply<0>(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(),
|
||||
inters.sides());
|
||||
inters.sides(),
|
||||
umbrella_strategy);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Swap p/q
|
||||
policy::template apply<1>(range_q, range_p, tp,
|
||||
inters.i_info(), inters.d_info(),
|
||||
inters.get_swapped_sides());
|
||||
inters.get_swapped_sides(),
|
||||
umbrella_strategy);
|
||||
}
|
||||
|
||||
if ( tp.operations[0].operation == operation_blocked )
|
||||
@@ -144,14 +146,16 @@ struct get_turn_info_linear_linear
|
||||
if ( get_turn_info_for_endpoint<false, true>
|
||||
::apply(range_p, range_q,
|
||||
tp_model, inters, method_touch, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
touch<TurnInfo>::apply(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(), inters.sides());
|
||||
inters.i_info(), inters.d_info(),
|
||||
inters.sides(),
|
||||
umbrella_strategy);
|
||||
|
||||
// workarounds for touch<> not taking spikes into account starts here
|
||||
// those was discovered empirically
|
||||
@@ -274,7 +278,7 @@ struct get_turn_info_linear_linear
|
||||
if ( get_turn_info_for_endpoint<true, true>
|
||||
::apply(range_p, range_q,
|
||||
tp_model, inters, method_equal, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@@ -288,7 +292,8 @@ struct get_turn_info_linear_linear
|
||||
// Both equal
|
||||
// or collinear-and-ending at intersection point
|
||||
equal<TurnInfo>::apply(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(), inters.sides());
|
||||
inters.i_info(), inters.d_info(), inters.sides(),
|
||||
umbrella_strategy);
|
||||
|
||||
operation_type spike_op
|
||||
= ( tp.operations[0].operation != operation_continue
|
||||
@@ -328,7 +333,7 @@ struct get_turn_info_linear_linear
|
||||
if ( get_turn_info_for_endpoint<true, true>
|
||||
::apply(range_p, range_q,
|
||||
tp_model, inters, method_collinear, out,
|
||||
strategy.get_point_in_point_strategy()) )
|
||||
umbrella_strategy.get_point_in_point_strategy()) )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@@ -347,7 +352,8 @@ struct get_turn_info_linear_linear
|
||||
{
|
||||
// Collinear, but similar thus handled as equal
|
||||
equal<TurnInfo>::apply(range_p, range_q, tp,
|
||||
inters.i_info(), inters.d_info(), inters.sides());
|
||||
inters.i_info(), inters.d_info(), inters.sides(),
|
||||
umbrella_strategy);
|
||||
|
||||
method_replace = method_touch;
|
||||
if ( tp.operations[0].operation != operation_continue
|
||||
@@ -410,7 +416,7 @@ struct get_turn_info_linear_linear
|
||||
// degenerate points
|
||||
if ( BOOST_GEOMETRY_CONDITION(AssignPolicy::include_degenerate) )
|
||||
{
|
||||
typedef typename IntersectionStrategy::point_in_point_strategy_type
|
||||
typedef typename UmbrellaStrategy::point_in_point_strategy_type
|
||||
equals_strategy_type;
|
||||
|
||||
only_convert::apply(tp, inters.i_info());
|
||||
|
||||
@@ -75,6 +75,8 @@ template
|
||||
>
|
||||
struct cartesian_segments
|
||||
{
|
||||
typedef cartesian_tag cs_tag;
|
||||
|
||||
typedef side::side_by_triangle<CalculationType> side_strategy_type;
|
||||
|
||||
static inline side_strategy_type get_side_strategy()
|
||||
|
||||
@@ -73,6 +73,8 @@ template
|
||||
>
|
||||
struct geographic_segments
|
||||
{
|
||||
typedef geographic_tag cs_tag;
|
||||
|
||||
typedef side::geographic
|
||||
<
|
||||
FormulaPolicy, Spheroid, CalculationType
|
||||
|
||||
@@ -89,6 +89,8 @@ template
|
||||
>
|
||||
struct ecef_segments
|
||||
{
|
||||
typedef spherical_tag cs_tag;
|
||||
|
||||
typedef side::spherical_side_formula<CalculationType> side_strategy_type;
|
||||
|
||||
static inline side_strategy_type get_side_strategy()
|
||||
|
||||
Reference in New Issue
Block a user