comparison Applications/Samples/rt-viewer-demo/main.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
comparison
equal deleted inserted replaced
1296:86400fa16091 1298:8a0a62189f46
504 504
505 void AddStructLayer( 505 void AddStructLayer(
506 SliceViewerWidget& widget, StructureSetLoader& loader); 506 SliceViewerWidget& widget, StructureSetLoader& loader);
507 507
508 SliceViewerWidget* CreateDoseCtWidget( 508 SliceViewerWidget* CreateDoseCtWidget(
509 std::auto_ptr<OrthancVolumeImage>& ct, 509 std::unique_ptr<OrthancVolumeImage>& ct,
510 std::auto_ptr<OrthancVolumeImage>& dose, 510 std::unique_ptr<OrthancVolumeImage>& dose,
511 std::auto_ptr<StructureSetLoader>& structLoader, 511 std::unique_ptr<StructureSetLoader>& structLoader,
512 VolumeProjection projection); 512 VolumeProjection projection);
513 513
514 void AddCtLayer(SliceViewerWidget& widget, OrthancVolumeImage& volume); 514 void AddCtLayer(SliceViewerWidget& widget, OrthancVolumeImage& volume);
515 515
516 std::auto_ptr<Interactor> mainWidgetInteractor_; 516 std::unique_ptr<Interactor> mainWidgetInteractor_;
517 const DicomSeriesVolumeSlicer* source_; 517 const DicomSeriesVolumeSlicer* source_;
518 unsigned int slice_; 518 unsigned int slice_;
519 519
520 std::string ctSeries_; 520 std::string ctSeries_;
521 std::string doseInstance_; 521 std::string doseInstance_;
522 std::string doseSeries_; 522 std::string doseSeries_;
523 std::string structInstance_; 523 std::string structInstance_;
524 std::auto_ptr<OrthancStone::OrthancVolumeImage> dose_; 524 std::unique_ptr<OrthancStone::OrthancVolumeImage> dose_;
525 std::auto_ptr<OrthancStone::OrthancVolumeImage> ct_; 525 std::unique_ptr<OrthancStone::OrthancVolumeImage> ct_;
526 std::auto_ptr<OrthancStone::StructureSetLoader> struct_; 526 std::unique_ptr<OrthancStone::StructureSetLoader> struct_;
527 527
528 public: 528 public:
529 RtViewerDemoApplication(MessageBroker& broker) : 529 RtViewerDemoApplication(MessageBroker& broker) :
530 IObserver(broker), 530 IObserver(broker),
531 source_(NULL), 531 source_(NULL),
727 727
728 auto axialWidget = CreateDoseCtWidget 728 auto axialWidget = CreateDoseCtWidget
729 (ct_, dose_, struct_, OrthancStone::VolumeProjection_Axial); 729 (ct_, dose_, struct_, OrthancStone::VolumeProjection_Axial);
730 mainWidget_->AddWidget(axialWidget); 730 mainWidget_->AddWidget(axialWidget);
731 731
732 std::auto_ptr<OrthancStone::LayoutWidget> subLayout( 732 std::unique_ptr<OrthancStone::LayoutWidget> subLayout(
733 new OrthancStone::LayoutWidget("main-layout")); 733 new OrthancStone::LayoutWidget("main-layout"));
734 subLayout->SetVertical(); 734 subLayout->SetVertical();
735 subLayout->SetPadding(5); 735 subLayout->SetPadding(5);
736 736
737 auto coronalWidget = CreateDoseCtWidget 737 auto coronalWidget = CreateDoseCtWidget
772 widget.AddLayer(new DicomStructureSetSlicer( 772 widget.AddLayer(new DicomStructureSetSlicer(
773 IObserver::GetBroker(), loader)); 773 IObserver::GetBroker(), loader));
774 } 774 }
775 775
776 SliceViewerWidget* RtViewerDemoApplication::CreateDoseCtWidget( 776 SliceViewerWidget* RtViewerDemoApplication::CreateDoseCtWidget(
777 std::auto_ptr<OrthancVolumeImage>& ct, 777 std::unique_ptr<OrthancVolumeImage>& ct,
778 std::auto_ptr<OrthancVolumeImage>& dose, 778 std::unique_ptr<OrthancVolumeImage>& dose,
779 std::auto_ptr<StructureSetLoader>& structLoader, 779 std::unique_ptr<StructureSetLoader>& structLoader,
780 VolumeProjection projection) 780 VolumeProjection projection)
781 { 781 {
782 std::auto_ptr<OrthancStone::SliceViewerWidget> widget( 782 std::unique_ptr<OrthancStone::SliceViewerWidget> widget(
783 new OrthancStone::SliceViewerWidget(IObserver::GetBroker(), 783 new OrthancStone::SliceViewerWidget(IObserver::GetBroker(),
784 "ct-dose-widget")); 784 "ct-dose-widget"));
785 785
786 if (ct.get() != NULL) 786 if (ct.get() != NULL)
787 { 787 {