diff Framework/Radiography/RadiographyWidget.h @ 428:751fb354149e am-vsol-upgrade

ability to change the scene of the RadiographyWidget
author am@osimis.io
date Wed, 28 Nov 2018 10:44:28 +0100
parents 18b707fb8620
children 4eb96c6b4e96
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyWidget.h	Thu Nov 22 23:15:24 2018 +0100
+++ b/Framework/Radiography/RadiographyWidget.h	Wed Nov 28 10:44:28 2018 +0100
@@ -32,7 +32,7 @@
     public IObserver
   {
   private:
-    RadiographyScene&                      scene_;
+    boost::shared_ptr<RadiographyScene>    scene_;
     std::auto_ptr<Orthanc::ImageAccessor>  floatBuffer_;
     std::auto_ptr<CairoSurface>            cairoBuffer_;
     bool                                   invert_;
@@ -47,7 +47,7 @@
   protected:
     virtual Extent2D GetSceneExtent()
     {
-      return scene_.GetSceneExtent();
+      return scene_->GetSceneExtent();
     }
 
     virtual bool RenderScene(CairoContext& context,
@@ -55,14 +55,16 @@
 
   public:
     RadiographyWidget(MessageBroker& broker,
-                      RadiographyScene& scene,
+                      boost::shared_ptr<RadiographyScene> scene,  // TODO: check how we can avoid boost::shared_ptr here since we don't want them in the public API (app is keeping a boost::shared_ptr to this right now)
                       const std::string& name);
 
     RadiographyScene& GetScene() const
     {
-      return scene_;
+      return *scene_;
     }
 
+    void SetScene(boost::shared_ptr<RadiographyScene> scene);
+
     void Unselect()
     {
       hasSelection_ = false;