comparison 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
comparison
equal deleted inserted replaced
426:660fe6f6bf4a 428:751fb354149e
30 class RadiographyWidget : 30 class RadiographyWidget :
31 public WorldSceneWidget, 31 public WorldSceneWidget,
32 public IObserver 32 public IObserver
33 { 33 {
34 private: 34 private:
35 RadiographyScene& scene_; 35 boost::shared_ptr<RadiographyScene> scene_;
36 std::auto_ptr<Orthanc::ImageAccessor> floatBuffer_; 36 std::auto_ptr<Orthanc::ImageAccessor> floatBuffer_;
37 std::auto_ptr<CairoSurface> cairoBuffer_; 37 std::auto_ptr<CairoSurface> cairoBuffer_;
38 bool invert_; 38 bool invert_;
39 ImageInterpolation interpolation_; 39 ImageInterpolation interpolation_;
40 bool hasSelection_; 40 bool hasSelection_;
45 ImageInterpolation interpolation); 45 ImageInterpolation interpolation);
46 46
47 protected: 47 protected:
48 virtual Extent2D GetSceneExtent() 48 virtual Extent2D GetSceneExtent()
49 { 49 {
50 return scene_.GetSceneExtent(); 50 return scene_->GetSceneExtent();
51 } 51 }
52 52
53 virtual bool RenderScene(CairoContext& context, 53 virtual bool RenderScene(CairoContext& context,
54 const ViewportGeometry& view); 54 const ViewportGeometry& view);
55 55
56 public: 56 public:
57 RadiographyWidget(MessageBroker& broker, 57 RadiographyWidget(MessageBroker& broker,
58 RadiographyScene& scene, 58 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)
59 const std::string& name); 59 const std::string& name);
60 60
61 RadiographyScene& GetScene() const 61 RadiographyScene& GetScene() const
62 { 62 {
63 return scene_; 63 return *scene_;
64 } 64 }
65
66 void SetScene(boost::shared_ptr<RadiographyScene> scene);
65 67
66 void Unselect() 68 void Unselect()
67 { 69 {
68 hasSelection_ = false; 70 hasSelection_ = false;
69 } 71 }