comparison Framework/Deprecated/Volumes/StructureSetLoader.cpp @ 1066:b537002f83a9 broker

removing broker from deprecated classes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 15 Oct 2019 15:39:39 +0200
parents 4fe4b221a31f
children 21c2b0eee53c
comparison
equal deleted inserted replaced
1065:9d42f89b8c3c 1066:b537002f83a9
25 25
26 #include <Core/OrthancException.h> 26 #include <Core/OrthancException.h>
27 27
28 namespace Deprecated 28 namespace Deprecated
29 { 29 {
30 StructureSetLoader::StructureSetLoader(OrthancStone::MessageBroker& broker, 30 StructureSetLoader::StructureSetLoader(OrthancApiClient& orthanc) :
31 OrthancApiClient& orthanc) :
32 IVolumeLoader(broker),
33 IObserver(broker),
34 orthanc_(orthanc) 31 orthanc_(orthanc)
35 { 32 {
36 } 33 }
37 34
38 35
58 55
59 for (std::set<std::string>::const_iterator it = instances.begin(); 56 for (std::set<std::string>::const_iterator it = instances.begin();
60 it != instances.end(); ++it) 57 it != instances.end(); ++it)
61 { 58 {
62 orthanc_.PostBinaryAsyncExpectJson("/tools/lookup", *it, 59 orthanc_.PostBinaryAsyncExpectJson("/tools/lookup", *it,
63 new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnLookupCompleted)); 60 new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(GetSharedObserver(), &StructureSetLoader::OnLookupCompleted));
64 } 61 }
65 62
66 BroadcastMessage(GeometryReadyMessage(*this)); 63 BroadcastMessage(GeometryReadyMessage(*this));
67 } 64 }
68 65
82 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); 79 throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol);
83 } 80 }
84 81
85 const std::string& instance = lookup[0]["ID"].asString(); 82 const std::string& instance = lookup[0]["ID"].asString();
86 orthanc_.GetJsonAsync("/instances/" + instance + "/tags", 83 orthanc_.GetJsonAsync("/instances/" + instance + "/tags",
87 new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnReferencedSliceLoaded)); 84 new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(GetSharedObserver(), &StructureSetLoader::OnReferencedSliceLoaded));
88 } 85 }
89 86
90 87
91 void StructureSetLoader::ScheduleLoadInstance(const std::string& instance) 88 void StructureSetLoader::ScheduleLoadInstance(const std::string& instance)
92 { 89 {
95 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 92 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
96 } 93 }
97 else 94 else
98 { 95 {
99 orthanc_.GetJsonAsync("/instances/" + instance + "/tags?ignore-length=3006-0050", 96 orthanc_.GetJsonAsync("/instances/" + instance + "/tags?ignore-length=3006-0050",
100 new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnStructureSetLoaded)); 97 new OrthancStone::Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(GetSharedObserver(), &StructureSetLoader::OnStructureSetLoaded));
101 } 98 }
102 } 99 }
103 100
104 101
105 OrthancStone::DicomStructureSet& StructureSetLoader::GetStructureSet() 102 OrthancStone::DicomStructureSet& StructureSetLoader::GetStructureSet()