| 1495 | |
| 1496 | |
| 1497 | OutPt* ClipperBase::AddOutPt(const Active& e, const Point64& pt) |
| 1498 | { |
| 1499 | OutPt* new_op = nullptr; |
| 1500 | |
| 1501 | //Outrec.OutPts: a circular doubly-linked-list of POutPt where ... |
| 1502 | //op_front[.Prev]* ~~~> op_back & op_back == op_front.Next |
| 1503 | OutRec* outrec = e.outrec; |
| 1504 | bool to_front = IsFront(e); |
| 1505 | OutPt* op_front = outrec->pts; |
| 1506 | OutPt* op_back = op_front->next; |
| 1507 | |
| 1508 | if (to_front) |
| 1509 | { |
| 1510 | if (pt == op_front->pt) |
| 1511 | return op_front; |
| 1512 | } |
| 1513 | else if (pt == op_back->pt) |
| 1514 | return op_back; |
| 1515 | |
| 1516 | new_op = new OutPt(pt, outrec); |
| 1517 | op_back->prev = new_op; |
| 1518 | new_op->prev = op_front; |
| 1519 | new_op->next = op_back; |
| 1520 | op_front->next = new_op; |
| 1521 | if (to_front) outrec->pts = new_op; |
| 1522 | return new_op; |
| 1523 | } |
| 1524 | |
| 1525 | void ClipperBase::CleanCollinear(OutRec* outrec) |
| 1526 | { |