# HG changeset patch # User Sebastien Jodogne # Date 1583163090 -3600 # Node ID 8a0a62189f464fdfd90b471f237e35384649bb85 # Parent 86400fa16091899181c3f8e81080a23d98bb95e9 replacing std::auto_ptr by std::unique_ptr diff -r 86400fa16091 -r 8a0a62189f46 Applications/Generic/GuiAdapter.cpp --- a/Applications/Generic/GuiAdapter.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Generic/GuiAdapter.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -34,6 +34,8 @@ # include "../../Framework/Messages/LockingEmitter.h" #endif +#include + namespace OrthancStone { std::ostream& operator<<( @@ -195,7 +197,7 @@ // userData is OnMouseWheelFuncAdapterPayload FuncAdapterPayload* payload = reinterpret_cast*>(userData); - //std::auto_ptr< FuncAdapterPayload > deleter(payload); + //std::unique_ptr< FuncAdapterPayload > deleter(payload); bool ret = (*(payload->callback))(time, payload->userData); return static_cast(ret); } @@ -214,7 +216,7 @@ // here FuncAdapterPayload* payload = new FuncAdapterPayload(); - std::auto_ptr > payloadP(payload); + std::unique_ptr > payloadP(payload); payload->canvasId = canvasId; payload->callback = func; payload->userData = userData; @@ -239,7 +241,7 @@ EmscriptenSetCallbackFunc emFunc, std::string canvasId, void* userData, bool capture, GenericFunc func) { - std::auto_ptr > payload( + std::unique_ptr > payload( new FuncAdapterPayload() ); payload->canvasId = canvasId; @@ -262,7 +264,7 @@ void* userData, GenericFunc func) { // LOG(ERROR) << "SetAnimationFrameCallback !!!!!! (RequestAnimationFrame)"; - std::auto_ptr > payload( + std::unique_ptr > payload( new FuncAdapterPayload() ); payload->canvasId = "UNDEFINED"; diff -r 86400fa16091 -r 8a0a62189f46 Applications/Qt/QCairoWidget.h --- a/Applications/Qt/QCairoWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Qt/QCairoWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -49,10 +49,10 @@ } }; - std::auto_ptr image_; + std::unique_ptr image_; OrthancStone::CairoSurface surface_; OrthancStone::NativeStoneApplicationContext* context_; - std::auto_ptr observer_; + std::unique_ptr observer_; protected: virtual void paintEvent(QPaintEvent *event); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Qt/QtStoneApplicationRunner.h --- a/Applications/Qt/QtStoneApplicationRunner.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Qt/QtStoneApplicationRunner.h Mon Mar 02 16:31:30 2020 +0100 @@ -33,7 +33,7 @@ class QtStoneApplicationRunner : public NativeStoneApplicationRunner { protected: - std::auto_ptr window_; + std::unique_ptr window_; public: QtStoneApplicationRunner(MessageBroker& broker, diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/BasicPetCtFusionApplication.h --- a/Applications/Samples/BasicPetCtFusionApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/BasicPetCtFusionApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -179,9 +179,9 @@ VolumeImage& petVolume = context.AddSeriesVolume(pet, true /* progressive download */, 1); // Take the PET volume as the reference for the slices - std::auto_ptr interactor(new Interactor(petVolume, VolumeProjection_Axial, false /* don't reverse normal */)); + std::unique_ptr interactor(new Interactor(petVolume, VolumeProjection_Axial, false /* don't reverse normal */)); - std::auto_ptr widget(new LayeredSceneWidget); + std::unique_ptr widget(new LayeredSceneWidget); widget->AddLayer(new VolumeImage::LayerFactory(ctVolume)); widget->AddLayer(new VolumeImage::LayerFactory(petVolume)); widget->SetSlice(interactor->GetCursor().GetCurrentSlice()); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/LayoutPetCtFusionApplication.h --- a/Applications/Samples/LayoutPetCtFusionApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/LayoutPetCtFusionApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -208,7 +208,7 @@ LayeredSceneWidget* CreateWidget() { - std::auto_ptr widget(new LayeredSceneWidget); + std::unique_ptr widget(new LayeredSceneWidget); widget->Register(dynamic_cast(*this)); widget->Register(dynamic_cast(*this)); return widget.release(); @@ -217,7 +217,7 @@ void CreateLayout(BasicApplicationContext& context) { - std::auto_ptr layout(new OrthancStone::LayoutWidget); + std::unique_ptr layout(new OrthancStone::LayoutWidget); layout->SetBackgroundCleared(true); //layout->SetBackgroundColor(255,0,0); layout->SetPadding(5); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/SampleInteractor.h --- a/Applications/Samples/SampleInteractor.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SampleInteractor.h Mon Mar 02 16:31:30 2020 +0100 @@ -47,7 +47,7 @@ VolumeProjection projection, bool reverse) { - std::auto_ptr slices(volume.GetGeometry(projection, reverse)); + std::unique_ptr slices(volume.GetGeometry(projection, reverse)); cursor_.SetGeometry(*slices); } @@ -56,7 +56,7 @@ { if (reverse) { - std::auto_ptr slices(series.GetGeometry().Reverse()); + std::unique_ptr slices(series.GetGeometry().Reverse()); cursor_.SetGeometry(*slices); } else diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/SimpleViewer/SimpleViewerApplication.h --- a/Applications/Samples/SimpleViewer/SimpleViewerApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SimpleViewer/SimpleViewerApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -81,8 +81,8 @@ private: Tool currentTool_; - std::auto_ptr mainWidgetInteractor_; - std::auto_ptr thumbnailInteractor_; + std::unique_ptr mainWidgetInteractor_; + std::unique_ptr thumbnailInteractor_; Deprecated::LayoutWidget* mainLayout_; Deprecated::LayoutWidget* thumbnailsLayout_; Deprecated::SliceViewerWidget* mainWidget_; @@ -94,7 +94,7 @@ Deprecated::WidgetViewport* wasmViewport2_; Deprecated::IStatusBar* statusBar_; - std::auto_ptr smartLoader_; + std::unique_ptr smartLoader_; Orthanc::Font font_; diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/SimpleViewerApplicationSingleFile.h --- a/Applications/Samples/SimpleViewerApplicationSingleFile.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SimpleViewerApplicationSingleFile.h Mon Mar 02 16:31:30 2020 +0100 @@ -239,8 +239,8 @@ }; Tool currentTool_; - std::auto_ptr mainWidgetInteractor_; - std::auto_ptr thumbnailInteractor_; + std::unique_ptr mainWidgetInteractor_; + std::unique_ptr thumbnailInteractor_; Deprecated::LayoutWidget* mainLayout_; Deprecated::LayoutWidget* thumbnailsLayout_; std::vector thumbnails_; @@ -253,7 +253,7 @@ Deprecated::WidgetViewport* wasmViewport2_; Deprecated::IStatusBar* statusBar_; - std::auto_ptr smartLoader_; + std::unique_ptr smartLoader_; Orthanc::Font font_; diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/SingleFrameApplication.h --- a/Applications/Samples/SingleFrameApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SingleFrameApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -197,7 +197,7 @@ GetMainWidget().FitContent(); } - std::auto_ptr mainWidgetInteractor_; + std::unique_ptr mainWidgetInteractor_; const Deprecated::DicomSeriesVolumeSlicer* source_; unsigned int slice_; @@ -245,7 +245,7 @@ mainWidget_ = new Deprecated::SliceViewerWidget(GetBroker(), "main-widget"); - std::auto_ptr layer(new Deprecated::DicomSeriesVolumeSlicer(GetBroker(), context->GetOrthancApiClient())); + std::unique_ptr layer(new Deprecated::DicomSeriesVolumeSlicer(GetBroker(), context->GetOrthancApiClient())); source_ = layer.get(); layer->LoadFrame(instance, frame); layer->RegisterObserverCallback(new Callable(*this, &SingleFrameApplication::OnMainWidgetGeometryReady)); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/SingleFrameEditorApplication.h --- a/Applications/Samples/SingleFrameEditorApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SingleFrameEditorApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -509,7 +509,7 @@ interactor_.SetMaskLayer(maskLayer_); { - std::auto_ptr renderedTextAlpha(TextRenderer::Render(Orthanc::EmbeddedResources::UBUNTU_FONT, 100, + std::unique_ptr renderedTextAlpha(TextRenderer::Render(Orthanc::EmbeddedResources::UBUNTU_FONT, 100, "%öÇaA&#")); RadiographyLayer& layer = scene_->LoadAlphaBitmap(renderedTextAlpha.release(), NULL); dynamic_cast(layer).SetForegroundValue(200.0f * 256.0f); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/SingleVolumeApplication.h --- a/Applications/Samples/SingleVolumeApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SingleVolumeApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -170,10 +170,10 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr widget(new SliceViewerWidget); + std::unique_ptr widget(new SliceViewerWidget); #if 1 - std::auto_ptr volume(new OrthancVolumeImage(context.GetWebService(), true)); + std::unique_ptr volume(new OrthancVolumeImage(context.GetWebService(), true)); if (series.empty()) { volume->ScheduleLoadInstance(instance); @@ -206,14 +206,14 @@ widget->SetLayerStyle(0, s); } #else - std::auto_ptr ct(new OrthancVolumeImage(context_->GetWebService(), false)); + std::unique_ptr ct(new OrthancVolumeImage(context_->GetWebService(), false)); //ct->ScheduleLoadSeries("15a6f44a-ac7b88fe-19c462d9-dddd918e-b01550d8"); // 0178023P //ct->ScheduleLoadSeries("dd069910-4f090474-7d2bba07-e5c10783-f9e4fb1d"); //ct->ScheduleLoadSeries("a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa"); // IBA //ct->ScheduleLoadSeries("03677739-1d8bca40-db1daf59-d74ff548-7f6fc9c0"); // 0522c0001 TCIA ct->ScheduleLoadSeries("295e8a13-dfed1320-ba6aebb2-9a13e20f-1b3eb953"); // Captain - std::auto_ptr pet(new OrthancVolumeImage(context_->GetWebService(), true)); + std::unique_ptr pet(new OrthancVolumeImage(context_->GetWebService(), true)); //pet->ScheduleLoadSeries("48d2997f-8e25cd81-dd715b64-bd79cdcc-e8fcee53"); // 0178023P //pet->ScheduleLoadSeries("aabad2e7-80702b5d-e599d26c-4f13398e-38d58a9e"); //pet->ScheduleLoadInstance("830a69ff-8e4b5ee3-b7f966c8-bccc20fb-d322dceb"); // IBA 1 @@ -223,7 +223,7 @@ pet->ScheduleLoadInstance("f080888c-0ab7528a-f7d9c28c-84980eb1-ff3b0ae6"); // Captain 1 //pet->ScheduleLoadInstance("4f78055b-6499a2c5-1e089290-394acc05-3ec781c1"); // Captain 2 - std::auto_ptr rtStruct(new StructureSetLoader(context_->GetWebService())); + std::unique_ptr rtStruct(new StructureSetLoader(context_->GetWebService())); //rtStruct->ScheduleLoadInstance("c2ebc17b-6b3548db-5e5da170-b8ecab71-ea03add3"); // 0178023P //rtStruct->ScheduleLoadInstance("54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9"); // IBA //rtStruct->ScheduleLoadInstance("17cd032b-ad92a438-ca05f06a-f9e96668-7e3e9e20"); // 0522c0001 TCIA diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/StoneSampleCommands_generated.hpp --- a/Applications/Samples/StoneSampleCommands_generated.hpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/StoneSampleCommands_generated.hpp Mon Mar 02 16:31:30 2020 +0100 @@ -18,7 +18,7 @@ //#define STONEGEN_NO_CPP11 1 #ifdef STONEGEN_NO_CPP11 -#define StoneSmartPtr std::auto_ptr +#define StoneSmartPtr std::unique_ptr #else #define StoneSmartPtr std::unique_ptr #endif diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/SynchronizedSeriesApplication.h --- a/Applications/Samples/SynchronizedSeriesApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/SynchronizedSeriesApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -40,12 +40,12 @@ LayeredSceneWidget* CreateSeriesWidget(BasicApplicationContext& context, const std::string& series) { - std::auto_ptr loader + std::unique_ptr loader (new OrthancSeriesLoader(context.GetWebService().GetConnection(), series)); - std::auto_ptr interactor(new SampleInteractor(*loader, false)); + std::unique_ptr interactor(new SampleInteractor(*loader, false)); - std::auto_ptr widget(new LayeredSceneWidget); + std::unique_ptr widget(new LayeredSceneWidget); widget->AddLayer(new SeriesFrameRendererFactory(loader.release(), false)); widget->SetSlice(interactor->GetCursor().GetCurrentSlice()); widget->SetInteractor(*interactor); @@ -83,19 +83,19 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr a(CreateSeriesWidget(context, parameters["a"].as())); - std::auto_ptr b(CreateSeriesWidget(context, parameters["b"].as())); - std::auto_ptr c(CreateSeriesWidget(context, parameters["c"].as())); + std::unique_ptr a(CreateSeriesWidget(context, parameters["a"].as())); + std::unique_ptr b(CreateSeriesWidget(context, parameters["b"].as())); + std::unique_ptr c(CreateSeriesWidget(context, parameters["c"].as())); ReferenceLineFactory::Configure(*a, *b); ReferenceLineFactory::Configure(*a, *c); ReferenceLineFactory::Configure(*b, *c); - std::auto_ptr layout(new LayoutWidget); + std::unique_ptr layout(new LayoutWidget); layout->SetPadding(5); layout->AddWidget(a.release()); - std::auto_ptr layoutB(new LayoutWidget); + std::unique_ptr layoutB(new LayoutWidget); layoutB->SetVertical(); layoutB->SetPadding(5); layoutB->AddWidget(b.release()); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/TestPatternApplication.h --- a/Applications/Samples/TestPatternApplication.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/TestPatternApplication.h Mon Mar 02 16:31:30 2020 +0100 @@ -49,7 +49,7 @@ { using namespace OrthancStone; - std::auto_ptr layout(new LayoutWidget); + std::unique_ptr layout(new LayoutWidget); layout->SetPadding(10); layout->SetBackgroundCleared(true); layout->AddWidget(new TestCairoWidget(parameters["animate"].as())); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Samples/rt-viewer-demo/main.cpp --- a/Applications/Samples/rt-viewer-demo/main.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Samples/rt-viewer-demo/main.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -506,14 +506,14 @@ SliceViewerWidget& widget, StructureSetLoader& loader); SliceViewerWidget* CreateDoseCtWidget( - std::auto_ptr& ct, - std::auto_ptr& dose, - std::auto_ptr& structLoader, + std::unique_ptr& ct, + std::unique_ptr& dose, + std::unique_ptr& structLoader, VolumeProjection projection); void AddCtLayer(SliceViewerWidget& widget, OrthancVolumeImage& volume); - std::auto_ptr mainWidgetInteractor_; + std::unique_ptr mainWidgetInteractor_; const DicomSeriesVolumeSlicer* source_; unsigned int slice_; @@ -521,9 +521,9 @@ std::string doseInstance_; std::string doseSeries_; std::string structInstance_; - std::auto_ptr dose_; - std::auto_ptr ct_; - std::auto_ptr struct_; + std::unique_ptr dose_; + std::unique_ptr ct_; + std::unique_ptr struct_; public: RtViewerDemoApplication(MessageBroker& broker) : @@ -729,7 +729,7 @@ (ct_, dose_, struct_, OrthancStone::VolumeProjection_Axial); mainWidget_->AddWidget(axialWidget); - std::auto_ptr subLayout( + std::unique_ptr subLayout( new OrthancStone::LayoutWidget("main-layout")); subLayout->SetVertical(); subLayout->SetPadding(5); @@ -774,12 +774,12 @@ } SliceViewerWidget* RtViewerDemoApplication::CreateDoseCtWidget( - std::auto_ptr& ct, - std::auto_ptr& dose, - std::auto_ptr& structLoader, + std::unique_ptr& ct, + std::unique_ptr& dose, + std::unique_ptr& structLoader, VolumeProjection projection) { - std::auto_ptr widget( + std::unique_ptr widget( new OrthancStone::SliceViewerWidget(IObserver::GetBroker(), "ct-dose-widget")); diff -r 86400fa16091 -r 8a0a62189f46 Applications/Sdl/SdlCairoSurface.h --- a/Applications/Sdl/SdlCairoSurface.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Sdl/SdlCairoSurface.h Mon Mar 02 16:31:30 2020 +0100 @@ -27,6 +27,8 @@ #include "../../Framework/Wrappers/CairoSurface.h" #include "../../Framework/Deprecated/Viewport/IViewport.h" +#include + #include namespace OrthancStone @@ -34,7 +36,7 @@ class SdlCairoSurface : public boost::noncopyable { private: - std::auto_ptr cairoSurface_; + std::unique_ptr cairoSurface_; SdlWindow& window_; SDL_Surface* sdlSurface_; diff -r 86400fa16091 -r 8a0a62189f46 Applications/Sdl/SdlOrthancSurface.h --- a/Applications/Sdl/SdlOrthancSurface.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/Sdl/SdlOrthancSurface.h Mon Mar 02 16:31:30 2020 +0100 @@ -25,7 +25,9 @@ #include "../../Framework/Viewport/SdlWindow.h" +#include #include + #include namespace OrthancStone @@ -33,7 +35,7 @@ class SdlOrthancSurface : public boost::noncopyable { private: - std::auto_ptr image_; + std::unique_ptr image_; SdlWindow& window_; SDL_Surface* sdlSurface_; diff -r 86400fa16091 -r 8a0a62189f46 Applications/StoneApplicationContext.h --- a/Applications/StoneApplicationContext.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Applications/StoneApplicationContext.h Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ MessageBroker& broker_; Deprecated::IWebService* webService_; Deprecated::IDelayedCallExecutor* delayedCallExecutor_; - std::auto_ptr orthanc_; + std::unique_ptr orthanc_; std::string orthancBaseUrl_; void InitializeOrthanc(); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Layers/ColorFrameRenderer.cpp --- a/Framework/Deprecated/Layers/ColorFrameRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/ColorFrameRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ { OrthancStone::CairoSurface* ColorFrameRenderer::GenerateDisplay(const RenderStyle& style) { - std::auto_ptr display + std::unique_ptr display (new OrthancStone::CairoSurface(frame_->GetWidth(), frame_->GetHeight(), false /* no alpha */)); Orthanc::ImageAccessor target; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Layers/ColorFrameRenderer.h --- a/Framework/Deprecated/Layers/ColorFrameRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/ColorFrameRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -28,7 +28,7 @@ class ColorFrameRenderer : public FrameRenderer { private: - std::auto_ptr frame_; // In RGB24 + std::unique_ptr frame_; // In RGB24 protected: virtual OrthancStone::CairoSurface* GenerateDisplay(const RenderStyle& style); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Layers/FrameRenderer.h --- a/Framework/Deprecated/Layers/FrameRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/FrameRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,7 +35,7 @@ double pixelSpacingY_; RenderStyle style_; bool isFullQuality_; - std::auto_ptr display_; + std::unique_ptr display_; protected: virtual OrthancStone::CairoSurface* GenerateDisplay(const RenderStyle& style) = 0; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Layers/GrayscaleFrameRenderer.cpp --- a/Framework/Deprecated/Layers/GrayscaleFrameRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/GrayscaleFrameRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ { assert(frame_->GetFormat() == Orthanc::PixelFormat_Float32); - std::auto_ptr result; + std::unique_ptr result; float windowCenter, windowWidth; style.ComputeWindowing(windowCenter, windowWidth, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Layers/GrayscaleFrameRenderer.h --- a/Framework/Deprecated/Layers/GrayscaleFrameRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/GrayscaleFrameRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ class GrayscaleFrameRenderer : public FrameRenderer { private: - std::auto_ptr frame_; // In Float32 + std::unique_ptr frame_; // In Float32 float defaultWindowCenter_; float defaultWindowWidth_; Orthanc::PhotometricInterpretation photometric_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Layers/SeriesFrameRendererFactory.h --- a/Framework/Deprecated/Layers/SeriesFrameRendererFactory.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/SeriesFrameRendererFactory.h Mon Mar 02 16:31:30 2020 +0100 @@ -30,11 +30,11 @@ class SeriesFrameRendererFactory : public ILayerRendererFactory { private: - std::auto_ptr loader_; + std::unique_ptr loader_; size_t currentFrame_; bool fast_; - std::auto_ptr currentDataset_; + std::unique_ptr currentDataset_; void ReadCurrentFrameDataset(size_t frame); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Layers/SingleFrameRendererFactory.h --- a/Framework/Deprecated/Layers/SingleFrameRendererFactory.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Layers/SingleFrameRendererFactory.h Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ { private: OrthancPlugins::IOrthancConnection& orthanc_; - std::auto_ptr dicom_; + std::unique_ptr dicom_; std::string instance_; unsigned int frame_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/SmartLoader.cpp --- a/Framework/Deprecated/SmartLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/SmartLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ }; unsigned int sliceIndex_; - std::auto_ptr slice_; + std::unique_ptr slice_; boost::shared_ptr image_; SliceImageQuality effectiveQuality_; CachedSliceStatus status_; @@ -140,7 +140,7 @@ // the messages to its observables // in both cases, we must be carefull about objects lifecycle !!! - std::auto_ptr layerSource; + std::unique_ptr layerSource; std::string sliceKeyId = instanceId + ":" + boost::lexical_cast(frame); SmartLoader::CachedSlice* cachedSlice = NULL; @@ -199,7 +199,7 @@ cachedSlices_[sliceKeyId] = boost::shared_ptr(cachedSlice); - std::auto_ptr layerSource(new DicomSeriesVolumeSlicer(IObserver::GetBroker(), orthancApiClient_)); + std::unique_ptr layerSource(new DicomSeriesVolumeSlicer(IObserver::GetBroker(), orthancApiClient_)); dynamic_cast(layerSource.get())->SetImageQuality(imageQuality_); layerSource->RegisterObserverCallback(new OrthancStone::Callable(*this, &SmartLoader::OnLayerGeometryReady)); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/BaseWebService.cpp --- a/Framework/Deprecated/Toolbox/BaseWebService.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/BaseWebService.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -37,9 +37,9 @@ class BaseWebService::BaseWebServicePayload : public Orthanc::IDynamicObject { private: - std::auto_ptr< OrthancStone::MessageHandler > userSuccessHandler_; - std::auto_ptr< OrthancStone::MessageHandler > userFailureHandler_; - std::auto_ptr< Orthanc::IDynamicObject> userPayload_; + std::unique_ptr< OrthancStone::MessageHandler > userSuccessHandler_; + std::unique_ptr< OrthancStone::MessageHandler > userFailureHandler_; + std::unique_ptr< Orthanc::IDynamicObject> userPayload_; public: BaseWebServicePayload(OrthancStone::MessageHandler* userSuccessHandler, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/DicomFrameConverter.cpp --- a/Framework/Deprecated/Toolbox/DicomFrameConverter.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/DicomFrameConverter.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -174,7 +174,7 @@ } - void DicomFrameConverter::ConvertFrameInplace(std::auto_ptr& source) const + void DicomFrameConverter::ConvertFrameInplace(std::unique_ptr& source) const { assert(sizeof(float) == 4); @@ -210,7 +210,7 @@ if (sourceFormat == Orthanc::PixelFormat_RGB24) { // This is the case of a color image. No conversion has to be done (*) - std::auto_ptr converted(new Orthanc::Image(Orthanc::PixelFormat_RGB24, + std::unique_ptr converted(new Orthanc::Image(Orthanc::PixelFormat_RGB24, source.GetWidth(), source.GetHeight(), false)); @@ -224,7 +224,7 @@ sourceFormat == Orthanc::PixelFormat_SignedGrayscale16); // This is the case of a grayscale frame. Convert it to Float32. - std::auto_ptr converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, + std::unique_ptr converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, source.GetWidth(), source.GetHeight(), false)); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/DicomFrameConverter.h --- a/Framework/Deprecated/Toolbox/DicomFrameConverter.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/DicomFrameConverter.h Mon Mar 02 16:31:30 2020 +0100 @@ -22,6 +22,7 @@ #pragma once #include +#include #include #include @@ -63,7 +64,7 @@ { // TODO: check whether this dtor is called or not // An MSVC warning explains that declaring an - // std::auto_ptr with a forward-declared type + // std::unique_ptr with a forward-declared type // prevents its dtor from being called. Does not // seem an issue here (only POD types inside), but // definitely something to keep an eye on. @@ -157,7 +158,7 @@ return rescaleSlope_; } - void ConvertFrameInplace(std::auto_ptr& source) const; + void ConvertFrameInplace(std::unique_ptr& source) const; Orthanc::ImageAccessor* ConvertFrame(const Orthanc::ImageAccessor& source) const; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/MessagingToolbox.cpp --- a/Framework/Deprecated/Toolbox/MessagingToolbox.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/MessagingToolbox.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -251,7 +251,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr result(new Orthanc::PngReader); + std::unique_ptr result(new Orthanc::PngReader); result->ReadFromMemory(compressed); if (targetFormat == Orthanc::PixelFormat_SignedGrayscale16) @@ -328,7 +328,7 @@ std::string jpeg; Orthanc::Toolbox::DecodeBase64(jpeg, info["PixelData"].asString()); - std::auto_ptr reader(new Orthanc::JpegReader); + std::unique_ptr reader(new Orthanc::JpegReader); reader->ReadFromMemory(jpeg); if (reader->GetFormat() == Orthanc::PixelFormat_RGB24) // This is a color image @@ -386,7 +386,7 @@ } // Decode a grayscale JPEG 8bpp image coming from the Web viewer - std::auto_ptr image + std::unique_ptr image (new Orthanc::Image(targetFormat, reader->GetWidth(), reader->GetHeight(), false)); float scaling = static_cast(stretchHigh - stretchLow) / 255.0f; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/OrthancApiClient.cpp --- a/Framework/Deprecated/Toolbox/OrthancApiClient.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/OrthancApiClient.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -68,11 +68,11 @@ class OrthancApiClient::WebServicePayload : public Orthanc::IDynamicObject { private: - std::auto_ptr< OrthancStone::MessageHandler > emptyHandler_; - std::auto_ptr< OrthancStone::MessageHandler > jsonHandler_; - std::auto_ptr< OrthancStone::MessageHandler > binaryHandler_; - std::auto_ptr< OrthancStone::MessageHandler > failureHandler_; - std::auto_ptr< Orthanc::IDynamicObject > userPayload_; + std::unique_ptr< OrthancStone::MessageHandler > emptyHandler_; + std::unique_ptr< OrthancStone::MessageHandler > jsonHandler_; + std::unique_ptr< OrthancStone::MessageHandler > binaryHandler_; + std::unique_ptr< OrthancStone::MessageHandler > failureHandler_; + std::unique_ptr< Orthanc::IDynamicObject > userPayload_; OrthancStone::MessageBroker& broker_; void NotifyConversionError(const IWebService::HttpRequestSuccessMessage& message) const { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/OrthancSlicesLoader.cpp --- a/Framework/Deprecated/Toolbox/OrthancSlicesLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/OrthancSlicesLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -128,7 +128,7 @@ static Operation* DownloadInstanceGeometry(const std::string& instanceId) { - std::auto_ptr operation(new Operation(Mode_InstanceGeometry)); + std::unique_ptr operation(new Operation(Mode_InstanceGeometry)); operation->instanceId_ = instanceId; return operation.release(); } @@ -136,7 +136,7 @@ static Operation* DownloadFrameGeometry(const std::string& instanceId, unsigned int frame) { - std::auto_ptr operation(new Operation(Mode_FrameGeometry)); + std::unique_ptr operation(new Operation(Mode_FrameGeometry)); operation->instanceId_ = instanceId; operation->frame_ = frame; return operation.release(); @@ -146,7 +146,7 @@ const Slice& slice, SliceImageQuality quality) { - std::auto_ptr tmp(new Operation(Mode_LoadImage)); + std::unique_ptr tmp(new Operation(Mode_LoadImage)); tmp->sliceIndex_ = sliceIndex; tmp->slice_ = &slice; tmp->quality_ = quality; @@ -156,7 +156,7 @@ static Operation* DownloadSliceRawImage(unsigned int sliceIndex, const Slice& slice) { - std::auto_ptr tmp(new Operation(Mode_LoadRawImage)); + std::unique_ptr tmp(new Operation(Mode_LoadRawImage)); tmp->sliceIndex_ = sliceIndex; tmp->slice_ = &slice; tmp->quality_ = SliceImageQuality_InternalRaw; @@ -165,7 +165,7 @@ static Operation* DownloadDicomFile(const Slice& slice) { - std::auto_ptr tmp(new Operation(Mode_LoadDicomFile)); + std::unique_ptr tmp(new Operation(Mode_LoadDicomFile)); tmp->slice_ = &slice; return tmp.release(); } @@ -241,7 +241,7 @@ for (unsigned int frame = 0; frame < frames; frame++) { - std::auto_ptr slice(new Slice); + std::unique_ptr slice(new Slice); if (slice->ParseOrthancFrame(dicom, instances[i], frame)) { OrthancStone::CoordinateSystem3D geometry = slice->GetGeometry(); @@ -277,7 +277,7 @@ for (unsigned int frame = 0; frame < frames; frame++) { - std::auto_ptr slice(new Slice); + std::unique_ptr slice(new Slice); if (slice->ParseOrthancFrame(dicom, instanceId, frame)) { OrthancStone::CoordinateSystem3D geometry = slice->GetGeometry(); @@ -308,7 +308,7 @@ Orthanc::DicomMap dicom; MessagingToolbox::ConvertDataset(dicom, dataset); - std::auto_ptr slice(new Slice); + std::unique_ptr slice(new Slice); if (slice->ParseOrthancFrame(dicom, instanceId, frame)) { LOG(INFO) << "Loaded instance geometry " << instanceId; @@ -329,7 +329,7 @@ void OrthancSlicesLoader::ParseSliceImagePng(const OrthancApiClient::BinaryResponseReadyMessage& message) { const Operation& operation = dynamic_cast(message.GetPayload()); - std::auto_ptr image; + std::unique_ptr image; try { @@ -369,7 +369,7 @@ void OrthancSlicesLoader::ParseSliceImagePam(const OrthancApiClient::BinaryResponseReadyMessage& message) { const Operation& operation = dynamic_cast(message.GetPayload()); - std::auto_ptr image; + std::unique_ptr image; try { @@ -449,7 +449,7 @@ } } - std::auto_ptr reader; + std::unique_ptr reader; { std::string jpeg; @@ -536,7 +536,7 @@ } // Decode a grayscale JPEG 8bpp image coming from the Web viewer - std::auto_ptr image + std::unique_ptr image (new Orthanc::Image(expectedFormat, reader->GetWidth(), reader->GetHeight(), false)); Orthanc::ImageProcessing::Convert(*image, *reader); @@ -599,7 +599,7 @@ { // This is the case of RT-DOSE (uint32_t values) - std::auto_ptr image + std::unique_ptr image (new StringImage(Orthanc::PixelFormat_Grayscale32, info.GetWidth(), info.GetHeight(), raw)); @@ -623,7 +623,7 @@ info.GetPhotometricInterpretation() == Orthanc::PhotometricInterpretation_Monochrome2 && raw.size() == info.GetWidth() * info.GetHeight() * 2) { - std::auto_ptr image + std::unique_ptr image (new StringImage(Orthanc::PixelFormat_Grayscale16, info.GetWidth(), info.GetHeight(), raw)); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/ParallelSlices.cpp --- a/Framework/Deprecated/Toolbox/ParallelSlices.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/ParallelSlices.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -143,7 +143,7 @@ ParallelSlices* ParallelSlices::Reverse() const { - std::auto_ptr reversed(new ParallelSlices); + std::unique_ptr reversed(new ParallelSlices); for (size_t i = slices_.size(); i > 0; i--) { @@ -164,7 +164,7 @@ const OrthancStone::Vector dimensions = geometry.GetVoxelDimensions(OrthancStone::VolumeProjection_Axial); const OrthancStone::CoordinateSystem3D& axial = geometry.GetAxialGeometry(); - std::auto_ptr result(new ParallelSlices); + std::unique_ptr result(new ParallelSlices); switch (projection) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/ParallelSlicesCursor.h --- a/Framework/Deprecated/Toolbox/ParallelSlicesCursor.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/ParallelSlicesCursor.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,12 +24,14 @@ #include "ParallelSlices.h" #include "../../StoneEnumerations.h" +#include + namespace Deprecated { class ParallelSlicesCursor : public boost::noncopyable { private: - std::auto_ptr slices_; + std::unique_ptr slices_; size_t currentSlice_; size_t GetDefaultSlice(); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/Slice.cpp --- a/Framework/Deprecated/Toolbox/Slice.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/Slice.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -48,7 +48,7 @@ Slice* Slice::Clone() const { - std::auto_ptr target(new Slice()); + std::unique_ptr target(new Slice()); target->type_ = type_; target->orthancInstanceId_ = orthancInstanceId_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Toolbox/Slice.h --- a/Framework/Deprecated/Toolbox/Slice.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Toolbox/Slice.h Mon Mar 02 16:31:30 2020 +0100 @@ -59,7 +59,7 @@ unsigned int height_; // TODO : Redundant with "imageInformation_" DicomFrameConverter converter_; // TODO : Partially redundant with "imageInformation_" - std::auto_ptr imageInformation_; + std::unique_ptr imageInformation_; public: Slice() : diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Viewport/WidgetViewport.h --- a/Framework/Deprecated/Viewport/WidgetViewport.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Viewport/WidgetViewport.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,8 @@ #include "IViewport.h" #include "../Widgets/IWidget.h" +#include + #include namespace Deprecated @@ -31,9 +33,9 @@ class WidgetViewport : public IViewport { private: - std::auto_ptr centralWidget_; + std::unique_ptr centralWidget_; IStatusBar* statusBar_; - std::auto_ptr mouseTracker_; + std::unique_ptr mouseTracker_; bool isMouseOver_; int lastMouseX_; int lastMouseY_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Volumes/StructureSetLoader.cpp --- a/Framework/Deprecated/Volumes/StructureSetLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Volumes/StructureSetLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -122,7 +122,7 @@ const std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050"; OrthancPlugins::FullOrthancDataset dataset(orthanc, uri); - std::auto_ptr result + std::unique_ptr result (new OrthancStone::DicomStructureSet(dataset)); std::set instances; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Volumes/StructureSetLoader.h --- a/Framework/Deprecated/Volumes/StructureSetLoader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Volumes/StructureSetLoader.h Mon Mar 02 16:31:30 2020 +0100 @@ -25,6 +25,8 @@ #include "../Toolbox/OrthancApiClient.h" #include "IVolumeLoader.h" +#include + namespace Deprecated { class StructureSetLoader : @@ -33,7 +35,7 @@ { private: OrthancApiClient& orthanc_; - std::auto_ptr structureSet_; + std::unique_ptr structureSet_; void OnReferencedSliceLoaded(const OrthancApiClient::JsonResponseReadyMessage& message); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Widgets/LayoutWidget.cpp --- a/Framework/Deprecated/Widgets/LayoutWidget.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/LayoutWidget.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -31,7 +31,7 @@ class LayoutWidget::LayoutMouseTracker : public IMouseTracker { private: - std::auto_ptr tracker_; + std::unique_ptr tracker_; int left_; int top_; unsigned int width_; @@ -85,7 +85,7 @@ class LayoutWidget::ChildWidget : public boost::noncopyable { private: - std::auto_ptr widget_; + std::unique_ptr widget_; int left_; int top_; unsigned int width_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Widgets/LayoutWidget.h --- a/Framework/Deprecated/Widgets/LayoutWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/LayoutWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -38,7 +38,7 @@ bool isHorizontal_; unsigned int width_; unsigned int height_; - std::auto_ptr mouseTracker_; + std::unique_ptr mouseTracker_; unsigned int paddingLeft_; unsigned int paddingTop_; unsigned int paddingRight_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Widgets/SliceViewerWidget.cpp --- a/Framework/Deprecated/Widgets/SliceViewerWidget.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/SliceViewerWidget.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -327,7 +327,7 @@ { LOG(INFO) << "Updating layer " << index; - std::auto_ptr tmp(renderer); + std::unique_ptr tmp(renderer); if (renderer == NULL) { @@ -357,7 +357,12 @@ !currentScene_->IsComplete() || pendingScene_->IsComplete()) { - currentScene_ = pendingScene_; +#if __cplusplus < 201103L + currentScene_.reset(pendingScene_.release()); +#else + currentScene_ = std::move(pendingScene_); +#endif + NotifyContentChanged(); } } @@ -518,7 +523,11 @@ (pendingScene_.get() != NULL && pendingScene_->IsComplete())) { - currentScene_ = pendingScene_; +#if __cplusplus < 201103L + currentScene_.reset(pendingScene_.release()); +#else + currentScene_ = std::move(pendingScene_); +#endif } plane_ = plane; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Widgets/SliceViewerWidget.h --- a/Framework/Deprecated/Widgets/SliceViewerWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/SliceViewerWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -75,8 +75,8 @@ std::vector layers_; std::vector styles_; OrthancStone::CoordinateSystem3D plane_; - std::auto_ptr currentScene_; - std::auto_ptr pendingScene_; + std::unique_ptr currentScene_; + std::unique_ptr pendingScene_; std::vector changedLayers_; bool LookupLayer(size_t& index /* out */, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Widgets/TestWorldSceneWidget.h --- a/Framework/Deprecated/Widgets/TestWorldSceneWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/TestWorldSceneWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: class Interactor; - std::auto_ptr interactor_; + std::unique_ptr interactor_; bool animate_; unsigned int count_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/Widgets/WorldSceneWidget.cpp --- a/Framework/Deprecated/Widgets/WorldSceneWidget.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/Widgets/WorldSceneWidget.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ { private: ViewportGeometry view_; - std::auto_ptr tracker_; + std::unique_ptr tracker_; public: SceneMouseTracker(const ViewportGeometry& view, @@ -166,7 +166,7 @@ view_.MapPixelCenterToScene(sceneX, sceneY, x, y); // asks the Widget Interactor to provide a mouse tracker - std::auto_ptr tracker; + std::unique_ptr tracker; if (interactor_) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Deprecated/dev.h --- a/Framework/Deprecated/dev.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Deprecated/dev.h Mon Mar 02 16:31:30 2020 +0100 @@ -47,8 +47,8 @@ { private: OrthancSlicesLoader loader_; - std::auto_ptr image_; - std::auto_ptr downloadStack_; + std::unique_ptr image_; + std::unique_ptr downloadStack_; bool computeRange_; size_t pendingSlices_; @@ -521,9 +521,9 @@ OrthancVolumeImage& volume_; - std::auto_ptr axialGeometry_; - std::auto_ptr coronalGeometry_; - std::auto_ptr sagittalGeometry_; + std::unique_ptr axialGeometry_; + std::unique_ptr coronalGeometry_; + std::unique_ptr sagittalGeometry_; bool IsGeometryReady() const @@ -662,7 +662,7 @@ { // As the slices of the volumic image are arranged in a box, // we only consider one single reference slice (the one with index 0). - std::auto_ptr slice(GetProjectionGeometry(projection).GetSlice(0)); + std::unique_ptr slice(GetProjectionGeometry(projection).GetSlice(0)); slice->GetExtent(points); return true; @@ -684,7 +684,7 @@ { bool isFullQuality = true; // TODO - std::auto_ptr frame; + std::unique_ptr frame; { OrthancStone::ImageBuffer3D::SliceReader reader(volume_.GetImage(), projection, static_cast(closest)); @@ -693,7 +693,7 @@ frame.reset(Orthanc::Image::Clone(reader.GetAccessor())); } - std::auto_ptr slice(geometry.GetSlice(closest)); + std::unique_ptr slice(geometry.GetSlice(closest)); RendererFactory factory(*frame, *slice, isFullQuality); @@ -716,7 +716,7 @@ private: SliceViewerWidget& widget_; OrthancStone::VolumeProjection projection_; - std::auto_ptr slices_; + std::unique_ptr slices_; size_t slice_; protected: @@ -858,7 +858,7 @@ { slice_ = slice; - std::auto_ptr tmp(slices_->GetSlice(slice_)); + std::unique_ptr tmp(slices_->GetSlice(slice_)); widget_.SetSlice(tmp->GetGeometry()); } } diff -r 86400fa16091 -r 8a0a62189f46 Framework/Fonts/FontRenderer.cpp --- a/Framework/Fonts/FontRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/FontRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -141,7 +141,7 @@ face_->glyph->bitmap.pitch, face_->glyph->bitmap.buffer); - std::auto_ptr glyph( + std::unique_ptr glyph( new Glyph(bitmap.GetWidth(), bitmap.GetHeight(), face_->glyph->bitmap_left, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Fonts/Glyph.h --- a/Framework/Fonts/Glyph.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/Glyph.h Mon Mar 02 16:31:30 2020 +0100 @@ -21,6 +21,7 @@ #pragma once +#include #include #include @@ -38,7 +39,7 @@ int advanceX_; unsigned int lineHeight_; - std::auto_ptr payload_; + std::unique_ptr payload_; public: // WARNING: This does not copy the payload diff -r 86400fa16091 -r 8a0a62189f46 Framework/Fonts/GlyphAlphabet.cpp --- a/Framework/Fonts/GlyphAlphabet.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphAlphabet.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -43,12 +43,12 @@ const Glyph& glyph, Orthanc::IDynamicObject* payload) { - std::auto_ptr protection(payload); + std::unique_ptr protection(payload); // Don't add twice the same character if (content_.find(unicode) == content_.end()) { - std::auto_ptr raii(new Glyph(glyph)); + std::unique_ptr raii(new Glyph(glyph)); if (payload != NULL) { @@ -65,7 +65,7 @@ void GlyphAlphabet::Register(FontRenderer& renderer, uint32_t unicode) { - std::auto_ptr glyph(renderer.Render(unicode)); + std::unique_ptr glyph(renderer.Render(unicode)); if (glyph.get() != NULL) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Fonts/GlyphBitmapAlphabet.cpp --- a/Framework/Fonts/GlyphBitmapAlphabet.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphBitmapAlphabet.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -98,7 +98,7 @@ { TextBoundingBox box(alphabet_, utf8); - std::auto_ptr bitmap( + std::unique_ptr bitmap( new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, box.GetWidth(), box.GetHeight(), true /* force minimal pitch */)); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Fonts/GlyphTextureAlphabet.cpp --- a/Framework/Fonts/GlyphTextureAlphabet.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphTextureAlphabet.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -77,7 +77,7 @@ class GlyphTextureAlphabet::TextureGenerator : public GlyphAlphabet::IGlyphVisitor { private: - std::auto_ptr texture_; + std::unique_ptr texture_; unsigned int countColumns_; unsigned int countRows_; @@ -289,7 +289,7 @@ { TextBoundingBox box(alphabet_, utf8); - std::auto_ptr bitmap( + std::unique_ptr bitmap( new Orthanc::Image(Orthanc::PixelFormat_RGBA32, box.GetWidth(), box.GetHeight(), true /* force minimal pitch */)); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Fonts/GlyphTextureAlphabet.h --- a/Framework/Fonts/GlyphTextureAlphabet.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Fonts/GlyphTextureAlphabet.h Mon Mar 02 16:31:30 2020 +0100 @@ -61,7 +61,7 @@ class RenderTextVisitor; GlyphAlphabet alphabet_; - std::auto_ptr texture_; + std::unique_ptr texture_; unsigned int textureWidth_; unsigned int textureHeight_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/BasicFetchingStrategy.h --- a/Framework/Loaders/BasicFetchingStrategy.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/BasicFetchingStrategy.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,8 @@ #include "IFetchingItemsSorter.h" #include "IFetchingStrategy.h" +#include + #include namespace OrthancStone @@ -56,7 +58,7 @@ } }; - std::auto_ptr sorter_; + std::unique_ptr sorter_; std::vector nextQuality_; unsigned int maxQuality_; std::vector content_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/DicomStructureSetLoader.cpp --- a/Framework/Loaders/DicomStructureSetLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/DicomStructureSetLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -140,7 +140,7 @@ const std::string instanceId = lookup[0]["ID"].asString(); { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags"; command->SetUri(uri); @@ -227,7 +227,7 @@ for (std::set::const_iterator it = nonEmptyInstances.begin(); it != nonEmptyInstances.end(); ++it) { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/tools/lookup"); command->SetMethod(Orthanc::HttpMethod_Post); command->SetBody(*it); @@ -292,7 +292,7 @@ { assert(isValid_); - std::auto_ptr layer(new PolylineSceneLayer); + std::unique_ptr layer(new PolylineSceneLayer); layer->SetThickness(2); for (size_t i = 0; i < content_.GetStructuresCount(); i++) @@ -377,7 +377,7 @@ initiallyVisibleStructures_ = initiallyVisibleStructures; { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050"; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/DicomStructureSetLoader.h --- a/Framework/Loaders/DicomStructureSetLoader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/DicomStructureSetLoader.h Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ class LookupInstance; // 2nd state class LoadStructure; // 1st state - std::auto_ptr content_; + std::unique_ptr content_; uint64_t revision_; std::string instanceId_; unsigned int countProcessedInstances_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/DicomStructureSetLoader2.cpp --- a/Framework/Loaders/DicomStructureSetLoader2.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/DicomStructureSetLoader2.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -81,7 +81,7 @@ void DicomStructureSetLoader2::LoadInstance(const std::string& instanceId) { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050"; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/LoaderStateMachine.cpp --- a/Framework/Loaders/LoaderStateMachine.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/LoaderStateMachine.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -47,7 +47,7 @@ { LOG(TRACE) << "LoaderStateMachine(" << std::hex << this << std::dec << ")::Schedule()"; - std::auto_ptr protection(command); + std::unique_ptr protection(command); if (command == NULL) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/OrthancMultiframeVolumeLoader.cpp --- a/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ class OrthancMultiframeVolumeLoader::LoadRTDoseGeometry : public LoaderStateMachine::State { private: - std::auto_ptr dicom_; + std::unique_ptr dicom_; public: LoadRTDoseGeometry(OrthancMultiframeVolumeLoader& that, @@ -90,7 +90,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); } - std::auto_ptr dicom(new Orthanc::DicomMap); + std::unique_ptr dicom(new Orthanc::DicomMap); dicom->FromDicomAsJson(body); if (StringToSopClassUid(GetSopClassUid(*dicom)) == SopClassUid_RTDose) @@ -98,7 +98,7 @@ // Download the "Grid Frame Offset Vector" DICOM tag, that is // mandatory for RT-DOSE, but is too long to be returned by default - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/instances/" + loader.GetInstanceId() + "/content/" + Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR.Format()); command->SetPayload(new LoadRTDoseGeometry(loader, dicom.release())); @@ -171,7 +171,7 @@ transferSyntaxUid_ == "1.2.840.10008.1.2.1" || transferSyntaxUid_ == "1.2.840.10008.1.2.2") { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId_ + "/content/" + Orthanc::DICOM_TAG_PIXEL_DATA.Format() + "/0"); @@ -563,7 +563,7 @@ instanceId_ = instanceId; { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetUri("/instances/" + instanceId + "/tags"); command->SetPayload(new LoadGeometry(*this)); @@ -571,7 +571,7 @@ } { - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/instances/" + instanceId + "/metadata/TransferSyntax"); command->SetPayload(new LoadTransferSyntax(*this)); Schedule(command.release()); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp --- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -261,11 +261,11 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } - std::auto_ptr command; + std::unique_ptr command; if (quality == BEST_QUALITY) { - std::auto_ptr tmp(new GetOrthancImageCommand); + std::unique_ptr tmp(new GetOrthancImageCommand); // TODO: review the following comment. // - Commented out by bgo on 2019-07-19 | reason: Alain has seen cases // where gzipping the uint16 image took 11 sec to produce 5mb. @@ -281,7 +281,7 @@ } else { - std::auto_ptr tmp(new GetOrthancWebViewerJpegCommand); + std::unique_ptr tmp(new GetOrthancWebViewerJpegCommand); // TODO: review the following comment. Commented out by bgo on 2019-07-19 // (gzip for jpeg seems overkill) //tmp->SetHttpHeader("Accept-Encoding", "gzip"); @@ -325,7 +325,7 @@ Orthanc::DicomMap dicom; dicom.FromDicomAsJson(body[instances[i]]); - std::auto_ptr instance(new DicomInstanceParameters(dicom)); + std::unique_ptr instance(new DicomInstanceParameters(dicom)); instance->SetOrthancInstanceIdentifier(instances[i]); // the 3D plane corresponding to the slice @@ -481,7 +481,7 @@ { active_ = true; - std::auto_ptr command(new OrthancRestApiCommand); + std::unique_ptr command(new OrthancRestApiCommand); command->SetUri("/series/" + seriesId + "/instances-tags"); // LOG(TRACE) << "OrthancSeriesVolumeProgressiveLoader::LoadSeries about to call oracle_.Schedule"; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h --- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.h Mon Mar 02 16:31:30 2020 +0100 @@ -67,7 +67,7 @@ void CheckSliceIndex(size_t index) const; - std::auto_ptr geometry_; + std::unique_ptr geometry_; std::vector slices_; std::vector slicesRevision_; @@ -111,8 +111,8 @@ unsigned int simultaneousDownloads_; SeriesGeometry seriesGeometry_; boost::shared_ptr volume_; - std::auto_ptr sorter_; - std::auto_ptr strategy_; + std::unique_ptr sorter_; + std::unique_ptr strategy_; std::vector slicesQuality_; bool volumeImageReadyInHighQuality_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Oracle/GetOrthancImageCommand.cpp --- a/Framework/Oracle/GetOrthancImageCommand.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancImageCommand.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -102,7 +102,7 @@ } } - std::auto_ptr image; + std::unique_ptr image; switch (contentType) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Oracle/GetOrthancImageCommand.h --- a/Framework/Oracle/GetOrthancImageCommand.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancImageCommand.h Mon Mar 02 16:31:30 2020 +0100 @@ -40,7 +40,7 @@ ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: - std::auto_ptr image_; + std::unique_ptr image_; Orthanc::MimeType mime_; public: diff -r 86400fa16091 -r 8a0a62189f46 Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp --- a/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -126,7 +126,7 @@ } } - std::auto_ptr reader; + std::unique_ptr reader; { std::string jpeg; @@ -197,7 +197,7 @@ } // Decode a grayscale JPEG 8bpp image coming from the Web viewer - std::auto_ptr image + std::unique_ptr image (new Orthanc::Image(expectedFormat_, reader->GetWidth(), reader->GetHeight(), false)); Orthanc::ImageProcessing::Convert(*image, *reader); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Oracle/GetOrthancWebViewerJpegCommand.h --- a/Framework/Oracle/GetOrthancWebViewerJpegCommand.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/GetOrthancWebViewerJpegCommand.h Mon Mar 02 16:31:30 2020 +0100 @@ -40,7 +40,7 @@ ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); private: - std::auto_ptr image_; + std::unique_ptr image_; public: SuccessMessage(const GetOrthancWebViewerJpegCommand& command, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Oracle/OracleCommandWithPayload.h --- a/Framework/Oracle/OracleCommandWithPayload.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/OracleCommandWithPayload.h Mon Mar 02 16:31:30 2020 +0100 @@ -23,6 +23,7 @@ #include "IOracleCommand.h" +#include #include #include @@ -32,7 +33,7 @@ class OracleCommandWithPayload : public IOracleCommand { private: - std::auto_ptr payload_; + std::unique_ptr payload_; public: void SetPayload(Orthanc::IDynamicObject* payload); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Oracle/ThreadedOracle.cpp --- a/Framework/Oracle/ThreadedOracle.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/ThreadedOracle.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -40,7 +40,7 @@ { private: const IObserver& receiver_; - std::auto_ptr command_; + std::unique_ptr command_; public: Item(const IObserver& receiver, @@ -74,7 +74,7 @@ { private: const IObserver& receiver_; - std::auto_ptr command_; + std::unique_ptr command_; boost::posix_time::ptime expiration_; public: @@ -310,7 +310,7 @@ void ThreadedOracle::Step() { - std::auto_ptr object(queue_.Dequeue(100)); + std::unique_ptr object(queue_.Dequeue(100)); if (object.get() != NULL) { @@ -324,7 +324,7 @@ { SleepOracleCommand& command = dynamic_cast(item.GetCommand()); - std::auto_ptr copy(new SleepOracleCommand(command.GetDelay())); + std::unique_ptr copy(new SleepOracleCommand(command.GetDelay())); if (command.HasPayload()) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Oracle/WebAssemblyOracle.cpp --- a/Framework/Oracle/WebAssemblyOracle.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Oracle/WebAssemblyOracle.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -43,7 +43,7 @@ private: WebAssemblyOracle& oracle_; const IObserver& receiver_; - std::auto_ptr command_; + std::unique_ptr command_; public: TimeoutContext(WebAssemblyOracle& oracle, @@ -70,7 +70,7 @@ static void Callback(void *userData) { - std::auto_ptr context(reinterpret_cast(userData)); + std::unique_ptr context(reinterpret_cast(userData)); context->EmitMessage(); } }; @@ -110,7 +110,7 @@ private: Emitter emitter_; const IObserver& receiver_; - std::auto_ptr command_; + std::unique_ptr command_; std::string expectedContentType_; int64_t receiverFingerprint_; @@ -213,7 +213,7 @@ * free data associated with the fetch. **/ - std::auto_ptr context(reinterpret_cast(fetch->userData)); + std::unique_ptr context(reinterpret_cast(fetch->userData)); // an UUID is 36 chars : 32 hex chars + 4 hyphens: char #0 --> char #35 // char #36 is \0. @@ -352,7 +352,7 @@ static void FailureCallback(emscripten_fetch_t *fetch) { - std::auto_ptr context(reinterpret_cast(fetch->userData)); + std::unique_ptr context(reinterpret_cast(fetch->userData)); { const size_t kEmscriptenStatusTextSize = sizeof(emscripten_fetch_t::statusText); @@ -389,7 +389,7 @@ private: WebAssemblyOracle& oracle_; const IObserver& receiver_; - std::auto_ptr command_; + std::unique_ptr command_; Orthanc::HttpMethod method_; std::string url_; std::string body_; @@ -702,7 +702,7 @@ << std::hex << &receiver << std::dec << " | Current fingerprint is " << receiver.GetFingerprint(); - std::auto_ptr protection(command); + std::unique_ptr protection(command); if (command == NULL) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographyAlphaLayer.cpp --- a/Framework/Radiography/RadiographyAlphaLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyAlphaLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -23,8 +23,10 @@ #include "RadiographyScene.h" +#include #include #include + #include "../Toolbox/ImageGeometry.h" namespace OrthancStone @@ -32,7 +34,7 @@ void RadiographyAlphaLayer::SetAlpha(Orthanc::ImageAccessor* image) { - std::auto_ptr raii(image); + std::unique_ptr raii(image); if (image == NULL) { @@ -45,7 +47,12 @@ } SetSize(image->GetWidth(), image->GetHeight()); - alpha_ = raii; + +#if __cplusplus < 201103L + alpha_.reset(raii.release()); +#else + alpha_ = std::move(raii); +#endif BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); } diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographyAlphaLayer.h --- a/Framework/Radiography/RadiographyAlphaLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyAlphaLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -23,6 +23,8 @@ #include "RadiographyLayer.h" +#include + namespace OrthancStone { class RadiographyScene; @@ -33,7 +35,7 @@ class RadiographyAlphaLayer : public RadiographyLayer { private: - std::auto_ptr alpha_; // Grayscale8 in the range [0, 255] 0 = transparent, 255 = opaque -> the foreground value will be displayed + std::unique_ptr alpha_; // Grayscale8 in the range [0, 255] 0 = transparent, 255 = opaque -> the foreground value will be displayed float foreground_; // in the range [0.0, 65535.0] public: diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographyDicomLayer.cpp --- a/Framework/Radiography/RadiographyDicomLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyDicomLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -97,7 +97,7 @@ void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image) // Takes ownership { - std::auto_ptr raii(image); + std::unique_ptr raii(image); if (image == NULL) { @@ -106,7 +106,12 @@ SetSize(image->GetWidth(), image->GetHeight()); - source_ = raii; +#if __cplusplus < 201103L + source_.reset(raii.release()); +#else + source_ = std::move(raii); +#endif + ApplyConverter(); BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); @@ -114,7 +119,7 @@ void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY, bool emitLayerEditedEvent) // Takes ownership { - std::auto_ptr raii(image); + std::unique_ptr raii(image); if (image == NULL) { @@ -123,7 +128,12 @@ SetSize(image->GetWidth(), image->GetHeight(), false); - source_ = raii; +#if __cplusplus < 201103L + source_.reset(raii.release()); +#else + source_ = std::move(raii); +#endif + ApplyConverter(); SetPixelSpacing(newPixelSpacingX, newPixelSpacingY, false); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographyDicomLayer.h --- a/Framework/Radiography/RadiographyDicomLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyDicomLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -33,9 +33,9 @@ class RadiographyDicomLayer : public RadiographyLayer { private: - std::auto_ptr source_; // Content of PixelData - std::auto_ptr converter_; - std::auto_ptr converted_; // Float32 + std::unique_ptr source_; // Content of PixelData + std::unique_ptr converter_; + std::unique_ptr converted_; // Float32 std::string instanceId_; unsigned int frame_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographyMaskLayer.h --- a/Framework/Radiography/RadiographyMaskLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyMaskLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -22,8 +22,10 @@ #pragma once #include "RadiographyLayer.h" -#include "Core/Images/Image.h" -#include "Core/Images/ImageProcessing.h" + +#include +#include +#include namespace OrthancStone { @@ -38,7 +40,7 @@ mutable bool invalidated_; float foreground_; - mutable std::auto_ptr mask_; + mutable std::unique_ptr mask_; public: RadiographyMaskLayer(MessageBroker& broker, const RadiographyScene& scene, const RadiographyDicomLayer& dicomLayer, float foreground) : diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographyScene.cpp --- a/Framework/Radiography/RadiographyScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -127,7 +127,7 @@ void RadiographyScene::_RegisterLayer(RadiographyLayer* layer) { - std::auto_ptr raii(layer); + std::unique_ptr raii(layer); // LOG(INFO) << "Registering layer: " << countLayers_; @@ -325,7 +325,7 @@ RadiographyLayer::Geometry* centerGeometry, bool isCenterGeometry) { - std::auto_ptr alpha(new RadiographyTextLayer(IObservable::GetBroker(), *this)); + std::unique_ptr alpha(new RadiographyTextLayer(IObservable::GetBroker(), *this)); alpha->SetText(utf8, font, fontSize, foreground); if (centerGeometry != NULL) { @@ -353,7 +353,7 @@ unsigned int height, RadiographyLayer::Geometry* geometry) { - std::auto_ptr block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); + std::unique_ptr block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); for (unsigned int padding = 0; (width > 2 * padding) && (height > 2 * padding); @@ -382,7 +382,7 @@ float foreground, RadiographyLayer::Geometry* geometry) { - std::auto_ptr mask(new RadiographyMaskLayer(IObservable::GetBroker(), *this, dicomLayer, foreground)); + std::unique_ptr mask(new RadiographyMaskLayer(IObservable::GetBroker(), *this, dicomLayer, foreground)); mask->SetCorners(corners); if (geometry != NULL) { @@ -395,7 +395,7 @@ RadiographyLayer& RadiographyScene::LoadAlphaBitmap(Orthanc::ImageAccessor* bitmap, RadiographyLayer::Geometry *geometry) { - std::auto_ptr alpha(new RadiographyAlphaLayer(IObservable::GetBroker(), *this)); + std::unique_ptr alpha(new RadiographyAlphaLayer(IObservable::GetBroker(), *this)); alpha->SetAlpha(bitmap); if (geometry != NULL) { @@ -534,7 +534,7 @@ content.assign(reinterpret_cast(message.GetAnswer()), message.GetAnswerSize()); } - std::auto_ptr reader(new Orthanc::PamReader); + std::unique_ptr reader(new Orthanc::PamReader); reader->ReadFromMemory(content); dynamic_cast(layer->second)->SetSourceImage(reader.release()); @@ -725,7 +725,7 @@ Render(layers, view, interpolation, applyWindowing); - std::auto_ptr rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, + std::unique_ptr rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, layers.GetWidth(), layers.GetHeight(), false)); Orthanc::ImageProcessing::Convert(*rendered, layers); @@ -746,7 +746,7 @@ { LOG(INFO) << "Exporting RadiographyScene to DICOM"; - std::auto_ptr rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags + std::unique_ptr rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags createDicomRequestContent["Tags"] = dicomTags; @@ -801,7 +801,7 @@ LOG(INFO) << "Exporting RadiographyScene to DICOM"; VLOG(1) << "Exporting RadiographyScene to: export to image"; - std::auto_ptr rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); + std::unique_ptr rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); // convert the image into base64 for inclusing in the createDicomRequest std::string base64; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographySceneReader.cpp --- a/Framework/Radiography/RadiographySceneReader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographySceneReader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -55,7 +55,7 @@ RadiographyDicomLayer* RadiographySceneGeometryReader::LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry) { - std::auto_ptr layer(new RadiographyPlaceholderLayer(dynamic_cast(scene_).GetBroker(), scene_)); + std::unique_ptr layer(new RadiographyPlaceholderLayer(dynamic_cast(scene_).GetBroker(), scene_)); layer->SetGeometry(*geometry); layer->SetSize(dicomImageWidth_, dicomImageHeight_); scene_.RegisterLayer(layer.get()); @@ -119,7 +119,7 @@ std::string mimeType; Orthanc::Toolbox::DecodeDataUriScheme(mimeType, pngContent, pngContentBase64); - std::auto_ptr image; + std::unique_ptr image; if (mimeType == "image/png") { image.reset(new Orthanc::PngReader()); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographySceneReader.h --- a/Framework/Radiography/RadiographySceneReader.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographySceneReader.h Mon Mar 02 16:31:30 2020 +0100 @@ -52,8 +52,8 @@ { protected: RadiographyScene& scene_; - std::auto_ptr dicomImage_; - std::auto_ptr dicomFrameConverter_; + std::unique_ptr dicomImage_; + std::unique_ptr dicomFrameConverter_; RadiographyPhotometricDisplayMode preferredPhotometricDisplayMode_; public: diff -r 86400fa16091 -r 8a0a62189f46 Framework/Radiography/RadiographyWidget.h --- a/Framework/Radiography/RadiographyWidget.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Radiography/RadiographyWidget.h Mon Mar 02 16:31:30 2020 +0100 @@ -39,8 +39,8 @@ private: boost::shared_ptr scene_; - std::auto_ptr floatBuffer_; - std::auto_ptr cairoBuffer_; + std::unique_ptr floatBuffer_; + std::unique_ptr cairoBuffer_; bool invert_; ImageInterpolation interpolation_; bool hasSelection_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/CairoCompositor.cpp --- a/Framework/Scene2D/CairoCompositor.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/CairoCompositor.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -118,7 +118,7 @@ } else { - std::auto_ptr protection(dict); + std::unique_ptr protection(dict); Fonts::iterator found = fonts_.find(index); @@ -146,7 +146,7 @@ FontRenderer renderer; renderer.LoadFont(resource, fontSize); - std::auto_ptr alphabet(new GlyphBitmapAlphabet); + std::unique_ptr alphabet(new GlyphBitmapAlphabet); alphabet->LoadCodepage(renderer, codepage); SetFont(index, alphabet.release()); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/CairoCompositor.h --- a/Framework/Scene2D/CairoCompositor.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/CairoCompositor.h Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ Fonts fonts_; // Only valid during a call to "Refresh()" - std::auto_ptr context_; + std::unique_ptr context_; virtual cairo_t* GetCairoContext() ORTHANC_OVERRIDE; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/ColorTextureSceneLayer.cpp --- a/Framework/Scene2D/ColorTextureSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/ColorTextureSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ ISceneLayer* ColorTextureSceneLayer::Clone() const { - std::auto_ptr cloned(new ColorTextureSceneLayer(GetTexture())); + std::unique_ptr cloned(new ColorTextureSceneLayer(GetTexture())); cloned->CopyParameters(*this); return cloned.release(); } diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/FloatTextureSceneLayer.cpp --- a/Framework/Scene2D/FloatTextureSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/FloatTextureSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -33,7 +33,7 @@ inverted_(false) { { - std::auto_ptr t( + std::unique_ptr t( new Orthanc::Image(Orthanc::PixelFormat_Float32, texture.GetWidth(), texture.GetHeight(), @@ -118,7 +118,7 @@ ISceneLayer* FloatTextureSceneLayer::Clone() const { - std::auto_ptr cloned + std::unique_ptr cloned (new FloatTextureSceneLayer(GetTexture())); cloned->CopyParameters(*this); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/GrayscaleStyleConfigurator.cpp --- a/Framework/Scene2D/GrayscaleStyleConfigurator.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/GrayscaleStyleConfigurator.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -70,7 +70,7 @@ const Orthanc::ImageAccessor& frame, const DicomInstanceParameters& parameters) const { - std::auto_ptr layer(parameters.CreateTexture(frame)); + std::unique_ptr layer(parameters.CreateTexture(frame)); if (layer.get() == NULL || layer->GetTexture().GetFormat() != Orthanc::PixelFormat_Float32) diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/InfoPanelSceneLayer.h --- a/Framework/Scene2D/InfoPanelSceneLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/InfoPanelSceneLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,7 @@ #include "ISceneLayer.h" #include "../StoneEnumerations.h" +#include #include #include @@ -33,7 +34,7 @@ class InfoPanelSceneLayer : public ISceneLayer { private: - std::auto_ptr texture_; + std::unique_ptr texture_; BitmapAnchor anchor_; bool isLinearInterpolation_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/CairoBaseRenderer.h --- a/Framework/Scene2D/Internals/CairoBaseRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/CairoBaseRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,8 @@ #include "ICairoContextProvider.h" #include "CompositorHelper.h" +#include + namespace OrthancStone { namespace Internals @@ -32,7 +34,7 @@ { private: ICairoContextProvider& target_; - std::auto_ptr layer_; + std::unique_ptr layer_; protected: template diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/CairoTextRenderer.cpp --- a/Framework/Scene2D/Internals/CairoTextRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/CairoTextRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -32,7 +32,7 @@ const TextSceneLayer& layer) : CairoBaseRenderer(target, layer) { - std::auto_ptr source(alphabet.RenderText(layer.GetText())); + std::unique_ptr source(alphabet.RenderText(layer.GetText())); if (source.get() != NULL) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/CompositorHelper.cpp --- a/Framework/Scene2D/Internals/CompositorHelper.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/CompositorHelper.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ class CompositorHelper::Item : public boost::noncopyable { private: - std::auto_ptr renderer_; + std::unique_ptr renderer_; const ISceneLayer& layer_; uint64_t layerIdentifier_; uint64_t lastRevision_; @@ -103,7 +103,7 @@ content_.erase(found); } - std::auto_ptr renderer(factory_.Create(layer)); + std::unique_ptr renderer(factory_.Create(layer)); if (renderer.get() != NULL) { diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLAdvancedPolylineRenderer.h --- a/Framework/Scene2D/Internals/OpenGLAdvancedPolylineRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLAdvancedPolylineRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLLinesProgram& program_; - std::auto_ptr data_; + std::unique_ptr data_; void LoadLayer(const PolylineSceneLayer& layer); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLColorTextureRenderer.h --- a/Framework/Scene2D/Internals/OpenGLColorTextureRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLColorTextureRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLColorTextureProgram& program_; - std::auto_ptr texture_; + std::unique_ptr texture_; AffineTransform2D layerTransform_; void LoadTexture(const ColorTextureSceneLayer& layer); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLFloatTextureRenderer.h --- a/Framework/Scene2D/Internals/OpenGLFloatTextureRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLFloatTextureRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLFloatTextureProgram& program_; - std::auto_ptr texture_; + std::unique_ptr texture_; AffineTransform2D layerTransform_; float windowCenter_; float windowWidth_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLInfoPanelRenderer.h --- a/Framework/Scene2D/Internals/OpenGLInfoPanelRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLInfoPanelRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -34,7 +34,7 @@ private: OpenGL::IOpenGLContext& context_; OpenGLColorTextureProgram& program_; - std::auto_ptr texture_; + std::unique_ptr texture_; BitmapAnchor anchor_; void LoadTexture(const InfoPanelSceneLayer& layer); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLLinesProgram.h --- a/Framework/Scene2D/Internals/OpenGLLinesProgram.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLLinesProgram.h Mon Mar 02 16:31:30 2020 +0100 @@ -73,7 +73,7 @@ private: OpenGL::IOpenGLContext& context_; - std::auto_ptr program_; + std::unique_ptr program_; public: OpenGLLinesProgram(OpenGL::IOpenGLContext& context); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.h --- a/Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLLookupTableTextureRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -36,8 +36,8 @@ private: OpenGL::IOpenGLContext& context_; OpenGLColorTextureProgram& program_; - std::auto_ptr glTexture_; - std::auto_ptr texture_; + std::unique_ptr glTexture_; + std::unique_ptr texture_; AffineTransform2D layerTransform_; void LoadTexture(const LookupTableTextureSceneLayer& layer); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLTextProgram.h --- a/Framework/Scene2D/Internals/OpenGLTextProgram.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLTextProgram.h Mon Mar 02 16:31:30 2020 +0100 @@ -120,7 +120,7 @@ private: OpenGL::IOpenGLContext& context_; - std::auto_ptr program_; + std::unique_ptr program_; GLint positionLocation_; GLint textureLocation_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLTextRenderer.h --- a/Framework/Scene2D/Internals/OpenGLTextRenderer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLTextRenderer.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,7 +35,7 @@ OpenGLTextProgram& program_; const GlyphTextureAlphabet& alphabet_; OpenGL::OpenGLTexture& texture_; - std::auto_ptr data_; + std::unique_ptr data_; void LoadLayer(const TextSceneLayer& layer); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Internals/OpenGLTextureProgram.h --- a/Framework/Scene2D/Internals/OpenGLTextureProgram.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Internals/OpenGLTextureProgram.h Mon Mar 02 16:31:30 2020 +0100 @@ -26,6 +26,8 @@ #include "../../OpenGL/OpenGLTexture.h" #include "../../Toolbox/AffineTransform2D.h" +#include + namespace OrthancStone { namespace Internals @@ -34,7 +36,7 @@ { private: OpenGL::IOpenGLContext& context_; - std::auto_ptr program_; + std::unique_ptr program_; GLint positionLocation_; GLint textureLocation_; GLuint buffers_[2]; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/LookupTableTextureSceneLayer.cpp --- a/Framework/Scene2D/LookupTableTextureSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/LookupTableTextureSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -30,7 +30,7 @@ LookupTableTextureSceneLayer::LookupTableTextureSceneLayer(const Orthanc::ImageAccessor& texture) { { - std::auto_ptr t( + std::unique_ptr t( new Orthanc::Image(Orthanc::PixelFormat_Float32, texture.GetWidth(), texture.GetHeight(), @@ -146,7 +146,7 @@ ISceneLayer* LookupTableTextureSceneLayer::Clone() const { - std::auto_ptr cloned + std::unique_ptr cloned (new LookupTableTextureSceneLayer(GetTexture())); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/OpenGLCompositor.cpp --- a/Framework/Scene2D/OpenGLCompositor.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/OpenGLCompositor.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -33,8 +33,8 @@ class OpenGLCompositor::Font : public boost::noncopyable { private: - std::auto_ptr alphabet_; - std::auto_ptr texture_; + std::unique_ptr alphabet_; + std::unique_ptr texture_; public: Font(OpenGL::IOpenGLContext& context, const GlyphBitmapAlphabet& dict) @@ -42,7 +42,7 @@ alphabet_.reset(new GlyphTextureAlphabet(dict)); texture_.reset(new OpenGL::OpenGLTexture(context)); - std::auto_ptr bitmap(alphabet_->ReleaseTexture()); + std::unique_ptr bitmap(alphabet_->ReleaseTexture()); texture_->Load(*bitmap, true /* enable linear interpolation */); } @@ -181,7 +181,7 @@ { context_.MakeCurrent(); // this can throw if context lost - std::auto_ptr font(new Font(context_, dict)); + std::unique_ptr font(new Font(context_, dict)); Fonts::iterator found = fonts_.find(index); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/PolylineSceneLayer.cpp --- a/Framework/Scene2D/PolylineSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/PolylineSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -35,7 +35,7 @@ ISceneLayer* PolylineSceneLayer::Clone() const { - std::auto_ptr cloned(new PolylineSceneLayer); + std::unique_ptr cloned(new PolylineSceneLayer); cloned->Copy(*this); return cloned.release(); } diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/Scene2D.cpp --- a/Framework/Scene2D/Scene2D.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/Scene2D.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,7 +29,7 @@ class Scene2D::Item { private: - std::auto_ptr layer_; + std::unique_ptr layer_; uint64_t identifier_; public: @@ -105,7 +105,7 @@ ISceneLayer* layer) // Takes ownership { LOG(TRACE) << "SetLayer(" << depth << ", " << reinterpret_cast(layer) << ")"; - std::auto_ptr item(new Item(layer, layerCounter_++)); + std::unique_ptr item(new Item(layer, layerCounter_++)); if (layer == NULL) { @@ -193,7 +193,7 @@ { assert(found->second != NULL); - std::auto_ptr layer(found->second->ReleaseLayer()); + std::unique_ptr layer(found->second->ReleaseLayer()); assert(layer.get() != NULL); content_.erase(found); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/TextSceneLayer.cpp --- a/Framework/Scene2D/TextSceneLayer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/TextSceneLayer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -21,6 +21,8 @@ #include "TextSceneLayer.h" +#include + namespace OrthancStone { TextSceneLayer::TextSceneLayer() : @@ -36,7 +38,7 @@ ISceneLayer* TextSceneLayer::Clone() const { - std::auto_ptr cloned(new TextSceneLayer); + std::unique_ptr cloned(new TextSceneLayer); cloned->SetColor(GetColor()); cloned->x_ = x_; cloned->y_ = y_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2D/TextureBaseSceneLayer.h --- a/Framework/Scene2D/TextureBaseSceneLayer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2D/TextureBaseSceneLayer.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,7 @@ #include "ISceneLayer.h" #include "../Toolbox/AffineTransform2D.h" +#include #include namespace OrthancStone @@ -31,7 +32,7 @@ class TextureBaseSceneLayer : public ISceneLayer { private: - std::auto_ptr texture_; + std::unique_ptr texture_; double originX_; double originY_; double pixelSpacingX_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Scene2DViewport/LayerHolder.cpp --- a/Framework/Scene2DViewport/LayerHolder.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Scene2DViewport/LayerHolder.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -49,13 +49,13 @@ for (int i = 0; i < polylineLayerCount_; ++i) { - std::auto_ptr layer(new PolylineSceneLayer()); + std::unique_ptr layer(new PolylineSceneLayer()); GetScene().SetLayer(baseLayerIndex_ + i, layer.release()); } for (int i = 0; i < textLayerCount_; ++i) { - std::auto_ptr layer(new TextSceneLayer()); + std::unique_ptr layer(new TextSceneLayer()); GetScene().SetLayer( baseLayerIndex_ + polylineLayerCount_ + i, layer.release()); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Toolbox/DicomInstanceParameters.cpp --- a/Framework/Toolbox/DicomInstanceParameters.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/DicomInstanceParameters.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -369,7 +369,7 @@ Orthanc::ImageAccessor* DicomInstanceParameters::ConvertToFloat(const Orthanc::ImageAccessor& pixelData) const { - std::auto_ptr converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, + std::unique_ptr converted(new Orthanc::Image(Orthanc::PixelFormat_Float32, pixelData.GetWidth(), pixelData.GetHeight(), false)); @@ -404,7 +404,7 @@ else { // This is the case of a grayscale frame. Convert it to Float32. - std::auto_ptr texture; + std::unique_ptr texture; if (pixelData.GetFormat() == Orthanc::PixelFormat_Float32) { @@ -412,7 +412,7 @@ } else { - std::auto_ptr converted(ConvertToFloat(pixelData)); + std::unique_ptr converted(ConvertToFloat(pixelData)); texture.reset(new FloatTextureSceneLayer(*converted)); } @@ -442,7 +442,7 @@ LookupTableTextureSceneLayer* DicomInstanceParameters::CreateLookupTableTexture (const Orthanc::ImageAccessor& pixelData) const { - std::auto_ptr texture; + std::unique_ptr texture; if (pixelData.GetFormat() == Orthanc::PixelFormat_Float32) { @@ -450,7 +450,7 @@ } else { - std::auto_ptr converted(ConvertToFloat(pixelData)); + std::unique_ptr converted(ConvertToFloat(pixelData)); return new LookupTableTextureSceneLayer(*converted); } } diff -r 86400fa16091 -r 8a0a62189f46 Framework/Toolbox/DynamicBitmap.h --- a/Framework/Toolbox/DynamicBitmap.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/DynamicBitmap.h Mon Mar 02 16:31:30 2020 +0100 @@ -21,6 +21,7 @@ #pragma once +#include #include #include @@ -31,7 +32,7 @@ class DynamicBitmap : public Orthanc::IDynamicObject { private: - std::auto_ptr bitmap_; + std::unique_ptr bitmap_; public: DynamicBitmap(const Orthanc::ImageAccessor& bitmap); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Toolbox/FiniteProjectiveCamera.cpp --- a/Framework/Toolbox/FiniteProjectiveCamera.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/FiniteProjectiveCamera.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -434,7 +434,7 @@ // to the line joining the camera center and the principal point const VolumeProjection projection = VolumeProjection_Axial; - std::auto_ptr target + std::unique_ptr target (new Orthanc::Image(targetFormat, targetWidth, targetHeight, false)); if (targetFormat == Orthanc::PixelFormat_Grayscale16 && diff -r 86400fa16091 -r 8a0a62189f46 Framework/Toolbox/ShearWarpProjectiveTransform.cpp --- a/Framework/Toolbox/ShearWarpProjectiveTransform.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/ShearWarpProjectiveTransform.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -414,7 +414,7 @@ * for each pixel is stored in the "counter" image. **/ - std::auto_ptr accumulator, counter, intermediate; + std::unique_ptr accumulator, counter, intermediate; accumulator.reset(new Orthanc::Image(Orthanc::PixelFormat_Float32, intermediateWidth, intermediateHeight, false)); @@ -635,7 +635,7 @@ ImageInterpolation shearInterpolation, ImageInterpolation warpInterpolation) { - std::auto_ptr target + std::unique_ptr target (new Orthanc::Image(targetFormat, targetWidth, targetHeight, false)); if (source.GetFormat() == Orthanc::PixelFormat_Grayscale16 && diff -r 86400fa16091 -r 8a0a62189f46 Framework/Toolbox/SlicesSorter.cpp --- a/Framework/Toolbox/SlicesSorter.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/SlicesSorter.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -33,7 +33,7 @@ CoordinateSystem3D geometry_; double depth_; - std::auto_ptr payload_; + std::unique_ptr payload_; public: SliceWithDepth(const CoordinateSystem3D& geometry, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Toolbox/TextRenderer.cpp --- a/Framework/Toolbox/TextRenderer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Toolbox/TextRenderer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -44,7 +44,7 @@ renderer.LoadFont(font, fontSize); // add each char to be rendered to the alphabet - std::auto_ptr alphabet(new GlyphBitmapAlphabet); + std::unique_ptr alphabet(new GlyphBitmapAlphabet); size_t posInString = 0; uint32_t unicode; @@ -58,10 +58,10 @@ } - std::auto_ptr renderedText(alphabet->RenderText(utf8String)); + std::unique_ptr renderedText(alphabet->RenderText(utf8String)); // add a blank line on top of the text (to improve bilinear filtering of the topmost line) - std::auto_ptr renderedTextExtended(new Orthanc::Image(renderedText->GetFormat(), renderedText->GetWidth(), renderedText->GetHeight() + 1, true)); + std::unique_ptr renderedTextExtended(new Orthanc::Image(renderedText->GetFormat(), renderedText->GetWidth(), renderedText->GetHeight() + 1, true)); Orthanc::ImageAccessor textRegion; Orthanc::ImageAccessor firstLineRegion; @@ -81,8 +81,8 @@ const std::string& utf8String, uint8_t foreground) { - std::auto_ptr renderedText8(Render(resource, fontSize, utf8String)); - std::auto_ptr target(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, renderedText8->GetWidth(), renderedText8->GetHeight(), true)); + std::unique_ptr renderedText8(Render(resource, fontSize, utf8String)); + std::unique_ptr target(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, renderedText8->GetWidth(), renderedText8->GetHeight(), true)); Orthanc::ImageProcessing::Set(*target, foreground, foreground, foreground, *renderedText8); return target.release(); @@ -98,18 +98,18 @@ // uint8_t foreground, // uint8_t borderColor) // { - // std::auto_ptr renderedBorderAlpha(RenderWithAlpha(resource, fontSize, utf8String, borderColor)); - // std::auto_ptr renderedTextAlpha(RenderWithAlpha(resource, fontSize, utf8String, foreground)); + // std::unique_ptr renderedBorderAlpha(RenderWithAlpha(resource, fontSize, utf8String, borderColor)); + // std::unique_ptr renderedTextAlpha(RenderWithAlpha(resource, fontSize, utf8String, foreground)); // unsigned int textWidth = renderedBorderAlpha->GetWidth(); // unsigned int textHeight = renderedBorderAlpha->GetHeight(); // Scene2D targetScene; - // std::auto_ptr borderLayerLeft(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr borderLayerRight(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr borderLayerTop(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr borderLayerBottom(new ColorTextureSceneLayer(*renderedBorderAlpha)); - // std::auto_ptr textLayerCenter(new ColorTextureSceneLayer(*renderedTextAlpha)); + // std::unique_ptr borderLayerLeft(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr borderLayerRight(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr borderLayerTop(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr borderLayerBottom(new ColorTextureSceneLayer(*renderedBorderAlpha)); + // std::unique_ptr textLayerCenter(new ColorTextureSceneLayer(*renderedTextAlpha)); // borderLayerLeft->SetOrigin(0, 1); // borderLayerRight->SetOrigin(2, 1); @@ -129,7 +129,7 @@ // Orthanc::ImageAccessor canvas; // compositor.GetCanvas().GetReadOnlyAccessor(canvas); - // std::auto_ptr output(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, canvas.GetWidth(), canvas.GetHeight(), false)); + // std::unique_ptr output(new Orthanc::Image(Orthanc::PixelFormat_RGBA32, canvas.GetWidth(), canvas.GetHeight(), false)); // Orthanc::ImageProcessing::Convert(*output, canvas); // return output.release(); // } diff -r 86400fa16091 -r 8a0a62189f46 Framework/Viewport/SdlViewport.h --- a/Framework/Viewport/SdlViewport.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Viewport/SdlViewport.h Mon Mar 02 16:31:30 2020 +0100 @@ -66,7 +66,7 @@ { private: SdlOpenGLContext context_; - std::auto_ptr compositor_; + std::unique_ptr compositor_; public: SdlOpenGLViewport(const char* title, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Viewport/WebAssemblyViewport.h --- a/Framework/Viewport/WebAssemblyViewport.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Viewport/WebAssemblyViewport.h Mon Mar 02 16:31:30 2020 +0100 @@ -57,7 +57,7 @@ { private: OpenGL::WebAssemblyOpenGLContext context_; - std::auto_ptr compositor_; + std::unique_ptr compositor_; double cssWidth_; double cssHeight_; int pixelWidth_; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/DicomStructureSetSlicer2.cpp --- a/Framework/Volumes/DicomStructureSetSlicer2.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomStructureSetSlicer2.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -78,7 +78,7 @@ { assert(isValid_); - std::auto_ptr layer(new PolylineSceneLayer); + std::unique_ptr layer(new PolylineSceneLayer); layer->SetThickness(2); // thickness of the on-screen line for (size_t i = 0; i < structureSet_->GetStructuresCount(); i++) diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/DicomVolumeImage.h --- a/Framework/Volumes/DicomVolumeImage.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomVolumeImage.h Mon Mar 02 16:31:30 2020 +0100 @@ -49,9 +49,9 @@ private: uint64_t revision_; - std::auto_ptr geometry_; - std::auto_ptr image_; - std::auto_ptr parameters_; + std::unique_ptr geometry_; + std::unique_ptr image_; + std::unique_ptr parameters_; void CheckHasGeometry() const; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/DicomVolumeImageMPRSlicer.cpp --- a/Framework/Volumes/DicomVolumeImageMPRSlicer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomVolumeImageMPRSlicer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -77,7 +77,7 @@ "A style configurator is mandatory for textures"); } - std::auto_ptr texture; + std::unique_ptr texture; { const DicomInstanceParameters& parameters = volume_.GetDicomParameters(); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/DicomVolumeImageReslicer.cpp --- a/Framework/Volumes/DicomVolumeImageReslicer.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/DicomVolumeImageReslicer.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -67,7 +67,7 @@ if (reslicer.IsSuccess()) { - std::auto_ptr layer + std::unique_ptr layer (configurator->CreateTextureFromDicom(reslicer.GetOutputSlice(), that_.volume_->GetDicomParameters())); if (layer.get() == NULL) diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/ImageBuffer3D.cpp --- a/Framework/Volumes/ImageBuffer3D.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/ImageBuffer3D.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -81,7 +81,7 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } - std::auto_ptr result(new Orthanc::Image(format_, height_, depth_, false)); + std::unique_ptr result(new Orthanc::Image(format_, height_, depth_, false)); //LOG(TRACE) << "ImageBuffer3D::ExtractSagittalSlice result will be an image of WIDTH = " << height_ << " and HEIGHT = " << depth_; unsigned int bytesPerPixel = Orthanc::GetBytesPerPixel(format_); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/ImageBuffer3D.h --- a/Framework/Volumes/ImageBuffer3D.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/ImageBuffer3D.h Mon Mar 02 16:31:30 2020 +0100 @@ -24,6 +24,7 @@ #include "../StoneEnumerations.h" #include "../Toolbox/LinearAlgebra.h" +#include #include namespace OrthancStone @@ -143,7 +144,7 @@ { private: Orthanc::ImageAccessor accessor_; - std::auto_ptr sagittal_; // Unused for axial and coronal + std::unique_ptr sagittal_; // Unused for axial and coronal public: SliceReader(const ImageBuffer3D& that, @@ -163,7 +164,7 @@ ImageBuffer3D& that_; bool modified_; Orthanc::ImageAccessor accessor_; - std::auto_ptr sagittal_; // Unused for axial and coronal + std::unique_ptr sagittal_; // Unused for axial and coronal void Flush(); diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/VolumeReslicer.h --- a/Framework/Volumes/VolumeReslicer.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/VolumeReslicer.h Mon Mar 02 16:31:30 2020 +0100 @@ -42,7 +42,7 @@ // Output of reslicing bool success_; Extent2D extent_; - std::auto_ptr slice_; + std::unique_ptr slice_; double pixelSpacing_; void CheckIterators(const ImageBuffer3D& source, diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/VolumeSceneLayerSource.cpp --- a/Framework/Volumes/VolumeSceneLayerSource.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/VolumeSceneLayerSource.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -96,7 +96,7 @@ void VolumeSceneLayerSource::Update(const CoordinateSystem3D& plane) { assert(slicer_.get() != NULL); - std::auto_ptr slice(slicer_->ExtractSlice(plane)); + std::unique_ptr slice(slicer_->ExtractSlice(plane)); if (slice.get() == NULL) { @@ -129,7 +129,7 @@ lastPlane_.reset(new CoordinateSystem3D(plane)); lastRevision_ = slice->GetRevision(); - std::auto_ptr layer(slice->CreateSceneLayer(configurator_.get(), plane)); + std::unique_ptr layer(slice->CreateSceneLayer(configurator_.get(), plane)); if (layer.get() == NULL) { LOG(TRACE) << "VolumeSceneLayerSource::Update -- (layer.get() == NULL)"; diff -r 86400fa16091 -r 8a0a62189f46 Framework/Volumes/VolumeSceneLayerSource.h --- a/Framework/Volumes/VolumeSceneLayerSource.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Framework/Volumes/VolumeSceneLayerSource.h Mon Mar 02 16:31:30 2020 +0100 @@ -41,8 +41,8 @@ Scene2D& scene_; int layerDepth_; boost::shared_ptr slicer_; - std::auto_ptr configurator_; - std::auto_ptr lastPlane_; + std::unique_ptr configurator_; + std::unique_ptr lastPlane_; uint64_t lastRevision_; uint64_t lastConfiguratorRevision_; diff -r 86400fa16091 -r 8a0a62189f46 Platforms/Generic/DelayedCallCommand.h --- a/Platforms/Generic/DelayedCallCommand.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/DelayedCallCommand.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,8 +35,8 @@ class DelayedCallCommand : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr > callback_; - std::auto_ptr payload_; + std::unique_ptr > callback_; + std::unique_ptr payload_; OrthancStone::NativeStoneApplicationContext& context_; boost::posix_time::ptime expirationTimePoint_; unsigned int timeoutInMs_; diff -r 86400fa16091 -r 8a0a62189f46 Platforms/Generic/Oracle.cpp --- a/Platforms/Generic/Oracle.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/Oracle.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ break; } - std::auto_ptr item(that->queue_.Dequeue(100)); + std::unique_ptr item(that->queue_.Dequeue(100)); if (item.get() != NULL) { IOracleCommand& command = dynamic_cast(*item); @@ -107,7 +107,7 @@ void Submit(IOracleCommand* command) { - std::auto_ptr protection(command); + std::unique_ptr protection(command); if (command == NULL) { diff -r 86400fa16091 -r 8a0a62189f46 Platforms/Generic/OracleWebService.cpp --- a/Platforms/Generic/OracleWebService.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/OracleWebService.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -29,8 +29,8 @@ class OracleWebService::WebServiceCachedGetCommand : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr > successCallback_; - std::auto_ptr payload_; + std::unique_ptr > successCallback_; + std::unique_ptr payload_; boost::shared_ptr cachedMessage_; OrthancStone::NativeStoneApplicationContext& context_; diff -r 86400fa16091 -r 8a0a62189f46 Platforms/Generic/WebServiceCommandBase.h --- a/Platforms/Generic/WebServiceCommandBase.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Generic/WebServiceCommandBase.h Mon Mar 02 16:31:30 2020 +0100 @@ -37,12 +37,12 @@ class WebServiceCommandBase : public IOracleCommand, OrthancStone::IObservable { protected: - std::auto_ptr > successCallback_; - std::auto_ptr > failureCallback_; + std::unique_ptr > successCallback_; + std::unique_ptr > failureCallback_; Orthanc::WebServiceParameters parameters_; std::string url_; IWebService::HttpHeaders headers_; - std::auto_ptr payload_; + std::unique_ptr payload_; bool success_; Orthanc::HttpStatus httpStatus_; std::string answer_; diff -r 86400fa16091 -r 8a0a62189f46 Platforms/Wasm/WasmWebService.cpp --- a/Platforms/Wasm/WasmWebService.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Platforms/Wasm/WasmWebService.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -7,7 +7,7 @@ struct CachedSuccessNotification { boost::shared_ptr cachedMessage; - std::auto_ptr payload; + std::unique_ptr payload; OrthancStone::MessageHandler* successCallback; }; @@ -56,7 +56,7 @@ void EMSCRIPTEN_KEEPALIVE WasmWebService_NotifyCachedSuccess(void* notification_) { // notification has been allocated in C++ and passed to JS. It must be deleted by this method - std::auto_ptr notification(reinterpret_cast(notification_)); + std::unique_ptr notification(reinterpret_cast(notification_)); notification->successCallback->Apply(Deprecated::IWebService::HttpRequestSuccessMessage( notification->cachedMessage->GetUri(), diff -r 86400fa16091 -r 8a0a62189f46 Resources/CMake/OrthancStoneParameters.cmake --- a/Resources/CMake/OrthancStoneParameters.cmake Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/CMake/OrthancStoneParameters.cmake Mon Mar 02 16:31:30 2020 +0100 @@ -52,6 +52,6 @@ ## the Stone of Orthanc ##################################################################### -set(ENABLE_OPENGL ON CACHE INTERNAL "Enable support of OpenGL") +set(ENABLE_OPENGL ON CACHE BOOL "Enable support of OpenGL") set(ENABLE_WASM OFF CACHE INTERNAL "Enable support of WebAssembly") set(ENABLE_STONE_DEPRECATED OFF CACHE INTERNAL "Enable backward compatibility with deprecated Stone classes") diff -r 86400fa16091 -r 8a0a62189f46 Resources/CodeGeneration/template.in.h.j2 --- a/Resources/CodeGeneration/template.in.h.j2 Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/CodeGeneration/template.in.h.j2 Mon Mar 02 16:31:30 2020 +0100 @@ -19,7 +19,7 @@ //#define STONEGEN_NO_CPP11 1 #ifdef STONEGEN_NO_CPP11 -#define StoneSmartPtr std::auto_ptr +#define StoneSmartPtr std::unique_ptr #else #define StoneSmartPtr std::unique_ptr #endif diff -r 86400fa16091 -r 8a0a62189f46 Resources/CodeGeneration/testWasmIntegrated/jsoncpp-1.8.4/jsoncpp.cpp --- a/Resources/CodeGeneration/testWasmIntegrated/jsoncpp-1.8.4/jsoncpp.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/CodeGeneration/testWasmIntegrated/jsoncpp-1.8.4/jsoncpp.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -287,7 +287,7 @@ #if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520) typedef std::unique_ptr CharReaderPtr; #else -typedef std::auto_ptr CharReaderPtr; +typedef std::unique_ptr CharReaderPtr; #endif // Implementation of class Features @@ -4242,7 +4242,7 @@ #if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520) typedef std::unique_ptr StreamWriterPtr; #else -typedef std::auto_ptr StreamWriterPtr; +typedef std::unique_ptr StreamWriterPtr; #endif String valueToString(LargestInt value) { diff -r 86400fa16091 -r 8a0a62189f46 Resources/Graveyard/ReferenceLineFactory.cpp --- a/Resources/Graveyard/ReferenceLineFactory.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/Graveyard/ReferenceLineFactory.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -101,7 +101,7 @@ x1, y1, x2, y2, sx1, sy1, sx2, sy2)) { - std::auto_ptr layer(new LineLayerRenderer(x1, y1, x2, y2)); + std::unique_ptr layer(new LineLayerRenderer(x1, y1, x2, y2)); layer->SetLayerStyle(style_); return layer.release(); } diff -r 86400fa16091 -r 8a0a62189f46 Resources/Graveyard/Threading/SdlBuffering.h --- a/Resources/Graveyard/Threading/SdlBuffering.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Resources/Graveyard/Threading/SdlBuffering.h Mon Mar 02 16:31:30 2020 +0100 @@ -35,8 +35,8 @@ { private: boost::mutex mutex_; - std::auto_ptr offscreenSurface_; - std::auto_ptr onscreenSurface_; + std::unique_ptr offscreenSurface_; + std::unique_ptr onscreenSurface_; SDL_Surface* sdlSurface_; bool pendingFrame_; diff -r 86400fa16091 -r 8a0a62189f46 Samples/MultiPlatform/BasicScene/BasicScene.cpp --- a/Samples/MultiPlatform/BasicScene/BasicScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/MultiPlatform/BasicScene/BasicScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -69,7 +69,7 @@ scene.SetLayer(12, new ColorTextureSceneLayer(i)); - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * 3.14); @@ -85,7 +85,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * 3.14); scene.SetLayer(13, l.release()); @@ -93,7 +93,7 @@ // Some lines { - std::auto_ptr layer(new PolylineSceneLayer); + std::unique_ptr layer(new PolylineSceneLayer); layer->SetThickness(1); @@ -125,7 +125,7 @@ // Some text { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layer->SetText("Hello"); scene.SetLayer(100, layer.release()); } @@ -170,7 +170,7 @@ } else { - std::auto_ptr + std::unique_ptr layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf); diff -r 86400fa16091 -r 8a0a62189f46 Samples/Sdl/BasicScene.cpp --- a/Samples/Sdl/BasicScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/BasicScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -78,7 +78,7 @@ scene.SetLayer(12, new ColorTextureSceneLayer(i)); - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * M_PI); @@ -94,7 +94,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * M_PI); scene.SetLayer(13, l.release()); @@ -102,7 +102,7 @@ // Some lines { - std::auto_ptr layer(new PolylineSceneLayer); + std::unique_ptr layer(new PolylineSceneLayer); layer->SetThickness(10); @@ -133,7 +133,7 @@ // Some text { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layer->SetText("Hello"); scene.SetLayer(100, layer.release()); } @@ -199,7 +199,7 @@ } else { - std::auto_ptr + std::unique_ptr layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf); diff -r 86400fa16091 -r 8a0a62189f46 Samples/Sdl/FusionMprSdl.cpp --- a/Samples/Sdl/FusionMprSdl.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/FusionMprSdl.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -125,7 +125,7 @@ } else { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layerP = layer.get(); layer->SetColor(0, 255, 0); layer->SetFontIndex(1); @@ -160,7 +160,7 @@ } else { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf); layer->SetBorder(20); @@ -635,7 +635,7 @@ this->SetVolume1(0, ctLoader, new GrayscaleStyleConfigurator); { - std::auto_ptr config(new LookupTableStyleConfigurator); + std::unique_ptr config(new LookupTableStyleConfigurator); config->SetLookupTable(Orthanc::EmbeddedResources::COLORMAP_HOT); boost::shared_ptr tmp(new DicomVolumeImageMPRSlicer(dose)); diff -r 86400fa16091 -r 8a0a62189f46 Samples/Sdl/Loader.cpp --- a/Samples/Sdl/Loader.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/Loader.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -120,7 +120,7 @@ OrthancStone::CoordinateSystem3D plane_; OrthancStone::IOracle& oracle_; OrthancStone::Scene2D scene_; - std::auto_ptr source1_, source2_, source3_; + std::unique_ptr source1_, source2_, source3_; void Refresh() @@ -342,7 +342,7 @@ { - std::auto_ptr config(new OrthancStone::LookupTableStyleConfigurator); + std::unique_ptr config(new OrthancStone::LookupTableStyleConfigurator); config->SetLookupTable(Orthanc::EmbeddedResources::COLORMAP_HOT); boost::shared_ptr tmp(new OrthancStone::DicomVolumeImageMPRSlicer(dose)); @@ -359,7 +359,7 @@ v["Level"] = "Series"; v["Query"] = Json::objectValue; - std::auto_ptr command(new OrthancStone::OrthancRestApiCommand); + std::unique_ptr command(new OrthancStone::OrthancRestApiCommand); command->SetMethod(Orthanc::HttpMethod_Post); command->SetUri("/tools/find"); command->SetBody(v); @@ -371,7 +371,7 @@ { if (0) { - std::auto_ptr command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Jpeg))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview"); oracle.Schedule(*toto, command.release()); @@ -379,7 +379,7 @@ if (0) { - std::auto_ptr command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/preview"); oracle.Schedule(*toto, command.release()); @@ -387,7 +387,7 @@ if (0) { - std::auto_ptr command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Png))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); oracle.Schedule(*toto, command.release()); @@ -395,7 +395,7 @@ if (0) { - std::auto_ptr command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); @@ -404,7 +404,7 @@ if (0) { - std::auto_ptr command(new OrthancStone::GetOrthancImageCommand); + std::unique_ptr command(new OrthancStone::GetOrthancImageCommand); command->SetHttpHeader("Accept", std::string(Orthanc::EnumerationToString(Orthanc::MimeType_Pam))); command->SetUri("/instances/6687cc73-07cae193-52ff29c8-f646cb16-0753ed92/image-uint16"); oracle.Schedule(*toto, command.release()); @@ -412,7 +412,7 @@ if (0) { - std::auto_ptr command(new OrthancStone::GetOrthancWebViewerJpegCommand); + std::unique_ptr command(new OrthancStone::GetOrthancWebViewerJpegCommand); command->SetHttpHeader("Accept-Encoding", "gzip"); command->SetInstance("e6c7c20b-c9f65d7e-0d76f2e2-830186f2-3e3c600e"); command->SetQuality(90); @@ -424,7 +424,7 @@ { for (unsigned int i = 0; i < 10; i++) { - std::auto_ptr command(new OrthancStone::SleepOracleCommand(i * 1000)); + std::unique_ptr command(new OrthancStone::SleepOracleCommand(i * 1000)); command->SetPayload(new Orthanc::SingleValueObject(42 * i)); oracle.Schedule(*toto, command.release()); } diff -r 86400fa16091 -r 8a0a62189f46 Samples/Sdl/RadiographyEditor.cpp --- a/Samples/Sdl/RadiographyEditor.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/RadiographyEditor.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -179,7 +179,7 @@ glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallback(OpenGLMessageCallback, 0); - std::auto_ptr compositorFactory(new OpenGlSdlCompositorFactory(window)); + std::unique_ptr compositorFactory(new OpenGlSdlCompositorFactory(window)); boost::shared_ptr app(new RadiographyEditorApp(oracle, lock.GetOracleObservable(), compositorFactory.release())); app->PrepareScene(); app->FitContent(window.GetCanvasWidth(), window.GetCanvasHeight()); diff -r 86400fa16091 -r 8a0a62189f46 Samples/Sdl/TrackerSampleApp.cpp --- a/Samples/Sdl/TrackerSampleApp.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/Sdl/TrackerSampleApp.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -96,7 +96,7 @@ } else { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layerP = layer.get(); layer->SetColor(0, 255, 0); layer->SetFontIndex(1); @@ -131,7 +131,7 @@ } else { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layer->SetColor(0, 255, 0); layer->SetText(buf); layer->SetBorder(20); @@ -516,7 +516,7 @@ controller_->GetScene().SetLayer(TEXTURE_2x2_1_ZINDEX, new ColorTextureSceneLayer(i)); - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * M_PI); @@ -532,7 +532,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * M_PI); controller_->GetScene().SetLayer(TEXTURE_1x1_ZINDEX, l.release()); @@ -540,7 +540,7 @@ // Some lines { - std::auto_ptr layer(new PolylineSceneLayer); + std::unique_ptr layer(new PolylineSceneLayer); layer->SetThickness(1); @@ -571,7 +571,7 @@ // Some text { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layer->SetText("Hello"); controller_->GetScene().SetLayer(LINESET_2_ZINDEX, layer.release()); } diff -r 86400fa16091 -r 8a0a62189f46 Samples/WebAssembly/BasicMPR.cpp --- a/Samples/WebAssembly/BasicMPR.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/WebAssembly/BasicMPR.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -38,7 +38,7 @@ { private: OrthancStone::WebAssemblyViewport viewport_; - std::auto_ptr source_; + std::unique_ptr source_; VolumeProjection projection_; std::vector planes_; size_t currentPlane_; @@ -155,9 +155,9 @@ boost::shared_ptr loader_; -std::auto_ptr widget1_; -std::auto_ptr widget2_; -std::auto_ptr widget3_; +std::unique_ptr widget1_; +std::unique_ptr widget2_; +std::unique_ptr widget3_; OrthancStone::MessageBroker broker_; OrthancStone::WebAssemblyOracle oracle_(broker_); @@ -371,7 +371,7 @@ widget1_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas1", OrthancStone::VolumeProjection_Axial)); { - std::auto_ptr style(new OrthancStone::GrayscaleStyleConfigurator); + std::unique_ptr style(new OrthancStone::GrayscaleStyleConfigurator); style->SetLinearInterpolation(true); style->SetWindowing(OrthancStone::ImageWindowing_Bone); widget1_->SetSlicer(0, loader_, *loader_, style.release()); @@ -380,7 +380,7 @@ widget2_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas2", OrthancStone::VolumeProjection_Coronal)); { - std::auto_ptr style(new OrthancStone::GrayscaleStyleConfigurator); + std::unique_ptr style(new OrthancStone::GrayscaleStyleConfigurator); style->SetLinearInterpolation(true); style->SetWindowing(OrthancStone::ImageWindowing_Bone); widget2_->SetSlicer(0, loader_, *loader_, style.release()); @@ -389,7 +389,7 @@ widget3_.reset(new OrthancStone::VolumeSlicerWidget(broker_, "mycanvas3", OrthancStone::VolumeProjection_Sagittal)); { - std::auto_ptr style(new OrthancStone::GrayscaleStyleConfigurator); + std::unique_ptr style(new OrthancStone::GrayscaleStyleConfigurator); style->SetLinearInterpolation(true); style->SetWindowing(OrthancStone::ImageWindowing_Bone); widget3_->SetSlicer(0, loader_, *loader_, style.release()); diff -r 86400fa16091 -r 8a0a62189f46 Samples/WebAssembly/BasicScene.cpp --- a/Samples/WebAssembly/BasicScene.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/WebAssembly/BasicScene.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -62,7 +62,7 @@ scene.SetLayer(12, new ColorTextureSceneLayer(i)); - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-3, 2); l->SetPixelSpacing(1.5, 1); l->SetAngle(20.0 / 180.0 * M_PI); @@ -79,7 +79,7 @@ p[1] = 0; p[2] = 0; - std::auto_ptr l(new ColorTextureSceneLayer(i)); + std::unique_ptr l(new ColorTextureSceneLayer(i)); l->SetOrigin(-2, 1); l->SetAngle(20.0 / 180.0 * M_PI); scene.SetLayer(13, l.release()); @@ -88,7 +88,7 @@ // Some lines if (1) { - std::auto_ptr layer(new PolylineSceneLayer); + std::unique_ptr layer(new PolylineSceneLayer); layer->SetThickness(1); @@ -120,16 +120,16 @@ // Some text if (1) { - std::auto_ptr layer(new TextSceneLayer); + std::unique_ptr layer(new TextSceneLayer); layer->SetText("Hello"); scene.SetLayer(100, layer.release()); } } -std::auto_ptr viewport1_; -std::auto_ptr viewport2_; -std::auto_ptr viewport3_; +std::unique_ptr viewport1_; +std::unique_ptr viewport2_; +std::unique_ptr viewport3_; boost::shared_ptr controller1_; boost::shared_ptr controller2_; boost::shared_ptr controller3_; diff -r 86400fa16091 -r 8a0a62189f46 Samples/WebAssembly/dev.h --- a/Samples/WebAssembly/dev.h Sun Feb 23 15:25:49 2020 +0100 +++ b/Samples/WebAssembly/dev.h Mon Mar 02 16:31:30 2020 +0100 @@ -79,7 +79,7 @@ const EmscriptenMouseEvent& source, OrthancStone::IViewport& viewport) { - std::auto_ptr target( + std::unique_ptr target( new OrthancStone::PointerEvent); target->AddPosition(viewport.GetPixelCenterCoordinates( @@ -91,7 +91,7 @@ return target.release(); } -std::auto_ptr tracker_; +std::unique_ptr tracker_; EM_BOOL OnMouseEvent(int eventType, const EmscriptenMouseEvent *mouseEvent, @@ -111,7 +111,7 @@ char buf[64]; sprintf(buf, "click %d", count++); - std::auto_ptr layer(new OrthancStone::TextSceneLayer); + std::unique_ptr layer(new OrthancStone::TextSceneLayer); layer->SetText(buf); controller->GetViewport().GetScene().SetLayer(100, layer.release()); controller->GetViewport().Refresh(); @@ -123,7 +123,7 @@ boost::shared_ptr t; { - std::auto_ptr event( + std::unique_ptr event( ConvertMouseEvent(*mouseEvent, controller->GetViewport())); switch (mouseEvent->button) @@ -165,7 +165,7 @@ case EMSCRIPTEN_EVENT_MOUSEMOVE: if (tracker_.get() != NULL) { - std::auto_ptr event( + std::unique_ptr event( ConvertMouseEvent(*mouseEvent, controller->GetViewport())); tracker_->PointerMove(*event); controller->GetViewport().Refresh(); @@ -175,7 +175,7 @@ case EMSCRIPTEN_EVENT_MOUSEUP: if (tracker_.get() != NULL) { - std::auto_ptr event( + std::unique_ptr event( ConvertMouseEvent(*mouseEvent, controller->GetViewport())); tracker_->PointerUp(*event); controller->GetViewport().Refresh(); diff -r 86400fa16091 -r 8a0a62189f46 UnitTestsSources/ImageToolboxTests.cpp --- a/UnitTestsSources/ImageToolboxTests.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/UnitTestsSources/ImageToolboxTests.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -23,6 +23,7 @@ // #include // #include +#include #include #include @@ -52,7 +53,7 @@ size_t pixCounter = 0; - std::auto_ptr image(new Orthanc::Image( + std::unique_ptr image(new Orthanc::Image( Orthanc::PixelFormat_Grayscale8, W, H, false)); for (unsigned int y = 0; y < H; ++y) @@ -92,7 +93,7 @@ size_t pixCounter = 0; - std::auto_ptr image(new Orthanc::Image( + std::unique_ptr image(new Orthanc::Image( Orthanc::PixelFormat_Grayscale8, W, H, false)); for (unsigned int y = 0; y < H; ++y) @@ -133,7 +134,7 @@ size_t pixCounter = 0; - std::auto_ptr image(new Orthanc::Image( + std::unique_ptr image(new Orthanc::Image( Format, W, H, false)); typedef typename Orthanc::PixelTraits::PixelType PixelType; @@ -203,7 +204,7 @@ size_t pixCounter = 0; - std::auto_ptr image(new Orthanc::Image( + std::unique_ptr image(new Orthanc::Image( Format, W, H, false)); typedef typename Orthanc::PixelTraits::PixelType PixelType; diff -r 86400fa16091 -r 8a0a62189f46 UnitTestsSources/PixelTestPatternsTests.cpp --- a/UnitTestsSources/PixelTestPatternsTests.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/UnitTestsSources/PixelTestPatternsTests.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -36,7 +36,7 @@ TEST(PixelTestPatterns, SimpleRedHGradient) { - std::auto_ptr texture; + std::unique_ptr texture; texture.reset(new Orthanc::Image( Orthanc::PixelFormat_RGBA32, @@ -72,7 +72,7 @@ TEST(PixelTestPatterns, SimpleRedBlueVGradient) { - std::auto_ptr texture; + std::unique_ptr texture; texture.reset(new Orthanc::Image( Orthanc::PixelFormat_RGBA32, @@ -109,7 +109,7 @@ TEST(PixelTestPatterns, MultiGradient) { - std::auto_ptr texture; + std::unique_ptr texture; const int CELLW = 64; const int CELLH = 64; diff -r 86400fa16091 -r 8a0a62189f46 UnitTestsSources/TestCommands.cpp --- a/UnitTestsSources/TestCommands.cpp Sun Feb 23 15:25:49 2020 +0100 +++ b/UnitTestsSources/TestCommands.cpp Mon Mar 02 16:31:30 2020 +0100 @@ -60,7 +60,7 @@ // Json::Value cmdJson; // cmdJson["command"] = "noop"; -// std::auto_ptr command(factory.CreateFromJson(cmdJson)); +// std::unique_ptr command(factory.CreateFromJson(cmdJson)); // ASSERT_TRUE(command.get() != NULL); // ASSERT_EQ("noop", command->GetName()); @@ -77,7 +77,7 @@ // cmdJson["command"] = "increment"; // cmdJson["args"]["increment"] = 2; -// std::auto_ptr command(factory.CreateFromJson(cmdJson)); +// std::unique_ptr command(factory.CreateFromJson(cmdJson)); // ASSERT_TRUE(command.get() != NULL); // CommandIncrement::counter = 0; @@ -93,7 +93,7 @@ // Json::Value cmdJson; // cmdJson["command"] = "unknown"; -// ASSERT_THROW(std::auto_ptr command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); +// ASSERT_THROW(std::unique_ptr command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); //} //TEST(Commands, TryCreateCommandFromInvalidJson) @@ -104,5 +104,5 @@ // Json::Value cmdJson; // cmdJson["command-name"] = "noop"; -// ASSERT_THROW(std::auto_ptr command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); +// ASSERT_THROW(std::unique_ptr command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException); //}