Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/ScenePoint2D.h @ 584:434ceeb0bcab
layers: InfoPanel, Polyline, Texture
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 Apr 2019 17:36:00 +0200 |
parents | |
children | b716763571ad |
comparison
equal
deleted
inserted
replaced
583:f9ac154c5a63 | 584:434ceeb0bcab |
---|---|
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-2019 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 #include "../Toolbox/AffineTransform2D.h" | |
25 | |
26 | |
27 namespace OrthancStone | |
28 { | |
29 class ScenePoint2D | |
30 { | |
31 private: | |
32 double x_; | |
33 double y_; | |
34 | |
35 public: | |
36 ScenePoint2D(double x, | |
37 double y) : | |
38 x_(x), | |
39 y_(y) | |
40 { | |
41 } | |
42 | |
43 double GetX() const | |
44 { | |
45 return x_; | |
46 } | |
47 | |
48 double GetY() const | |
49 { | |
50 return y_; | |
51 } | |
52 | |
53 ScenePoint2D Apply(const AffineTransform2D& t) const | |
54 { | |
55 double x = x_; | |
56 double y = y_; | |
57 t.Apply(x, y); | |
58 return ScenePoint2D(x, y); | |
59 } | |
60 }; | |
61 } |