Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/StoneEnumerations.cpp @ 1515:b750b6eab453
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Jul 2020 20:52:35 +0200 |
parents | 244ad1e4e76a |
children | 4fb8fdf03314 |
rev | line source |
---|---|
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
625
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * the License, or (at your option) any later version. |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * Affero General Public License for more details. |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 **/ |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
194
7a031ac16b2d
rename Enumerations.h to StoneEnumerations.h to avoid clashes with Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
22 #include "StoneEnumerations.h" |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
24 #include <Logging.h> |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
25 #include <OrthancException.h> |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
26 #include <Toolbox.h> |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 namespace OrthancStone |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 { |
625
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
30 SopClassUid StringToSopClassUid(const std::string& source) |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
174
a7674c0ae4ac
fix captain rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
142
diff
changeset
|
32 std::string s = Orthanc::Toolbox::StripSpaces(source); |
a7674c0ae4ac
fix captain rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
142
diff
changeset
|
33 |
a7674c0ae4ac
fix captain rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
142
diff
changeset
|
34 if (s == "1.2.840.10008.5.1.4.1.1.481.2") |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 { |
625
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
36 return SopClassUid_RTDose; |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 } |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 else |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 { |
625
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
40 //LOG(INFO) << "Other SOP class UID: " << source; |
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
41 return SopClassUid_Other; |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 } |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 } |
142
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
44 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
45 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
46 void ComputeWindowing(float& targetCenter, |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
47 float& targetWidth, |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
48 ImageWindowing windowing, |
589
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
49 float customCenter, |
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
50 float customWidth) |
142
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
51 { |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
52 switch (windowing) |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
53 { |
589
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
54 case ImageWindowing_Custom: |
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
55 targetCenter = customCenter; |
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
56 targetWidth = customWidth; |
142
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
57 break; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
58 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
59 case ImageWindowing_Bone: |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
60 targetCenter = 300; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
61 targetWidth = 2000; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
62 break; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
63 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
64 case ImageWindowing_Lung: |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
65 targetCenter = -600; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
66 targetWidth = 1600; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
67 break; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
68 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
69 default: |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
70 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
71 } |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
72 } |
366
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
73 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
74 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
75 void ComputeAnchorTranslation(double& deltaX, |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
76 double& deltaY, |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
77 BitmapAnchor anchor, |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
78 unsigned int bitmapWidth, |
557
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
79 unsigned int bitmapHeight, |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
80 unsigned int border) |
366
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
81 { |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
82 double dw = static_cast<double>(bitmapWidth); |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
83 double dh = static_cast<double>(bitmapHeight); |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
84 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
85 switch (anchor) |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
86 { |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
87 case BitmapAnchor_TopLeft: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
88 deltaX = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
89 deltaY = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
90 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
91 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
92 case BitmapAnchor_TopCenter: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
93 deltaX = -dw / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
94 deltaY = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
95 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
96 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
97 case BitmapAnchor_TopRight: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
98 deltaX = -dw; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
99 deltaY = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
100 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
101 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
102 case BitmapAnchor_CenterLeft: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
103 deltaX = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
104 deltaY = -dh / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
105 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
106 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
107 case BitmapAnchor_Center: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
108 deltaX = -dw / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
109 deltaY = -dh / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
110 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
111 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
112 case BitmapAnchor_CenterRight: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
113 deltaX = -dw; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
114 deltaY = -dh / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
115 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
116 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
117 case BitmapAnchor_BottomLeft: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
118 deltaX = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
119 deltaY = -dh; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
120 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
121 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
122 case BitmapAnchor_BottomCenter: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
123 deltaX = -dw / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
124 deltaY = -dh; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
125 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
126 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
127 case BitmapAnchor_BottomRight: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
128 deltaX = -dw; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
129 deltaY = -dh; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
130 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
131 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
132 default: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
133 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
134 } |
557
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
135 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
136 if (border != 0) |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
137 { |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
138 double b = static_cast<double>(border); |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
139 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
140 switch (anchor) |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
141 { |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
142 case BitmapAnchor_TopLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
143 case BitmapAnchor_TopCenter: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
144 case BitmapAnchor_TopRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
145 deltaY += b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
146 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
147 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
148 case BitmapAnchor_BottomLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
149 case BitmapAnchor_BottomCenter: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
150 case BitmapAnchor_BottomRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
151 deltaY -= b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
152 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
153 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
154 default: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
155 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
156 } |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
157 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
158 switch (anchor) |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
159 { |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
160 case BitmapAnchor_TopLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
161 case BitmapAnchor_CenterLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
162 case BitmapAnchor_BottomLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
163 deltaX += b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
164 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
165 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
166 case BitmapAnchor_CenterRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
167 case BitmapAnchor_TopRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
168 case BitmapAnchor_BottomRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
169 deltaX -= b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
170 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
171 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
172 default: |
559 | 173 break; |
557
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
174 } |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
175 } |
366
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
176 } |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 } |