Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/Extent.h @ 97:d18dcc963930 wasm
separation of the renderers vs. viewport slice
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 May 2017 14:09:11 +0200 |
parents | |
children | 53bd9277b025 |
comparison
equal
deleted
inserted
replaced
96:f8bce1bebe01 | 97:d18dcc963930 |
---|---|
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 Osimis, 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 namespace OrthancStone | |
25 { | |
26 class Extent | |
27 { | |
28 private: | |
29 bool empty_; | |
30 double x1_; | |
31 double y1_; | |
32 double x2_; | |
33 double y2_; | |
34 | |
35 public: | |
36 Extent() | |
37 { | |
38 Reset(); | |
39 } | |
40 | |
41 void Reset(); | |
42 | |
43 void AddPoint(double x, | |
44 double y); | |
45 | |
46 void Union(const Extent& other); | |
47 | |
48 bool IsEmpty() const | |
49 { | |
50 return empty_; | |
51 } | |
52 | |
53 double GetX1() const | |
54 { | |
55 return x1_; | |
56 } | |
57 | |
58 double GetY1() const | |
59 { | |
60 return y1_; | |
61 } | |
62 | |
63 double GetX2() const | |
64 { | |
65 return x2_; | |
66 } | |
67 | |
68 double GetY2() const | |
69 { | |
70 return y2_; | |
71 } | |
72 | |
73 double GetWidth() const | |
74 { | |
75 return x2_ - x1_; | |
76 } | |
77 | |
78 double GetHeight() const | |
79 { | |
80 return y2_ - y1_; | |
81 } | |
82 }; | |
83 } |