comparison OrthancStone/Sources/Scene2DViewport/ViewportController.h @ 2170:7e8b918b0482

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Oct 2024 16:02:28 +0200
parents 16c01cc201e7
children
comparison
equal deleted inserted replaced
2169:fe5406abd43f 2170:7e8b918b0482
25 #include "PredeclaredTypes.h" 25 #include "PredeclaredTypes.h"
26 26
27 #include "../Messages/IObservable.h" 27 #include "../Messages/IObservable.h"
28 #include "../Scene2D/Scene2D.h" 28 #include "../Scene2D/Scene2D.h"
29 #include "../Scene2DViewport/IFlexiblePointerTracker.h" 29 #include "../Scene2DViewport/IFlexiblePointerTracker.h"
30 #include "../Toolbox/Windowing.h"
30 #include "../Viewport/IViewportInteractor.h" 31 #include "../Viewport/IViewportInteractor.h"
31 32
32 #include <Compatibility.h> 33 #include <Compatibility.h>
33 34
34 #include <boost/enable_shared_from_this.hpp> 35 #include <boost/enable_shared_from_this.hpp>
92 class GrayscaleWindowingChanged : public OriginMessage<ViewportController> 93 class GrayscaleWindowingChanged : public OriginMessage<ViewportController>
93 { 94 {
94 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); 95 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
95 96
96 private: 97 private:
97 double windowingCenter_; 98 Windowing windowing_;
98 double windowingWidth_;
99 99
100 public: 100 public:
101 GrayscaleWindowingChanged(const ViewportController& origin, 101 GrayscaleWindowingChanged(const ViewportController& origin,
102 double windowingCenter, 102 const Windowing& windowing) :
103 double windowingWidth) :
104 OriginMessage(origin), 103 OriginMessage(origin),
105 windowingCenter_(windowingCenter), 104 windowing_(windowing)
106 windowingWidth_(windowingWidth)
107 { 105 {
108 } 106 }
109 107
110 double GetWindowingCenter() const 108 const Windowing& GetWindowing() const
111 { 109 {
112 return windowingCenter_; 110 return windowing_;
113 }
114
115 double GetWindowingWidth() const
116 {
117 return windowingWidth_;
118 } 111 }
119 }; 112 };
120 113
121 explicit ViewportController(boost::weak_ptr<IViewport> viewport); 114 explicit ViewportController(boost::weak_ptr<IViewport> viewport);
122 115
153 146
154 /** Forwarded to the underlying scene, and broadcasted to the observers */ 147 /** Forwarded to the underlying scene, and broadcasted to the observers */
155 void SetSceneToCanvasTransform(const AffineTransform2D& transform); 148 void SetSceneToCanvasTransform(const AffineTransform2D& transform);
156 149
157 /** Info broadcasted to the observers */ 150 /** Info broadcasted to the observers */
158 void BroadcastGrayscaleWindowingChanged(double windowingCenter, 151 void BroadcastGrayscaleWindowingChanged(const Windowing& windowing);
159 double windowingWidth);
160 152
161 /** Forwarded to the underlying scene, and broadcasted to the observers */ 153 /** Forwarded to the underlying scene, and broadcasted to the observers */
162 void FitContent(unsigned int viewportWidth, 154 void FitContent(unsigned int viewportWidth,
163 unsigned int viewportHeight); 155 unsigned int viewportHeight);
164 156