comparison Framework/Deprecated/Widgets/SliceViewerWidget.cpp @ 1298:8a0a62189f46

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 16:31:30 +0100
parents 2d8ab34c8c91
children 257f2c9a02ac
comparison
equal deleted inserted replaced
1296:86400fa16091 1298:8a0a62189f46
325 ILayerRenderer* renderer, 325 ILayerRenderer* renderer,
326 const OrthancStone::CoordinateSystem3D& plane) 326 const OrthancStone::CoordinateSystem3D& plane)
327 { 327 {
328 LOG(INFO) << "Updating layer " << index; 328 LOG(INFO) << "Updating layer " << index;
329 329
330 std::auto_ptr<ILayerRenderer> tmp(renderer); 330 std::unique_ptr<ILayerRenderer> tmp(renderer);
331 331
332 if (renderer == NULL) 332 if (renderer == NULL)
333 { 333 {
334 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 334 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
335 } 335 }
355 355
356 if (currentScene_.get() == NULL || 356 if (currentScene_.get() == NULL ||
357 !currentScene_->IsComplete() || 357 !currentScene_->IsComplete() ||
358 pendingScene_->IsComplete()) 358 pendingScene_->IsComplete())
359 { 359 {
360 currentScene_ = pendingScene_; 360 #if __cplusplus < 201103L
361 currentScene_.reset(pendingScene_.release());
362 #else
363 currentScene_ = std::move(pendingScene_);
364 #endif
365
361 NotifyContentChanged(); 366 NotifyContentChanged();
362 } 367 }
363 } 368 }
364 } 369 }
365 370
516 { 521 {
517 if (currentScene_.get() == NULL || 522 if (currentScene_.get() == NULL ||
518 (pendingScene_.get() != NULL && 523 (pendingScene_.get() != NULL &&
519 pendingScene_->IsComplete())) 524 pendingScene_->IsComplete()))
520 { 525 {
521 currentScene_ = pendingScene_; 526 #if __cplusplus < 201103L
527 currentScene_.reset(pendingScene_.release());
528 #else
529 currentScene_ = std::move(pendingScene_);
530 #endif
522 } 531 }
523 532
524 plane_ = plane; 533 plane_ = plane;
525 ResetPendingScene(); 534 ResetPendingScene();
526 535