| 4219 | //------------------------------------------------------------------------------ |
| 4220 | |
| 4221 | void Clipper::DoSimplePolygons() |
| 4222 | { |
| 4223 | PolyOutList::size_type i = 0; |
| 4224 | while (i < m_PolyOuts.size()) |
| 4225 | { |
| 4226 | OutRec* outrec = m_PolyOuts[i++]; |
| 4227 | OutPt* op = outrec->Pts; |
| 4228 | if (!op || outrec->IsOpen) continue; |
| 4229 | do //for each Pt in Polygon until duplicate found do ... |
| 4230 | { |
| 4231 | OutPt* op2 = op->Next; |
| 4232 | while (op2 != outrec->Pts) |
| 4233 | { |
| 4234 | if ((op->Pt == op2->Pt) && op2->Next != op && op2->Prev != op) |
| 4235 | { |
| 4236 | //split the polygon into two ... |
| 4237 | OutPt* op3 = op->Prev; |
| 4238 | OutPt* op4 = op2->Prev; |
| 4239 | op->Prev = op4; |
| 4240 | op4->Next = op; |
| 4241 | op2->Prev = op3; |
| 4242 | op3->Next = op2; |
| 4243 | |
| 4244 | outrec->Pts = op; |
| 4245 | OutRec* outrec2 = CreateOutRec(); |
| 4246 | outrec2->Pts = op2; |
| 4247 | UpdateOutPtIdxs(*outrec2); |
| 4248 | if (Poly2ContainsPoly1(outrec2->Pts, outrec->Pts)) |
| 4249 | { |
| 4250 | //OutRec2 is contained by OutRec1 ... |
| 4251 | outrec2->IsHole = !outrec->IsHole; |
| 4252 | outrec2->FirstLeft = outrec; |
| 4253 | if (m_UsingPolyTree) FixupFirstLefts2(outrec2, outrec); |
| 4254 | } |
| 4255 | else |
| 4256 | if (Poly2ContainsPoly1(outrec->Pts, outrec2->Pts)) |
| 4257 | { |
| 4258 | //OutRec1 is contained by OutRec2 ... |
| 4259 | outrec2->IsHole = outrec->IsHole; |
| 4260 | outrec->IsHole = !outrec2->IsHole; |
| 4261 | outrec2->FirstLeft = outrec->FirstLeft; |
| 4262 | outrec->FirstLeft = outrec2; |
| 4263 | if (m_UsingPolyTree) FixupFirstLefts2(outrec, outrec2); |
| 4264 | } |
| 4265 | else |
| 4266 | { |
| 4267 | //the 2 polygons are separate ... |
| 4268 | outrec2->IsHole = outrec->IsHole; |
| 4269 | outrec2->FirstLeft = outrec->FirstLeft; |
| 4270 | if (m_UsingPolyTree) FixupFirstLefts1(outrec, outrec2); |
| 4271 | } |
| 4272 | op2 = op; //ie get ready for the Next iteration |
| 4273 | } |
| 4274 | op2 = op2->Next; |
| 4275 | } |
| 4276 | op = op->Next; |
| 4277 | } |
| 4278 | while (op != outrec->Pts); |
nothing calls this directly
no test coverage detected