MCPcopy Create free account
hub / github.com/axmolengine/axmol / CheckJoinRight

Method CheckJoinRight

3rdparty/clipper2/src/clipper.engine.cpp:2840–2867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2838 }
2839
2840 void ClipperBase::CheckJoinRight(Active& e,
2841 const Point64& pt, bool check_curr_x)
2842 {
2843 Active* next = e.next_in_ael;
2844 if (!next ||
2845 !IsHotEdge(e) || !IsHotEdge(*next) ||
2846 IsHorizontal(e) || IsHorizontal(*next) ||
2847 IsOpen(e) || IsOpen(*next)) return;
2848 if ((pt.y < e.top.y +2 || pt.y < next->top.y +2) &&
2849 ((e.bot.y > pt.y) || (next->bot.y > pt.y))) return; // avoid trivial joins
2850
2851 if (check_curr_x)
2852 {
2853 if (PerpendicDistFromLineSqrd(pt, next->bot, next->top) > 0.35) return;
2854 }
2855 else if (e.curr_x != next->curr_x) return;
2856 if (!IsCollinear(e.top, pt, next->top)) return;
2857
2858 if (e.outrec->idx == next->outrec->idx)
2859 AddLocalMaxPoly(e, *next, pt);
2860 else if (e.outrec->idx < next->outrec->idx)
2861 JoinOutrecPaths(e, *next);
2862 else
2863 JoinOutrecPaths(*next, e);
2864
2865 e.join_with = JoinWith::Right;
2866 next->join_with = JoinWith::Left;
2867 }
2868
2869 inline bool GetHorzExtendedHorzSeg(OutPt*& op, OutPt*& op2)
2870 {

Callers

nothing calls this directly

Calls 5

IsHotEdgeFunction · 0.85
IsOpenFunction · 0.85
IsCollinearFunction · 0.85
IsHorizontalFunction · 0.70

Tested by

no test coverage detected