comparison OrthancStone/Sources/Scene2D/GrayscaleWindowingSceneTracker.h @ 1533:82279abb92d0

GrayscaleWindowingSceneTracker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Aug 2020 15:55:59 +0200
parents
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1532:c7a37c3a0b8e 1533:82279abb92d0
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Affero General Public License
9 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details.
16 *
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/>.
19 **/
20
21
22 #pragma once
23
24
25 #include "../Scene2DViewport/OneGesturePointerTracker.h"
26 #include "../Viewport/IViewport.h"
27 #include "Internals/FixedPointAligner.h"
28
29 #include <boost/weak_ptr.hpp>
30
31 namespace OrthancStone
32 {
33 class GrayscaleWindowingSceneTracker : public OneGesturePointerTracker
34 {
35 private:
36 bool active_;
37 int layerIndex_;
38 double normalization_;
39 float originalCenter_;
40 float originalWidth_;
41 double clickX_;
42 double clickY_;
43
44 void SetWindowing(float center,
45 float width);
46
47 public:
48 GrayscaleWindowingSceneTracker(boost::shared_ptr<IViewport> viewport,
49 int layerIndex,
50 const PointerEvent& event,
51 unsigned int canvasWidth,
52 unsigned int canvasHeight);
53
54 virtual void PointerMove(const PointerEvent& event) ORTHANC_OVERRIDE;
55
56 virtual void Cancel() ORTHANC_OVERRIDE;
57 };
58 }