Mercurial > gemma
comparison pkg/octree/strtree.go @ 4645:946689a56fc2
Forgot a bbox check when evaluating STRTree speeding it significantly.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 13 Oct 2019 16:01:06 +0200 |
parents | a1a9b1eab57c |
children | 18331577a251 |
comparison
equal
deleted
inserted
replaced
4644:486495590483 | 4645:946689a56fc2 |
---|---|
42 n := s.index[top+1] | 42 n := s.index[top+1] |
43 stack = append(stack, s.index[top+2:top+2+n]...) | 43 stack = append(stack, s.index[top+2:top+2+n]...) |
44 } | 44 } |
45 } else { // leaf | 45 } else { // leaf |
46 top = -top - 1 | 46 top = -top - 1 |
47 if !s.bbox(top).Contains(x, y) { | |
48 continue | |
49 } | |
47 for i, n := int32(0), s.index[top+1]; i < n; i++ { | 50 for i, n := int32(0), s.index[top+1]; i < n; i++ { |
48 idx := s.index[top+2+i] | 51 idx := s.index[top+2+i] |
49 ti := s.tin.Triangles[idx] | 52 ti := s.tin.Triangles[idx] |
50 t := Triangle{ | 53 t := Triangle{ |
51 vertices[ti[0]], | 54 vertices[ti[0]], |