comparison Framework/Widgets/LayerWidget.cpp @ 93:5945e81734a3 wasm

decoding of JPEG images
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 May 2017 17:28:31 +0200
parents 961ee171d933
children f47349f4815c
comparison
equal deleted inserted replaced
92:961ee171d933 93:5945e81734a3
87 const SliceGeometry& GetSlice() const 87 const SliceGeometry& GetSlice() const
88 { 88 {
89 return slice_; 89 return slice_;
90 } 90 }
91 91
92 bool HasRenderer(size_t index)
93 {
94 return renderers_[index] != NULL;
95 }
96
92 bool IsComplete() const 97 bool IsComplete() const
93 { 98 {
94 return countMissing_ == 0; 99 return countMissing_ == 0;
95 } 100 }
96 101
206 double ax, ay, bx, by; 211 double ax, ay, bx, by;
207 212
208 assert(layers_[i] != NULL); 213 assert(layers_[i] != NULL);
209 if (GetAndFixExtent(ax, ay, bx, by, *layers_[i])) 214 if (GetAndFixExtent(ax, ay, bx, by, *layers_[i]))
210 { 215 {
211 LOG(INFO) << "Extent of layer " << i << ": (" << ax << "," << ay << ")->(" << bx << "," << by << ")"; 216 LOG(INFO) << "Extent of layer " << i << ": (" << ax << "," << ay
217 << ")->(" << bx << "," << by << ")";
212 218
213 if (first) 219 if (first)
214 { 220 {
215 x1 = ax; 221 x1 = ax;
216 y1 = ay; 222 y1 = ay;
377 } 383 }
378 384
379 385
380 void LayerWidget::SetSlice(const SliceGeometry& slice) 386 void LayerWidget::SetSlice(const SliceGeometry& slice)
381 { 387 {
388 LOG(INFO) << "Setting slice origin: (" << slice.GetOrigin()[0]
389 << "," << slice.GetOrigin()[1]
390 << "," << slice.GetOrigin()[2] << ")";
391
382 Slice displayedSlice(slice_, THIN_SLICE_THICKNESS); 392 Slice displayedSlice(slice_, THIN_SLICE_THICKNESS);
383 393
384 if (!displayedSlice.ContainsPlane(slice)) 394 if (!displayedSlice.ContainsPlane(slice))
385 { 395 {
386 if (currentScene_.get() == NULL || 396 if (currentScene_.get() == NULL ||
488 LOG(INFO) << "Unable to load a slice from layer " << index; 498 LOG(INFO) << "Unable to load a slice from layer " << index;
489 499
490 double x1, y1, x2, y2; 500 double x1, y1, x2, y2;
491 if (GetAndFixExtent(x1, y1, x2, y2, *layers_[index])) 501 if (GetAndFixExtent(x1, y1, x2, y2, *layers_[index]))
492 { 502 {
503 printf("**%d** %f %f %f %f\n", index, x1, y1, x2, y2);
493 UpdateLayer(index, new MissingLayerRenderer(x1, y1, x2, y2), Slice(slice, THIN_SLICE_THICKNESS)); 504 UpdateLayer(index, new MissingLayerRenderer(x1, y1, x2, y2), Slice(slice, THIN_SLICE_THICKNESS));
494 } 505 }
495 } 506 }
496 } 507 }
497 } 508 }