initLoopProperties sets the properties for polygons with multiple loops.
()
| 387 | |
| 388 | // initLoopProperties sets the properties for polygons with multiple loops. |
| 389 | func (p *Polygon) initLoopProperties() { |
| 390 | p.numVertices = 0 |
| 391 | // the loops depths are set by initNested/initOriented prior to this. |
| 392 | p.bound = EmptyRect() |
| 393 | p.hasHoles = false |
| 394 | for _, l := range p.loops { |
| 395 | if l.IsHole() { |
| 396 | p.hasHoles = true |
| 397 | } else { |
| 398 | p.bound = p.bound.Union(l.RectBound()) |
| 399 | } |
| 400 | p.numVertices += l.NumVertices() |
| 401 | } |
| 402 | p.subregionBound = ExpandForSubregions(p.bound) |
| 403 | |
| 404 | p.initEdgesAndIndex() |
| 405 | } |
| 406 | |
| 407 | // initEdgesAndIndex performs the shape related initializations and adds the final |
| 408 | // polygon to the index. |
no test coverage detected