static inline void apply(Turns& turns) { turns.erase( std::unique(turns.begin(), turns.end(), TurnEqualsTo()), turns.end() ); }
std::string stream_turn_index(Turns const& turns, Turn const& turn, Operation const& op) { std::ostringstream out; if (turn.cluster_id >= 0) { out << "cl=" << turn.cluster_id << " "; } // Because turn index is unknown here, and still useful for debugging, std::size_t index = 0; for (typename Turns::const_iterator it = turns.begin(); it != turns.end(); ++it, ++index) { Turn const& t = *it; if (&t == &turn) { out << index; break; } } if (&op == &turn.operations[0]) { out << "[0]"; } if (&op == &turn.operations[1]) { out << "[1]"; } return out.str(); }
static inline void apply(Turns& turns) { turns.erase( std::remove_if(turns.begin(), turns.end(), IsContinueTurn()), turns.end() ); }
static inline int inside_or_outside_turn(Turns const& turns) { using namespace overlay; for (typename Turns::const_iterator it = turns.begin(); it != turns.end(); ++it) { operation_type op0 = it->operations[0].operation; operation_type op1 = it->operations[1].operation; if (op0 == operation_intersection && op1 == operation_intersection) { return 1; // inside } else if (op0 == operation_union && op1 == operation_union) { return -1; // outside } } return 0; }
static inline void compute_turns(Turns& turns, LinearGeometry1 const& linear1, LinearGeometry2 const& linear2) { turns.clear(); bg_detail::relate::turns::get_turns < LinearGeometry1, LinearGeometry2, bg_detail::get_turns::get_turn_info_type < LinearGeometry1, LinearGeometry2, assign_policy > >::apply(turns, linear1, linear2); }
static inline void compute_turns(Turns& turns, LinearGeometry1 const& linear1, LinearGeometry2 const& linear2, RobustPolicy const& robust_policy) { turns.clear(); detail::get_turns::no_interrupt_policy interrupt_policy; geometry::detail::relate::turns::get_turns < LinearGeometry1, LinearGeometry2, detail::get_turns::get_turn_info_type < LinearGeometry1, LinearGeometry2, assign_policy >, RobustPolicy >::apply(turns, linear1, linear2, interrupt_policy, robust_policy); }
inline void merge_turns(Turns& rhs) { std::move(rhs.begin(),rhs.end(),std::back_inserter(m_turns)); }