Mercurial > gemma
diff pkg/octree/tree.go @ 1692:f4dcbe8941a1
Octree: Resolved the remaing golint issues with this package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 31 Dec 2018 11:13:49 +0100 |
parents | a244b18cb916 |
children | 00f34a00e6d5 |
line wrap: on
line diff
--- a/pkg/octree/tree.go Sun Dec 30 16:24:51 2018 +0100 +++ b/pkg/octree/tree.go Mon Dec 31 11:13:49 2018 +0100 @@ -17,14 +17,18 @@ "math" ) +// Tree is an Octree holding triangles. type Tree struct { + // EPSG is the projection. EPSG uint32 vertices []Vertex triangles [][]int32 index []int32 + // Min is the lower left corner of the bbox. Min Vertex + // Max is the upper right corner of the bbox. Max Vertex } @@ -35,6 +39,7 @@ {0.5, 0.5, 1.0, 1.0}, } +// Vertical does a vertical cross cut from (x1, y1) to (x2, y2). func (ot *Tree) Vertical(x1, y1, x2, y2 float64, fn func(*Triangle)) { box := Box2D{ @@ -123,6 +128,7 @@ } } +// Horizontal does a horizontal cross cut. func (ot *Tree) Horizontal(h float64, fn func(*Triangle)) { if h < ot.Min.Z || ot.Max.Z < h {