Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Layers/IVolumeSlicer.h @ 732:c35e98d22764
move Deprecated classes to a separate folder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 21 May 2019 14:27:35 +0200 |
parents | Framework/Layers/IVolumeSlicer.h@4f2416d519b4 |
children | b537002f83a9 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
729:529189f399ec | 732:c35e98d22764 |
---|---|
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 "ILayerRenderer.h" | |
25 #include "../Toolbox/Slice.h" | |
26 #include "../../Messages/IObservable.h" | |
27 #include "../../Messages/IMessage.h" | |
28 #include "Core/Images/Image.h" | |
29 #include <boost/shared_ptr.hpp> | |
30 | |
31 namespace Deprecated | |
32 { | |
33 class IVolumeSlicer : public OrthancStone::IObservable | |
34 { | |
35 public: | |
36 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryReadyMessage, IVolumeSlicer); | |
37 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, GeometryErrorMessage, IVolumeSlicer); | |
38 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, ContentChangedMessage, IVolumeSlicer); | |
39 | |
40 class SliceContentChangedMessage : public OrthancStone::OriginMessage<IVolumeSlicer> | |
41 { | |
42 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); | |
43 | |
44 private: | |
45 const Deprecated::Slice& slice_; | |
46 | |
47 public: | |
48 SliceContentChangedMessage(IVolumeSlicer& origin, | |
49 const Deprecated::Slice& slice) : | |
50 OriginMessage(origin), | |
51 slice_(slice) | |
52 { | |
53 } | |
54 | |
55 const Deprecated::Slice& GetSlice() const | |
56 { | |
57 return slice_; | |
58 } | |
59 }; | |
60 | |
61 | |
62 class LayerReadyMessage : public OrthancStone::OriginMessage<IVolumeSlicer> | |
63 { | |
64 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); | |
65 | |
66 public: | |
67 class IRendererFactory : public boost::noncopyable | |
68 { | |
69 public: | |
70 virtual ~IRendererFactory() | |
71 { | |
72 } | |
73 | |
74 virtual ILayerRenderer* CreateRenderer() const = 0; | |
75 }; | |
76 | |
77 private: | |
78 const IRendererFactory& factory_; | |
79 const OrthancStone::CoordinateSystem3D& slice_; | |
80 | |
81 public: | |
82 LayerReadyMessage(IVolumeSlicer& origin, | |
83 const IRendererFactory& rendererFactory, | |
84 const OrthancStone::CoordinateSystem3D& slice) : | |
85 OriginMessage(origin), | |
86 factory_(rendererFactory), | |
87 slice_(slice) | |
88 { | |
89 } | |
90 | |
91 ILayerRenderer* CreateRenderer() const | |
92 { | |
93 return factory_.CreateRenderer(); | |
94 } | |
95 | |
96 const OrthancStone::CoordinateSystem3D& GetSlice() const | |
97 { | |
98 return slice_; | |
99 } | |
100 }; | |
101 | |
102 | |
103 class LayerErrorMessage : public OrthancStone::OriginMessage<IVolumeSlicer> | |
104 { | |
105 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); | |
106 | |
107 private: | |
108 const OrthancStone::CoordinateSystem3D& slice_; | |
109 | |
110 public: | |
111 LayerErrorMessage(IVolumeSlicer& origin, | |
112 const OrthancStone::CoordinateSystem3D& slice) : | |
113 OriginMessage(origin), | |
114 slice_(slice) | |
115 { | |
116 } | |
117 | |
118 const OrthancStone::CoordinateSystem3D& GetSlice() const | |
119 { | |
120 return slice_; | |
121 } | |
122 }; | |
123 | |
124 | |
125 IVolumeSlicer(OrthancStone::MessageBroker& broker) : | |
126 IObservable(broker) | |
127 { | |
128 } | |
129 | |
130 virtual ~IVolumeSlicer() | |
131 { | |
132 } | |
133 | |
134 virtual bool GetExtent(std::vector<OrthancStone::Vector>& points, | |
135 const OrthancStone::CoordinateSystem3D& viewportSlice) = 0; | |
136 | |
137 virtual void ScheduleLayerCreation(const OrthancStone::CoordinateSystem3D& viewportSlice) = 0; | |
138 }; | |
139 } |