Mercurial > gemma
comparison pkg/imports/sr.go @ 974:7a89313f0ead
Fetch the octree directly from the builder. No need to deserialize it from the blob.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 18 Oct 2018 15:11:49 +0200 |
parents | b6fec8f85599 |
children | c397fdd8c327 |
comparison
equal
deleted
inserted
replaced
973:b6fec8f85599 | 974:7a89313f0ead |
---|---|
323 | 323 |
324 builder := octree.NewBuilder(tin) | 324 builder := octree.NewBuilder(tin) |
325 start = time.Now() | 325 start = time.Now() |
326 builder.Build() | 326 builder.Build() |
327 octreeIndex, err := builder.Bytes() | 327 octreeIndex, err := builder.Bytes() |
328 builder, tin = nil, nil // not needed from now on | 328 tin = nil // not needed from now on |
329 log.Printf("building octree took %s\n", time.Since(start)) | 329 log.Printf("building octree took %s\n", time.Since(start)) |
330 if err != nil { | 330 if err != nil { |
331 return err | 331 return err |
332 } | 332 } |
333 | 333 |
340 log.Printf("storing octree index took %s\n", time.Since(start)) | 340 log.Printf("storing octree index took %s\n", time.Since(start)) |
341 if err != nil { | 341 if err != nil { |
342 return err | 342 return err |
343 } | 343 } |
344 | 344 |
345 index, err := octree.Deserialize(octreeIndex) | 345 index := builder.Tree() |
346 if err != nil { | 346 builder = nil // not needed from now on |
347 return err | |
348 } | |
349 | 347 |
350 // TODO: Generate iso-lines | 348 // TODO: Generate iso-lines |
351 | 349 |
352 _ = index | 350 _ = index |
353 | 351 |