comparison Framework/Radiography/RadiographyScene.h @ 643:f0008c55e5f7

getting rid of MessageType enumeration
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 10 May 2019 17:34:48 +0200
parents 848170ca4351
children 63982c8c294a
comparison
equal deleted inserted replaced
642:7ca8dc7ec17b 643:f0008c55e5f7
35 class RadiographyScene : 35 class RadiographyScene :
36 public IObserver, 36 public IObserver,
37 public IObservable 37 public IObservable
38 { 38 {
39 public: 39 public:
40 class GeometryChangedMessage : 40 class GeometryChangedMessage : public OriginMessage<RadiographyScene>
41 public OriginMessage<MessageType_RadiographyScene_GeometryChanged, RadiographyScene> 41 {
42 { 42 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
43
43 private: 44 private:
44 RadiographyLayer& layer_; 45 RadiographyLayer& layer_;
45 46
46 public: 47 public:
47 GeometryChangedMessage(const RadiographyScene& origin, 48 GeometryChangedMessage(const RadiographyScene& origin,
55 { 56 {
56 return layer_; 57 return layer_;
57 } 58 }
58 }; 59 };
59 60
60 class ContentChangedMessage : 61 class ContentChangedMessage : public OriginMessage<RadiographyScene>
61 public OriginMessage<MessageType_RadiographyScene_ContentChanged, RadiographyScene> 62 {
62 { 63 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
64
63 private: 65 private:
64 RadiographyLayer& layer_; 66 RadiographyLayer& layer_;
65 67
66 public: 68 public:
67 ContentChangedMessage(const RadiographyScene& origin, 69 ContentChangedMessage(const RadiographyScene& origin,
75 { 77 {
76 return layer_; 78 return layer_;
77 } 79 }
78 }; 80 };
79 81
80 class LayerEditedMessage : 82 class LayerEditedMessage : public OriginMessage<RadiographyScene>
81 public OriginMessage<MessageType_RadiographyScene_LayerEdited, RadiographyScene> 83 {
82 { 84 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
85
83 private: 86 private:
84 const RadiographyLayer& layer_; 87 const RadiographyLayer& layer_;
85 88
86 public: 89 public:
87 LayerEditedMessage(const RadiographyScene& origin, 90 LayerEditedMessage(const RadiographyScene& origin,
93 96
94 const RadiographyLayer& GetLayer() const 97 const RadiographyLayer& GetLayer() const
95 { 98 {
96 return layer_; 99 return layer_;
97 } 100 }
98
99 }; 101 };
100 102
101 class WindowingChangedMessage : 103
102 public OriginMessage<MessageType_RadiographyScene_WindowingChanged, RadiographyScene> 104 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, WindowingChangedMessage, RadiographyScene);
103 { 105
104 106
105 public:
106 WindowingChangedMessage(const RadiographyScene& origin) :
107 OriginMessage(origin)
108 {
109 }
110 };
111
112 class LayerAccessor : public boost::noncopyable 107 class LayerAccessor : public boost::noncopyable
113 { 108 {
114 private: 109 private:
115 RadiographyScene& scene_; 110 RadiographyScene& scene_;
116 size_t index_; 111 size_t index_;