Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/OsiriXLayerFactory.h @ 2123:538c7b7c6e46 deep-learning
integration mainline->deep-learning
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 Mar 2024 16:11:42 +0100 |
parents | c23eef785569 |
children | 16c01cc201e7 |
rev | line source |
---|---|
1615
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
2114
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium |
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1615
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * the License, or (at your option) any later version. |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * License along with this program. If not, see |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #pragma once |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #include "../Toolbox/CoordinateSystem3D.h" |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include "../Toolbox/OsiriX/Annotation.h" |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #include "Color.h" |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 #include "ISceneLayer.h" |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 namespace OrthancStone |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 class OsiriXLayerFactory : public boost::noncopyable |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 private: |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 Color color_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 double thickness_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 double arrowLength_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 double arrowAngle_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 size_t fontIndex_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 public: |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 OsiriXLayerFactory(); |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 void SetColor(const Color& color) |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 color_ = color; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 void SetColor(uint8_t red, |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 uint8_t green, |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 uint8_t blue) |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 color_ = Color(red, green, blue); |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 const Color& GetColor() const |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 return color_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 void SetThickness(double thickness) |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 thickness_ = thickness; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 double GetThickness() const |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 return thickness_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 void SetArrowLength(double arrowLength) |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 arrowLength_ = arrowLength; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 double GetArrowLength() const |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 return arrowLength_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 void SetArrowAngle(double arrowAngle) |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 arrowAngle_ = arrowAngle; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 double GetArrowAngle() const |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 return arrowAngle_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 void SetFontIndex(double fontIndex) |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 fontIndex_ = fontIndex; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 double GetFontIndex() const |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 { |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 return fontIndex_; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 } |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 ISceneLayer* Create(const OsiriX::Annotation& annotation, |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 const CoordinateSystem3D& plane) const; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 }; |
f5d4bd7b5593
new class: OsiriXLayerFactory
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 } |