Mercurial > hg > orthanc-stone
comparison Framework/Widgets/LayerWidget.h @ 77:f5f54ed8d307 wasm
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 May 2017 21:13:29 +0200 |
parents | 298f375dcb68 |
children | 93b917b02fee |
comparison
equal
deleted
inserted
replaced
76:0aef120d7e1c | 77:f5f54ed8d307 |
---|---|
28 | 28 |
29 namespace OrthancStone | 29 namespace OrthancStone |
30 { | 30 { |
31 class LayerWidget : | 31 class LayerWidget : |
32 public WorldSceneWidget, | 32 public WorldSceneWidget, |
33 public ILayerSource::IObserver // TODO move this as PImpl | 33 private ILayerSource::IObserver |
34 { | 34 { |
35 private: | 35 private: |
36 class Scene; | 36 class Scene; |
37 | 37 |
38 typedef std::map<ILayerSource*, size_t> LayersIndex; | 38 typedef std::map<ILayerSource*, size_t> LayersIndex; |
48 | 48 |
49 | 49 |
50 bool LookupLayer(size_t& index /* out */, | 50 bool LookupLayer(size_t& index /* out */, |
51 ILayerSource& layer) const; | 51 ILayerSource& layer) const; |
52 | 52 |
53 | |
54 virtual void NotifyGeometryReady(ILayerSource& source); | |
55 | |
56 virtual void NotifyGeometryError(ILayerSource& source); | |
57 | |
58 virtual void NotifySourceChange(ILayerSource& source); | |
59 | |
60 virtual void NotifySliceChange(ILayerSource& source, | |
61 const Slice& slice); | |
62 | |
63 virtual void NotifyLayerReady(ILayerRenderer* renderer, | |
64 ILayerSource& source, | |
65 const Slice& slice); | |
66 | |
67 virtual void NotifyLayerError(ILayerSource& source, | |
68 const SliceGeometry& slice); | |
69 | |
53 | 70 |
54 protected: | 71 protected: |
55 virtual void GetSceneExtent(double& x1, | 72 virtual void GetSceneExtent(double& x1, |
56 double& y1, | 73 double& y1, |
57 double& x2, | 74 double& x2, |
62 | 79 |
63 void ResetPendingScene(); | 80 void ResetPendingScene(); |
64 | 81 |
65 void UpdateLayer(size_t index, | 82 void UpdateLayer(size_t index, |
66 ILayerRenderer* renderer, | 83 ILayerRenderer* renderer, |
67 const SliceGeometry& slice); | 84 const Slice& slice); |
68 | 85 |
69 public: | 86 public: |
70 LayerWidget(); | 87 LayerWidget(); |
71 | 88 |
72 virtual ~LayerWidget(); | 89 virtual ~LayerWidget(); |
77 const RenderStyle& style); | 94 const RenderStyle& style); |
78 | 95 |
79 void SetSlice(const SliceGeometry& slice, | 96 void SetSlice(const SliceGeometry& slice, |
80 double sliceThickness); | 97 double sliceThickness); |
81 | 98 |
82 virtual void NotifyGeometryReady(ILayerSource& source); | |
83 | |
84 virtual void NotifySourceChange(ILayerSource& source); | |
85 | |
86 virtual void NotifySliceChange(ILayerSource& source, | |
87 const SliceGeometry& slice); | |
88 | |
89 virtual void NotifyLayerReady(ILayerRenderer* renderer, | |
90 ILayerSource& source, | |
91 const SliceGeometry& viewportSlice); | |
92 | |
93 virtual void NotifyLayerError(ILayerSource& source, | |
94 const SliceGeometry& viewportSlice); | |
95 | |
96 virtual void Start(); | 99 virtual void Start(); |
97 }; | 100 }; |
98 } | 101 } |