comparison Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp @ 1128:8e3763d1736a broker

removing CustomOracleCommand
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Nov 2019 22:39:25 +0100
parents 81b29bc7c3d4
children 87fbeb823375
comparison
equal deleted inserted replaced
1127:3308ef083297 1128:8e3763d1736a
235 CheckSliceIndex(index); 235 CheckSliceIndex(index);
236 slicesRevision_[index] ++; 236 slicesRevision_[index] ++;
237 } 237 }
238 238
239 239
240 static unsigned int GetSliceIndexPayload(const OracleCommandWithPayload& command) 240 static unsigned int GetSliceIndexPayload(const OracleCommandBase& 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
259 if (instance.empty()) 259 if (instance.empty())
260 { 260 {
261 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 261 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
262 } 262 }
263 263
264 std::auto_ptr<OracleCommandWithPayload> command; 264 std::auto_ptr<OracleCommandBase> command;
265 265
266 if (quality == BEST_QUALITY) 266 if (quality == BEST_QUALITY)
267 { 267 {
268 std::auto_ptr<GetOrthancImageCommand> tmp(new GetOrthancImageCommand); 268 std::auto_ptr<GetOrthancImageCommand> tmp(new GetOrthancImageCommand);
269 // TODO: review the following comment. 269 // TODO: review the following comment.
289 tmp->SetQuality((quality == 0 ? 50 : 90)); 289 tmp->SetQuality((quality == 0 ? 50 : 90));
290 tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat()); 290 tmp->SetExpectedPixelFormat(slice.GetExpectedPixelFormat());
291 command.reset(tmp.release()); 291 command.reset(tmp.release());
292 } 292 }
293 293
294 command->SetPayload(new Orthanc::SingleValueObject<unsigned int>(sliceIndex)); 294 command->AcquirePayload(new Orthanc::SingleValueObject<unsigned int>(sliceIndex));
295 295
296 boost::shared_ptr<IObserver> observer(GetSharedObserver()); 296 boost::shared_ptr<IObserver> observer(GetSharedObserver());
297 oracle_.Schedule(observer, command.release()); 297 oracle_.Schedule(observer, command.release());
298 } 298 }
299 else 299 else