Mercurial > gemma
diff pkg/octree/loader.go @ 1879:9a2fbeaabd52 dev-pdf-generation
merging in from branch default
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Tue, 15 Jan 2019 10:07:10 +0100 |
parents | f4dcbe8941a1 |
children | 86c7a023400e |
line wrap: on
line diff
--- a/pkg/octree/loader.go Tue Jan 15 09:54:46 2019 +0100 +++ b/pkg/octree/loader.go Tue Jan 15 10:07:10 2019 +0100 @@ -18,7 +18,6 @@ "bytes" "encoding/binary" "log" - "os" "github.com/golang/snappy" ) @@ -30,7 +29,7 @@ return nil, err } - log.Printf("EPSG: %d\n", tree.EPSG) + log.Printf("info: EPSG: %d\n", tree.EPSG) if err := tree.Min.Read(r); err != nil { return nil, err @@ -40,7 +39,7 @@ return nil, err } - log.Printf("BBOX: [[%f, %f, %f], [%f, %f, %f]]\n", + log.Printf("info: BBOX: [[%f, %f, %f], [%f, %f, %f]]\n", tree.Min.X, tree.Min.Y, tree.Min.Z, tree.Max.X, tree.Max.Y, tree.Max.Z) @@ -49,7 +48,7 @@ return nil, err } - log.Printf("vertices: %d\n", numVertices) + log.Printf("info: vertices: %d\n", numVertices) vertices := make([]Vertex, numVertices) tree.vertices = vertices @@ -65,7 +64,7 @@ return nil, err } - log.Printf("triangles: %d\n", numTriangles) + log.Printf("info: triangles: %d\n", numTriangles) indices := make([]int32, 3*numTriangles) triangles := make([][]int32, numTriangles) @@ -93,7 +92,7 @@ return nil, err } - log.Printf("num nodes: %d\n", numNodes) + log.Printf("info: num nodes: %d\n", numNodes) tree.index = make([]int32, numNodes) entries := tree.index[1:] @@ -112,19 +111,7 @@ return tree, nil } -func LoadTree(fname string) (*Tree, error) { - - f, err := os.Open(fname) - if err != nil { - return nil, err - } - defer f.Close() - return loadReader( - bufio.NewReader( - snappy.NewReader(f))) -} - -func Deserialize(data []byte) (*Tree, error) { +func deserialize(data []byte) (*Tree, error) { return loadReader( bufio.NewReader( snappy.NewReader(