Mercurial > hg > orthanc-stone
comparison Framework/Widgets/LayerWidget.h @ 267:89d02de83c03 am-2
added declaretion of messages handled/emitted
author | am@osimis.io |
---|---|
date | Wed, 22 Aug 2018 14:59:20 +0200 |
parents | c9cf95b49a86 |
children | 5bd4161bf11b |
comparison
equal
deleted
inserted
replaced
266:c9cf95b49a86 | 267:89d02de83c03 |
---|---|
11 * | 11 * |
12 * This program is distributed in the hope that it will be useful, but | 12 * This program is distributed in the hope that it will be useful, but |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Affero General Public License for more details. | 15 * Affero General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Affero General Public License | 17 * You should have received a copy of the GNU Affero General Public License |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
29 #include <map> | 29 #include <map> |
30 | 30 |
31 namespace OrthancStone | 31 namespace OrthancStone |
32 { | 32 { |
33 class LayerWidget : | 33 class LayerWidget : |
34 public WorldSceneWidget, | 34 public WorldSceneWidget, |
35 public IObserver | 35 public IObserver, |
36 public IObservable | |
36 { | 37 { |
37 private: | 38 private: |
38 class Scene; | 39 class Scene; |
39 | 40 |
40 typedef std::map<const ILayerSource*, size_t> LayersIndex; | 41 typedef std::map<const ILayerSource*, size_t> LayersIndex; |
57 void OnGeometryReady(const ILayerSource& source); | 58 void OnGeometryReady(const ILayerSource& source); |
58 | 59 |
59 virtual void OnContentChanged(const ILayerSource& source); | 60 virtual void OnContentChanged(const ILayerSource& source); |
60 | 61 |
61 virtual void OnSliceChanged(const ILayerSource& source, | 62 virtual void OnSliceChanged(const ILayerSource& source, |
62 const Slice& slice); | 63 const Slice& slice); |
63 | 64 |
64 virtual void OnLayerReady(std::auto_ptr<ILayerRenderer>& renderer, | 65 virtual void OnLayerReady(std::auto_ptr<ILayerRenderer>& renderer, |
65 const ILayerSource& source, | 66 const ILayerSource& source, |
66 const CoordinateSystem3D& slice, | 67 const CoordinateSystem3D& slice, |
67 bool isError); | 68 bool isError); |
68 | 69 |
69 | 70 |
70 void ResetChangedLayers(); | 71 void ResetChangedLayers(); |
71 | 72 |
72 public: | 73 public: |
73 LayerWidget(MessageBroker& broker); | 74 LayerWidget(MessageBroker& broker); |
74 | 75 |
75 virtual void HandleMessage(const IObservable& from, const IMessage& message); | 76 virtual void HandleMessage(const IObservable& from, const IMessage& message); |
76 | 77 |
77 virtual Extent2D GetSceneExtent(); | 78 virtual Extent2D GetSceneExtent(); |
78 | 79 |
79 protected: | 80 protected: |
80 virtual bool RenderScene(CairoContext& context, | 81 virtual bool RenderScene(CairoContext& context, |
81 const ViewportGeometry& view); | 82 const ViewportGeometry& view); |
82 | 83 |
83 void ResetPendingScene(); | 84 void ResetPendingScene(); |