Mercurial > hg > orthanc-stone
comparison Framework/Volumes/StructureSetLoader.h @ 300:b4abaeb783b1 am-callable-and-promise
messaging refactoring almost complete: works fine in native
author | am@osimis.io |
---|---|
date | Tue, 18 Sep 2018 15:23:21 +0200 |
parents | 192e6e349e69 |
children | ba4ace20454e |
comparison
equal
deleted
inserted
replaced
299:3897f9f28cfa | 300:b4abaeb783b1 |
---|---|
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "../Toolbox/DicomStructureSet.h" | 24 #include "../Toolbox/DicomStructureSet.h" |
25 #include "../Toolbox/IWebService.h" | 25 #include "../Toolbox/OrthancApiClient.h" |
26 #include "VolumeLoaderBase.h" | 26 #include "VolumeLoaderBase.h" |
27 | 27 |
28 namespace OrthancStone | 28 namespace OrthancStone |
29 { | 29 { |
30 class StructureSetLoader : | 30 class StructureSetLoader : |
31 public VolumeLoaderBase, | 31 public VolumeLoaderBase, |
32 private IWebService::ICallback | 32 public OrthancStone::IObserver |
33 { | 33 { |
34 private: | 34 private: |
35 class Operation; | |
36 | |
37 virtual void OnHttpRequestError(const std::string& uri, | |
38 Orthanc::IDynamicObject* payload); | |
39 | 35 |
40 virtual void OnHttpRequestSuccess(const std::string& uri, | 36 OrthancApiClient& orthanc_; |
41 const void* answer, | |
42 size_t answerSize, | |
43 Orthanc::IDynamicObject* payload); | |
44 | |
45 IWebService& orthanc_; | |
46 std::auto_ptr<DicomStructureSet> structureSet_; | 37 std::auto_ptr<DicomStructureSet> structureSet_; |
47 | 38 |
48 public: | 39 public: |
49 StructureSetLoader(MessageBroker& broker, IWebService& orthanc); | 40 StructureSetLoader(MessageBroker& broker, OrthancApiClient& orthanc); |
50 | 41 |
51 void ScheduleLoadInstance(const std::string& instance); | 42 void ScheduleLoadInstance(const std::string& instance); |
52 | 43 |
53 bool HasStructureSet() const | 44 bool HasStructureSet() const |
54 { | 45 { |
55 return structureSet_.get() != NULL; | 46 return structureSet_.get() != NULL; |
56 } | 47 } |
57 | 48 |
58 DicomStructureSet& GetStructureSet(); | 49 DicomStructureSet& GetStructureSet(); |
50 | |
51 protected: | |
52 void OnReferencedSliceLoaded(const OrthancApiClient::JsonResponseReadyMessage& message); | |
53 | |
54 void OnStructureSetLoaded(const OrthancApiClient::JsonResponseReadyMessage& message); | |
55 | |
56 void OnLookupCompleted(const OrthancApiClient::JsonResponseReadyMessage& message); | |
59 }; | 57 }; |
60 } | 58 } |