comparison 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
comparison
equal deleted inserted replaced
1133:0e3a3be313fd 1134:87fbeb823375
235 CheckSliceIndex(index); 235 CheckSliceIndex(index);
236 slicesRevision_[index] ++; 236 slicesRevision_[index] ++;
237 } 237 }
238 238
239 239
240 static unsigned int GetSliceIndexPayload(const OracleCommandBase& command) 240 static unsigned int GetSliceIndexPayload(const IOracleCommand& command)
241 { 241 {
242 return dynamic_cast< const Orthanc::SingleValueObject<unsigned int>& >(command.GetPayload()).GetValue(); 242 return dynamic_cast< const Orthanc::SingleValueObject<unsigned int>& >(command.GetPayload()).GetValue();
243 } 243 }
244 244
245 245
392 } 392 }
393 393
394 394
395 void OrthancSeriesVolumeProgressiveLoader::LoadBestQualitySliceContent(const GetOrthancImageCommand::SuccessMessage& message) 395 void OrthancSeriesVolumeProgressiveLoader::LoadBestQualitySliceContent(const GetOrthancImageCommand::SuccessMessage& message)
396 { 396 {
397 SetSliceContent(GetSliceIndexPayload(message.GetOrigin()), message.GetImage(), BEST_QUALITY); 397 SetSliceContent(GetSliceIndexPayload(message.GetCommand()), message.GetImage(), BEST_QUALITY);
398 } 398 }
399 399
400 400
401 void OrthancSeriesVolumeProgressiveLoader::LoadJpegSliceContent(const GetOrthancWebViewerJpegCommand::SuccessMessage& message) 401 void OrthancSeriesVolumeProgressiveLoader::LoadJpegSliceContent(const GetOrthancWebViewerJpegCommand::SuccessMessage& message)
402 { 402 {
403 unsigned int quality; 403 unsigned int quality;
404 404
405 switch (message.GetOrigin().GetQuality()) 405 switch (dynamic_cast<const GetOrthancWebViewerJpegCommand&>(message.GetCommand()).GetQuality())
406 { 406 {
407 case 50: 407 case 50:
408 quality = LOW_QUALITY; 408 quality = LOW_QUALITY;
409 break; 409 break;
410 410
414 414
415 default: 415 default:
416 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 416 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
417 } 417 }
418 418
419 SetSliceContent(GetSliceIndexPayload(message.GetOrigin()), message.GetImage(), quality); 419 SetSliceContent(GetSliceIndexPayload(message.GetCommand()), message.GetImage(), quality);
420 } 420 }
421 421
422 422
423 OrthancSeriesVolumeProgressiveLoader::OrthancSeriesVolumeProgressiveLoader(const boost::shared_ptr<DicomVolumeImage>& volume, 423 OrthancSeriesVolumeProgressiveLoader::OrthancSeriesVolumeProgressiveLoader(const boost::shared_ptr<DicomVolumeImage>& volume,
424 IOracle& oracle, 424 IOracle& oracle,