diff Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1134:87fbeb823375 broker

allocating messages from oracle commands on the stack
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Nov 2019 15:16:45 +0100
parents 8e3763d1736a
children a0a33e5ea5bb
line wrap: on
line diff
--- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Wed Nov 06 12:56:23 2019 +0100
+++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Wed Nov 06 15:16:45 2019 +0100
@@ -237,7 +237,7 @@
   }
 
 
-  static unsigned int GetSliceIndexPayload(const OracleCommandBase& command)
+  static unsigned int GetSliceIndexPayload(const IOracleCommand& command)
   {
     return dynamic_cast< const Orthanc::SingleValueObject<unsigned int>& >(command.GetPayload()).GetValue();
   }
@@ -394,7 +394,7 @@
 
   void OrthancSeriesVolumeProgressiveLoader::LoadBestQualitySliceContent(const GetOrthancImageCommand::SuccessMessage& message)
   {
-    SetSliceContent(GetSliceIndexPayload(message.GetOrigin()), message.GetImage(), BEST_QUALITY);
+    SetSliceContent(GetSliceIndexPayload(message.GetCommand()), message.GetImage(), BEST_QUALITY);
   }
 
 
@@ -402,7 +402,7 @@
   {
     unsigned int quality;
       
-    switch (message.GetOrigin().GetQuality())
+    switch (dynamic_cast<const GetOrthancWebViewerJpegCommand&>(message.GetCommand()).GetQuality())
     {
       case 50:
         quality = LOW_QUALITY;
@@ -416,7 +416,7 @@
         throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
     }
       
-    SetSliceContent(GetSliceIndexPayload(message.GetOrigin()), message.GetImage(), quality);
+    SetSliceContent(GetSliceIndexPayload(message.GetCommand()), message.GetImage(), quality);
   }