annotate OrthancStone/Sources/Scene2D/MagnifyingGlassTracker.h @ 2012:637d6373127a

width of the vertical slider has doubled to ease user interactions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Dec 2022 18:49:06 +0100
parents 2f242d231a22
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1993
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * Lesser General Public License for more details.
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * License along with this program. If not, see
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * <http://www.gnu.org/licenses/>.
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "../Scene2DViewport/OneGesturePointerTracker.h"
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "../Viewport/ViewportLocker.h"
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <boost/weak_ptr.hpp>
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace OrthancStone
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class MagnifyingGlassTracker : public OneGesturePointerTracker
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 boost::weak_ptr<IViewport> viewport_;
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 ScenePoint2D pivot_;
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 AffineTransform2D originalSceneToCanvas_;
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 AffineTransform2D originalCanvasToScene_;
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
1994
2f242d231a22 cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1993
diff changeset
41 void Update(const ViewportLocker& locker,
1993
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 const PointerEvent& event);
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 public:
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 MagnifyingGlassTracker(boost::weak_ptr<IViewport> viewport,
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 const PointerEvent& event);
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 virtual void PointerUp(const PointerEvent& event,
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 const Scene2D& scene) ORTHANC_OVERRIDE;
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 virtual void PointerMove(const PointerEvent& event,
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 const Scene2D& scene) ORTHANC_OVERRIDE;
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 virtual void Cancel(const Scene2D& scene) ORTHANC_OVERRIDE;
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 };
317a53d4fdc6 added magnifying glass
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 }