Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/Internals/FixedPointAligner.h @ 1305:a5326ce4f24b broker
Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 04 Mar 2020 09:45:38 +0100 |
parents | 2d8ab34c8c91 |
children | ab81ee8fce1f |
comparison
equal
deleted
inserted
replaced
1304:b7fa67bf87fa | 1305:a5326ce4f24b |
---|---|
20 | 20 |
21 #pragma once | 21 #pragma once |
22 | 22 |
23 #include "../../Scene2DViewport/PredeclaredTypes.h" | 23 #include "../../Scene2DViewport/PredeclaredTypes.h" |
24 #include "../../Scene2D/ScenePoint2D.h" | 24 #include "../../Scene2D/ScenePoint2D.h" |
25 #include "../../Viewport/IViewport.h" | |
26 | |
27 #include <boost/weak_ptr.hpp> | |
25 | 28 |
26 namespace OrthancStone | 29 namespace OrthancStone |
27 { | 30 { |
28 namespace Internals | 31 namespace Internals |
29 { | 32 { |
30 // During a mouse event that modifies the view of a scene, keeps | 33 // During a mouse event that modifies the view of a scene, keeps |
31 // one point (the pivot) at a fixed position on the canvas | 34 // one point (the pivot) at a fixed position on the canvas |
32 class FixedPointAligner : public boost::noncopyable | 35 class FixedPointAligner : public boost::noncopyable |
33 { | 36 { |
34 private: | 37 private: |
35 boost::weak_ptr<ViewportController> controllerW_; | 38 IViewport& viewport_; |
36 ScenePoint2D pivot_; | 39 ScenePoint2D pivot_; |
37 ScenePoint2D canvas_; | 40 ScenePoint2D canvas_; |
38 | 41 |
39 public: | 42 public: |
40 FixedPointAligner(boost::weak_ptr<ViewportController> controllerW, | 43 FixedPointAligner(IViewport& viewport, |
41 const ScenePoint2D& p); | 44 const ScenePoint2D& p); |
42 | 45 |
43 void Apply(); | 46 void Apply(); |
44 }; | 47 }; |
45 } | 48 } |