Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Scene2DViewport/ViewportController.h @ 1721:d4a8e2b19a65
new "GrayscaleWindowingChanged" message from GrayscaleWindowingSceneTracker
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 01 Dec 2020 12:51:57 +0100 |
parents | fb62c1522193 |
children | 9ac2a65d4172 |
comparison
equal
deleted
inserted
replaced
1720:b8d19f53aaca | 1721:d4a8e2b19a65 |
---|---|
86 public: | 86 public: |
87 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, \ | 87 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, \ |
88 SceneTransformChanged, \ | 88 SceneTransformChanged, \ |
89 ViewportController); | 89 ViewportController); |
90 | 90 |
91 class GrayscaleWindowingChanged : public OriginMessage<ViewportController> | |
92 { | |
93 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); | |
94 | |
95 private: | |
96 double windowingCenter_; | |
97 double windowingWidth_; | |
98 | |
99 public: | |
100 GrayscaleWindowingChanged(const ViewportController& origin, | |
101 double windowingCenter, | |
102 double windowingWidth) : | |
103 OriginMessage(origin), | |
104 windowingCenter_(windowingCenter), | |
105 windowingWidth_(windowingWidth) | |
106 { | |
107 } | |
108 | |
109 double GetWindowingCenter() const | |
110 { | |
111 return windowingCenter_; | |
112 } | |
113 | |
114 double GetWindowingWidth() const | |
115 { | |
116 return windowingWidth_; | |
117 } | |
118 }; | |
119 | |
91 explicit ViewportController(boost::weak_ptr<IViewport> viewport); | 120 explicit ViewportController(boost::weak_ptr<IViewport> viewport); |
92 | 121 |
93 ~ViewportController(); | 122 ~ViewportController(); |
94 | 123 |
95 /** | 124 /** |
118 /** Forwarded to the underlying scene */ | 147 /** Forwarded to the underlying scene */ |
119 AffineTransform2D GetSceneToCanvasTransform() const; | 148 AffineTransform2D GetSceneToCanvasTransform() const; |
120 | 149 |
121 /** Forwarded to the underlying scene, and broadcasted to the observers */ | 150 /** Forwarded to the underlying scene, and broadcasted to the observers */ |
122 void SetSceneToCanvasTransform(const AffineTransform2D& transform); | 151 void SetSceneToCanvasTransform(const AffineTransform2D& transform); |
152 | |
153 /** Info broadcasted to the observers */ | |
154 void BroadcastGrayscaleWindowingChanged(double windowingCenter, | |
155 double windowingWidth); | |
123 | 156 |
124 /** Forwarded to the underlying scene, and broadcasted to the observers */ | 157 /** Forwarded to the underlying scene, and broadcasted to the observers */ |
125 void FitContent(unsigned int viewportWidth, | 158 void FitContent(unsigned int viewportWidth, |
126 unsigned int viewportHeight); | 159 unsigned int viewportHeight); |
127 | 160 |