Mercurial > hg > orthanc-stone
comparison Framework/Layers/IVolumeSlicer.h @ 396:ed7146fa2c98
rename ILayerSource as IVolumeSlicer, and OrthancFrameLayerSource as as DicomSeriesVolumeSlicer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 10 Nov 2018 09:29:08 +0100 |
parents | Framework/Layers/ILayerSource.h@5f13809f3f76 |
children | 1d9dd542adfe |
comparison
equal
deleted
inserted
replaced
395:5f13809f3f76 | 396:ed7146fa2c98 |
---|---|
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-2018 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 "../../Framework/Messages/IObservable.h" | |
27 #include "../../Framework/Messages/IMessage.h" | |
28 #include "Core/Images/Image.h" | |
29 #include <boost/shared_ptr.hpp> | |
30 | |
31 namespace OrthancStone | |
32 { | |
33 class IVolumeSlicer : public IObservable | |
34 { | |
35 public: | |
36 typedef OriginMessage<MessageType_LayerSource_GeometryReady, IVolumeSlicer> GeometryReadyMessage; | |
37 typedef OriginMessage<MessageType_LayerSource_GeometryError, IVolumeSlicer> GeometryErrorMessage; | |
38 typedef OriginMessage<MessageType_LayerSource_ContentChanged, IVolumeSlicer> ContentChangedMessage; | |
39 | |
40 class SliceChangedMessage : public OriginMessage<MessageType_LayerSource_SliceChanged, IVolumeSlicer> | |
41 { | |
42 private: | |
43 const Slice& slice_; | |
44 | |
45 public: | |
46 SliceChangedMessage(IVolumeSlicer& origin, | |
47 const Slice& slice) : | |
48 OriginMessage(origin), | |
49 slice_(slice) | |
50 { | |
51 } | |
52 | |
53 const Slice& GetSlice() const | |
54 { | |
55 return slice_; | |
56 } | |
57 }; | |
58 | |
59 | |
60 class LayerReadyMessage : public OriginMessage<MessageType_LayerSource_LayerReady, IVolumeSlicer> | |
61 { | |
62 public: | |
63 class IRendererFactory : public boost::noncopyable | |
64 { | |
65 public: | |
66 virtual ~IRendererFactory() | |
67 { | |
68 } | |
69 | |
70 virtual ILayerRenderer* CreateRenderer() const = 0; | |
71 }; | |
72 | |
73 private: | |
74 const IRendererFactory& factory_; | |
75 const CoordinateSystem3D& slice_; | |
76 | |
77 public: | |
78 LayerReadyMessage(IVolumeSlicer& origin, | |
79 const IRendererFactory& rendererFactory, | |
80 const CoordinateSystem3D& slice) : | |
81 OriginMessage(origin), | |
82 factory_(rendererFactory), | |
83 slice_(slice) | |
84 { | |
85 } | |
86 | |
87 ILayerRenderer* CreateRenderer() const | |
88 { | |
89 return factory_.CreateRenderer(); | |
90 } | |
91 | |
92 const CoordinateSystem3D& GetSlice() const | |
93 { | |
94 return slice_; | |
95 } | |
96 }; | |
97 | |
98 | |
99 class LayerErrorMessage : public OriginMessage<MessageType_LayerSource_LayerError, IVolumeSlicer> | |
100 { | |
101 private: | |
102 const CoordinateSystem3D& slice_; | |
103 | |
104 public: | |
105 LayerErrorMessage(IVolumeSlicer& origin, | |
106 const CoordinateSystem3D& slice) : | |
107 OriginMessage(origin), | |
108 slice_(slice) | |
109 { | |
110 } | |
111 | |
112 const CoordinateSystem3D& GetSlice() const | |
113 { | |
114 return slice_; | |
115 } | |
116 }; | |
117 | |
118 | |
119 IVolumeSlicer(MessageBroker& broker) : | |
120 IObservable(broker) | |
121 { | |
122 } | |
123 | |
124 virtual ~IVolumeSlicer() | |
125 { | |
126 } | |
127 | |
128 virtual bool GetExtent(std::vector<Vector>& points, | |
129 const CoordinateSystem3D& viewportSlice) = 0; | |
130 | |
131 virtual void ScheduleLayerCreation(const CoordinateSystem3D& viewportSlice) = 0; | |
132 }; | |
133 } |