MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / ProcessBound

Method ProcessBound

TheForceEngine/TFE_Polygon/clipper.cpp:928–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926//------------------------------------------------------------------------------
927
928TEdge* ClipperBase::ProcessBound(TEdge* E, bool NextIsForward)
929{
930 TEdge *Result = E;
931 TEdge *Horz = 0;
932
933 if (E->OutIdx == Skip)
934 {
935 //if edges still remain in the current bound beyond the skip edge then
936 //create another LocMin and call ProcessBound once more
937 if (NextIsForward)
938 {
939 while (E->Top.Y == E->Next->Bot.Y) E = E->Next;
940 //don't include top horizontals when parsing a bound a second time,
941 //they will be contained in the opposite bound ...
942 while (E != Result && IsHorizontal(*E)) E = E->Prev;
943 }
944 else
945 {
946 while (E->Top.Y == E->Prev->Bot.Y) E = E->Prev;
947 while (E != Result && IsHorizontal(*E)) E = E->Next;
948 }
949
950 if (E == Result)
951 {
952 if (NextIsForward) Result = E->Next;
953 else Result = E->Prev;
954 }
955 else
956 {
957 //there are more edges in the bound beyond result starting with E
958 if (NextIsForward)
959 E = Result->Next;
960 else
961 E = Result->Prev;
962 MinimaList::value_type locMin;
963 locMin.Y = E->Bot.Y;
964 locMin.LeftBound = 0;
965 locMin.RightBound = E;
966 E->WindDelta = 0;
967 Result = ProcessBound(E, NextIsForward);
968 m_MinimaList.push_back(locMin);
969 }
970 return Result;
971 }
972
973 TEdge *EStart;
974
975 if (IsHorizontal(*E))
976 {
977 //We need to be careful with open paths because this may not be a
978 //true local minima (ie E may be following a skip edge).
979 //Also, consecutive horz. edges may start heading left before going right.
980 if (NextIsForward)
981 EStart = E->Prev;
982 else
983 EStart = E->Next;
984 if (IsHorizontal(*EStart)) //ie an adjoining horizontal skip edge
985 {

Callers

nothing calls this directly

Calls 3

IsHorizontalFunction · 0.85
ReverseHorizontalFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected