Mercurial > hg > orthanc-stone
comparison Samples/Common/RtViewerView.cpp @ 1433:8635b333fa5b
[BREAKING] VolumeSceneLayerSource now locks the viewport properly before using the scene. The ctor now accepts the viewport instead of a ref. to the scene. RtViewer sample has been adapted accordingly.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 19 May 2020 13:22:48 +0200 |
parents | 5d7ee14dc1eb |
children | 15173a383a00 |
comparison
equal
deleted
inserted
replaced
1431:1eaf19af15bf | 1433:8635b333fa5b |
---|---|
310 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 310 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
311 ViewportController& controller = lock->GetController(); | 311 ViewportController& controller = lock->GetController(); |
312 Scene2D& scene = controller.GetScene(); | 312 Scene2D& scene = controller.GetScene(); |
313 int depth = scene.GetMaxDepth() + 1; | 313 int depth = scene.GetMaxDepth() + 1; |
314 | 314 |
315 ctVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(scene, depth, volume)); | 315 ctVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); |
316 | 316 |
317 if (style != NULL) | 317 if (style != NULL) |
318 { | 318 { |
319 ctVolumeLayerSource_->SetConfigurator(style); | 319 ctVolumeLayerSource_->SetConfigurator(style); |
320 } | 320 } |
326 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 326 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
327 ViewportController& controller = lock->GetController(); | 327 ViewportController& controller = lock->GetController(); |
328 Scene2D& scene = controller.GetScene(); | 328 Scene2D& scene = controller.GetScene(); |
329 int depth = scene.GetMaxDepth() + 1; | 329 int depth = scene.GetMaxDepth() + 1; |
330 | 330 |
331 doseVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(scene, depth, volume)); | 331 doseVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); |
332 | 332 |
333 if (style != NULL) | 333 if (style != NULL) |
334 { | 334 { |
335 doseVolumeLayerSource_->SetConfigurator(style); | 335 doseVolumeLayerSource_->SetConfigurator(style); |
336 } | 336 } |
341 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 341 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
342 ViewportController& controller = lock->GetController(); | 342 ViewportController& controller = lock->GetController(); |
343 Scene2D& scene = controller.GetScene(); | 343 Scene2D& scene = controller.GetScene(); |
344 int depth = scene.GetMaxDepth() + 1; | 344 int depth = scene.GetMaxDepth() + 1; |
345 | 345 |
346 structLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(scene, depth, volume)); | 346 structLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); |
347 } | 347 } |
348 } | 348 } |