Mercurial > hg > orthanc-stone
comparison UnitTestsSources/UnitTestsMain.cpp @ 89:f244018a4e4b wasm
BUGGY- trying to remove IVolumeSlicesObserver
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 26 May 2017 18:27:59 +0200 |
parents | 90bf4116a23c |
children | 5945e81734a3 |
comparison
equal
deleted
inserted
replaced
88:90bf4116a23c | 89:f244018a4e4b |
---|---|
26 #include "../Resources/Orthanc/Core/HttpClient.h" | 26 #include "../Resources/Orthanc/Core/HttpClient.h" |
27 #include "../Resources/Orthanc/Core/Logging.h" | 27 #include "../Resources/Orthanc/Core/Logging.h" |
28 #include "../Resources/Orthanc/Core/MultiThreading/SharedMessageQueue.h" | 28 #include "../Resources/Orthanc/Core/MultiThreading/SharedMessageQueue.h" |
29 #include "../Resources/Orthanc/Core/OrthancException.h" | 29 #include "../Resources/Orthanc/Core/OrthancException.h" |
30 | 30 |
31 #include "../Framework/Toolbox/IVolumeSlicesObserver.h" | |
32 #include "../Framework/Volumes/ImageBuffer3D.h" | 31 #include "../Framework/Volumes/ImageBuffer3D.h" |
33 #include "../Framework/Volumes/SlicedVolumeBase.h" | 32 #include "../Framework/Volumes/SlicedVolumeBase.h" |
34 #include "../Framework/Toolbox/DownloadStack.h" | 33 #include "../Framework/Toolbox/DownloadStack.h" |
35 #include "../Resources/Orthanc/Core/Images/ImageProcessing.h" | 34 #include "../Resources/Orthanc/Core/Images/ImageProcessing.h" |
36 | 35 |
80 public SlicedVolumeBase, | 79 public SlicedVolumeBase, |
81 private OrthancSlicesLoader::ICallback | 80 private OrthancSlicesLoader::ICallback |
82 { | 81 { |
83 private: | 82 private: |
84 OrthancSlicesLoader loader_; | 83 OrthancSlicesLoader loader_; |
85 IVolumeSlicesObserver* observer_; | |
86 std::auto_ptr<ImageBuffer3D> image_; | 84 std::auto_ptr<ImageBuffer3D> image_; |
87 std::auto_ptr<DownloadStack> downloadStack_; | 85 std::auto_ptr<DownloadStack> downloadStack_; |
88 | 86 |
89 | 87 |
90 void ScheduleSliceDownload() | 88 void ScheduleSliceDownload() |
234 ScheduleSliceDownload(); | 232 ScheduleSliceDownload(); |
235 } | 233 } |
236 | 234 |
237 public: | 235 public: |
238 OrthancVolumeImageLoader(IWebService& orthanc) : | 236 OrthancVolumeImageLoader(IWebService& orthanc) : |
239 loader_(*this, orthanc), | 237 loader_(*this, orthanc) |
240 observer_(NULL) | |
241 { | 238 { |
242 } | 239 } |
243 | 240 |
244 void ScheduleLoadSeries(const std::string& seriesId) | 241 void ScheduleLoadSeries(const std::string& seriesId) |
245 { | 242 { |
259 | 256 |
260 virtual const Slice& GetSlice(size_t index) const | 257 virtual const Slice& GetSlice(size_t index) const |
261 { | 258 { |
262 return loader_.GetSlice(index); | 259 return loader_.GetSlice(index); |
263 } | 260 } |
264 | |
265 void SetObserver(IVolumeSlicesObserver& observer) | |
266 { | |
267 if (observer_ == NULL) | |
268 { | |
269 observer_ = &observer; | |
270 } | |
271 else | |
272 { | |
273 // Cannot add more than one observer | |
274 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); | |
275 } | |
276 } | |
277 | |
278 }; | 261 }; |
279 } | 262 } |
280 | 263 |
281 | 264 |
282 TEST(Toto, DISABLED_Tutu) | 265 TEST(Toto, DISABLED_Tutu) |