mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-11 11:52:11 +00:00
Merge pull request #16 from mkaravel/feature/setops
Feature/setops: fixes/changes due to recent changes in develop branch
This commit is contained in:
@@ -124,7 +124,7 @@ static inline bool is_isolated_point(Turn const& turn,
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( turn.method == method_collinear )
|
||||
if ( turn.method == method_none )
|
||||
{
|
||||
BOOST_ASSERT( operation.operation == operation_continue );
|
||||
return true;
|
||||
|
||||
@@ -79,11 +79,10 @@ struct less_seg_dist_other_op
|
||||
}
|
||||
|
||||
template <typename Op>
|
||||
static inline bool use_distance(Op const& left, Op const& right)
|
||||
static inline bool use_fraction(Op const& left, Op const& right)
|
||||
{
|
||||
return left.enriched.distance < right.enriched.distance
|
||||
|| ( geometry::math::equals(left.enriched.distance,
|
||||
right.enriched.distance)
|
||||
return left.fraction < right.fraction
|
||||
|| ( geometry::math::equals(left.fraction, right.fraction)
|
||||
&& use_other_id(left, right)
|
||||
);
|
||||
}
|
||||
@@ -94,7 +93,7 @@ struct less_seg_dist_other_op
|
||||
segment_identifier const& sl = left.operations[OpId].seg_id;
|
||||
segment_identifier const& sr = right.operations[OpId].seg_id;
|
||||
|
||||
return sl < sr || ( sl == sr && use_distance(left.operations[OpId], right.operations[OpId]) );
|
||||
return sl < sr || ( sl == sr && use_fraction(left.operations[OpId], right.operations[OpId]) );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ static inline void print_turns(Geometry1 const& g1,
|
||||
else
|
||||
out << '\n';
|
||||
|
||||
double fraction[2];
|
||||
|
||||
fraction[0] = turn.operations[0].fraction.numerator()
|
||||
/ turn.operations[0].fraction.denominator();
|
||||
|
||||
out << geometry::operation_char(turn.operations[0].operation)
|
||||
<<": seg: " << turn.operations[0].seg_id.source_index
|
||||
<< ", m: " << turn.operations[0].seg_id.multi_index
|
||||
@@ -61,11 +66,15 @@ static inline void print_turns(Geometry1 const& g1,
|
||||
<< ", m: " << turn.operations[0].other_id.multi_index
|
||||
<< ", r: " << turn.operations[0].other_id.ring_index
|
||||
<< ", s: " << turn.operations[0].other_id.segment_index;
|
||||
out << ", fr: " << fraction[0];
|
||||
out << ", col?: " << turn.operations[0].is_collinear;
|
||||
out << ' ' << geometry::dsv(turn.point) << ' ';
|
||||
|
||||
out << '\n';
|
||||
|
||||
fraction[1] = turn.operations[1].fraction.numerator()
|
||||
/ turn.operations[1].fraction.denominator();
|
||||
|
||||
out << geometry::operation_char(turn.operations[1].operation)
|
||||
<< ": seg: " << turn.operations[1].seg_id.source_index
|
||||
<< ", m: " << turn.operations[1].seg_id.multi_index
|
||||
@@ -75,6 +84,7 @@ static inline void print_turns(Geometry1 const& g1,
|
||||
<< ", m: " << turn.operations[1].other_id.multi_index
|
||||
<< ", r: " << turn.operations[1].other_id.ring_index
|
||||
<< ", s: " << turn.operations[1].other_id.segment_index;
|
||||
out << ", fr: " << fraction[1];
|
||||
out << ", col?: " << turn.operations[1].is_collinear;
|
||||
out << ' ' << geometry::dsv(turn.point) << ' ';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user