diff Framework/Loaders/LoaderCache.cpp @ 937:86ac61a040c9

Added getters and notifications to allow clients of the loaders (DicomStructureSetLoader, OrthancSeriesVolumeProgressiveLoader and OrthancMultiframeVolumeLoader) to know when the loading is finished + added ability for SDL event loop to execute a callback repeatedly (used to check the view loading state)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 31 Jul 2019 10:24:09 +0200
parents f75f6cb69c1b
children 92e32e263ae9
line wrap: on
line diff
--- a/Framework/Loaders/LoaderCache.cpp	Mon Jul 29 15:39:45 2019 +0200
+++ b/Framework/Loaders/LoaderCache.cpp	Wed Jul 31 10:24:09 2019 +0200
@@ -119,6 +119,18 @@
     }
   }
 
+  boost::shared_ptr<OrthancMultiframeVolumeLoader> LoaderCache::GetMultiframeVolumeLoader(std::string instanceUuid)
+  {
+    // if the loader is not available, let's trigger its creation
+    if(multiframeVolumeLoaders_.find(instanceUuid) == multiframeVolumeLoaders_.end())
+    {
+      GetMultiframeDicomVolumeImageMPRSlicer(instanceUuid);
+    }
+    ORTHANC_ASSERT(multiframeVolumeLoaders_.find(instanceUuid) != multiframeVolumeLoaders_.end());
+
+    return multiframeVolumeLoaders_[instanceUuid];
+  }
+
   boost::shared_ptr<DicomVolumeImageMPRSlicer> LoaderCache::GetMultiframeDicomVolumeImageMPRSlicer(std::string instanceUuid)
   {
     try