annotate Framework/Radiography/RadiographyLayerRotateTracker.h @ 585:b9ce24c606ae

TextSceneLayer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Apr 2019 17:57:58 +0200
parents 3b4df9925db6
children 4f2416d519b4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
414
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
439
b70e9be013e4 preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 414
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
414
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "../Toolbox/UndoRedoStack.h"
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "../Toolbox/ViewportGeometry.h"
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "../Widgets/IWorldSceneMouseTracker.h"
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "RadiographyScene.h"
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 namespace OrthancStone
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 class RadiographyLayerRotateTracker : public IWorldSceneMouseTracker
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 private:
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 class UndoRedoCommand;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 UndoRedoStack& undoRedoStack_;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 RadiographyScene::LayerAccessor accessor_;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 double centerX_;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 double centerY_;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 double originalAngle_;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 double clickAngle_;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 bool roundAngles_;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 bool ComputeAngle(double& angle /* out */,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 double sceneX,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 double sceneY) const;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 public:
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 RadiographyLayerRotateTracker(UndoRedoStack& undoRedoStack,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 RadiographyScene& scene,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 const ViewportGeometry& view,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 size_t layer,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 double x,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 double y,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 bool roundAngles);
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 virtual bool HasRender() const
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 {
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 return false;
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 }
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 virtual void Render(CairoContext& context,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 double zoom);
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 virtual void MouseUp();
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 virtual void MouseMove(int displayX,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 int displayY,
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 double sceneX,
457
3b4df9925db6 added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents: 439
diff changeset
71 double sceneY,
3b4df9925db6 added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents: 439
diff changeset
72 const std::vector<Touch>& displayTouches,
3b4df9925db6 added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
Alain Mazy <alain@mazy.be>
parents: 439
diff changeset
73 const std::vector<Touch>& sceneTouches);
414
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 };
f7616c010056 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }