comparison Framework/Widgets/LayerWidget.cpp @ 96:f8bce1bebe01 wasm

removal of the NotifyLayerError callback
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 May 2017 10:30:57 +0200
parents f47349f4815c
children d18dcc963930
comparison
equal deleted inserted replaced
95:f47349f4815c 96:f8bce1bebe01
479 } 479 }
480 480
481 481
482 void LayerWidget::NotifyLayerReady(std::auto_ptr<ILayerRenderer>& renderer, 482 void LayerWidget::NotifyLayerReady(std::auto_ptr<ILayerRenderer>& renderer,
483 const ILayerSource& source, 483 const ILayerSource& source,
484 const Slice& slice) 484 const Slice& slice,
485 bool isError)
485 { 486 {
486 size_t index; 487 size_t index;
487 if (LookupLayer(index, source) && 488 if (renderer.get() != NULL &&
489 LookupLayer(index, source) &&
488 slice.ContainsPlane(slice_)) // Whether the slice comes from an older request 490 slice.ContainsPlane(slice_)) // Whether the slice comes from an older request
489 { 491 {
490 LOG(INFO) << "Renderer ready for layer " << index; 492 if (isError)
493 {
494 LOG(ERROR) << "Using error renderer on layer " << index;
495 }
496 else
497 {
498 LOG(INFO) << "Renderer ready for layer " << index;
499 }
500
491 UpdateLayer(index, renderer.release(), slice); 501 UpdateLayer(index, renderer.release(), slice);
492 } 502 }
493 } 503 }
494
495
496 void LayerWidget::NotifyLayerError(const ILayerSource& source,
497 const SliceGeometry& slice)
498 {
499 size_t index;
500
501 Slice expected(slice_, THIN_SLICE_THICKNESS);
502
503 if (LookupLayer(index, source) &&
504 expected.ContainsPlane(slice)) // Whether the slice comes from an older request
505 {
506 LOG(INFO) << "Unable to load a slice from layer " << index;
507
508 double x1, y1, x2, y2;
509 if (GetAndFixExtent(x1, y1, x2, y2, *layers_[index]))
510 {
511 printf("**%d** %f %f %f %f\n", index, x1, y1, x2, y2);
512 UpdateLayer(index, new MissingLayerRenderer(x1, y1, x2, y2), Slice(slice, THIN_SLICE_THICKNESS));
513 }
514 }
515 }
516 } 504 }