diff Framework/Volumes/StructureSetLoader.cpp @ 404:ba4ace20454e

use of MessageBroker in DicomStructureSetSlicer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 11 Nov 2018 13:02:38 +0100
parents 8eb4fe74000f
children b70e9be013e4
line wrap: on
line diff
--- a/Framework/Volumes/StructureSetLoader.cpp	Sun Nov 11 12:13:31 2018 +0100
+++ b/Framework/Volumes/StructureSetLoader.cpp	Sun Nov 11 13:02:38 2018 +0100
@@ -27,9 +27,10 @@
 
 namespace OrthancStone
 {
-  
-  StructureSetLoader::StructureSetLoader(MessageBroker& broker, OrthancApiClient& orthanc) :
-    OrthancStone::IObserver(broker),
+  StructureSetLoader::StructureSetLoader(MessageBroker& broker,
+                                         OrthancApiClient& orthanc) :
+    IVolumeLoader(broker),
+    IObserver(broker),
     orthanc_(orthanc)
   {
   }
@@ -43,8 +44,9 @@
     MessagingToolbox::ConvertDataset(slice, dataset);
     structureSet_->AddReferencedSlice(slice);
 
-    VolumeLoaderBase::NotifyContentChange();
+    EmitMessage(ContentChangedMessage(*this));
   }
+  
 
   void StructureSetLoader::OnStructureSetLoaded(const OrthancApiClient::JsonResponseReadyMessage& message)
   {
@@ -61,9 +63,10 @@
                             new Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnLookupCompleted));
     }
 
-    VolumeLoaderBase::NotifyGeometryReady();
+    EmitMessage(GeometryReadyMessage(*this));
   }
 
+  
   void StructureSetLoader::OnLookupCompleted(const OrthancApiClient::JsonResponseReadyMessage& message)
   {
     const Json::Value& lookup = message.GetJson();
@@ -84,6 +87,7 @@
                           new Callable<StructureSetLoader, OrthancApiClient::JsonResponseReadyMessage>(*this, &StructureSetLoader::OnReferencedSliceLoaded));
   }
 
+  
   void StructureSetLoader::ScheduleLoadInstance(const std::string& instance)
   {
     if (structureSet_.get() != NULL)