diff Framework/Loaders/DicomStructureSetLoader.cpp @ 1342:13573ff63eb6 broker

New StructuresUpdated message that is sent during individual structure set addition.
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 06 Apr 2020 08:42:40 +0200
parents 556b4bc19118
children 0d6a01ffa1dd
line wrap: on
line diff
--- a/Framework/Loaders/DicomStructureSetLoader.cpp	Fri Apr 03 18:18:37 2020 +0200
+++ b/Framework/Loaders/DicomStructureSetLoader.cpp	Mon Apr 06 08:42:40 2020 +0200
@@ -29,11 +29,6 @@
 
 #include <algorithm>
 
-#if 0
-bool logbgo233 = false;
-bool logbgo115 = false;
-#endif
-
 namespace OrthancStone
 {
 
@@ -78,10 +73,11 @@
       DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>();
 
       loader.content_->AddReferencedSlice(dicom);
-
       loader.countProcessedInstances_ ++;
       assert(loader.countProcessedInstances_ <= loader.countReferencedInstances_);
 
+      loader.SetStructuresUpdated();
+
       if (loader.countProcessedInstances_ == loader.countReferencedInstances_)
       {
         // All the referenced instances have been loaded, finalize the RT-STRUCT
@@ -161,10 +157,6 @@
     
     virtual void Handle(const OrthancStone::OrthancRestApiCommand::SuccessMessage& message)
     {
-#if 0
-      if (logbgo115)
-        LOG(TRACE) << "DicomStructureSetLoader::LoadStructure::Handle() (SUCCESS)";
-#endif
       DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>();
         
       {
@@ -413,6 +405,11 @@
     }
   }
 
+  void DicomStructureSetLoader::SetStructuresUpdated()
+  {
+    BroadcastMessage(DicomStructureSetLoader::StructuresUpdated(*this));
+  }
+
   void DicomStructureSetLoader::SetStructuresReady()
   {
     ORTHANC_ASSERT(!structuresReady_);