(z Point)
| 316 | } |
| 317 | |
| 318 | func (s *SweepPoint) SplitAt(z Point) (*SweepPoint, *SweepPoint) { |
| 319 | // split segment at point |
| 320 | r := boPointPool.Get().(*SweepPoint) |
| 321 | l := boPointPool.Get().(*SweepPoint) |
| 322 | *r, *l = *s.other, *s |
| 323 | r.Point, l.Point = z, z |
| 324 | r.end, l.end = false, false |
| 325 | |
| 326 | // update references |
| 327 | r.other, s.other.other = s, l |
| 328 | l.other, s.other = s.other, r |
| 329 | l.node = nil |
| 330 | return r, l |
| 331 | } |
| 332 | |
| 333 | func (s *SweepPoint) Reverse() { |
| 334 | s.left, s.other.left = !s.left, s.left |
no test coverage detected