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

Method FixupFirstLefts2

TheForceEngine/TFE_Polygon/clipper.cpp:3641–3664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3639//----------------------------------------------------------------------
3640
3641void Clipper::FixupFirstLefts2(OutRec* InnerOutRec, OutRec* OuterOutRec)
3642{
3643 //A polygon has split into two such that one is now the inner of the other.
3644 //It's possible that these polygons now wrap around other polygons, so check
3645 //every polygon that's also contained by OuterOutRec's FirstLeft container
3646 //(including 0) to see if they've become inner to the new inner polygon ...
3647 OutRec* orfl = OuterOutRec->FirstLeft;
3648 for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i)
3649 {
3650 OutRec* outRec = m_PolyOuts[i];
3651
3652 if (!outRec->Pts || outRec == OuterOutRec || outRec == InnerOutRec)
3653 continue;
3654 OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft);
3655 if (firstLeft != orfl && firstLeft != InnerOutRec && firstLeft != OuterOutRec)
3656 continue;
3657 if (Poly2ContainsPoly1(outRec->Pts, InnerOutRec->Pts))
3658 outRec->FirstLeft = InnerOutRec;
3659 else if (Poly2ContainsPoly1(outRec->Pts, OuterOutRec->Pts))
3660 outRec->FirstLeft = OuterOutRec;
3661 else if (outRec->FirstLeft == InnerOutRec || outRec->FirstLeft == OuterOutRec)
3662 outRec->FirstLeft = orfl;
3663 }
3664}
3665//----------------------------------------------------------------------
3666void Clipper::FixupFirstLefts3(OutRec* OldOutRec, OutRec* NewOutRec)
3667{

Callers

nothing calls this directly

Calls 3

ParseFirstLeftFunction · 0.85
Poly2ContainsPoly1Function · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected