Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/Internals/FixedPointAligner.h @ 700:059e1fd05fd6 refactor-viewport-controller
Introduced the ViewportController that sits between the application and the
Scene2D to handle the trackers and measuring tools. This is a work in progress.
The Scene2D is no longer an observable. Message sending is managed by the
ViewportController.
Move some refs to shared and weak to prevent lifetime issues.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Sun, 19 May 2019 16:26:17 +0200 |
parents | 7efa2543699d |
children | c0fcb2757b0a |
comparison
equal
deleted
inserted
replaced
699:5c551f078c18 | 700:059e1fd05fd6 |
---|---|
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 | |
22 #pragma once | 21 #pragma once |
23 | 22 |
24 #include "../Scene2D.h" | 23 #include <Framework/Scene2DViewport/PointerTypes.h> |
25 #include "../ScenePoint2D.h" | 24 #include <Framework/Scene2D/ScenePoint2D.h> |
26 | 25 |
27 namespace OrthancStone | 26 namespace OrthancStone |
28 { | 27 { |
29 namespace Internals | 28 namespace Internals |
30 { | 29 { |
31 // During a mouse event that modifies the view of a scene, keeps | 30 // During a mouse event that modifies the view of a scene, keeps |
32 // one point (the pivot) at the same position on the canvas | 31 // one point (the pivot) at the same position on the canvas |
33 class FixedPointAligner : public boost::noncopyable | 32 class FixedPointAligner : public boost::noncopyable |
34 { | 33 { |
35 private: | 34 private: |
36 Scene2D& scene_; | 35 ViewportControllerWPtr controllerW_; |
37 ScenePoint2D pivot_; | 36 ScenePoint2D pivot_; |
38 ScenePoint2D canvas_; | 37 ScenePoint2D canvas_; |
39 | 38 |
40 public: | 39 public: |
41 FixedPointAligner(Scene2D& scene, | 40 FixedPointAligner(ViewportControllerWPtr controllerW, |
42 const ScenePoint2D& p); | 41 const ScenePoint2D& p); |
43 | 42 |
44 void Apply(); | 43 void Apply(); |
45 }; | 44 }; |
46 } | 45 } |