changeset 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 d80a3e3cc800
children e92c516adcbd
files Framework/Loaders/DicomStructureSetLoader.cpp Framework/Loaders/DicomStructureSetLoader.h
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
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_);
--- a/Framework/Loaders/DicomStructureSetLoader.h	Fri Apr 03 18:18:37 2020 +0200
+++ b/Framework/Loaders/DicomStructureSetLoader.h	Mon Apr 06 08:42:40 2020 +0200
@@ -75,6 +75,7 @@
 
   public:
     ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresReady, DicomStructureSetLoader);
+    ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, StructuresUpdated, DicomStructureSetLoader);
 
     static boost::shared_ptr<DicomStructureSetLoader> Create(
       OrthancStone::ILoadersContext& loadersContext);
@@ -99,6 +100,7 @@
     virtual IExtractedSlice* ExtractSlice(const OrthancStone::CoordinateSystem3D& cuttingPlane) ORTHANC_OVERRIDE;
 
     void SetStructuresReady();
+    void SetStructuresUpdated();
 
     bool AreStructuresReady() const;
   };