annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
584
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * Affero General Public License for more details.
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "../Toolbox/AffineTransform2D.h"
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 namespace OrthancStone
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 {
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 class ScenePoint2D
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 private:
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 double x_;
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 double y_;
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 public:
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 ScenePoint2D(double x,
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 double y) :
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 x_(x),
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 y_(y)
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 }
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 double GetX() const
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 return x_;
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 }
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 double GetY() const
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 {
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 return y_;
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 }
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 ScenePoint2D Apply(const AffineTransform2D& t) const
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 {
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 double x = x_;
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 double y = y_;
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 t.Apply(x, y);
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 return ScenePoint2D(x, y);
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 }
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 };
434ceeb0bcab layers: InfoPanel, Polyline, Texture
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 }