This change prevents duplication and decreases the number of parameters that must be passed to various functions and makes the code more readable.
Enclose parts of the code used in both implementations in one class - intersection_info. Move there IntersectionsResult, sides_calculator, spikes checks. Use this class in get_turn_info_linear_*. Provide convenient i_info() and d_info() to allow replacing result.template get<0>() and result.template get<1>() calls.
The code was moved outside get_turn_info_for_endpoints, to linear_intersections.
The code in the caller is more clear and safer since all variables are initialized and stored in linear_intersections.
relate_linear_areal:
handle non-endpoint x-c turns pair generated for a collinear spike.
relate/follow helpers:
fix turn_on_the_same_ip to use fraction instead of dimension.
get_turns:
L/L and L/A - use base_turn_handler::assign_point() to set fractions properly for collinear-opposite spikes.
L/A - fix the condition in calculate_spike_operation() used to check if a spike goes into the interior or exterior.
The latest robustness upgrade introduced changes that broke the support:
1. degenerated turns are now method_none+c/c. This is fixed by this commit.
2. ratios aren't calculated for degenerated turns (proviously distances were calculated by AssignPolicy).
Some asserts are invalid when 'x' operation can be somewhere in the middle (boundary_checker).
boundary_checker::is_boundary() function removed since it's not used anywhere.
Errors in get_turns are related to the handling of touches turn. t,i/i must be handled and is_collinear must be set in operations for spikes.
2 Turns are generated for a spike, one with operation_blocked the second one with operation_intersection.
relate_linear_linear is not working yet, for now it is only ensured that boundaries will not be checked for those turns, which would result with assert failure.
TODO: opposite collinear and equal, touches c/c and endpoints intersecting a spike + the adaptation of relate(L,L).
w.r.t. either segment a or segment b.
This results in small differences in the unit test for difference, which are
checked visually and/or compared with other output. In these cases it is
an enhancement