Mercurial > hg > orthanc-stone
comparison Applications/Samples/Common/RtViewerView.cpp @ 1640:52b8b96cb55f
cleaning namespaces
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 10 Nov 2020 16:55:22 +0100 |
parents | 74ed691f9c64 |
children | 03afa09cfcf1 |
comparison
equal
deleted
inserted
replaced
1639:5cdc5b98f14d | 1640:52b8b96cb55f |
---|---|
72 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 72 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
73 ViewportController& controller = lock->GetController(); | 73 ViewportController& controller = lock->GetController(); |
74 Scene2D& scene = controller.GetScene(); | 74 Scene2D& scene = controller.GetScene(); |
75 | 75 |
76 // do not try to use stuff too early! | 76 // do not try to use stuff too early! |
77 const OrthancStone::ICompositor& compositor = lock->GetCompositor(); | 77 const ICompositor& compositor = lock->GetCompositor(); |
78 | 78 |
79 std::stringstream msg; | 79 std::stringstream msg; |
80 | 80 |
81 for (std::map<std::string, std::string>::const_iterator kv = infoTextMap_.begin(); | 81 for (std::map<std::string, std::string>::const_iterator kv = infoTextMap_.begin(); |
82 kv != infoTextMap_.end(); ++kv) | 82 kv != infoTextMap_.end(); ++kv) |
159 DisplayInfoText(); | 159 DisplayInfoText(); |
160 } | 160 } |
161 | 161 |
162 void RtViewerView::Invalidate() | 162 void RtViewerView::Invalidate() |
163 { | 163 { |
164 std::unique_ptr<OrthancStone::IViewport::ILock> lock(viewport_->Lock()); | 164 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
165 lock->GetCompositor().FitContent(lock->GetController().GetScene()); | 165 lock->GetCompositor().FitContent(lock->GetController().GetScene()); |
166 lock->Invalidate(); | 166 lock->Invalidate(); |
167 } | 167 } |
168 | 168 |
169 void RtViewerView::FitContent() | 169 void RtViewerView::FitContent() |
170 { | 170 { |
171 std::unique_ptr<OrthancStone::IViewport::ILock> lock(viewport_->Lock()); | 171 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
172 lock->GetCompositor().FitContent(lock->GetController().GetScene()); | 172 lock->GetCompositor().FitContent(lock->GetController().GetScene()); |
173 lock->Invalidate(); | 173 lock->Invalidate(); |
174 } | 174 } |
175 | 175 |
176 void RtViewerView::Scroll(int delta) | 176 void RtViewerView::Scroll(int delta) |
312 } | 312 } |
313 | 313 |
314 this->SetStructureSet(rtstructLoader); | 314 this->SetStructureSet(rtstructLoader); |
315 } | 315 } |
316 | 316 |
317 void RtViewerView::SetCtVolumeSlicer(const boost::shared_ptr<OrthancStone::IVolumeSlicer>& volume, | 317 void RtViewerView::SetCtVolumeSlicer(const boost::shared_ptr<IVolumeSlicer>& volume, |
318 OrthancStone::ILayerStyleConfigurator* style) | 318 ILayerStyleConfigurator* style) |
319 { | 319 { |
320 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 320 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
321 ViewportController& controller = lock->GetController(); | 321 ViewportController& controller = lock->GetController(); |
322 Scene2D& scene = controller.GetScene(); | 322 Scene2D& scene = controller.GetScene(); |
323 int depth = scene.GetMaxDepth() + 1; | 323 int depth = scene.GetMaxDepth() + 1; |
324 | 324 |
325 ctVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); | 325 ctVolumeLayerSource_.reset(new VolumeSceneLayerSource(viewport_, depth, volume)); |
326 | 326 |
327 if (style != NULL) | 327 if (style != NULL) |
328 { | 328 { |
329 ctVolumeLayerSource_->SetConfigurator(style); | 329 ctVolumeLayerSource_->SetConfigurator(style); |
330 } | 330 } |
331 | 331 |
332 ctLayer_ = depth; | 332 ctLayer_ = depth; |
333 } | 333 } |
334 | 334 |
335 void RtViewerView::SetDoseVolumeSlicer(const boost::shared_ptr<OrthancStone::IVolumeSlicer>& volume, | 335 void RtViewerView::SetDoseVolumeSlicer(const boost::shared_ptr<IVolumeSlicer>& volume, |
336 OrthancStone::ILayerStyleConfigurator* style) | 336 ILayerStyleConfigurator* style) |
337 { | 337 { |
338 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 338 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
339 ViewportController& controller = lock->GetController(); | 339 ViewportController& controller = lock->GetController(); |
340 Scene2D& scene = controller.GetScene(); | 340 Scene2D& scene = controller.GetScene(); |
341 int depth = scene.GetMaxDepth() + 1; | 341 int depth = scene.GetMaxDepth() + 1; |
342 | 342 |
343 doseVolumeLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); | 343 doseVolumeLayerSource_.reset(new VolumeSceneLayerSource(viewport_, depth, volume)); |
344 | 344 |
345 if (style != NULL) | 345 if (style != NULL) |
346 { | 346 { |
347 doseVolumeLayerSource_->SetConfigurator(style); | 347 doseVolumeLayerSource_->SetConfigurator(style); |
348 } | 348 } |
349 } | 349 } |
350 | 350 |
351 void RtViewerView::SetStructureSet(const boost::shared_ptr<OrthancStone::DicomStructureSetLoader>& volume) | 351 void RtViewerView::SetStructureSet(const boost::shared_ptr<DicomStructureSetLoader>& volume) |
352 { | 352 { |
353 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 353 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
354 ViewportController& controller = lock->GetController(); | 354 ViewportController& controller = lock->GetController(); |
355 Scene2D& scene = controller.GetScene(); | 355 Scene2D& scene = controller.GetScene(); |
356 int depth = scene.GetMaxDepth() + 1; | 356 int depth = scene.GetMaxDepth() + 1; |
357 | 357 |
358 structLayerSource_.reset(new OrthancStone::VolumeSceneLayerSource(viewport_, depth, volume)); | 358 structLayerSource_.reset(new VolumeSceneLayerSource(viewport_, depth, volume)); |
359 } | 359 } |
360 } | 360 } |