MCPcopy Create free account
hub / github.com/AngusJohnson/Clipper2 / SetWindCountForOpenPathEdge

Method SetWindCountForOpenPathEdge

CPP/Clipper2Lib/src/clipper.engine.cpp:1089–1117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1087
1088
1089 void ClipperBase::SetWindCountForOpenPathEdge(Active& e)
1090 {
1091 Active* e2 = actives_;
1092 if (fillrule_ == FillRule::EvenOdd)
1093 {
1094 int cnt1 = 0, cnt2 = 0;
1095 while (e2 != &e)
1096 {
1097 if (GetPolyType(*e2) == PathType::Clip)
1098 cnt2++;
1099 else if (!IsOpen(*e2))
1100 cnt1++;
1101 e2 = e2->next_in_ael;
1102 }
1103 e.wind_cnt = (IsOdd(cnt1) ? 1 : 0);
1104 e.wind_cnt2 = (IsOdd(cnt2) ? 1 : 0);
1105 }
1106 else
1107 {
1108 while (e2 != &e)
1109 {
1110 if (GetPolyType(*e2) == PathType::Clip)
1111 e.wind_cnt2 += e2->wind_dx;
1112 else if (!IsOpen(*e2))
1113 e.wind_cnt += e2->wind_dx;
1114 e2 = e2->next_in_ael;
1115 }
1116 }
1117 }
1118
1119 bool IsValidAelOrder(const Active& resident, const Active& newcomer)
1120 {

Callers

nothing calls this directly

Calls 3

GetPolyTypeFunction · 0.85
IsOpenFunction · 0.85
IsOddFunction · 0.85

Tested by

no test coverage detected