comparison Framework/Widgets/SliceViewerWidget.h @ 726:4f2416d519b4

moving layers, widgets and loaders to Deprecated namespace
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 May 2019 11:43:25 +0200
parents d2c0e347ddc2
children
comparison
equal deleted inserted replaced
714:d2c0e347ddc2 726:4f2416d519b4
26 #include "../Toolbox/Extent2D.h" 26 #include "../Toolbox/Extent2D.h"
27 #include "../../Framework/Messages/IObserver.h" 27 #include "../../Framework/Messages/IObserver.h"
28 28
29 #include <map> 29 #include <map>
30 30
31 namespace OrthancStone 31 namespace Deprecated
32 { 32 {
33 class SliceViewerWidget : 33 class SliceViewerWidget :
34 public WorldSceneWidget, 34 public WorldSceneWidget,
35 public IObserver, 35 public OrthancStone::IObserver,
36 public IObservable 36 public OrthancStone::IObservable
37 { 37 {
38 public: 38 public:
39 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryChangedMessage, SliceViewerWidget); 39 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryChangedMessage, SliceViewerWidget);
40 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ContentChangedMessage, SliceViewerWidget); 40 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ContentChangedMessage, SliceViewerWidget);
41 41
42 42
43 // TODO - Use this message in ReferenceLineSource 43 // TODO - Use this message in ReferenceLineSource
44 class DisplayedSliceMessage : public OriginMessage<SliceViewerWidget> 44 class DisplayedSliceMessage : public OrthancStone::OriginMessage<SliceViewerWidget>
45 { 45 {
46 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); 46 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
47 47
48 private: 48 private:
49 const Deprecated::Slice& slice_; 49 const Deprecated::Slice& slice_;
72 72
73 bool started_; 73 bool started_;
74 LayersIndex layersIndex_; 74 LayersIndex layersIndex_;
75 std::vector<IVolumeSlicer*> layers_; 75 std::vector<IVolumeSlicer*> layers_;
76 std::vector<RenderStyle> styles_; 76 std::vector<RenderStyle> styles_;
77 CoordinateSystem3D plane_; 77 OrthancStone::CoordinateSystem3D plane_;
78 std::auto_ptr<Scene> currentScene_; 78 std::auto_ptr<Scene> currentScene_;
79 std::auto_ptr<Scene> pendingScene_; 79 std::auto_ptr<Scene> pendingScene_;
80 std::vector<bool> changedLayers_; 80 std::vector<bool> changedLayers_;
81 81
82 bool LookupLayer(size_t& index /* out */, 82 bool LookupLayer(size_t& index /* out */,
83 const IVolumeSlicer& layer) const; 83 const IVolumeSlicer& layer) const;
84 84
85 void GetLayerExtent(Extent2D& extent, 85 void GetLayerExtent(OrthancStone::Extent2D& extent,
86 IVolumeSlicer& source) const; 86 IVolumeSlicer& source) const;
87 87
88 void OnGeometryReady(const IVolumeSlicer::GeometryReadyMessage& message); 88 void OnGeometryReady(const IVolumeSlicer::GeometryReadyMessage& message);
89 89
90 virtual void OnContentChanged(const IVolumeSlicer::ContentChangedMessage& message); 90 virtual void OnContentChanged(const IVolumeSlicer::ContentChangedMessage& message);
98 void ObserveLayer(IVolumeSlicer& source); 98 void ObserveLayer(IVolumeSlicer& source);
99 99
100 void ResetChangedLayers(); 100 void ResetChangedLayers();
101 101
102 public: 102 public:
103 SliceViewerWidget(MessageBroker& broker, 103 SliceViewerWidget(OrthancStone::MessageBroker& broker,
104 const std::string& name); 104 const std::string& name);
105 105
106 virtual Extent2D GetSceneExtent(); 106 virtual OrthancStone::Extent2D GetSceneExtent();
107 107
108 protected: 108 protected:
109 virtual bool RenderScene(CairoContext& context, 109 virtual bool RenderScene(OrthancStone::CairoContext& context,
110 const ViewportGeometry& view); 110 const ViewportGeometry& view);
111 111
112 void ResetPendingScene(); 112 void ResetPendingScene();
113 113
114 void UpdateLayer(size_t index, 114 void UpdateLayer(size_t index,
115 ILayerRenderer* renderer, 115 ILayerRenderer* renderer,
116 const CoordinateSystem3D& plane); 116 const OrthancStone::CoordinateSystem3D& plane);
117 117
118 void InvalidateAllLayers(); 118 void InvalidateAllLayers();
119 119
120 void InvalidateLayer(size_t layer); 120 void InvalidateLayer(size_t layer);
121 121
136 const RenderStyle& GetLayerStyle(size_t layer) const; 136 const RenderStyle& GetLayerStyle(size_t layer) const;
137 137
138 void SetLayerStyle(size_t layer, 138 void SetLayerStyle(size_t layer,
139 const RenderStyle& style); 139 const RenderStyle& style);
140 140
141 void SetSlice(const CoordinateSystem3D& plane); 141 void SetSlice(const OrthancStone::CoordinateSystem3D& plane);
142 142
143 const CoordinateSystem3D& GetSlice() const 143 const OrthancStone::CoordinateSystem3D& GetSlice() const
144 { 144 {
145 return plane_; 145 return plane_;
146 } 146 }
147 147
148 virtual bool HasAnimation() const 148 virtual bool HasAnimation() const