func (s *SweepStatus) Clear() { n := s.First() for n != nil { cur := n n = n.Next() s.returnNode(cur) } s.root = nil }
(b *SweepPoint)
| 995 | //} |
| 996 | |
| 997 | func (a *SweepPoint) LessH(b *SweepPoint) bool { |
| 998 | // used for sweep queue |
| 999 | if a.X != b.X { |
| 1000 | return a.X < b.X // sort left to right |
| 1001 | } else if a.Y != b.Y { |
| 1002 | return a.Y < b.Y // then bottom to top |
| 1003 | } else if a.left != b.left { |
| 1004 | return b.left // handle right-endpoints before left-endpoints |
| 1005 | } else if a.compareTangentsV(b) < 0 { |
| 1006 | return true // sort upwards, this ensures CCW orientation order of result |
| 1007 | } |
| 1008 | return false |
| 1009 | } |
| 1010 | |
| 1011 | func (a *SweepPoint) CompareH(b *SweepPoint) int { |
| 1012 | // used for nodes in tolerance square so that a.X==b.X and a.Y==b.Y |